Remove unused preference pages [message #359945] |
Tue, 28 July 2009 13:33 |
Peter Lang Messages: 153 Registered: July 2009 |
Senior Member |
|
|
Hi,
In an GMF-editor there are loads of preferences provided by other plugins.
There's Xtext, ATL, CDO, EMF Compare, Ecore Diagram and so on, even when I
have only the required plugins in my run configuration.
While the preferences of my own GMF-application might be necessary, most
others are not useful (and have no impact) in this context.
So I wrote the following code to have them removed:
PreferenceManager preferenceManager =
getWorkbench().getPreferenceManager();
for (IPreferenceNode node : preferenceManager.getRootSubNodes()) {
if ( ! node.getId().startsWith(XxxDiagramEditorPlugin.ID)) {
preferenceManager.remove(node);
}
}
Is there a better way to accomplish this?
Where to put this code?
The first position I thought of is XxxDiagramEditorPlugin.start, but
workbench is not initialized at this time so
getWorkbench().getPreferenceManager() populates my Error Log quite nice :)
Thanks in advance!
|
|
|
Powered by
FUDForum. Page generated in 0.02710 seconds