Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Eclipse standard warning/error overlay icons

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?

like image 433
Stan Avatar asked Mar 14 '26 13:03

Stan


1 Answers

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");

like image 162
Bananeweizen Avatar answered Mar 16 '26 01:03

Bananeweizen



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!