In a custom plug-in that I need to migrate from Eclipse 4.5.2 to Eclipse 4.6.3, I'm using the following code to access the org.eclipse.ui plugin
public class myClass extends Wizard {
...
AbstractUIPlugin plugin = (AbstractUIPlugin) Platform.getPlugin("org.eclipse.ui");
IDialogSettings settings = plugin.getDialogSettings();
IDialogSettings section = workbenchSettings.getSection("myWizard");
if (section == null) {
section = workbenchSettings.addNewSection("myWizard");
}
setDialogSettings(section);
...
}
But since 4.6.0 the org.eclipse.core.runtime.compatibility
plug-in has been removed. So I can't use the Platform.getPlugin()
method.
I've found here someone having an equivalent problem but with no answer. And I've found there that I can access the plugin only if the creator expose the singleton.
So I have two questions:
org.eclipse.ui
plug-in exposed ? Platform.getPlugin()
to access the org.eclipse.ui
plug-in?There is no equivalent API to Platform.getPlugin
. You can get limited information about other plugins using Platform.getBundle
and FileLocator.find
but that doesn't help here.
The org.eclipse.ui
plugin does have a UIPlugin.getDefault()
method but this is in an internal package so you would be breaking the Eclipse API Rules of Engagement if you used it.
For dialog settings it is standard practice to call the getDialogSettings
on your own plugin not some other plugin which you don't control.