void (@NotNull AnActionEvent e) { Project project = e.getProject(); if (project == null) { e.getPresentation().setEnabled(false); return; } boolean dumb = DumbServiceImpl.getInstance(project).isDumb(); if (!dumb && isToggledDumb(project)) { setToggledDumb(project, false); } e.getPresentation().setEnabled(!dumb || isToggledDumb(project)); e.getPresentation().setText(dumb ? "Exit Dumb Mode" : "Enter Dumb Mode"); }