void (@NotNull AnActionEvent e) { Project project = e.getProject(); Editor editor = e.getData(CommonDataKeys.EDITOR); VirtualFile virtualFile = e.getData(CommonDataKeys.VIRTUAL_FILE); e.getPresentation().setEnabledAndVisible( project != null && editor != null && virtualFile != null && ( engineInfo != null || virtualFile.getUserData(SELECTED_ENGINE_INFO_KEY) != null || virtualFile.getExtension() != null)); }