Search in sources :

Example 1 with SettingsNodeVersion1

use of org.gradle.openapi.external.ui.SettingsNodeVersion1 in project gradle by gradle.

the class TestSettingsNodeVersion1 method getNodeAtPath.

public SettingsNodeVersion1 getNodeAtPath(String... pathPortions) {
    if (pathPortions == null || pathPortions.length == 0) {
        return null;
    }
    String firstPathPortion = pathPortions[0];
    SettingsNodeVersion1 currentNode = getChildNode(firstPathPortion);
    //Skip the first one. we've already used that one.
    int index = 1;
    while (index < pathPortions.length && currentNode != null) {
        String pathPortion = pathPortions[index];
        currentNode = currentNode.getChildNode(pathPortion);
        index++;
    }
    return currentNode;
}
Also used : SettingsNodeVersion1(org.gradle.openapi.external.ui.SettingsNodeVersion1)

Example 2 with SettingsNodeVersion1

use of org.gradle.openapi.external.ui.SettingsNodeVersion1 in project gradle by gradle.

the class TestSettingsNodeVersion1 method getNodeAtPathCreateIfNotFound.

private SettingsNodeVersion1 getNodeAtPathCreateIfNotFound(String... pathPortions) {
    if (pathPortions == null || pathPortions.length == 0) {
        return null;
    }
    String firstPathPortion = pathPortions[0];
    SettingsNodeVersion1 currentNode = getChildNode(firstPathPortion);
    if (currentNode == null) {
        currentNode = addChild(firstPathPortion);
    }
    int index = 1;
    while (index < pathPortions.length) {
        String pathPortion = pathPortions[index];
        currentNode = currentNode.getChildNode(pathPortion);
        if (currentNode == null) {
            currentNode = addChild(firstPathPortion);
        }
        index++;
    }
    return currentNode;
}
Also used : SettingsNodeVersion1(org.gradle.openapi.external.ui.SettingsNodeVersion1)

Example 3 with SettingsNodeVersion1

use of org.gradle.openapi.external.ui.SettingsNodeVersion1 in project gradle by gradle.

the class TestSettingsNodeVersion1 method getChildNodes.

public List<SettingsNodeVersion1> getChildNodes(String name) {
    List<SettingsNodeVersion1> children = new ArrayList<SettingsNodeVersion1>();
    Iterator<SettingsNodeVersion1> iterator = children.iterator();
    while (iterator.hasNext()) {
        SettingsNodeVersion1 childNode = iterator.next();
        if (name.equals(childNode.getName())) {
            children.add(childNode);
        }
    }
    return children;
}
Also used : SettingsNodeVersion1(org.gradle.openapi.external.ui.SettingsNodeVersion1) ArrayList(java.util.ArrayList)

Example 4 with SettingsNodeVersion1

use of org.gradle.openapi.external.ui.SettingsNodeVersion1 in project gradle by gradle.

the class TestSettingsNodeVersion1 method setValueOfChild.

public void setValueOfChild(String name, String value) {
    SettingsNodeVersion1 settingsNode = addChildIfNotPresent(name);
    settingsNode.setValue(value);
}
Also used : SettingsNodeVersion1(org.gradle.openapi.external.ui.SettingsNodeVersion1)

Example 5 with SettingsNodeVersion1

use of org.gradle.openapi.external.ui.SettingsNodeVersion1 in project gradle by gradle.

the class TestSettingsNodeVersion1 method addChild.

public SettingsNodeVersion1 addChild(String name) {
    SettingsNodeVersion1 childNode = new TestSettingsNodeVersion1(this);
    childNode.setName(name);
    children.add(childNode);
    return childNode;
}
Also used : SettingsNodeVersion1(org.gradle.openapi.external.ui.SettingsNodeVersion1)

Aggregations

SettingsNodeVersion1 (org.gradle.openapi.external.ui.SettingsNodeVersion1)6 ArrayList (java.util.ArrayList)2 SettingsNode (org.gradle.gradleplugin.foundation.settings.SettingsNode)1