List of usage examples for com.intellij.openapi.actionSystem.ex ActionUtil getActions
@NotNull public static List<AnAction> getActions(@NotNull JComponent component)
From source file:com.maddyhome.idea.vim.group.KeyGroup.java
License:Open Source License
@NotNull private static List<AnAction> getLocalActions(@NotNull Component component, @NotNull KeyStroke keyStroke) { final List<AnAction> results = new ArrayList<AnAction>(); final KeyboardShortcut keyStrokeShortcut = new KeyboardShortcut(keyStroke, null); for (Component c = component; c != null; c = c.getParent()) { if (c instanceof JComponent) { final List<AnAction> actions = ActionUtil.getActions((JComponent) c); for (AnAction action : actions) { if (action instanceof VimShortcutKeyAction) { continue; }// w w w .j a va 2s . co m final com.intellij.openapi.actionSystem.Shortcut[] shortcuts = action.getShortcutSet() .getShortcuts(); for (com.intellij.openapi.actionSystem.Shortcut shortcut : shortcuts) { if (shortcut.isKeyboard() && shortcut.startsWith(keyStrokeShortcut) && !results.contains(action)) { results.add(action); } } } } } return results; }