Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Using bundled images
Using bundled images [message #462611] Wed, 31 January 2007 00:14 Go to next message
Troy Zimmerman is currently offline Troy ZimmermanFriend
Messages: 2
Registered: July 2009
Junior Member
I'd like to use images found in the org.eclipse.ui bundle for actions in an RCP application. I've come up with two ways of doing this, but am not sure which is preferred.

First I tried:

URL url = Platform.getBundle("org.eclipse.ui").getEntry("/icons/full/elcl16/up_nav.gif ");

Second I tried:

Activator.imageDescriptorFromPlugin("org.eclipse.ui", "/icons/full/elcl16/up_nav.gif");

Both return a URL which can be used to create an image descriptor. After diving into the source, it appears that they are both doing pretty much the same thing. Are they both correct, or should they both be avoided and another method used?

Also, should I place these descriptors in a registry of some sort, or is it OK to allow each action to create it's own?

Thanks!

Troy
Re: Using bundled images [message #462677 is a reply to message #462611] Wed, 31 January 2007 14:39 Go to previous message
Troy Zimmerman is currently offline Troy ZimmermanFriend
Messages: 2
Registered: July 2009
Junior Member
I came across IWorkbenchConfigurer.declareImage(), which states that it will register an Image (or ImageDescriptor) with the workbench's images. This seems like a better approach since I can declare the images as shared and allow the workbench to manage them while being able to access them globally through ISharedImages.

Troy
Previous Topic:Modifying the perspective bar
Next Topic:Change workspace root
Goto Forum:
  


Current Time: Thu Sep 19 07:58:43 GMT 2024

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

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

Back to the top