use of com.haulmont.cuba.web.gui.MenuShortcutAction in project cuba by cuba-platform.
the class MenuBuilder method assignShortcut.
protected void assignShortcut(Window webWindow, AppMenu.MenuItem menuItem, MenuItem item) {
KeyCombination itemShortcut = item.getShortcut();
if (itemShortcut != null) {
ShortcutListener shortcut = new MenuShortcutAction(menuItem, "shortcut_" + item.getId(), item.getShortcut());
AbstractComponent windowImpl = webWindow.unwrap(AbstractComponent.class);
windowImpl.addShortcutListener(shortcut);
appMenu.setMenuItemShortcutCaption(menuItem, itemShortcut.format());
}
}
Aggregations