Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[pde-ui-dev] Action for bundle.update() in Plugin Registry Browser

Hi there,

 

I wondered if it would be possible to add an Action to the context menu of the Plugin Registry Browser (org.eclipse.pde.internal.runtime.registry.RegistryBrowser) which calls bundle.update() for all selected bundles. I already found out that in the current HEAD version of this class, actions to start and stop a bundle were added.

 

Updating a bundle would however be a nice feature, especially for plugins generated by EMF and oAW. It would permit to change the meta-model or some code-generation templates, export the plugin into the local “eclipse/plugins” directory and then call bundle.update() so that the running workbench is updated, and the new functionality is instantly available.

This would be much easier than always launching another Runtime-Workbench from within the current eclipse to test the plugin, because changes in the meta-model and code-generation are easier to test with a “real” model instead of an additionally maintained test model.

 

I’m not sure if this is 100% correct, but the following code worked for me:

 

bundle.stop();

bundle.update();

ServiceReference packageAdminRef = bundle.getBundleContext().getServiceReference(PackageAdmin.class.getName());

PackageAdmin packageAdmin = null;

if (packageAdminRef != null) {

   packageAdmin = (PackageAdmin) bundle.getBundleContext().getService(packageAdminRef);

   if (packageAdmin != null) {

      packageAdmin.refreshPackages(new Bundle[] { bundle });

   }

}

bundle.start();

 

I’d also provide a patch, but the current HEAD doesn’t compile in my Eclipse Europa L.

 

Another nice feature would be an extra Action “Install/Update locally” in the PDE Tools section of the context menu of a PDE  project. This Action would deploy or update the plugin in the current (running) instance of eclipse.

 

Best regards

Andy

 


Back to the top