Skip to main content



      Home
Home » Eclipse Projects » Plugin Development Environment (PDE) » Retrieve activated plugins for extension id
Retrieve activated plugins for extension id [message #54792] Tue, 14 April 2009 03:56 Go to next message
Eclipse UserFriend
I'm trying to allow the ability to perform clean up when the workbench
shuts down. The issue I have is I'm not sure how I'm supposed to get all
the current plug ins that have been activated. The code that I'm aware of
(which is at the bottom of this) will activate the plug if it is not
already activated which is inefficient in a shut down process. Also, if
there is a good website for learning these types of things, I would love
to learn more about the plug in registry.

IExtensionRegistry registry = Platform.getExtensionRegistry();
IExtensionPoint p = registry.getExtensionPoint(EXTENSION_ID);
IExtension[] extensions = p.getExtensions();
for (IExtension extension : extensions)
{
IConfigurationElement [] configs = extension.getConfigurationElements();
for (IConfigurationElement config: configs)
{
try
{
Interface protocol = (Interface
)config.createExecutableExtension(Interface .ATTRIBUTE_ID);
protocol.handleShutdown();
}
catch (CoreException e)
{
e.printStackTrace();
}
}
}
Re: Retrieve activated plugins for extension id [message #55801 is a reply to message #54792] Thu, 16 April 2009 09:58 Go to previous message
Eclipse UserFriend
So maybe this is the actual solution... Instead of making a shutdown
method for the application, clean up in the stop method of the Activator
class of each plugin? This seems like the proper way to run clean up for
an application since this method will not be called if the plug-in has not
be started so I think I've answered my own question...
Re: Retrieve activated plugins for extension id [message #595437 is a reply to message #54792] Thu, 16 April 2009 09:58 Go to previous message
Eclipse UserFriend
So maybe this is the actual solution... Instead of making a shutdown
method for the application, clean up in the stop method of the Activator
class of each plugin? This seems like the proper way to run clean up for
an application since this method will not be called if the plug-in has not
be started so I think I've answered my own question...
Previous Topic:Running inside Eclipse and Exporting (Import-Package: Conflicts)
Next Topic:Bug(?) in Update Site Project
Goto Forum:
  


Current Time: Thu Mar 13 13:23:05 EDT 2025

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

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

Back to the top