[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
|
[pde-ui-dev] Unable to get Image Descriptor
|
- From: Harsh Jain <harsh@xxxxxxxxxxxxxx>
- Date: Sat, 1 Nov 2003 04:57:44 +0530 (IST)
- Delivered-to: pde-ui-dev@eclipse.org
Hello everyone,
using the following code to get the Image Descriptor
(taken from an article)
private ImageDescriptor getImageDescriptor(String relativePath) {
String iconPath = "icons/";
try {
ViewsPlugin plugin = ViewsPlugin.getDefault();
URL installURL = plugin.getDescriptor().getInstallURL();
URL url = new URL(installURL, iconPath + relativePath);
return ImageDescriptor.createFromURL(url);
}
catch (MalformedURLException e) {
return ImageDescriptor.getMissingImageDescriptor();
}
}
This isn't loading the image,the problem is the value of
installURL.getPath is /plugin/org.eclipse.ui.views_2.0.1/
(there is no such directory)
where it should be /home/Harsh/plugins/Harsh/
(Harsh is the plugin name)..
I m stuck from hours on this little problem,please help
thanks in advance
harsh