In a subclass of StyledCellLabelProvider
, I have a line like this:
ImageDescriptor d = Activator.getImageDescriptor("/icons/sample.gif");
However, the variable d
is always null
. Strangely, the image shows up correctly in the upper left corner of a View when I specify the exact same path in plugin.xml
:
<view
name="Message"
allowMultiple="true"
icon="/icons/sample.gif"
class="com.myapp.views.EmailView"
id="com.myapp.gui.emailView">
</view>
The path of this image in my project is the standard location of <project>/icons/sample.gif
, and the plugin source code is in <project>/src
.
Frustratingly, the sample Plugin project "RCP Mail Template" uses (successfully) an identical function to obtain a reference to an ImageDescriptor
:
ImageDescriptor d = Activator.getImageDescriptor("/icons/sample.gif");
Could there be something wrong with my plugin configuration that would cause images to not be found when referenced programmatically?
But the static getImageDescriptor
methods of your Activator
class and "RCP Mail Template"'s Activator
class are different. Perhaps you are using incorrect plugin ID there?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With