I have an eclipse rcp and want to hide the security and help prerence pages. How can I do that?
Preferences are stored in the workspace of your application in the . metadata/. plugins/org. eclipse.
I was looking for the same thing and found the solution in this link:
http://sourceforge.net/apps/trac/fable/wiki/Preferences
Cheers. Stefan
Put the following code into your subclass of org.eclipse.ui.application.WorkbenchAdvisor
, and it removes the "Help" group from RCP preference dialog:
public void postStartup() {
PreferenceManager pm = PlatformUI.getWorkbench().getPreferenceManager( );
pm.remove( "org.eclipse.help.ui.browsersPreferencePage" );
}
"org.eclipse.help.ui.browsersPreferencePage
" is the ID for the preferences extension point.
Add Perspective preferences ¶
Remark : to find plugin id preferences, select Window-->show view--> PDE Runtime--> Plugin Registry
..... and try to find what you are looking for .....
For example, for "Workbench preferences
", have a look in fable.eclipse.ui.ide
and extension org.eclipse.ui.preferencePages
: id="org.eclipse.ui.preferencePages.Workbench"
If you want to add only perspective (for example) preferences, add a preference extension in MANIFEST.XML
:
id : org.eclipse.ui.preferencePages.Perspectives
name:perspective(fable)
class:org.eclipse.ui.internal.ide.dialogs.IDEPerspectivesPreferencePage
//Add : org.eclipse.ui.ide in your Dependencies
In ApplicationWorkBenchAdvisor :
public void postStartup() {
PreferenceManager pm = PlatformUI.getWorkbench().getPreferenceManager( );
pm.remove( ""org.eclipse.ui.preferencePages.Workbench"browsersPreferencePage" );
}
public String getInitialWindowPerspectiveId() {
IPreferenceStore pref = Activator.getDefault().getPreferenceStore();
String ret = pref.getDefaultString(IWorkbenchPreferenceConstants.DEFAULT_PERSPECTIVE_ID);
ret=(ret==null || ret.equals(""))?"yourDefaultPerspectiveID":ret;
return ret;
}//
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With