void (@NotNull AnActionEvent e) { Editor editor = e.getData(CommonDataKeys.EDITOR); e.getPresentation().setEnabledAndVisible(isSupported() && getFile(e) != null && (!ActionPlaces.isPopupPlace(e.getPlace()) || editor == null || !editor.getSelectionModel().hasSelection() || EditorUtil.contextMenuInvokedOutsideOfSelection(e))); e.getPresentation().setText(getActionName(e.getPlace())); }