Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Plugin Development Environment (PDE) » Query target platform for a plugin id
Query target platform for a plugin id [message #50690] Tue, 17 March 2009 17:59 Go to next message
Steve is currently offline SteveFriend
Messages: 16
Registered: July 2009
Junior Member
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 #50719 is a reply to message #50690] Tue, 17 March 2009 19:03 Go to previous messageGo to next message
Chris Aniszczyk is currently offline Chris AniszczykFriend
Messages: 674
Registered: July 2009
Senior Member
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 #51120 is a reply to message #50719] Thu, 19 March 2009 14:36 Go to previous messageGo to next message
Steve is currently offline SteveFriend
Messages: 16
Registered: July 2009
Junior Member
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 #51230 is a reply to message #51120] Thu, 19 March 2009 16:02 Go to previous messageGo to next message
Chris Aniszczyk is currently offline Chris AniszczykFriend
Messages: 674
Registered: July 2009
Senior Member
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
Re: Query target platform for a plugin id [message #51256 is a reply to message #51230] Thu, 19 March 2009 18:20 Go to previous message
Steve is currently offline SteveFriend
Messages: 16
Registered: July 2009
Junior Member
Chris,
Thanks for the help. I will try using a background operation. I
appreciate all the help.
Steve
Re: Query target platform for a plugin id [message #593322 is a reply to message #50690] Tue, 17 March 2009 19:03 Go to previous message
Chris Aniszczyk is currently offline Chris AniszczykFriend
Messages: 674
Registered: July 2009
Senior Member
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 14:36 Go to previous message
Steve is currently offline SteveFriend
Messages: 16
Registered: July 2009
Junior Member
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 16:02 Go to previous message
Chris Aniszczyk is currently offline Chris AniszczykFriend
Messages: 674
Registered: July 2009
Senior Member
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
Re: Query target platform for a plugin id [message #593635 is a reply to message #51230] Thu, 19 March 2009 18:20 Go to previous message
Steve is currently offline SteveFriend
Messages: 16
Registered: July 2009
Junior Member
Chris,
Thanks for the help. I will try using a background operation. I
appreciate all the help.
Steve
Previous Topic:Shared target platform, debugging, and multiple dev platforms
Next Topic:[Jade] Can't get a proxy to the Platform Manager
Goto Forum:
  


Current Time: Fri Mar 29 10:00:19 GMT 2024

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

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

Back to the top