Skip to main content



      Home
Home » Newcomers » Newcomers » Right click menu doesn't update shortcut keys between views(Right click menu doesn't update shortcut keys between views)
Right click menu doesn't update shortcut keys between views [message #502846] Wed, 09 December 2009 17:34
Eclipse UserFriend
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,
Previous Topic:Can't create a new project.
Next Topic:javassist : ClassNotFound Exception while using javassist.jar in plugin
Goto Forum:
  


Current Time: Fri Nov 07 01:46:52 EST 2025

Powered by FUDForum. Page generated in 0.08896 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top