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;
}
Aggregations