Search in sources :

Example 36 with OptionList

use of com.iplanet.jato.view.html.OptionList in project OpenAM by OpenRock.

the class SelectTypeViewBeanBase method setDefaultServiceOption.

protected void setDefaultServiceOption(CCRadioButton rb) {
    OptionList optList = rb.getOptions();
    if ((optList != null) && (optList.size() > 0)) {
        Option opt = optList.get(0);
        rb.setValue(opt.getValue());
    }
}
Also used : Option(com.iplanet.jato.view.html.Option) OptionList(com.iplanet.jato.view.html.OptionList)

Example 37 with OptionList

use of com.iplanet.jato.view.html.OptionList in project OpenAM by OpenRock.

the class AbstractEventHandlerSelectViewBean method beginDisplay.

@Override
public void beginDisplay(DisplayEvent event) throws ModelControlException {
    super.beginDisplay(event);
    try {
        AbstractAuditModel model = (AbstractAuditModel) getModel();
        Set<String> auditHandlerTypes = model.getEventHandlerTypeNames();
        OptionList optionList = new OptionList();
        for (String type : auditHandlerTypes) {
            optionList.add(type, type);
        }
        CCRadioButton rb = (CCRadioButton) getChild(RB_EVENT_HANDLER);
        rb.setOptions(optionList);
        rb.setValue(optionList.getValue(0));
    } catch (AMConsoleException e) {
        setInlineAlertMessage(TYPE_ERROR, ERROR_MESSAGE, e.getMessage());
    }
}
Also used : CCRadioButton(com.sun.web.ui.view.html.CCRadioButton) AbstractAuditModel(com.sun.identity.console.audit.model.AbstractAuditModel) AMConsoleException(com.sun.identity.console.base.model.AMConsoleException) OptionList(com.iplanet.jato.view.html.OptionList)

Example 38 with OptionList

use of com.iplanet.jato.view.html.OptionList in project OpenAM by OpenRock.

the class MAPDeviceProfileViewBean method initializedClassificationDropDownList.

private void initializedClassificationDropDownList() {
    MAPDeviceProfileModel model = (MAPDeviceProfileModel) getModel();
    String[] classification = model.getAttributeClassification(deviceName);
    if (classification != null) {
        Map localizedLabels = model.getLocalizedClassificationLabels(classification);
        OptionList optList = new OptionList();
        for (int i = 0; i < classification.length; i++) {
            String c = classification[i];
            String label = (String) localizedLabels.get(c);
            if ((label == null) || (label.trim().length() == 0)) {
                label = c;
            }
            optList.add(label, c);
        }
        CCDropDownMenu cb = (CCDropDownMenu) getChild(SINGLECHOICE_CLASSIFICATION);
        cb.setOptions(optList);
        String value = (String) cb.getValue();
        if ((value == null) || (value.length() == 0)) {
            cb.setValue(classification[0]);
            setDisplayFieldValue(TF_CLASSIFICATION, classification[0]);
        } else {
            setDisplayFieldValue(TF_CLASSIFICATION, value);
        }
    }
}
Also used : Map(java.util.Map) CCDropDownMenu(com.sun.web.ui.view.html.CCDropDownMenu) MAPDeviceProfileModel(com.sun.identity.console.service.model.MAPDeviceProfileModel) OptionList(com.iplanet.jato.view.html.OptionList)

Example 39 with OptionList

use of com.iplanet.jato.view.html.OptionList in project OpenAM by OpenRock.

the class MAPClientManagerViewBean method setStyles.

private void setStyles() {
    MAPServiceModel model = (MAPServiceModel) getModel();
    Set styles = model.getStyleNames(getProfileName());
    if ((styles != null) && !styles.isEmpty()) {
        OptionList styleList = new OptionList();
        for (Iterator iter = styles.iterator(); iter.hasNext(); ) {
            String name = (String) iter.next();
            styleList.add(name, name);
        }
        CCDropDownMenu menu = (CCDropDownMenu) getChild(SINGLECHOICE_STYLE);
        menu.setOptions(styleList);
    }
}
Also used : MAPServiceModel(com.sun.identity.console.service.model.MAPServiceModel) Set(java.util.Set) Iterator(java.util.Iterator) CCDropDownMenu(com.sun.web.ui.view.html.CCDropDownMenu) OptionList(com.iplanet.jato.view.html.OptionList)

Example 40 with OptionList

use of com.iplanet.jato.view.html.OptionList in project OpenAM by OpenRock.

the class TimeConditionHelper method setTimeZone.

public void setTimeZone(ConditionOpViewBeanBase viewBean, boolean canModify, String tz) {
    if ((tz != null) && (tz.trim().length() > 0)) {
        AMPropertySheetModel propModel = viewBean.getPropertySheetModel();
        if (canModify) {
            CCDropDownMenu list = (CCDropDownMenu) viewBean.getChild(STANDARDTIMEZONE);
            OptionList optList = list.getOptions();
            if ((optList != null) && optList.hasValue(tz)) {
                propModel.setValue(STANDARDTIMEZONE, tz);
                propModel.setValue(RADIOTIMEZONE, "standard");
            } else {
                propModel.setValue(CUSTOMTIMEZONE, tz);
                propModel.setValue(RADIOTIMEZONE, "custom");
            }
        } else {
            String[] ids = TimeZone.getAvailableIDs();
            boolean contains = false;
            for (int i = 0; (i < ids.length) && !contains; i++) {
                contains = ids[i].equals(tz);
            }
            if (contains) {
                propModel.setValue(STANDARDTIMEZONE, tz);
                propModel.setValue(RADIOTIMEZONE, "standard");
            } else {
                propModel.setValue(CUSTOMTIMEZONE, tz);
                propModel.setValue(RADIOTIMEZONE, "custom");
            }
        }
    }
}
Also used : AMPropertySheetModel(com.sun.identity.console.base.model.AMPropertySheetModel) CCDropDownMenu(com.sun.web.ui.view.html.CCDropDownMenu) OptionList(com.iplanet.jato.view.html.OptionList)

Aggregations

OptionList (com.iplanet.jato.view.html.OptionList)75 Set (java.util.Set)35 Iterator (java.util.Iterator)27 CCDropDownMenu (com.sun.web.ui.view.html.CCDropDownMenu)25 Map (java.util.Map)24 AMConsoleException (com.sun.identity.console.base.model.AMConsoleException)21 HashSet (java.util.HashSet)17 List (java.util.List)15 HashMap (java.util.HashMap)13 ArrayList (java.util.ArrayList)9 Option (com.iplanet.jato.view.html.Option)7 CCAddRemoveModel (com.sun.web.ui.model.CCAddRemoveModel)7 CCAddRemove (com.sun.web.ui.view.addremove.CCAddRemove)7 EntitiesModel (com.sun.identity.console.idm.model.EntitiesModel)6 PolicyModel (com.sun.identity.console.policy.model.PolicyModel)6 CCRadioButton (com.sun.web.ui.view.html.CCRadioButton)6 TreeSet (java.util.TreeSet)6 IdentitySubjectModel (com.sun.identity.console.policy.model.IdentitySubjectModel)5 TaskModel (com.sun.identity.console.task.model.TaskModel)5 CCSelect (com.sun.web.ui.view.html.CCSelect)5