AnAction (@NotNull Action action) { AnAction anAction = new AnAction((String)action.getValue(Action.NAME)) { @Override public void update(@NotNull AnActionEvent e) { e.getPresentation().setEnabled(action.isEnabled()); } @Override public @NotNull ActionUpdateThread getActionUpdateThread() { return ActionUpdateThread.EDT; } @Override public void actionPerformed(@NotNull AnActionEvent e) { action.actionPerformed(new ActionEvent(this, ActionEvent.ACTION_PERFORMED, null)); } }; Object value = action.getValue(Action.ACCELERATOR_KEY); if (value instanceof KeyStroke keys) { anAction.setShortcutSet(new CustomShortcutSet(keys)); } return anAction; }