Can't load images in SWT/Eclipse
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Janice_Guevara
Posted On:   Thursday, October 2, 2008 04:36 PM

I'm writing an Eclipse plugin (following an example I found on the net) and try to load small icons in a table. In my LabelProvider class I have this: static { String iconPath = "icons/"; imageRegistry.put( CHECKED_IMAGE, ImageDescriptor.createFromFile( EbbTableViewer.class, iconPath + CHECKED_IMAGE + ".gif")); ... more the same... } and here's the method that gets the image: private Image getImage(boolean isSelected) { String key = isSelected ? CHECKED_IMAGE : UNCHECKED_IMAGE; return imageRegistry.get(key); } But no image is drawn. I   More>>

I'm writing an Eclipse plugin (following an example I found on the net) and try to load small icons in a table. In my LabelProvider class I have this:


static {

String iconPath = "icons/";

imageRegistry.put(

CHECKED_IMAGE,

ImageDescriptor.createFromFile(

EbbTableViewer.class,

iconPath + CHECKED_IMAGE + ".gif"));


... more the same...


}


and here's the method that gets the image:

private Image getImage(boolean isSelected) {

String key = isSelected ? CHECKED_IMAGE : UNCHECKED_IMAGE;

return imageRegistry.get(key);

}

But no image is drawn. I got this error:


Unable to create resource File ImageDescriptor


Any ideas?

   <<Less
About | Sitemap | Contact