BaseAction (final JComponent component) { final ActionBehaviour<V> behaviour = new ActionBehaviour<>() { @Override public V performAction(final @NotNull AnActionEvent e) { return addInternal(myAddHandler.create()); } @Override public void updateAction(final @NotNull AnActionEvent e) {} }; final BaseAction action = createAction(behaviour); if (myCreateShortcut) { action.registerCustomShortcutSet(CommonShortcuts.INSERT, component); } return action; }