| Right click menu doesn't update shortcut keys between views [message #502846] |
Wed, 09 December 2009 17:34 |
Eclipse User |
|
|
|
I have two views in the application that have same right click menu options (created using same code for both views). When the keybiding for the command action is changed from preference page; one of the view's shortcut keys in the right click menu are not updating properly while the other one is. However, the actual keybindings are changed for both of the views. For the view that shorcuts didn't change, i can close the view and reopen it and the correct shortcut keys are displayed.
Does anyone have any ideas or suggestions as to why one of the views right click menu shortcuts are changed but not the other?
The menu is created using JFace MenuManager. Below is the snippet on how the menu is created:
tableContextMenuManager = new MenuManager("tableContextMenu"); //$NON-NLS-1$
Menu menu = tableContextMenuManager.createContextMenu(tableViewer.getCon trol());
tableViewer.getControl().setMenu(menu);
//these are the two menu items of concern that the shortcuts are being changed
tableContextMenuManager.add(interpretAction);
handlerService.activateHandler(interpretAction.getActionDefi nitionId(),
new ActionHandler(interpretAction));
tableContextMenuManager.add(viewAction);
handlerService.activateHandler(viewAction.getActionDefinitio nId(), new ActionHandler(
viewAction));
The IHandlerService handlerService being used is retrieved from the ViewPart for both views as below.
handlerService = (IHandlerService) viewPart.getSite().getService(IHandlerService.class);
I am using IBindingService.savePreferences(Scheme activeScheme, Binding[] bindings) method to update the bindings for command.
Thanks,
|
|
|
Powered by
FUDForum. Page generated in 0.08600 seconds