Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Plugin Development Environment (PDE) » Dynamic annotation type color
Dynamic annotation type color [message #1315144] Fri, 25 April 2014 20:36 Go to next message
David Pfeffer is currently offline David PfefferFriend
Messages: 2
Registered: April 2014
Junior Member

I'm working on an eclipse plugin where the user should be able to categorise java source code lines of a project. The categories are added by the user and are project dependent.

I added my own Marker with an additional category attribute to distinguish the category. I used the annotationTypes and markerAnnotationSpecification extension point to highlight the source code part which belongs to a category and which doesn't.

However, now I got stuck. I need to allow the user to have a different highlight color for each category. Am I right that this setup it is not capable of doing that?

I would appreciate any suggestions on how I could solve that porblem.

Dynamic annotation type color [message #1401947 is a reply to message #1315144] Wed, 16 July 2014 09:38 Go to previous message
David Pfeffer is currently offline David PfefferFriend
Messages: 2
Registered: April 2014
Junior Member
Looks like this is currently not possible to achieve.

I figured out that I would need a custom IDrawingStrategy implementation to influence the drawing of Annotations. However, currently it's not possible to add custom DrawingStrategies via an extension point (Bug #51498). There is a comment (in waiting since ages to get fixed.

protected AnnotationPainter  [More ...] createAnnotationPainter() {
    AnnotationPainter painter= new AnnotationPainter(fSourceViewer, fAnnotationAccess);

     * XXX:
     * Could provide an extension point for drawing strategies,
     * see:

    painter.addDrawingStrategy(AnnotationPreference.STYLE_NONE, fgNullStrategy);
    painter.addDrawingStrategy(AnnotationPreference.STYLE_IBEAM, fgIBeamStrategy);

I tried to force in my own IDrawingStrategy implementation via reflection as mentioned in the bug report comments. However this isn't a perfect solution.

Suggestions are still appreciated.
Previous Topic:Customize Package- or Project Explorer on a per-project base
Next Topic:IResource.getPersistentProperties() returns empty
Goto Forum:

Current Time: Mon Jun 25 18:05:05 GMT 2018

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

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

Back to the top