Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » Programmatically created marker annotations not showing
Programmatically created marker annotations not showing [message #208150] Tue, 28 June 2005 23:24 Go to next message
Eclipse UserFriend
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 #208158 is a reply to message #208150] Wed, 29 June 2005 05:17 Go to previous messageGo to next message
Tom Hofmann is currently offline Tom HofmannFriend
Messages: 770
Registered: July 2009
Senior Member
Kai Brückner wrote:
> i'm creating the markers via resource.createMarker()

Try MarkerUtilities.createMarker

-tom
Re: Programmatically created marker annotations not showing [message #208192 is a reply to message #208158] Wed, 29 June 2005 11:53 Go to previous messageGo to next message
Eclipse UserFriend
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 ...
Re: Programmatically created marker annotations not showing [message #208223 is a reply to message #208192] Wed, 29 June 2005 15:01 Go to previous message
Eclipse UserFriend
Originally posted by: daszelt.web.de

finally found the solution!
i'm such an idiot ...
of course you may not include those markers on the preference page...
includeOnPreferencePage=false in plugin.xml
solved the problem
Previous Topic:Marking Files In Navigator Window as having errors
Next Topic:Table(Viewer), ViewerSorter and Selection woes.
Goto Forum:
  


Current Time: Sat Oct 19 09:02:19 GMT 2024

Powered by FUDForum. Page generated in 0.04241 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top