mirror of
https://gitee.com/jmix/cuba.git
synced 2024-12-02 19:27:57 +08:00
NPE - Key combinations for submenu #PL-3527
This commit is contained in:
parent
99deaae981
commit
0406a16cec
@ -70,8 +70,6 @@ public class MenuBuilder {
|
||||
public void menuCanceled(MenuEvent e) {
|
||||
}
|
||||
});
|
||||
|
||||
assignShortcut(jMenu, item);
|
||||
menuBar.add(jMenu);
|
||||
createSubMenu(jMenu, item);
|
||||
} else {
|
||||
@ -128,7 +126,6 @@ public class MenuBuilder {
|
||||
}
|
||||
} else {
|
||||
JMenu jChildMenu = new JMenu(MenuConfig.getMenuItemCaption(child.getId()));
|
||||
assignShortcut(jChildMenu, child);
|
||||
createSubMenu(jChildMenu, child);
|
||||
if (!isMenuEmpty(jChildMenu)) {
|
||||
items.add(new MenuItemContainer(jChildMenu));
|
||||
|
@ -161,7 +161,7 @@ public class MenuBuilder {
|
||||
}
|
||||
|
||||
protected void assignShortcut(MenuBar.MenuItem menuItem, MenuItem item) {
|
||||
if (item.getShortcut() != null) {
|
||||
if (item.getShortcut() != null && menuItem.getCommand() != null) {
|
||||
MenuShortcutAction shortcut = new MenuShortcutAction(menuItem, "shortcut_" + item.getId(), item.getShortcut());
|
||||
appWindow.addAction(shortcut);
|
||||
menuBar.setShortcut(menuItem, item.getShortcut());
|
||||
|
@ -156,7 +156,7 @@ public class MenuBuilder {
|
||||
}
|
||||
|
||||
protected void assignShortcut(MenuBar.MenuItem menuItem, MenuItem item) {
|
||||
if (item.getShortcut() != null) {
|
||||
if (item.getShortcut() != null && menuItem.getCommand() != null) {
|
||||
MenuShortcutAction shortcut = new MenuShortcutAction(menuItem, "shortcut_" + item.getId(), item.getShortcut());
|
||||
appWindow.addAction(shortcut);
|
||||
menuBar.setShortcut(menuItem, item.getShortcut());
|
||||
|
Loading…
Reference in New Issue
Block a user