use of com.sun.identity.console.ui.model.CCOrderedListModel in project OpenAM by OpenRock.
the class AMPropertySheet method setValuesToOrderedList.
private boolean setValuesToOrderedList(View view, String name, Object values, AMModel amModel, AMPropertySheetModel model) {
boolean set = false;
if (CCOrderedList.class.isInstance(view)) {
((CCOrderedList) view).resetStateData();
CCOrderedListModel m = (CCOrderedListModel) model.getModel(name);
if (Set.class.isInstance(values)) {
Set sorted = new TreeSet(new OrderedListComparator());
sorted.addAll((Set) values);
if (sorted.size() == 1) {
String tmp = (String) sorted.iterator().next();
if (tmp.equals("[0]=")) {
sorted.clear();
}
}
List list = new ArrayList();
for (Iterator i = sorted.iterator(); i.hasNext(); ) {
String val = (String) i.next();
int idx = val.indexOf(']');
idx = val.indexOf('=', idx);
list.add(val.substring(idx + 1).trim());
}
m.setSelectedOptionList(AMViewBeanBase.createOptionList(list, amModel.getUserLocale(), false));
}
set = true;
}
return set;
}
Aggregations