Archive for August, 2011

August 6, 2011

How to remove unwanted Preference Pages

by Jay Jonas

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 don’t know the id for the page you want to remove, so you can first try to 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());
}