Search in sources :

Example 1 with CCMapList

use of com.sun.identity.console.ui.view.CCMapList in project OpenAM by OpenRock.

the class AMPropertySheet method setValuesToMapList.

private boolean setValuesToMapList(View view, String name, Object values, AMModel amModel, AMPropertySheetModel model) {
    boolean set = false;
    if (CCMapList.class.isInstance(view)) {
        ((CCMapList) view).resetStateData();
        CCMapListModel m = (CCMapListModel) model.getModel(name);
        if (Set.class.isInstance(values)) {
            Set v = new LinkedHashSet();
            v.addAll((Set) values);
            v.remove("[]=");
            m.setOptionList(AMViewBeanBase.createOptionList(v, amModel.getUserLocale(), false));
        }
        set = true;
    }
    return set;
}
Also used : LinkedHashSet(java.util.LinkedHashSet) TreeSet(java.util.TreeSet) HashSet(java.util.HashSet) LinkedHashSet(java.util.LinkedHashSet) Set(java.util.Set) OrderedSet(com.sun.identity.shared.datastruct.OrderedSet) CCMapListModel(com.sun.identity.console.ui.model.CCMapListModel) CCMapList(com.sun.identity.console.ui.view.CCMapList)

Example 2 with CCMapList

use of com.sun.identity.console.ui.view.CCMapList in project OpenAM by OpenRock.

the class CCMapListTag method init.

protected View init(Tag parent, PageContext pageContext, View view, Class c) throws JspException {
    View baseView = super.init(parent, pageContext, view, c);
    CCMapList field = (CCMapList) view;
    model = (CCMapListModel) field.getModel();
    return baseView;
}
Also used : CCMapList(com.sun.identity.console.ui.view.CCMapList) View(com.iplanet.jato.view.View)

Example 3 with CCMapList

use of com.sun.identity.console.ui.view.CCMapList in project OpenAM by OpenRock.

the class AMPropertySheetModel method createChild.

public View createChild(View parent, String name, AMModel model) {
    String tagName = (String) childMap.get(name);
    View view = null;
    if (tagName != null) {
        if (tagName.equals(ORDERED_LIST)) {
            CCOrderedListModel m = new CCOrderedListModel();
            view = new CCOrderedList((ContainerView) parent, m, name);
            m.setAddButtonLabel(model.getLocalizedString("addremove.orderable.list.add.button"));
            m.setDeleteButtonLabel(model.getLocalizedString("addremove.orderable.list.delete.button"));
            setModel(name, m);
        } else if (tagName.equals(UNORDERED_LIST)) {
            CCUnOrderedListModel m = new CCUnOrderedListModel();
            view = new CCUnOrderedList((ContainerView) parent, m, name);
            setModel(name, m);
        } else if (tagName.equals(MAP_LIST) || tagName.equals(GLOBAL_MAP_LIST)) {
            CCMapListModel m = new CCMapListModel();
            view = new CCMapList((ContainerView) parent, m, name);
            m.setValueOptionList(mapOptionList.get(name));
            m.setKeyLabel(model.getLocalizedString("maplist.key.label"));
            m.setValueLabel(model.getLocalizedString("maplist.value.label"));
            m.setMsgInvalidEntry(model.getLocalizedString("maplist.msg.invalid.entry"));
            m.setMsgInvalidKey(model.getLocalizedString("maplist.msg.invalid.key"));
            m.setMsgInvalidValue(model.getLocalizedString("maplist.msg.invalid.value"));
            m.setMsgInvalidNoKey(model.getLocalizedString("maplist.msg.invalid.nokey"));
            setModel(name, m);
        } else if (tagName.equals(ADDREMOVE_LIST)) {
            CCAddRemoveModel m = (CCAddRemoveModel) getModel(name);
            if (m == null) {
                setModel(name, new CCAddRemoveModel());
            }
        }
    }
    if (view == null) {
        view = super.createChild(parent, name);
    }
    if (CCEditableList.class.isInstance(view)) {
        CCEditableList editable = (CCEditableList) view;
        CCEditableListModel m = (CCEditableListModel) editable.getModel();
        m.setAddBtnLabel(model.getLocalizedString("editableList.addButtonLabel"));
        m.setRemoveBtnLabel(model.getLocalizedString("editableList.deleteButtonLabel"));
    }
    children.add(view);
    return view;
}
Also used : CCEditableList(com.sun.web.ui.view.editablelist.CCEditableList) CCAddRemoveModel(com.sun.web.ui.model.CCAddRemoveModel) CCMapListModel(com.sun.identity.console.ui.model.CCMapListModel) CCMapList(com.sun.identity.console.ui.view.CCMapList) CCUnOrderedListModel(com.sun.identity.console.ui.model.CCUnOrderedListModel) CCEditableListModel(com.sun.web.ui.model.CCEditableListModel) ContainerView(com.iplanet.jato.view.ContainerView) CCOrderedListModel(com.sun.identity.console.ui.model.CCOrderedListModel) CCOrderedList(com.sun.identity.console.ui.view.CCOrderedList) View(com.iplanet.jato.view.View) ContainerView(com.iplanet.jato.view.ContainerView) CCUnOrderedList(com.sun.identity.console.ui.view.CCUnOrderedList)

