Retrieve activated plugins for extension id [message #595037] |
Tue, 14 April 2009 07:56 |
Ricky Patel Messages: 33 Registered: July 2009 |
Member |
|
|
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();
}
}
}
|
|
|
Powered by
FUDForum. Page generated in 0.02458 seconds