Example usage for org.springframework.ide.eclipse.boot.wizard MultiSelectionFieldModel select

List of usage examples for org.springframework.ide.eclipse.boot.wizard MultiSelectionFieldModel select

Introduction

In this page you can find the example usage for org.springframework.ide.eclipse.boot.wizard MultiSelectionFieldModel select.

Prototype

public void select(T v) 

Source Link

Usage

From source file:org.springframework.ide.eclipse.boot.wizard.NewSpringBootWizardModel.java

/**
 * Convenience method for easier scripting of the wizard model (used in testing). Not used
 * by the UI itself. If the dependencyId isn't found in the wizard model then an IllegalArgumentException
 * will be raised.//w ww. j  a va 2s  . com
 */
public void addDependency(String dependencyId) {
    for (String catName : dependencies.getCategories()) {
        MultiSelectionFieldModel<Dependency> cat = dependencies.getContents(catName);
        for (Dependency dep : cat.getChoices()) {
            if (dependencyId.equals(dep.getId())) {
                cat.select(dep);
                return; //dep found and added to selection
            }
        }
    }
    throw new IllegalArgumentException("No such dependency: " + dependencyId);
}