DefaultActionGroup (@NotNull String actionId, Keymap selectedKeymap) { DefaultActionGroup group = new DefaultActionGroup(); final ShortcutRestrictions restrictions = ActionShortcutRestrictions.getInstance().getForActionId(actionId); if (restrictions.allowKeyboardShortcut) { group.add(new AddKeyboardShortcutAction(actionId, restrictions, selectedKeymap)); } if (restrictions.allowMouseShortcut) { group.add(new AddMouseShortcutAction(actionId, restrictions, selectedKeymap)); } if (restrictions.allowAbbreviation) { group.add(new AddAbbreviationAction(actionId)); } group.addSeparator(); Shortcut[] shortcuts = selectedKeymap.getShortcuts(actionId); for (Shortcut shortcut : shortcuts) { group.add(new RemoveShortcutAction(shortcut, selectedKeymap, actionId)); } for (final String abbreviation : AbbreviationManager.getInstance().getAbbreviations(actionId)) { group.addAction(new RemoveAbbreviationAction(abbreviation, actionId)); } boolean separator = true; if (shortcuts.length > 2) { group.add(new Separator()); group.add(new RemoveAllShortcuts(selectedKeymap, actionId)); separator = false; } if (myManager.canResetActionInKeymap(selectedKeymap, actionId)) { if (separator) { group.add(new Separator()); } group.add(new ResetShortcutsAction(selectedKeymap, actionId)); } return group; }