Icon and Label Decorators in Eclipse
Join the DZone community and get the full member experience.
Join For Freefrom 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?
otherwise icons might depend on the eclipse version used. there is an answer to the question “ what do the icons in eclipse mean? “ which is replicated here:
indigo: http://help.eclipse.org/indigo/index.jsp?topic=/org.eclipse.jdt.doc.user/reference/ref-icons.htm
helios: http://help.eclipse.org/helios/index.jsp?topic=/org.eclipse.jdt.doc.user/reference/ref-icons.htm
galileo: http://help.eclipse.org/galileo/topic/org.eclipse.jdt.doc.user/reference/ref-icons.htm?resultof=%22icon%22there 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.
happy decorating
Published at DZone with permission of Erich Styger, DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.
Comments