Icon and Label Decorators in Eclipse
From time to time, I scratch my head and ask myself: Gee, that file icon looks interesting and different; what does it mean? What I’m wondering about is on Eclipse Icon Decorators. Label and Icon Decorations allow additional information to be displayed in an item’s label and icon. Very powerful. But as with many powerful things: if you don’t know it, it might cause harm or confusion. Unfortunately, that’s not so easy to find out.
Things are best explained with an example. Below are some files in my project view:
So my source file icon looks like this:
But it might look like this as well:
What happened? Looks like someone pinned that icon? The longer answer can be found in Symbol defined or not, that’s the question. The short answer is: that source file has ‘per file‘ settings, and that ‘pin icon overlay‘ tells me this.
But what about this one:
It means that the file has been ‘excluded from build‘ (see again Symbol defined or not, that’s the question):
But it does not stop here: Icon Decorators can be combined:
So that file is excluded from the current build, and has special per file settings.
Now let’s have a look a this ProcessorExpert.pe file:
It means that the file is excluded from build, plus it has its own build settings. Interestingly this happens for projects imported from MCU10.1 into MCU10.2? But it is possible bo get rid of it. The first thing is to remove that ‘Exclude resource from build‘ flag as shown earlier). The other step is to reset the resource configuration to default settings:
This will ‘reset’ my icon and settings.
Now the question is: how to know that icon decorator is for what? For Subversion/SVN or CVS they are easily accessible under Window > Preferences:
An excellent explanation of all the SVN Icon/Label Decorations can be found in What do the arrow icons in Subclipse mean?
There are also some CDT icons at the bottom of this help page.
Unfortunately, except for things like CVS or SVN, I have not found a comprehensive list of icon or label decorators. I have found this thread that gives some clues. Maybe someone has found a better answer? Until then, it is a continued exploring and learning experience.
(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)