void (@NotNull AnActionEvent e) { Editor editor = e.getData(CommonDataKeys.EDITOR); if (editor == null || editor.getEditorKind() != EditorKind.PREVIEW) { e.getPresentation().setEnabledAndVisible(false); return; } super.update(e); }