Search in sources :

Example 1 with DartTestRunnerParameters

use of com.jetbrains.lang.dart.ide.runner.test.DartTestRunnerParameters in project intellij-plugins by JetBrains.

the class DartTestConfigurationEditorForm method resetEditorFrom.

@Override
protected void resetEditorFrom(@NotNull final DartTestRunConfiguration configuration) {
    final DartTestRunnerParameters parameters = configuration.getRunnerParameters();
    myScopeCombo.setSelectedItem(parameters.getScope());
    String testPath = FileUtil.toSystemDependentName(StringUtil.notNullize(parameters.getFilePath()));
    if (parameters.getScope() == FOLDER) {
        myDirField.setText(testPath);
        myTargetNameField.setText(parameters.getTargetName());
    } else {
        myFileField.setText(testPath);
    }
    myTestNameField.setText(parameters.getScope() == GROUP_OR_TEST_BY_NAME ? StringUtil.notNullize(parameters.getTestName()) : "");
    myTestRunnerOptionsField.setText(parameters.getTestRunnerOptions());
    myEnvironmentVariables.setEnvs(parameters.getEnvs());
    myEnvironmentVariables.setPassParentEnvs(parameters.isIncludeParentEnvs());
    onScopeChanged();
}
Also used : DartTestRunnerParameters(com.jetbrains.lang.dart.ide.runner.test.DartTestRunnerParameters)

Example 2 with DartTestRunnerParameters

use of com.jetbrains.lang.dart.ide.runner.test.DartTestRunnerParameters in project intellij-plugins by JetBrains.

the class DartTestConfigurationEditorForm method applyEditorTo.

@Override
protected void applyEditorTo(@NotNull final DartTestRunConfiguration configuration) throws ConfigurationException {
    final DartTestRunnerParameters parameters = configuration.getRunnerParameters();
    final DartTestRunnerParameters.Scope scope = (DartTestRunnerParameters.Scope) myScopeCombo.getSelectedItem();
    parameters.setScope(scope);
    TextFieldWithBrowseButton pathSource = scope == FOLDER ? myDirField : myFileField;
    parameters.setFilePath(StringUtil.nullize(FileUtil.toSystemIndependentName(pathSource.getText().trim())));
    parameters.setTestName(scope == GROUP_OR_TEST_BY_NAME ? StringUtil.nullize(myTestNameField.getText().trim()) : null);
    parameters.setTargetName(scope == FOLDER ? StringUtil.nullize(myTargetNameField.getText().trim()) : null);
    parameters.setTestRunnerOptions(StringUtil.nullize(myTestRunnerOptionsField.getText().trim()));
    parameters.setEnvs(myEnvironmentVariables.getEnvs());
    parameters.setIncludeParentEnvs(myEnvironmentVariables.isPassParentEnvs());
}
Also used : TextFieldWithBrowseButton(com.intellij.openapi.ui.TextFieldWithBrowseButton) Scope(com.jetbrains.lang.dart.ide.runner.test.DartTestRunnerParameters.Scope) Scope(com.jetbrains.lang.dart.ide.runner.test.DartTestRunnerParameters.Scope) DartTestRunnerParameters(com.jetbrains.lang.dart.ide.runner.test.DartTestRunnerParameters)

Aggregations

DartTestRunnerParameters (com.jetbrains.lang.dart.ide.runner.test.DartTestRunnerParameters)2 TextFieldWithBrowseButton (com.intellij.openapi.ui.TextFieldWithBrowseButton)1 Scope (com.jetbrains.lang.dart.ide.runner.test.DartTestRunnerParameters.Scope)1