Search in sources :

Example 6 with Option

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;
}
Also used : TreeSet(java.util.TreeSet) HashSet(java.util.HashSet) LinkedHashSet(java.util.LinkedHashSet) Set(java.util.Set) OrderedSet(com.sun.identity.shared.datastruct.OrderedSet) Option(com.iplanet.jato.view.html.Option) HashSet(java.util.HashSet) LinkedHashSet(java.util.LinkedHashSet)

Example 7 with Option

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;
}
Also used : Option(com.iplanet.jato.view.html.Option)

Example 8 with Option

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());
            }
        }
    }
}
Also used : CCSelect(com.sun.web.ui.view.html.CCSelect) Option(com.iplanet.jato.view.html.Option) OptionList(com.iplanet.jato.view.html.OptionList)

Example 9 with Option

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;
}
Also used : CCAddRemoveModel(com.sun.web.ui.model.CCAddRemoveModel) Set(java.util.Set) CCSelectableList(com.sun.web.ui.view.html.CCSelectableList) Option(com.iplanet.jato.view.html.Option) OptionList(com.iplanet.jato.view.html.OptionList)

Example 10 with Option

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;
}
Also used : OrderedSet(com.sun.identity.shared.datastruct.OrderedSet) Option(com.iplanet.jato.view.html.Option)

Aggregations

Option (com.iplanet.jato.view.html.Option)11 OptionList (com.iplanet.jato.view.html.OptionList)7 Set (java.util.Set)6 HashSet (java.util.HashSet)4 OrderedSet (com.sun.identity.shared.datastruct.OrderedSet)3 CCAddRemoveModel (com.sun.web.ui.model.CCAddRemoveModel)3 CCSelectableList (com.sun.web.ui.view.html.CCSelectableList)2 HashMap (java.util.HashMap)2 Iterator (java.util.Iterator)2 LinkedHashSet (java.util.LinkedHashSet)2 Map (java.util.Map)2 TreeSet (java.util.TreeSet)2 AMConsoleException (com.sun.identity.console.base.model.AMConsoleException)1 RMRealmModel (com.sun.identity.console.realm.model.RMRealmModel)1 CCDropDownMenu (com.sun.web.ui.view.html.CCDropDownMenu)1 CCSelect (com.sun.web.ui.view.html.CCSelect)1