Bug 291871 - [Design] CommandUtil in design.example does not handle command parameters
[Design] CommandUtil in design.example does not handle command parameters
Status: RESOLVED FIXED
Product: RAP
Classification: RT
Component: Demo
1.2
All All
: P3 normal (vote)
: 1.3 M6
Assigned To: Project Inbox CLA Friend
:
Depends on: 277883 299525 301822
Blocks:
  Show dependency tree
 
Reported: 2009-10-09 03:11 EDT by Erdal Karaca CLA Friend
Modified: 2010-02-09 10:12 EST (History)
1 user (show)

See Also:


Attachments
Patches CommandUtil to handle command parameters properly (6.89 KB, patch)
2009-11-03 07:55 EST, Erdal Karaca CLA Friend
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Erdal Karaca CLA Friend 2009-10-09 03:11:16 EDT
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.
Comment 1 Holger Staudacher CLA Friend 2009-10-22 11:04:05 EDT
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.
Comment 2 Erdal Karaca CLA Friend 2009-11-02 03:27:08 EST
Any workarounds for this? Just till bug 277883 gets fixed...
Comment 3 Erdal Karaca CLA Friend 2009-11-02 05:26:48 EST
The command parameters are not passed through in views' toolbars, too.
So, commands cannot work properly.
Comment 4 Erdal Karaca CLA Friend 2009-11-02 07:46:00 EST
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.
Comment 5 Paul Webster CLA Friend 2009-11-02 08:44:07 EST
CommandContributionItem.getCommand() will return the ParameterizedCommand (added in 3.5) with the information you need.

PW
Comment 6 Erdal Karaca CLA Friend 2009-11-03 07:55:20 EST
Created attachment 151179 [details]
Patches CommandUtil to handle command parameters properly
Comment 7 Erdal Karaca CLA Friend 2009-11-03 07:58:10 EST
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).
Comment 8 Holger Staudacher CLA Friend 2010-02-09 10:12:48 EST
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.