Search in sources :

Example 11 with Option

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

the class RMRealmAddViewBean method populateRealmParentList.

private void populateRealmParentList() {
    RMRealmModel model = (RMRealmModel) getModel();
    Set realms = new HashSet();
    try {
        realms = model.getRealmNames(model.getStartDN(), "*");
    } catch (AMConsoleException a) {
    // do something here
    }
    Map display = new HashMap(realms.size() * 2);
    for (Iterator i = realms.iterator(); i.hasNext(); ) {
        String tmp = (String) i.next();
        String path = getPath(tmp);
        display.put(tmp, path);
    }
    OptionList optionList = createOptionList(display);
    CCSelectableList parentList = (CCSelectableList) getChild(RMRealmModel.TF_PARENT);
    parentList.setOptions(optionList);
    String value = (String) parentList.getValue();
    if ((value == null) || (value.length() == 0)) {
        Option opt = optionList.get(0);
        parentList.setValue(opt.getValue());
    }
}
Also used : Set(java.util.Set) HashSet(java.util.HashSet) HashMap(java.util.HashMap) Iterator(java.util.Iterator) CCSelectableList(com.sun.web.ui.view.html.CCSelectableList) Option(com.iplanet.jato.view.html.Option) AMConsoleException(com.sun.identity.console.base.model.AMConsoleException) HashMap(java.util.HashMap) Map(java.util.Map) RMRealmModel(com.sun.identity.console.realm.model.RMRealmModel) OptionList(com.iplanet.jato.view.html.OptionList) HashSet(java.util.HashSet)

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