Bug 28938

Summary: [Decorators] Enable ordering of LabelDecorators for enhanced icon decorations
Product: [Eclipse Project] Platform Reporter: Markus Gebhard <markus>
Component: UIAssignee: Platform-UI-Inbox <Platform-UI-Inbox>
Status: RESOLVED WONTFIX QA Contact:
Severity: enhancement    
Priority: P3 CC: balajik, ekuleshov, sflaniga, Tod_Creasey
Version: 2.1   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:

Description Markus Gebhard CLA 2003-01-01 13:31:55 EST
There does not seem to be a way to specify the order the DecoratorManager iterates through the registered ILabelDecorators when decorating an icon image.
If one could specify the order it would be possible to write more complex icon decorations:
A labelDecorator with highest priority could modify the colors of an original icon (or even overwrite it totally) without influencing the other decorations. 

Example:
  A plugin could be written that fades/enhances/modifies the colors of packages by certain criteria. Packages containing junit-tests could appear with a blue icon instead of the orange one (or with a faded icon or whatever). In fact I have already written that plugin and the drawing order is the only problem left: http://www.jave.de/eclipse/labeldecorations/screenshot1.gif.

Solutions:
 (1) A minimal solution is an API method in DecoratorManager or IDecoratorManager by which a plugin can move a LabelDecorator to the top of the list. Of course this would lead to problems with more than one plugin claiming to be the one with highest priority.
 (2) A better solution seems to be an optional priority value for the decorator element in the plugin.xml. Of course the default priority should leave enough space for lower and higher priority decorators.

Finally the order could be made adjustable in the Label Decorations preference page.
Comment 1 Eugene Kuleshov CLA 2004-02-23 10:38:57 EST
Another option will be to add an API to retrieve/replace original undecorated
icon in order to do the decoration implemented by Markus.
Comment 2 Tod Creasey CLA 2006-06-22 08:35:14 EDT
There are currently no plans to work on this feature