use of com.iplanet.jato.view.html.Option in project OpenAM by OpenRock.
the class AMPropertySheet method getListValues.
private static Set getListValues(OptionList optList) {
Set values = null;
if ((optList != null) && (optList.size() > 0)) {
int sz = optList.size();
values = new HashSet(sz * 2);
for (int i = 0; i < sz; i++) {
Option opt = optList.get(i);
values.add("[" + i + "]=" + opt.getValue());
}
}
return (values == null) ? Collections.EMPTY_SET : values;
}
use of com.iplanet.jato.view.html.Option in project OpenAM by OpenRock.
the class AuthActionTiledView method containsOption.
private boolean containsOption(OptionList optList, String val) {
boolean bYes = false;
for (int i = 0; (i < optList.size()) && !bYes; i++) {
Option opt = optList.get(i);
bYes = opt.getValue().equals(val);
}
return bYes;
}
use of com.iplanet.jato.view.html.Option in project OpenAM by OpenRock.
the class PMDefaultAuthSchemeConditionAddViewBean method beginDisplay.
public void beginDisplay(DisplayEvent event) throws ModelControlException {
super.beginDisplay(event);
CCSelect sl = (CCSelect) getChild(AuthSchemeCondition.AUTH_SCHEME);
OptionList optList = sl.getOptions();
if (optList != null) {
int size = optList.size();
String emptyRealm = getModel().getLocalizedString("policy.condition.null.realm");
for (int i = 0; i < size; i++) {
Option opt = optList.get(i);
if (opt.getLabel().startsWith(":")) {
opt.setLabel(emptyRealm + opt.getLabel());
}
}
}
}
use of com.iplanet.jato.view.html.Option in project OpenAM by OpenRock.
the class ActionTiledView method displayMultipleChoiceAction.
private boolean displayMultipleChoiceAction(ActionSchema actionSchema, String childName, int type, int syntax) {
boolean display = false;
RuleOpViewBeanBase parentVB = (RuleOpViewBeanBase) getParentViewBean();
String serviceType = (String) parentVB.propertySheetModel.getValue(RuleOpViewBeanBase.SERVICE_TYPE);
if (type == AMDisplayType.TYPE_MULTIPLE_CHOICE) {
CCSelectableList child = (CCSelectableList) getChild(childName);
child.resetStateData();
CCAddRemoveModel addRemoveModel = (CCAddRemoveModel) model.getModel(childName);
Set defaultValues = parentVB.getValues(addRemoveModel.getSelectedOptionList());
if ((defaultValues == null) || defaultValues.isEmpty()) {
defaultValues = parentVB.getDefaultActionValues(actionSchema);
}
OptionList optList = parentVB.getChoiceValues(serviceType, actionSchema);
int sz = optList.size();
OptionList availList = new OptionList();
for (int i = 0; i < sz; i++) {
Option opt = (Option) optList.get(i);
if (!defaultValues.contains(opt.getValue())) {
availList.add(opt);
}
}
addRemoveModel.setAvailableOptionList(availList);
addRemoveModel.setSelectedOptionList(parentVB.createOptionList(defaultValues));
display = true;
}
return display;
}
use of com.iplanet.jato.view.html.Option in project OpenAM by OpenRock.
the class AMPropertySheet method getValues.
private static Set getValues(OptionList optList) {
OrderedSet values = null;
if ((optList != null) && (optList.size() > 0)) {
int sz = optList.size();
values = new OrderedSet();
for (int i = 0; i < sz; i++) {
Option opt = optList.get(i);
values.add(opt.getValue());
}
}
return (values == null) ? Collections.EMPTY_SET : values;
}
Aggregations