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

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

Introduction

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

Prototype

@SuppressWarnings("unchecked")
    public synchronized T[] getChoices() 

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.//ww w.  j  a  v a  2s  . c o  m
 */
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);
}