void (@NotNull AnActionEvent e) { super.update(e); Editor editor = e.getData(CommonDataKeys.EDITOR); e.getPresentation().setEnabledAndVisible(editor == null || !editor.getSelectionModel().hasSelection()); }