Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[pde-ui-dev] Unable to get Image Descriptor

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



Back to the top