bundle.getEntry() always returns null [message #676250] |
Fri, 03 June 2011 07:55  |
Eclipse User |
|
|
|
Hi,
I am struggling with something that seems a trivial task for a day now, and I am completely lost! For some reason bundle.getEntry() just won't return the url of my resource. getResource() however DOES work.
I have checked, double checked an triple checked that the PLUGIN_ID is correct, that the filename is correct, desperately moved the resource around, added '/', and '.' to the image path, but to no avail.
Code and build.properties below.
Any help is highly appreciated.
Kind Regards,
Erwin
...
image = getImageDescriptor("icons/myImage.jpg").createImage();
...
private ImageDescriptor getImageDescriptor(String id){
// URL url = Platform.getBundle(Activator.PLUGIN_ID).getResource(id); // Valid URL
// URL url = Platform.getBundle(Activator.PLUGIN_ID).getEntry(id); // null
// return ImageDescriptor.createFromURL(url);
ImageDescriptor imd = AbstractUIPlugin.imageDescriptorFromPlugin(Activator.PLUGIN_ID, id); // null
return imd;
}
Build.properties:
source.. = src/
output.. = bin/
bin.includes = plugin.xml,\
META-INF/,\
.,\
icons/
src.includes = META-INF/,\
icons/,\
plugin.xml
|
|
|
Re: bundle.getEntry() always returns null - RESOLVED [message #676285 is a reply to message #676250] |
Fri, 03 June 2011 10:22  |
Eclipse User |
|
|
|
So the file name was correct, and the plugin ID was correct, but for some reason, when I copied the file in Eclipse from one folder to another, it had not copied the file in the file system as well. After refreshing the project the file still showed up in Eclipse even though it wasn't there. Manually copied the file over, and that resolved the mystery.
Thanks for your attention.
Erwin
|
|
|
Powered by
FUDForum. Page generated in 0.03054 seconds