Search in sources :

Example 1 with CCStaticTextField

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;
}
Also used : Set(java.util.Set) CCTextField(com.sun.web.ui.view.html.CCTextField) CCSelect(com.sun.web.ui.view.html.CCSelect) CCStaticTextField(com.sun.web.ui.view.html.CCStaticTextField)

Example 2 with CCStaticTextField

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");
            }
        }
    }
}
Also used : Set(java.util.Set) CCCheckBox(com.sun.web.ui.view.html.CCCheckBox) Iterator(java.util.Iterator) CCSelectableList(com.sun.web.ui.view.html.CCSelectableList) CCSelectableList(com.sun.web.ui.view.html.CCSelectableList) ArrayList(java.util.ArrayList) CCEditableList(com.sun.web.ui.view.editablelist.CCEditableList) OptionList(com.iplanet.jato.view.html.OptionList) List(java.util.List) HashMap(java.util.HashMap) Map(java.util.Map) CCStaticTextField(com.sun.web.ui.view.html.CCStaticTextField)

Example 3 with CCStaticTextField

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());
    }
}
Also used : AgentDumpModel(com.sun.identity.console.agentconfig.model.AgentDumpModel) AMConsoleException(com.sun.identity.console.base.model.AMConsoleException) Map(java.util.Map) CCStaticTextField(com.sun.web.ui.view.html.CCStaticTextField)

Example 4 with CCStaticTextField

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;
}
Also used : SerializedField(com.sun.identity.console.components.view.html.SerializedField) CCActionTable(com.sun.web.ui.view.table.CCActionTable) View(com.iplanet.jato.view.View) CCPageTitle(com.sun.web.ui.view.pagetitle.CCPageTitle) CCStaticTextField(com.sun.web.ui.view.html.CCStaticTextField)

Example 5 with CCStaticTextField

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;
}
Also used : SerializedField(com.sun.identity.console.components.view.html.SerializedField) CCActionTable(com.sun.web.ui.view.table.CCActionTable) CCHref(com.sun.web.ui.view.html.CCHref) View(com.iplanet.jato.view.View) CCPageTitle(com.sun.web.ui.view.pagetitle.CCPageTitle) CCDropDownMenu(com.sun.web.ui.view.html.CCDropDownMenu) CCStaticTextField(com.sun.web.ui.view.html.CCStaticTextField)

Aggregations

CCStaticTextField (com.sun.web.ui.view.html.CCStaticTextField)6 View (com.iplanet.jato.view.View)3 SerializedField (com.sun.identity.console.components.view.html.SerializedField)3 CCPageTitle (com.sun.web.ui.view.pagetitle.CCPageTitle)3 CCActionTable (com.sun.web.ui.view.table.CCActionTable)3 Map (java.util.Map)2 Set (java.util.Set)2 OptionList (com.iplanet.jato.view.html.OptionList)1 AgentDumpModel (com.sun.identity.console.agentconfig.model.AgentDumpModel)1 AMConsoleException (com.sun.identity.console.base.model.AMConsoleException)1 CCEditableList (com.sun.web.ui.view.editablelist.CCEditableList)1 CCCheckBox (com.sun.web.ui.view.html.CCCheckBox)1 CCDropDownMenu (com.sun.web.ui.view.html.CCDropDownMenu)1 CCHref (com.sun.web.ui.view.html.CCHref)1 CCSelect (com.sun.web.ui.view.html.CCSelect)1 CCSelectableList (com.sun.web.ui.view.html.CCSelectableList)1 CCTextField (com.sun.web.ui.view.html.CCTextField)1 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 Iterator (java.util.Iterator)1