Exemplo n.º 1
0
  private void setCurrentDirectory(File file) {

    if (file == null) {
      currentDirectoryTextField.setText("");
      settingsNode.setValueOfChild(CURRENT_DIRECTORY, "");
    } else {
      currentDirectoryTextField.setText(file.getAbsolutePath());
      settingsNode.setValueOfChild(CURRENT_DIRECTORY, file.getAbsolutePath());
    }

    if (gradlePluginLord.setCurrentDirectory(file)) {
      // refresh the tasks only if we actually changed the current directory
      gradlePluginLord.addRefreshRequestToQueue();
    }
  }
Exemplo n.º 2
0
  /**
   * Call this to set a custom gradle executor. We'll enable all fields appropriately and setup the
   * foundation settings. We'll also fire off a refresh.
   *
   * @param file the file to use as a custom executor. Null not to use one.
   */
  private void setCustomGradleExecutor(File file) {
    String storagePath;
    boolean isUsingCustom = false;
    if (file == null) {
      isUsingCustom = false;
      storagePath = null;
    } else {
      isUsingCustom = true;
      storagePath = file.getAbsolutePath();
    }

    // set the executor in the foundation
    if (gradlePluginLord.setCustomGradleExecutor(file)) {
      // refresh the tasks only if we actually changed the executor
      gradlePluginLord.addRefreshRequestToQueue();
    }

    // set the UI values
    useCustomGradleExecutorCheckBox.setSelected(isUsingCustom);
    customGradleExecutorField.setText(storagePath);

    // enable the UI appropriately.
    browseForCustomGradleExecutorButton.setEnabled(isUsingCustom);
    customGradleExecutorField.setEnabled(isUsingCustom);

    // store the settings
    settingsNode.setValueOfChild(CUSTOM_GRADLE_EXECUTOR, storagePath);
  }
Exemplo n.º 3
0
  /** This stores the current stack trace setting (based on the UI controls) in the plugin. */
  private void updateStackTraceSetting(boolean saveSetting) {
    ShowStacktrace stackTraceLevel = getSelectedStackTraceLevel();
    gradlePluginLord.setStackTraceLevel(stackTraceLevel);

    if (saveSetting) {
      settingsNode.setValueOfChild(STACK_TRACE_LEVEL, stackTraceLevel.name());
    }
  }