Programmatically created marker annotations not showing [message #208150] |
Tue, 28 June 2005 23:24 |
Eclipse User |
|
|
|
Originally posted by: daszelt.web.de
i'm writing a plugin to visualise slices in eclipse.
i have about 100 markers to visualise the slice levels.
i use the markers to highlight the source code in different colors.
the user can chose a basic color in the preferences menu and the color for
the following marker is just a little bit darker and so on ...
so my approach was, to create 100 markers and add a MarkerAnnotation with
the appropriate AnnotationPreferences programmatically ...
i'm creating the markers via
resource.createMarker()
the marker creation should be ok since the plugin works fine if i define
the colors in the plugin.xml file ...
nothing is showing in the javaeditor when i create the
AnnotationPreferences programmatically ... but
EditorsUI.getAnnotationPreferenceLookup()
getAnnotationPreference(
EditorsUI.getAnnotationTypeLookup()
getAnnotationType("myMarker",IMarker.SEVERITY_ERROR))
getColorPreferenceValue().toString()
returns the right color value ...
//--------------AnnotationPreferences---------
AnnotationTypeLookup atl = EditorsUI.getAnnotationTypeLookup();
AnnotationPreferenceLookup apl = EditorsUI.getAnnotationPreferenceLookup();
AnnotationPreference ap = null;
ap = apl.getAnnotationPreference(
atl.getAnnotationType("myMarker",IMarker.SEVERITY_ERROR));
ap.setColorPreferenceValue(new RGB(190,0,0,));
any help would be appreciated ...
|
|
|
|
Re: Programmatically created marker annotations not showing [message #208192 is a reply to message #208158] |
Wed, 29 June 2005 11:53 |
Eclipse User |
|
|
|
Originally posted by: daszelt.web.de
marker creation via
MarkerUtilities.createMarker
doesn't change anything ...
but now i'm completely confused ...
actually it looked like once i had changed the annotation preferences
no more markers and annotations were added in the javaeditor ... no
markers appearing in the vertical ruler
sorry if i misinformed you tom ;-)
so i added a small function querying for my created markers
to check if they were there without annotation or just missing completely
...
result: suddenly all markers appearing all in the color from the
plugin.xml file
and still the query for the annotation preferences returns the right value
i thought the annotation preferences had the right value after placing the
first marker, because the setColor function and the createMarker were in
the same WorkspaceRunnable. So i have changed that too. i have put them in
2 WorkspaceRunnables the result is the same ...
perhaps somebody knows a plugin or some sample code for changing marker
annotation preferences ...
|
|
|
|
Powered by
FUDForum. Page generated in 0.04241 seconds