void (@NotNull List<? super AnAction> actions, @NotNull Component component, @NotNull MouseShortcut mouseShortcut, boolean recursive) { // here we try to find "local" shortcuts for (Component c = component; c != null; c = c.getParent()) { if (c instanceof JComponent) { for (AnAction action : ActionUtil.getActions((JComponent)c)) { for (Shortcut shortcut : action.getShortcutSet().getShortcuts()) { if (mouseShortcut.equals(shortcut) && !actions.contains(action)) { actions.add(action); } } } // once we've found a proper local shortcut(s), we exit if (!actions.isEmpty()) { return; } } if (!recursive) break; } ActionManager actionManager = ApplicationManager.getApplication().getServiceIfCreated(ActionManager.class); if (actionManager == null) { return; } // search in main keymap KeymapManager keymapManager = KeymapManagerImpl.isKeymapManagerInitialized() ? KeymapManager.getInstance() : null; if (keymapManager == null) { return; } boolean isModalContext = IdeKeyEventDispatcher.isModalContext(component); Keymap keymap = keymapManager.getActiveKeymap(); for (String actionId : keymap.getActionIds(mouseShortcut)) { AnAction action = actionManager.getAction(actionId); if (action == null || isModalContext && !action.isEnabledInModalContext()) { continue; } if (!actions.contains(action)) { actions.add(action); } } }