Bug 441653 - shortcut for ParameterizedCommand are not working.
Summary: shortcut for ParameterizedCommand are not working.
Status: CLOSED WONTFIX
Alias: None
Product: e4
Classification: Eclipse Project
Component: Runtime (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords: needinfo
Depends on:
Blocks:
 
Reported: 2014-08-13 02:19 EDT by Sumit Singh CLA
Modified: 2019-06-10 09:30 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sumit Singh CLA 2014-08-13 02:19:16 EDT
I'm working on RCP application in e4.

In fragments.e4xmi I declared one command (com.test.command) with parameter(com.test.parameter), handler(com.test.handler) for that command, and I'm adding keyBinding(CTRL+5) for this command. 

I'm using dynamic menu contribution, Shortcut for below code work fine if I'm not passing any parameter for this command: 

@AboutToShow
public void aboutToShow(List<MMenuElement> items) {    
   MHandledMenuItem handledMenuItem = MMenuFactory.INSTANCE.createHandledMenuItem();
   handledMenuItem.setLabel(runScriptModel.getScriptName());
   handledMenuItem.setTooltip(runScriptModel.getScriptPath());
   handledMenuItem.setContributorURI("platform:/plugin/com.test");
   ParameterizedCommand command = commandService.createCommand("com.test.command", Collections.emptyMap());
   handledMenuItem.setWbCommand(command);   
   items.add(handledMenuItem);
}

But If I pass parameter in command handler then Shortcut not visible in menu and even it not working any more:

@AboutToShow
public void aboutToShow(List<MMenuElement> items) {    
   MHandledMenuItem handledMenuItem = MMenuFactory.INSTANCE.createHandledMenuItem();
   handledMenuItem.setLabel(runScriptModel.getScriptName());
   handledMenuItem.setTooltip(runScriptModel.getScriptPath());
   handledMenuItem.setContributorURI("platform:/plugin/com.test");
   Map<String, String> paramMap = new HashMap<String, String>();
   paramMap.put("com.test.parameter", "Hello");
   ParameterizedCommand command = commandService.createCommand("com.test.command", paramMap);
   handledMenuItem.setWbCommand(command);   
   items.add(handledMenuItem);
}


Reproducible: Always
Comment 1 Paul Webster CLA 2014-08-15 16:58:24 EDT
Shortcuts have nothing to do with menu item declarations.  Does the parameterized menu item still work?

What does your parameterized keybinding look like?

PW
Comment 2 Eclipse Genie CLA 2019-06-10 09:30:16 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.