Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » How to find the location of the plugin in Eclipse 3.0?
How to find the location of the plugin in Eclipse 3.0? [message #259989] Thu, 08 July 2004 23:45 Go to next message
Eclipse UserFriend
In eclipse 2.0 version i was able to get the location (absolute path) of a
plugin with the aid of pluginId in the following way.
URL installURL =
Platform.getPluginRegistry().getPluginDescriptor(pluginId).g etInstallURL();
String location = Platform.resolve(installURL).getFile().substring(1);

In eclipse 3.0, I can get the location using the same code but the method
getPluginRegistry() from the type Platform is deprecated.

I could find any another way to get the location of the plugin so that i
can avoid using the deprecated ones.

Any ideas?

Mahi
Re: How to find the location of the plugin in Eclipse 3.0? [message #260025 is a reply to message #259989] Fri, 09 July 2004 03:14 Go to previous messageGo to next message
Eclipse UserFriend
Hello,

the only way I know is to remember the BundleContext in the Plugin#start(BundleContext)
method, then get all Bundles from the context (BundleContext#getBundles()), iterate
over it and compare each Bundle#getSymbolicName() with your pluginId.
When you have the bundle, use
URL installURL = bundle.getEntry("/");

Regards,

Peter Schaich


Mahendra Akkina wrote:
> In eclipse 2.0 version i was able to get the location (absolute path) of a
> plugin with the aid of pluginId in the following way.
> URL installURL =
> Platform.getPluginRegistry().getPluginDescriptor(pluginId).g etInstallURL();
> String location = Platform.resolve(installURL).getFile().substring(1);
>
> In eclipse 3.0, I can get the location using the same code but the method
> getPluginRegistry() from the type Platform is deprecated.
>
> I could find any another way to get the location of the plugin so that i
> can avoid using the deprecated ones.
>
> Any ideas?
>
> Mahi
>
>
>
>
>
>
>
>


--
Dipl.-Inf. Peter Schaich
Mind8 GmbH
Gänsheidestraße 59
D-70184 Stuttgart, Germany

+49-(0)711-210707-14 (phone)
+49-(0)711-210707-99 (fax)
www.mind8.com
Re: How to find the location of the plugin in Eclipse 3.0? [message #260076 is a reply to message #260025] Fri, 09 July 2004 08:14 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: pascal.ibm.canada

To get the bundles you can use Platform.getBundle("bundleId")


Peter Schaich wrote:
> Hello,
>
> the only way I know is to remember the BundleContext in the
> Plugin#start(BundleContext)
> method, then get all Bundles from the context
> (BundleContext#getBundles()), iterate
> over it and compare each Bundle#getSymbolicName() with your pluginId.
> When you have the bundle, use
> URL installURL = bundle.getEntry("/");
>
> Regards,
>
> Peter Schaich
>
>
> Mahendra Akkina wrote:
>
>> In eclipse 2.0 version i was able to get the location (absolute path)
>> of a
>> plugin with the aid of pluginId in the following way.
>> URL installURL =
>> Platform.getPluginRegistry().getPluginDescriptor(pluginId).g etInstallURL();
>>
>> String location = Platform.resolve(installURL).getFile().substring(1);
>>
>> In eclipse 3.0, I can get the location using the same code but the method
>> getPluginRegistry() from the type Platform is deprecated.
>>
>> I could find any another way to get the location of the plugin so that i
>> can avoid using the deprecated ones.
>>
>> Any ideas?
>>
>> Mahi
>>
>>
>>
>>
>>
>>
>>
>>
>
>
Re: How to find the location of the plugin in Eclipse 3.0? [message #260286 is a reply to message #260076] Fri, 09 July 2004 17:52 Go to previous messageGo to next message
Eclipse UserFriend
Thanks Peter/Pascal

I was able to get location by doing the follwing

URL installURL = Platform.getBundle(pluginId).getEntry("/");
String location = Platform.resolve(installURL).getFile().substring(1);

Pascal Rapicault wrote:

> To get the bundles you can use Platform.getBundle("bundleId")


> Peter Schaich wrote:
> > Hello,
> >
> > the only way I know is to remember the BundleContext in the
> > Plugin#start(BundleContext)
> > method, then get all Bundles from the context
> > (BundleContext#getBundles()), iterate
> > over it and compare each Bundle#getSymbolicName() with your pluginId.
> > When you have the bundle, use
> > URL installURL = bundle.getEntry("/");
> >
> > Regards,
> >
> > Peter Schaich
> >
> >
> > Mahendra Akkina wrote:
> >
> >> In eclipse 2.0 version i was able to get the location (absolute path)
> >> of a
> >> plugin with the aid of pluginId in the following way.
> >> URL installURL =
> >>
Platform.getPluginRegistry().getPluginDescriptor(pluginId).g etInstallURL();
> >>
> >> String location = Platform.resolve(installURL).getFile().substring(1);
> >>
> >> In eclipse 3.0, I can get the location using the same code but the method
> >> getPluginRegistry() from the type Platform is deprecated.
> >>
> >> I could find any another way to get the location of the plugin so that i
> >> can avoid using the deprecated ones.
> >>
> >> Any ideas?
> >>
> >> Mahi
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >
> >
Re: How to find the location of the plugin in Eclipse 3.0? [message #260298 is a reply to message #260286] Fri, 09 July 2004 18:30 Go to previous message
Eclipse UserFriend
Originally posted by: richkulp.NO.SPAM.us.ibm.com

But be aware there is no requirement that the install location be a
local file directory. If could be on a remote machine.


--
Thanks, Rich Kulp

Previous Topic:How to change username for ${user} ?
Next Topic:Ant input tag
Goto Forum:
  


Current Time: Wed May 07 11:49:39 EDT 2025

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

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

Back to the top