void (@NotNull AnActionEvent e) { Project project = e.getProject(); boolean enabled = project != null; boolean running = CachedValueProfiler.isProfiling(); e.getPresentation().setEnabledAndVisible(enabled); e.getPresentation().setText(running ? "Stop Cached Value Profiling" : "Start Cached Value Profiling"); }