views:

284

answers:

1

I'm writing an Eclipse plug-in... In my custom label decorator, I want to overlay a warning icon, and I'd like to use the standard one used by eclipse (the little yellow triangle). How can I get an image descriptor of this icon?

I tried using

workbench.getSharedImages().getImageDescriptor(ISharedImages.IMG_DEC_FIELD_WARNING)

since that ID seems to match what I'm looking for, but the shared images collection doesn't actually have that image in it (so I just get a null returned).

Is there some other shared image collection that I should be looking at?

A: 

You have run across an Eclipse bug: https://bugs.eclipse.org/bugs/show_bug.cgi?id=304397

The bugzilla entry gives this code as workaround:

ImageDescriptor descriptor = JFaceResources.getImageRegistry().getDescriptor("org.eclipse.jface.fieldassist.IMG_DEC_FIELD_WARNING");

Bananeweizen