How to add shortcuts for Dynamic menus. [message #1407216] |
Tue, 12 August 2014 05:31 |
|
In my RCP application I'm using dynamic menu.
I want to add shortcuts for that, there is option to set setMnemonics but I want to set shortcut let say ALT+1
@AboutToShow
public void aboutToShow(List<MMenuElement> items) {
MDirectMenuItem dynamicItem = MMenuFactory.INSTANCE.createDirectMenuItem();
dynamicItem.setLabel("Test Menu");
dynamicItem.setTooltip("Test Menu tooltip");
dynamicItem.setContributorURI("platform:/plugin/com.sumit.test");
dynamicItem.setContributionURI"bundleclass://com.sumit.test/com.sumit.test.TestHandler");
dynamicItem.setMnemonics("T");
items.add(dynamicItem);
}
Shortcut are possible with commands but in this case is there any workaround?.
Thanks,
Sumit
|
|
|
Re: How to add shortcuts for Dynamic menus. [message #1407395 is a reply to message #1407216] |
Tue, 12 August 2014 13:55 |
Eclipse User |
|
|
|
Quote:Shortcut are possible with commands but in this case is there any workaround?
No, it's not possible. It goes against the whole approach of commands/keybinding approach: how would the system handle two different direct menu items both specify the same shortcut?
Brian.
|
|
|
Powered by
FUDForum. Page generated in 0.03749 seconds