CommandContributionItem parameterization not working in Main Menu [message #1402650] |
Thu, 17 July 2014 09:38 |
João Rebelo Messages: 28 Registered: December 2013 |
Junior Member |
|
|
Hi,
I'm working in E4 compatibility mode, in a application that is using CommandContributionItem for dinamically add items to the Main Menu.
This is being added at the ApplicationActionBarAdvisor.fillMenuBar (in case it affects the bootup flow)
The code would be something as:
CommandContributionItemParameter aEnParam = new CommandContributionItemParameter(theWindow, "Language.en.Label", "com.compxc.workbench.presentation.command.changeLanguageCommand", IAction.AS_RADIO_BUTTON);
aEnParam.label = ResourceManager.getText("Language.en.Label");
HashMap<String, String> aEnParamMap = new HashMap<String, String>();
aEnParamMap.put("org.eclipse.ui.commands.radioStateParameter", "EN");
aEnParam.parameters = aEnParamMap;
englishAction = new CommandContributionItem(aEnParam);
theMenuBar.add(englishAction);
Although I can see it being correctly parameterized with my value, when I get to the execution in the Handler, the Event doesn't bring any parameter.
A similar example in a context menu, with the same code creating the Contribution works just fine, and the Handler receives the parameter.
Any idea how to fix this, or how to generate a Command based Contribution with correct parameterization?
|
|
|
|
Powered by
FUDForum. Page generated in 0.03829 seconds