use of com.sun.webui.jsf.model.Option in project Payara by payara.
the class WoodstockHandler method getMenuOptions.
private static OptionGroup getMenuOptions(List values, String label, String label2, boolean addLabel) {
if (values == null) {
return null;
}
ArrayList nList = new ArrayList();
Collections.sort(values);
ListIterator nl = values.listIterator();
while (nl.hasNext()) {
String name = (String) nl.next();
if (addLabel && label2.equals("")) {
if (!label.equals(name)) {
nList.add(new Option(label + "/" + name, name));
} else {
nList.add(new Option(name, name));
}
} else if (addLabel && !label2.equals("")) {
nList.add(new Option(label2 + "/" + label + "/" + name, name));
} else {
nList.add(new Option(name, name));
}
}
Option[] groupedOptions3 = (Option[]) nList.toArray(new Option[nList.size()]);
OptionGroup jumpGroup3 = new OptionGroup();
jumpGroup3.setLabel(label);
jumpGroup3.setOptions(groupedOptions3);
return jumpGroup3;
}
Aggregations