Condition<AnAction> (final ActionManager actionManager, final Keymap keymap, final Condition<? super Shortcut> predicat) { return action -> { if (action == null) return false; final Shortcut[] actionShortcuts = keymap.getShortcuts(actionManager.getId(action)); for (Shortcut actionShortcut : actionShortcuts) { if (predicat.value(actionShortcut)) { return true; } } return false; }; }