[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Newsgroup Home]
|
[news.eclipse.newcomer] Deprecated Platform.find
|
- From: Ric Wright <riwright@xxxxxxxxx>
- Date: Sun, 22 Feb 2009 09:43:23 -0800
- Newsgroups: eclipse.newcomer
- Organization: EclipseCorner
- Thread-index: AcmVFQ6v4SnmL4tFIEC6tebFEpbcAg==
- Thread-topic: Deprecated Platform.find
- User-agent: Microsoft-Entourage/12.15.0.081119
I wanted to learn how to use the ImageRegistry with a plugin. I found this
in Eclipsepedia (at
http://wiki.eclipse.org/FAQ_How_do_I_create_an_image_registry_for_my_plug-in
%3F):
public class ExamplesPlugin extends AbstractUIPlugin {
public static final String PLUGIN_ID = "org.eclipse.faq.examples";
public static final String IMAGE_ID = "sample.image";
...
protected void initializeImageRegistry(ImageRegistry registry) {
Bundle bundle = Platform.getBundle(PLUGIN_ID);
IPath path = new Path("icons/sample.gif");
URL url = Platform.find(bundle, path);
ImageDescriptor desc = ImageDescriptor.createFromURL(url);
registry.put(IMAGE_ID, desc);
}
}
However, if I enter the code in my plugin, Eclipse tells me that
Platform.find is deprecated. Moreover, the article says
initializeImageRegistry() will be called when the plugin is initialized, but
that doesn't appear to be true - a breakpoint there is never hit.
What's the right way to do this?
TIA, Ric