Example 4 with CCMapList

use of com.sun.identity.console.ui.view.CCMapList in project OpenAM by OpenRock.

the class AMPropertySheet method restoreStateData.

/**
     * Automates the restoring of store data in some children. This is required
     * for some special children such as <code>CCAddRemvoe</code>.
     *
     * @throws ModelControlException if cannot get model of property sheet.
     */
public void restoreStateData(Collection participatingChildren) throws ModelControlException {
    ViewBean parent = getParentViewBean();
    String[] names = parent == null ? null : parent.getChildNames();
    if ((names != null) && (names.length > 0)) {
        for (int i = 0; i < names.length; i++) {
            String name = names[i];
            if (participatingChildren.contains(name)) {
                View child = parent.getChild(name);
                if (CCAddRemove.class.isInstance(child)) {
                    ((CCAddRemove) child).restoreStateData();
                } else if (CCUnOrderedList.class.isInstance(child)) {
                    ((CCUnOrderedList) child).restoreStateData();
                } else if (CCMapList.class.isInstance(child)) {
                    ((CCMapList) child).restoreStateData();
                } else if (CCEditableList.class.isInstance(child)) {
                    ((CCEditableList) child).restoreStateData();
                } else if (CCOrderedList.class.isInstance(child)) {
                    ((CCOrderedList) child).restoreStateData();
                } else if (CCActionTable.class.isInstance(child)) {
                    ((CCActionTable) child).restoreStateData();
                }
            }
        }
    }
}
Also used : CCEditableList(com.sun.web.ui.view.editablelist.CCEditableList) CCMapList(com.sun.identity.console.ui.view.CCMapList) ViewBean(com.iplanet.jato.view.ViewBean) CCOrderedList(com.sun.identity.console.ui.view.CCOrderedList) CCActionTable(com.sun.web.ui.view.table.CCActionTable) View(com.iplanet.jato.view.View) ContainerView(com.iplanet.jato.view.ContainerView) CCAddRemove(com.sun.web.ui.view.addremove.CCAddRemove) CCUnOrderedList(com.sun.identity.console.ui.view.CCUnOrderedList)

Example 5 with CCMapList

use of com.sun.identity.console.ui.view.CCMapList in project OpenAM by OpenRock.

the class AMPropertySheetModel method clear.

