protected boolean isEnabled(@NotNull AnActionEvent event) {
    RunContentDescriptor descriptor = getDescriptor(event);
    ProcessHandler processHandler = descriptor == null ? null : descriptor.getProcessHandler();
    ExecutionEnvironment environment = getEnvironment(event);
    Project project = getEventProject(event);
    if (environment == null || project == null) {
      return false;
    }

    RunnerAndConfigurationSettings settings = environment.getRunnerAndConfigurationSettings();
    return (!DumbService.isDumb(project) || settings == null || settings.getType().isDumbAware()) &&
           !ExecutionManager.getInstance(project).isStarting(environment) &&
           !(processHandler != null && processHandler.isProcessTerminating());
  }
protected boolean isEnabled(@NotNull AnActionEvent event)