Community
Participate
Working Groups
Bugzilla – Bug 291871
[Design] CommandUtil in design.example does not handle command parameters
Last modified: 2010-02-09 10:12:48 EST
Just contribute a menu to the org.eclipse.ui.main.toolbar using the command org.eclipse.ui.perspectives.showPerspective providing the parameter org.eclipse.ui.perspectives.showPerspective.perspectiveId.
This bug occurs because we extract information from the commands to show it in the coolbar and menu. This problem will be obsoleted when the new toolbar (bug 277883) is implemented.
Any workarounds for this? Just till bug 277883 gets fixed...
The command parameters are not passed through in views' toolbars, too. So, commands cannot work properly.
I think this might be fixed by extracting the parameters map of the CommandContributionItem. Yet, the parameters map is not public and there need to be a way to access it.
CommandContributionItem.getCommand() will return the ParameterizedCommand (added in 3.5) with the information you need. PW
Created attachment 151179 [details] Patches CommandUtil to handle command parameters properly
Note: CommandContributionItem in rap and eclipse 3.5 are not in sync: I just copied the api docs and made CommandContributionItem.getCommand() public (as in eclipse 3.5).
Finally this bug is fixed. The class CommandUtil isn't necessary anymore because all managers use the new ToolBar and let their ContributionItems render themselves now. See the blocking bugs.