Here\'s something obvious that should be easy to do...
How do I retrieve a list of installed plugins at runtime? Can\'t see an obvious way to do this a Platform.getBundl
If you're looking to write this in your code, see VonC's answer.
If you just want a view that does this, there's already one in eclipse: Window->Show View->Other...->PDE Runtime->Plugin Registry. This displays plugins, their extensions, dependencies, and who is providing extensions.
From here:
The BundleContext class has a getBundles
() method that returns all installed bundles.
You get an instance of the BundleContext
when your bundle is activated BundleActivator.start(BundleContext))
.
You can use it to get some Bundle version number for instance.
The interactions between the bundles are done through two complementary mechanisms: the package export/import and the service registration lookup facility.
The publication and lookup of services are performed through the BundleContext
reference that each bundle receives at startup time.
During the publication process, the advertising bundles registers a service by publishing a Java interface it is implementing, and by providing a class implementing this interface.
The lookup is performed by the client bundle, which gets the service from the BundleContext
and uses it as a standard Java object.
Use following code to get the List of plugin installed in your RCP
BundleContext ctx = FrameworkUtil.getBundle(your/Class/Name.class).getBundleContext();
Bundle[] bundles = ctx.getBundles();