Skip to main content



      Home
Home » Newcomers » Newcomers » Eclipse article outdated
Eclipse article outdated [message #122098] Tue, 06 December 2005 11:19 Go to next message
Eclipse UserFriend
Originally posted by: jean-philippe.shields.nurun.com

Hi to everyone,

I recently found an article written by John Arthorne, OTI dated :
April 20, 2001; updated September 12, 2002 for Eclipse 2.0. The title was
Using Images in the Eclipse UI. In this article the author presents a way
to load images programmaticaly from a plugin like this :

public class MyAction extends Action {
private static ImageDescriptor image;
static {
URL url = null;
try {
url = new URL(MyPlugin.getInstance().getDescriptor().getInstallURL(),
"images/my_action.gif");
} catch (MalformedURLException e) {
}
image = ImageDescriptor.createFromURL(url);
}
... other methods and fields defined here ...
}

Since .getDescriptor().getInstallURL() is deprecated from version 3, I
would like to know what code I could use to replace the deprecated one.

thanks in advance.
Re: Eclipse article outdated [message #122137 is a reply to message #122098] Tue, 06 December 2005 13:26 Go to previous messageGo to next message
Eclipse Webmaster is currently offline Eclipse WebmasterFriend
Messages: 607353
Registered: July 2009
Senior Member
Thanks... I've forwarded this message to Wayne Beaton, who now takes
care of the Articles.

D.


Jean-Philippe Shields wrote:
> Hi to everyone,
>
> I recently found an article written by John Arthorne, OTI dated :
> April 20, 2001; updated September 12, 2002 for Eclipse 2.0. The title
> was Using Images in the Eclipse UI. In this article the author presents
> a way to load images programmaticaly from a plugin like this :
>
> public class MyAction extends Action {
> private static ImageDescriptor image;
> static {
> URL url = null;
> try {
> url = new URL(MyPlugin.getInstance().getDescriptor().getInstallURL(),
> "images/my_action.gif");
> } catch (MalformedURLException e) {
> }
> image = ImageDescriptor.createFromURL(url);
> }
> ... other methods and fields defined here ...
> }
>
> Since .getDescriptor().getInstallURL() is deprecated from version 3, I
> would like to know what code I could use to replace the deprecated one.
>
> thanks in advance.
>
>
>
Re: Eclipse article outdated [message #122314 is a reply to message #122098] Wed, 07 December 2005 15:20 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: john.eclipsefaq.org

The article certainly needs updating, but here is a quick answer.

url = Platform.find(Platform.getBundle(bundleId), new Path(path));

Where "bundleId" is the id of your plugin (referred to in OSGi as a
bundle), and "path" is the relative path to the image within your
plugin's install directory.
--

Jean-Philippe Shields wrote:
> Hi to everyone,
>
> I recently found an article written by John Arthorne, OTI dated :
> April 20, 2001; updated September 12, 2002 for Eclipse 2.0. The title
> was Using Images in the Eclipse UI. In this article the author presents
> a way to load images programmaticaly from a plugin like this :
>
> public class MyAction extends Action {
> private static ImageDescriptor image;
> static {
> URL url = null;
> try {
> url = new URL(MyPlugin.getInstance().getDescriptor().getInstallURL(),
> "images/my_action.gif");
> } catch (MalformedURLException e) {
> }
> image = ImageDescriptor.createFromURL(url);
> }
> ... other methods and fields defined here ...
> }
>
> Since .getDescriptor().getInstallURL() is deprecated from version 3, I
> would like to know what code I could use to replace the deprecated one.
>
> thanks in advance.
>
>
>
Re: Eclipse article outdated [message #122416 is a reply to message #122314] Thu, 08 December 2005 09:53 Go to previous message
Eclipse UserFriend
Originally posted by: jean-philippe.shields.nurun.com

thanks a lot for the help.
Previous Topic:Eclipse install
Next Topic:Is it possible to search for fields with specific properties?
Goto Forum:
  


Current Time: Sun Jul 13 07:45:27 EDT 2025

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

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

Back to the top