Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » Auto-load plugins
Auto-load plugins [message #122542] Thu, 04 September 2003 05:01 Go to next message
Eclipse UserFriend
Hi!

I have got a minor problem:
I want to provide an extension point to which classes have to register at
boot time, in order to be used by Eclipse. I know that there is the
"startup" extension point in order to provide such functionality but I don't
actually want plugins that implement my extension point to require to
implement this extension point "startup" as well. So is there any
possibility to somehow tell my plugin "when loaded look for all plugins that
dock to the extension point that we provide and load these plugins as well"?

Thank you very much,

Eric
Re: Auto-load plugins [message #122583 is a reply to message #122542] Thu, 04 September 2003 06:45 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: pascal_rapicault.yahoo.fr

Although not recommanded you just have to run through the registry, find
your extension point, find all extensions contibuted to it, find the plugin
contributing this extension, and use the registry to get the plugin
descriptor from which you get the plugin object.

This practice is not recommanded because quickly a lot of plugins are loaded
and activated and take a lot of space in memory. The worst is that the user
may not even use those plugins.

PaScaL

"Eric Bodden" <eric@bodden.de> a
Re: Auto-load plugins [message #122641 is a reply to message #122583] Thu, 04 September 2003 08:13 Go to previous messageGo to next message
Eclipse UserFriend
> Although not recommanded you just have to run through the registry, find
> your extension point, find all extensions contibuted to it, find the
plugin
> contributing this extension, and use the registry to get the plugin
> descriptor from which you get the plugin object.
Thank you! Could you perhaps point me roughly to the appropriate
objects/mehtods for that?

> This practice is not recommanded because quickly a lot of plugins are
loaded
> and activated and take a lot of space in memory. The worst is that the
user
> may not even use those plugins.
So is it not possible to list at least the plugins that extend the extension
point withut loading them? All I would need to know at boot-time is the "id"
and "name" (for UI display) of the extending plugins, that are given in its
XML definition.

Cheers,
Eric
Re: Auto-load plugins [message #122646 is a reply to message #122641] Thu, 04 September 2003 08:23 Go to previous message
Eclipse UserFriend
Eric Bodden wrote:
> So is it not possible to list at least the plugins that extend the extension
> point withut loading them? All I would need to know at boot-time is the "id"
> and "name" (for UI display) of the extending plugins, that are given in its
> XML definition.

It is possible to get the plugin descriptors without loading the plugins
(and that's pretty fundamental to Eclipse).

Code snippet:
,----------------------------------------------------------- -------------
| IPluginRegistry r = Platform.getPluginRegistry();
| String xpid = "Your extension point ID";
| IExtensionPoint p = r.getExtensionPoint(xpid);
| IExtension[] extensions = p.getExtensions();
| for (int i = 0; i < extensions.length; i++) {
| IExtension ext = extensions[i];
| IConfigurationElement[] elements = ext.getConfigurationElements();
| for (int j = 0; j < elements.length; j++) {
| IConfigurationElement element = elements[j];
| String id = element.getAttribute("id");
| String name = element.getAttribute("name");
| }
| }
`----------------------------------------------------------- -------------

This is a very good read:
http://www.eclipse.org/articles/Article-Plug-in-architecture /plugin_architecture.html

Hope that helps!
-chris
Previous Topic:How do I get notifications on changes of resource properties
Next Topic:Has anyone used XDoclet with Ant on Eclipse 3.0 platform
Goto Forum:
  


Current Time: Tue Jul 15 06:32:16 EDT 2025

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

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

Back to the top