Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » Plug-in deployment: icons not found
Plug-in deployment: icons not found [message #150087] Tue, 28 October 2003 06:25 Go to next message
Eclipse UserFriend
Originally posted by: tcn.spamgourmet.com

Hi!

I do not have this problem when running the plug-in within the run-time
workbench but when installing it to eclipse/plugin.

I load the images from the JAR this way:

URL url = new URL(plugin.getDescriptor().getInstallURL(), "icons/" + file +
".gif");
return ImageDescriptor.createFromURL(url);

So, getInstallURL() is probably wrong. What's the correct way to load
images?

Timo
Re: Plug-in deployment: icons not found [message #150192 is a reply to message #150087] Tue, 28 October 2003 10:14 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: richkulp.NO.SPAM.us.ibm.com

The URL you created isn't looking into a jar. It is looking for an
actual file in the file system under your plugin's install directory.

If the icon really is within a jar (and under the icons directory in the
jar, where icons is a root directory in the jar and not a subdirectory
in it), then you should use:

getClass().getResource("/icons/"+file+".gif")

NOTE: Take note of the leading "/". This is necessary because
getClass().getResource() will prepend the package directory of the class
to the path if there isn't a leading "/".

This will find it in the jar itself.

If the icons directory really is in the plugin's directory and not in
the jar itself, then make sure your build.properties bin.includes entry
has icons/ in it. Otherwise the directory won't be copied across when
you create the plugin.


--
Thanks, Rich Kulp

Re: Plug-in deployment: icons not found [message #150350 is a reply to message #150192] Tue, 28 October 2003 14:43 Go to previous message
Eclipse UserFriend
Originally posted by: tcn.spamgourmet.com

Rich Kulp wrote:
> the jar itself, then make sure your build.properties bin.includes entry

Thanks!
Previous Topic:Delete Project Resource is not working in Eclplse2.1
Next Topic:Possible bug in visibility element of the object contribution markup
Goto Forum:
  


Current Time: Fri May 09 22:58:05 EDT 2025

Powered by FUDForum. Page generated in 0.07601 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top