public void clear() {
    super.clear();
    for (Iterator iter = children.iterator(); iter.hasNext(); ) {
        View view = (View) iter.next();
        if (CCAddRemove.class.isInstance(view)) {
            CCAddRemoveModel m = (CCAddRemoveModel) getModel(view.getName());
            m.clear();
            m.setAvailableOptionList(new OptionList());
            m.setSelectedOptionList(new OptionList());
        } else if (CCEditableList.class.isInstance(view)) {
            CCEditableListModel m = (CCEditableListModel) getModel(view.getName());
            m.setOptionList(new OptionList());
            ((CCEditableList) view).resetStateData();
        } else if (CCOrderedList.class.isInstance(view)) {
            CCOrderedListModel m = (CCOrderedListModel) getModel(view.getName());
            m.setSelectedOptionList(new OptionList());
            ((CCOrderedList) view).resetStateData();
        } else if (CCUnOrderedList.class.isInstance(view)) {
            CCUnOrderedListModel m = (CCUnOrderedListModel) getModel(view.getName());
            m.setOptionList(new OptionList());
            ((CCUnOrderedList) view).resetStateData();
        } else if (CCMapList.class.isInstance(view)) {
            CCMapListModel m = (CCMapListModel) getModel(view.getName());
            m.setOptionList(new OptionList());
            ((CCMapList) view).resetStateData();
        } else {
            if (DisplayFieldImpl.class.isInstance(view)) {
                ((DisplayFieldImpl) view).setValues(null);
            }
        }
    }
}
Also used : DisplayFieldImpl(com.iplanet.jato.view.DisplayFieldImpl) CCEditableList(com.sun.web.ui.view.editablelist.CCEditableList) CCAddRemoveModel(com.sun.web.ui.model.CCAddRemoveModel) CCMapListModel(com.sun.identity.console.ui.model.CCMapListModel) CCOrderedListModel(com.sun.identity.console.ui.model.CCOrderedListModel) CCOrderedList(com.sun.identity.console.ui.view.CCOrderedList) View(com.iplanet.jato.view.View) ContainerView(com.iplanet.jato.view.ContainerView) CCMapList(com.sun.identity.console.ui.view.CCMapList) Iterator(java.util.Iterator) CCEditableListModel(com.sun.web.ui.model.CCEditableListModel) CCUnOrderedListModel(com.sun.identity.console.ui.model.CCUnOrderedListModel) OptionList(com.iplanet.jato.view.html.OptionList) CCUnOrderedList(com.sun.identity.console.ui.view.CCUnOrderedList)

Aggregations

CCMapList (com.sun.identity.console.ui.view.CCMapList)5 View (com.iplanet.jato.view.View)4 ContainerView (com.iplanet.jato.view.ContainerView)3 CCMapListModel (com.sun.identity.console.ui.model.CCMapListModel)3 CCOrderedList (com.sun.identity.console.ui.view.CCOrderedList)3 CCUnOrderedList (com.sun.identity.console.ui.view.CCUnOrderedList)3 CCEditableList (com.sun.web.ui.view.editablelist.CCEditableList)3 CCOrderedListModel (com.sun.identity.console.ui.model.CCOrderedListModel)2 CCUnOrderedListModel (com.sun.identity.console.ui.model.CCUnOrderedListModel)2 CCAddRemoveModel (com.sun.web.ui.model.CCAddRemoveModel)2 CCEditableListModel (com.sun.web.ui.model.CCEditableListModel)2 DisplayFieldImpl (com.iplanet.jato.view.DisplayFieldImpl)1 ViewBean (com.iplanet.jato.view.ViewBean)1 OptionList (com.iplanet.jato.view.html.OptionList)1 OrderedSet (com.sun.identity.shared.datastruct.OrderedSet)1 CCAddRemove (com.sun.web.ui.view.addremove.CCAddRemove)1 CCActionTable (com.sun.web.ui.view.table.CCActionTable)1 HashSet (java.util.HashSet)1 Iterator (java.util.Iterator)1 LinkedHashSet (java.util.LinkedHashSet)1