| External Image Management in RCP [message #902987] |
Tue, 21 August 2012 10:25  |
ModelGeek Mising name Messages: 347 Registered: June 2011 |
Senior Member |
|
|
Hi,
I am working with an RCP app uing GEF library. I have couple of hundreds of images and i have multiple plugins. I want to create one plugin for image management and that will share all images amongst rest of plugins something like ISharedImages concept.
what is the best practise in that regard.
Regards,
|
|
|
| Re: External Image Management in RCP [message #903481 is a reply to message #902987] |
Thu, 23 August 2012 15:35  |
Paul Webster Messages: 6813 Registered: July 2009 Location: Ottawa |
Senior Member |
|
|
If a UI plugin activator subclasses AbstractUIPlugin, you have a couple of options.
1) use org.eclipse.ui.plugin.AbstractUIPlugin.getImageRegistry() and load it up with image descriptors in org.eclipse.ui.plugin.AbstractUIPlugin.initializeImageRegistry(ImageRegistry). Then have all of your bundles retrieve that bundle's image registry and get Images and ImageDescriptors from it.
2) use org.eclipse.ui.plugin.AbstractUIPlugin.imageDescriptorFromPlugin(String, String) from your bundles to get ImageDescriptors from a central plugin. Then classes in your plugins have to create Images out of them, preferrably using a local resource manager org.eclipse.jface.resource.LocalResourceManager
For centrally located images that are used in extensions, you can use the platform:/plugin/plugin.id/path/to/icon.gif pattern to load images from other plugins.
PW
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Menu_Contributions
|
|
|
Powered by
FUDForum. Page generated in 0.01510 seconds