AnAction (@NotNull Runnable runnable) { return new AnAction() { @Override public void update(@NotNull AnActionEvent e) { e.getPresentation().setEnabledAndVisible(true); } @Override public void actionPerformed(@NotNull AnActionEvent e) { runnable.run(); } }; }