Query target platform for a plugin id [message #50690] |
Tue, 17 March 2009 13:59  |
Eclipse User |
|
|
|
I want to programmatically query the target platform to see if it contains
a plug-in with a particular id. Currently, I am doing this:
if
(PDECore.getDefault().getModelManager().findModel("org.eclipse.core.runtime ")
!= null)
System.out.println("target platform contains id");
The call to findModel() takes a long time the first time it is made when
using a new workspace. Is there another way to query the target platform
for a specific plug-in id?
Thanks,
Steve
|
|
|
|
|
|
|
Re: Query target platform for a plugin id [message #593322 is a reply to message #50690] |
Tue, 17 March 2009 15:03  |
Eclipse User |
|
|
|
Steve wrote:
> I want to programmatically query the target platform to see if it
> contains a plug-in with a particular id. Currently, I am doing this:
>
> if
> (PDECore.getDefault().getModelManager().findModel("org.eclipse.core.runtime ")
> != null)
> System.out.println("target platform contains id");
>
> The call to findModel() takes a long time the first time it is made when
> using a new workspace. Is there another way to query the target
> platform for a specific plug-in id?
You should be using the public API for this instead of the internal way.
See: org.eclipse.pde.core.plugin.PluginRegistry
The first time is going to take awhile as PDE has to load the target,
parse manifests and extensions. After that, the information is cached.
This is similar to what Equinox does on the first startup.
Cheers,
Chris Aniszczyk | EclipseSource Austin | +1 860 839 2465
http://twitter.com/eclipsesource | http://twitter.com/caniszczyk
|
|
|
Re: Query target platform for a plugin id [message #593535 is a reply to message #50719] |
Thu, 19 March 2009 10:36  |
Eclipse User |
|
|
|
Chris Aniszczyk wrote:
> Steve wrote:
>> I want to programmatically query the target platform to see if it
>> contains a plug-in with a particular id. Currently, I am doing this:
>>
>> if
>>
(PDECore.getDefault().getModelManager().findModel("org.eclipse.core.runtime ")
>> != null)
>> System.out.println("target platform contains id");
>>
>> The call to findModel() takes a long time the first time it is made when
>> using a new workspace. Is there another way to query the target
>> platform for a specific plug-in id?
> You should be using the public API for this instead of the internal way.
> See: org.eclipse.pde.core.plugin.PluginRegistry
> The first time is going to take awhile as PDE has to load the target,
> parse manifests and extensions. After that, the information is cached.
> This is similar to what Equinox does on the first startup.
> Cheers,
> Chris Aniszczyk | EclipseSource Austin | +1 860 839 2465
> http://twitter.com/eclipsesource | http://twitter.com/caniszczyk
Chris,
Thanks for the information. I would much rather use the public API. This
is inherited code and I am always trying to make it better. I'd really
like a different way to query the target platform, though. My code is
checking the target platform for a specific plug-in. This code is in a
wizard. Using PluginRegistry.findModel() takes a very long time and
causes my wizard to become unresponsive. I don't need to do anything with
the plug-in model, I just need to see if the plug-in is included in the
target platform. Any suggestions?
Thanks,
Steve
|
|
|
Re: Query target platform for a plugin id [message #593629 is a reply to message #51120] |
Thu, 19 March 2009 12:02  |
Eclipse User |
|
|
|
Steve wrote:
> Chris,
> Thanks for the information. I would much rather use the public API.
> This is inherited code and I am always trying to make it better. I'd
> really like a different way to query the target platform, though. My
> code is checking the target platform for a specific plug-in. This code
> is in a wizard. Using PluginRegistry.findModel() takes a very long time
> and causes my wizard to become unresponsive. I don't need to do
> anything with the plug-in model, I just need to see if the plug-in is
> included in the target platform. Any suggestions?
> Thanks,
The target needs to be loaded first so that's why your wizard isn't
responsive. You may also consider running the operation in a background
job as not to block the UI thread. Other than that, I'm not sure what to
tell you as PDE lazily loads the target, when you find the model, it
will initialize its target platform model which may take some time.
Cheers,
Chris Aniszczyk | EclipseSource Austin | +1 860 839 2465
http://twitter.com/eclipsesource | http://twitter.com/caniszczyk
|
|
|
|
Powered by
FUDForum. Page generated in 0.03625 seconds