|
Re: Hiding MenuContributions based Command ID [message #479621 is a reply to message #479603] |
Tue, 11 August 2009 17:58 |
|
Using the visibleWhen is the system supported method of managing visibility correctly. Especially if are contributing the commands, you can provide your own ISourceProvider (the list of command ids to show or not show) using org.eclipse.ui.services or provide a property tester and call org.eclipse.ui.services.IEvaluationService.requestEvaluation (String) and have the system update appropriately for all of the menus, toolbars, and popups.
Other than that, there are static ways to remove commands from plugin.xmls, but it involves hackery.
In 3.5 there was extra support added for the CustomizePerspectiveDialog to remove specific menu and toolbar items from the main menu and main toolbar. It is statically available from the IPerspectiveFactory and org.eclipse.ui.perspectiveExtensions EP, but there is no dynamic, programmatic API (it is really an experimental feature).
PW
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Menu_Contributions
|
|
|
Powered by
FUDForum. Page generated in 0.03050 seconds