Search in sources :

Example 1 with Scope

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

the class DartTestConfigurationEditorForm method onScopeChanged.

private void onScopeChanged() {
    final DartTestRunnerParameters.Scope scope = (DartTestRunnerParameters.Scope) myScopeCombo.getSelectedItem();
    myTestNameLabel.setVisible(scope == GROUP_OR_TEST_BY_NAME);
    myTestNameField.setVisible(scope == GROUP_OR_TEST_BY_NAME);
    boolean folderMode = scope == FOLDER;
    boolean projectWithoutPubspec = Registry.is("dart.projects.without.pubspec", false);
    myFileField.setVisible(!folderMode);
    myTestFileLabel.setVisible(!folderMode);
    myDirField.setVisible(folderMode);
    myDirLabel.setVisible(folderMode);
    myTargetNameField.setVisible(folderMode && projectWithoutPubspec);
    myTargetNameLabel.setVisible(folderMode && projectWithoutPubspec);
}
Also used : 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)

Example 2 with Scope

use of com.jetbrains.lang.dart.ide.runner.test.DartTestRunnerParameters.Scope 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 Scope (com.jetbrains.lang.dart.ide.runner.test.DartTestRunnerParameters.Scope)2 TextFieldWithBrowseButton (com.intellij.openapi.ui.TextFieldWithBrowseButton)1