I’m using a JFace TreeViewer object in my Eclipse RCP ViewPart, and I’d like to add some additional information to the label on some of my nodes by way of an image.
Essentially the image should sit to the right of the label text and will represent a rating (I’m thinking 1 – 5 stars)
If there’s a way to do this I can’t find it, does anybody know of one?
If not then does anyone know how the eclipse package explorer shows the different coloured extra info when using other plugins like Subclipse? I guess if I’m forced to I could use that and the “*” character? ( I have tried to look at the source but it’s very abstracted and a little beyond me at the moment, so I’m just asking if anyone knows off hand, I’m not asking anyone to dig through the source for me)
Regards,
Glen
x
You can custom-draw tree items by adding
SWT.MeasureItemandSWT.PaintItemlisteners to the tree. Check out example 5 in this tutorial.In order to get the selection highlight painted over the extended area, add also
SWT.EraseItemlistener and updateevent.width.