java - SWT popup menu shortcut not working -
i creating eclipse plugin , using swt popup menu (context menu) 1 of controls in plugin. context menu item works, accelerator (shortcut) set menu item has no effect , not work. create menuitem this:
menuitem parent = new menu(getshell(), swt.pop_up); menuitem menuitem = new menuitem(parent, swt.push); menuitem.settext("click me"); menuitem.setaccelerator( swt.ctrl+ 'f');
note shortcut problem occurs pop_up
menu, not bar
menu item.
try item.setaccelerator(swt.mod1 + 'a');
mod1, mod2 .. mod4 keyboard and/or mouse event mask indicating mod1 key pushed on keyboard when event generated.
edit:
if developing eclipse plugin, , putting menu on view
, possible eclipse platform shortcut system interfering swt component's accelerator.
i suggest refactor code, use shortcuts extension eclipse provides.
Comments
Post a Comment