use of com.sun.webui.jsf.model.OptionGroup 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;
}
use of com.sun.webui.jsf.model.OptionGroup in project Payara by payara.
the class WoodstockHandler method getWebComponentMenuOptions.
private static List getWebComponentMenuOptions(String appname, String modulename, List vsList, String monitorURL, HandlerContext handlerCtx) {
String endpoint = monitorURL + "/applications/" + appname;
List menuList = new ArrayList();
if (modulename != null && !modulename.trim().equals("") && !appname.equals(modulename)) {
endpoint += "/" + modulename;
}
if (vsList != null) {
ListIterator vl = vsList.listIterator();
while (vl.hasNext()) {
String name = (String) vl.next();
try {
List servlets = new ArrayList(RestUtil.getChildMap(endpoint + "/" + name).keySet());
if (!servlets.isEmpty()) {
OptionGroup menuOptions = getMenuOptions(servlets, name, "", true);
menuList.add(menuOptions);
}
} catch (Exception ex) {
GuiUtil.getLogger().severe("Error in getWebComponentMenuOptions ; \nendpoint = " + endpoint + "/" + name + "method=GET");
}
}
}
return menuList;
}
Aggregations