becks
becks

Reputation: 2718

icons of tree items in eclipse trees

Is there a way to do the following ?

I have a tree item icon which is for example :

http://cdn1.iconfinder.com/data/icons/DarkGlass_Reworked/128x128/actions/contents.png

and when a certain action occurs I want to add a flag on it ( the flag is an icon which will be place on it)

if the flag is the right mark so it should be like

http://store2.up-00.com/June12/yk105816.png

Simply, can I add image on image on an action ?

Note: I know I can do this in another way to change between the two images upon action.. but I'll have to do a loooot of work on paint of PS.

sorry for the links of images as as a new user I can't post images

Upvotes: 0

Views: 835

Answers (2)

Blaise
Blaise

Reputation: 7508

What you want to achieve is called a decorator in Eclipse platform.

You can find a detailed description with example on this page: http://www.eclipse.org/articles/Article-Decorators/decorators.html

Check also the following stackoverflow question:

Hope this helps.

Upvotes: 5

Erich Schreiner
Erich Schreiner

Reputation: 2058

You can combine several images on the fly by using or subclassing org.eclipse.jface.resource.CompositeImageDescriptor.

Upvotes: 2

Related Questions