Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Eclipse RCP - change plugin.xml programmatically? Reload?

Edit:
What I want to do, is adding preferences-pages to the preferences-menu in an Rclipse-RCP 3.7 application programmatically. Unfortuanately this seems not to work programmatically, as described in this post.

As a solution I think about creating a special plugin, which will maintain the preferences. This plugin should declare all preference-pages in it's plugin.xml and uninstall/install itself to apply the changes in the preferences-menu.

Question:

Is there a possibility to

  1. change the plugin's own plugin.xml programmatically?
  2. is there a possibility to update the plugin programmatically, to reload the new settings from plugin.xml ?
like image 422
Skip Avatar asked Jan 23 '26 10:01

Skip


1 Answers

It would be helpful to understand the problem you are trying to solve, instead of what you are doing.

In general, there's no easy way to do what you want.

You can force a reload of your plugin.xml by using OSGi to uninstall and re-install your bundle. See org.osgi.framework.Bundle.uninstall(). But depending on the extensions contributed by the plugin.xml, not extension point consumers are written to be dynamic aware.

The other option for an RCP app is to contribute extensions using org.eclipse.core.runtime.IExtensionRegistry.addContribution(InputStream, IContributor, boolean, String, ResourceBundle, Object). This is great for dynamic additions, it's less reliable for removing extensions, and the same caveat applies (how dynamic-aware is the consumer of the extension point). You use it in RCP apps by setting the user token to null.

like image 80
Paul Webster Avatar answered Jan 25 '26 23:01

Paul Webster



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!