Community
Participate
Working Groups
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
Shortcuts have nothing to do with menu item declarations. Does the parameterized menu item still work? What does your parameterized keybinding look like? PW
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.