public void reset() {
   RunnerAndConfigurationSettings configuration = getSettings();
   if (configuration != null) {
     setNameText(configuration.getName());
   }
   super.reset();
 }
예제 #2
0
  private boolean checkRunConfiguration(
      Executor executor, Project project, RunnerAndConfigurationSettings configuration) {
    ExecutionTarget target = ExecutionTargetManager.getActiveTarget(project);

    if (!ExecutionTargetManager.canRun(configuration, target)) {
      ExecutionUtil.handleExecutionError(
          project,
          executor.getToolWindowId(),
          configuration.getConfiguration(),
          new ExecutionException(
              StringUtil.escapeXml(
                  "Cannot run '"
                      + configuration.getName()
                      + "' on '"
                      + target.getDisplayName()
                      + "'")));
      return false;
    }

    if (!RunManagerImpl.canRunConfiguration(configuration, executor)
        || configuration.isEditBeforeRun()) {
      if (!RunDialog.editConfiguration(project, configuration, "Edit configuration", executor)) {
        return false;
      }

      while (!RunManagerImpl.canRunConfiguration(configuration, executor)) {
        if (0
            == Messages.showYesNoDialog(
                project,
                "Configuration is still incorrect. Do you want to edit it again?",
                "Change Configuration Settings",
                "Edit",
                "Continue Anyway",
                Messages.getErrorIcon())) {
          if (!RunDialog.editConfiguration(
              project, configuration, "Edit configuration", executor)) {
            break;
          }
        } else {
          break;
        }
      }
    }
    return true;
  }