Wednesday, March 31, 2010

When you use some of the Eclipse IDE plugins they may contribute preference pages that you may not necessarily want to show to your users.

Remove them in the ApplicationWorkbenchWindowAdvisor.postWindowCreate():


PreferenceManager pm = PlatformUI.getWorkbench( ).getPreferenceManager();
pm.remove("org.eclipse.ui.preferencePages.Workbench");


The "org.eclipse.ui.preferencePages.Workbench" id removes the "General" preference page group. If you do not know the id for the page you want to remove. You can first print them like this:

PreferenceManager pm = PlatformUI.getWorkbench( ).getPreferenceManager();
IPreferenceNode[] arr = pm.getRootSubNodes();

for(IPreferenceNode pn:arr){
System.out.println("Label:" + pn.getLabelText() + " ID:" + pn.getId());
}

5 comments:

Lance said...

Thanks, your blog helped me a lot !

Prusch said...

Thanks for your help!

Ioana said...

Thank you very much! That was very useful.

Kuldeep said...

How to do this in Eclipse e4 (http://www.eclipse.org/e4/) ??

Unknown said...

Thank you very much! I needed exactly this.

Post a Comment