void (@NotNull AnActionEvent e) { Presentation p = e.getPresentation(); Editor editor = e.getData(CommonDataKeys.EDITOR); p.setVisible(!RichCopySettings.getInstance().isEnabled() && (e.isFromActionToolbar() || (editor != null && editor.getSelectionModel().hasSelection(true))) && (editor == null || isRichCopyPossible(editor))); }