I have an eclipse rcp and want to hide the security and help prerence pages. How can I do that?
-
You mean you are the developer of the RCP software? – Mario Marinato Sep 22 '09 at 15:33
-
I am the devleoper, but the preference pages are from other plugins, like the help plugins. – Hannes Niederhausen Sep 23 '09 at 07:07
-
Just added the preference page ids needed to hide the extra preference page (help and storage) – VonC Sep 23 '09 at 10:44
-
Note: the `activityPatternBinding` in my answer was invisible due to an incorrect formatting of the xml code. I take it from the tick that you manage to hide your extra preference page I suppose? – VonC Sep 24 '09 at 10:20
2 Answers
I was looking for the same thing and found the solution in this link:
http://sourceforge.net/apps/trac/fable/wiki/Preferences
Cheers. Stefan
Disable help preferences
¶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;
}//
-
-
Good catch. +1. I imported the wiki page here. That way, if the sourceforge project goes down, the information remain available here. – VonC Nov 25 '09 at 11:36
-
1Another good way to find the ids of preferences is to open the Plugin Registry... Then go go down to the plugin org.eclipse.ui...expand it... then expand Extension points, then expand org.eclipse.ui.preferencePages and this will have a list of all the preferences added to the Eclipse you are using for development. – nbz Feb 04 '13 at 11:18
According to this entry, you could use the "workbench activities" mechanism, and:
- define separate activities corresponding to the different access levels
- define your actions in regular action sets, grouped according to access level
- associate each activity with the appropriate action sets via
activityPatternBinding
elements- set the enabled activity ids after authentication, early in the workbench lifecycle, e.g. from your
WorkbenchAdvisor
'spreStartup()
method.
(Note, the above was for a filtering based on user's permissions, but it could be generalize to other criteria.)
Regarding the preference pages for the storage and help, you should bind the id of those pages with an activity you know you can disable:
<activityPatternBinding
activityId="org.eclipse.javaDevelopment"
pattern="org\.eclipse\.help\..*/.*">
</activityPatternBinding>
would disable all menu/preferences/views related to help.
If you use org.eclipse.help.ui.PrefPageHelp\..*
, it would only bind prefPageHelp
and prefPageHelpContent
.
If you add another activity binding extension with
org.eclipse.equinox.security.ui.sec_storage_preferences_context
, that would also take care of the Secure Storage preference page.

- 1,262,500
- 529
- 4,410
- 5,250
-
I managed to hide my own views and prerference pages, but the preference pages for the storage and help remained :( – Hannes Niederhausen Sep 23 '09 at 08:26