Over a million developers have joined DZone.

Icon and Label Decorators in Eclipse

· Java Zone

What every Java engineer should know about microservices: Reactive Microservices Architecture.  Brought to you in partnership with Lightbend.


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:

Sources in Project View

Sources in Project View

So my source file icon looks like this:

Normal Source File Icon

Normal Source File Icon

But it might look like this as well:

Icon Decorator on Source File

Icon Decorator on Source File

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:

Excluded Overlay

Excluded Icon Decorator

It means that the file has been ‘excluded from build‘ (see again Symbol defined or not, that’s the question):

Excluded from Build

Excluded from Build

But it does not stop here: Icon Decorators can be combined:

Combined Icon Decorators

Combined Icon Decorators

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:

ProcessorExpert.pe Icon

ProcessorExpert.pe Icon

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:

Reset to default

Reset to default

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:

SVN Label Decorations

SVN Label Decorations

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%22

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.

Happy Decorating :-)

Microservices for Java, explained. Revitalize your legacy systems (and your career) with Reactive Microservices Architecture, a free O'Reilly book. Brought to you in partnership with Lightbend.

Topics:

Published at DZone with permission of Erich Styger, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

The best of DZone straight to your inbox.

SEE AN EXAMPLE
Please provide a valid email address.

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.
Subscribe

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}