use of com.sun.web.ui.view.html.CCStaticTextField in project OpenAM by OpenRock.
the class ReferralOpViewBeanBase method beginChildDisplay.
public boolean beginChildDisplay(ChildDisplayEvent event) {
super.endDisplay(event);
boolean display = true;
String childName = event.getChildName();
int syntax = Integer.parseInt((String) propertySheetModel.getValue(SYNTAX));
if ((childName.indexOf(LBL_FILTER) != -1) || (childName.indexOf(BTN_FILTER) != -1) || (childName.indexOf(FILTER) != -1)) {
display = (syntax == AMDisplayType.SYNTAX_SINGLE_CHOICE) || (syntax == AMDisplayType.SYNTAX_MULTIPLE_CHOICE);
} else if (childName.indexOf(VALUES_TEXT_VALUE) != -1) {
display = (syntax == AMDisplayType.SYNTAX_TEXTFIELD);
Set values = getDefaultValues();
if ((values != null) && !values.isEmpty()) {
if (canModify) {
CCTextField tf = (CCTextField) getChild(childName);
tf.setValue(values.iterator().next());
} else {
CCStaticTextField tf = (CCStaticTextField) getChild(childName);
tf.setValue(values.iterator().next());
}
}
} else if (childName.indexOf(VALUES_SINGLE_CHOICE_VALUE) != -1) {
display = (syntax == AMDisplayType.SYNTAX_SINGLE_CHOICE);
if (display) {
Set values = getDefaultValues();
if (canModify) {
CCSelect child = (CCSelect) getChild(childName);
setPossibleValues(child);
if ((values != null) && !values.isEmpty()) {
child.setValue(values.iterator().next());
}
} else {
CCStaticTextField tf = (CCStaticTextField) getChild(childName);
tf.setValue(values.iterator().next());
}
}
} else if (childName.indexOf(VALUES_MULTIPLE_CHOICE_VALUE) != -1) {
display = (syntax == AMDisplayType.SYNTAX_MULTIPLE_CHOICE);
if (display) {
Set values = getDefaultValues();
if (canModify) {
CCSelect child = (CCSelect) getChild(childName);
setPossibleValues(child);
if ((values != null) && !values.isEmpty()) {
child.setValues(values.toArray());
}
} else {
CCStaticTextField tf = (CCStaticTextField) getChild(childName);
tf.setValue(AMAdminUtils.getString(values, ",", false));
}
}
}
return display;
}
use of com.sun.web.ui.view.html.CCStaticTextField in project OpenAM by OpenRock.
the class SMDiscoveryBootstrapRefOffViewBeanBase method setDirectiveMechIDMapping.
private void setDirectiveMechIDMapping(SMDiscoEntryData smDisco) {
populateDirectiveMechIDRefs(smDisco);
Map directives = smDisco.directives;
Set directiveNames = directives.keySet();
for (Iterator iter = DIRECTIVES_MECHID.iterator(); iter.hasNext(); ) {
String directiveName = (String) iter.next();
String childName = (String) MAP_DIRECTIVES_MECHID.get(directiveName);
CCCheckBox cb = null;
CCStaticTextField staticText = null;
if (canModify) {
cb = (CCCheckBox) getChild(childName.substring(0, childName.length() - 4));
} else {
staticText = (CCStaticTextField) getChild(childName.substring(0, childName.length() - 4));
}
if (directiveNames.contains(directiveName)) {
List refIds = (List) directives.get(directiveName);
if (canModify) {
cb.setChecked(true);
CCSelectableList child = (CCSelectableList) getChild(childName);
if ((refIds != null) && !refIds.isEmpty()) {
child.setValues(refIds.toArray());
} else {
child.setValues(null);
}
} else {
staticText.setValue("true");
CCStaticTextField child = (CCStaticTextField) getChild(childName);
if ((refIds != null) && !refIds.isEmpty()) {
child.setValue(AMAdminUtils.getString(refIds, ",", false));
} else {
child.setValue("");
}
}
} else {
if (canModify) {
cb.setChecked(false);
} else {
staticText.setValue("false");
}
}
}
}
use of com.sun.web.ui.view.html.CCStaticTextField in project OpenAM by OpenRock.
the class AgentDumpViewBean method beginDisplay.
public void beginDisplay(DisplayEvent event) throws ModelControlException {
try {
super.beginDisplay(event);
setTitle();
String universalId = (String) getPageSessionAttribute(AgentProfileViewBean.UNIVERSAL_ID);
AgentDumpModel model = (AgentDumpModel) getModel();
Map values = model.getAttributeValues(universalId);
CCStaticTextField valuesText = (CCStaticTextField) getChild(STATICTEXT_VALUES);
valuesText.setValue(getFormattedAttributes(values));
} catch (AMConsoleException amce) {
setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", amce.getMessage());
}
}
use of com.sun.web.ui.view.html.CCStaticTextField in project OpenAM by OpenRock.
the class AgentConfigInheritViewBean method createChild.
protected View createChild(String name) {
View view = null;
if (name.equals(TBL_PROPERTY_NAMES)) {
SerializedField szCache = (SerializedField) getChild(SZ_CACHE);
populatePropertyNameTableModel((List) szCache.getSerializedObj());
view = new CCActionTable(this, tblPropertyNamesModel, name);
} else if (name.equals(PGTITLE_THREE_BTNS)) {
view = new CCPageTitle(this, ptModel, name);
} else if (tblPropertyNamesModel.isChildSupported(name)) {
view = tblPropertyNamesModel.createChild(this, name);
} else if (ptModel.isChildSupported(name)) {
view = ptModel.createChild(this, name);
} else if (name.equals(CHILD_STATICTEXT)) {
view = new CCStaticTextField(this, name, null);
} else {
view = super.createChild(name);
}
return view;
}
use of com.sun.web.ui.view.html.CCStaticTextField in project OpenAM by OpenRock.
the class SMProfileViewBean method createChild.
/**
* Creates user interface components used by this view bean.
*
* @param name of component
* @return child component
*/
protected View createChild(String name) {
View view = null;
if (name.equals(TBL_SESSIONS)) {
SerializedField szCache = (SerializedField) getChild(SZ_CACHE);
populateTableModel((List) szCache.getSerializedObj());
view = new CCActionTable(this, tblModel, name);
} else if (name.equals(PAGETITLE)) {
view = new CCPageTitle(this, ptModel, name);
} else if (tblModel.isChildSupported(name)) {
view = tblModel.createChild(this, name);
} else if (name.equals(CHILD_SERVER_NAME_MENU)) {
view = new CCDropDownMenu(this, name, null);
} else if (name.equals(LOGOUT_URL)) {
return new CCStaticTextField(this, LOGOUT_URL, "");
} else if (name.equals(CHILD_SERVER_NAME_HREF)) {
view = new CCHref(this, name, null);
} else {
view = super.createChild(name);
}
return view;
}
Aggregations