Search in sources :

Example 1 with ContainerView

use of com.iplanet.jato.view.ContainerView 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)

Aggregations

ContainerView (com.iplanet.jato.view.ContainerView)1 View (com.iplanet.jato.view.View)1 CCMapListModel (com.sun.identity.console.ui.model.CCMapListModel)1 CCOrderedListModel (com.sun.identity.console.ui.model.CCOrderedListModel)1 CCUnOrderedListModel (com.sun.identity.console.ui.model.CCUnOrderedListModel)1 CCMapList (com.sun.identity.console.ui.view.CCMapList)1 CCOrderedList (com.sun.identity.console.ui.view.CCOrderedList)1 CCUnOrderedList (com.sun.identity.console.ui.view.CCUnOrderedList)1 CCAddRemoveModel (com.sun.web.ui.model.CCAddRemoveModel)1 CCEditableListModel (com.sun.web.ui.model.CCEditableListModel)1 CCEditableList (com.sun.web.ui.view.editablelist.CCEditableList)1