Search in sources :

Example 1 with CCRadioButton

use of com.sun.web.ui.view.html.CCRadioButton in project OpenAM by OpenRock.

the class NewAuthInstanceViewBean method createChild.

protected View createChild(String name) {
    View view = null;
    if (name.equals(PGTITLE_TWO_BTNS)) {
        view = new CCPageTitle(this, ptModel, name);
    } else if (name.equals(PROPERTY_ATTRIBUTE)) {
        view = new AMPropertySheet(this, propertySheetModel, name);
    } else if (propertySheetModel.isChildSupported(name)) {
        view = propertySheetModel.createChild(this, name, getModel());
        if (name.equals(INSTANCE_TYPE)) {
            //set the available options for the radio button
            CCRadioButton radio = (CCRadioButton) view;
            radio.setOptions(createAuthTypeOptionList());
        }
    } else if (ptModel.isChildSupported(name)) {
        view = ptModel.createChild(this, name);
    } else {
        view = super.createChild(name);
    }
    return view;
}
Also used : CCRadioButton(com.sun.web.ui.view.html.CCRadioButton) AMPropertySheet(com.sun.identity.console.base.AMPropertySheet) View(com.iplanet.jato.view.View) CCPageTitle(com.sun.web.ui.view.pagetitle.CCPageTitle)

Example 2 with CCRadioButton

use of com.sun.web.ui.view.html.CCRadioButton in project OpenAM by OpenRock.

the class AbstractEventHandlerSelectViewBean method beginDisplay.

@Override
public void beginDisplay(DisplayEvent event) throws ModelControlException {
    super.beginDisplay(event);
    try {
        AbstractAuditModel model = (AbstractAuditModel) getModel();
        Set<String> auditHandlerTypes = model.getEventHandlerTypeNames();
        OptionList optionList = new OptionList();
        for (String type : auditHandlerTypes) {
            optionList.add(type, type);
        }
        CCRadioButton rb = (CCRadioButton) getChild(RB_EVENT_HANDLER);
        rb.setOptions(optionList);
        rb.setValue(optionList.getValue(0));
    } catch (AMConsoleException e) {
        setInlineAlertMessage(TYPE_ERROR, ERROR_MESSAGE, e.getMessage());
    }
}
Also used : CCRadioButton(com.sun.web.ui.view.html.CCRadioButton) AbstractAuditModel(com.sun.identity.console.audit.model.AbstractAuditModel) AMConsoleException(com.sun.identity.console.base.model.AMConsoleException) OptionList(com.iplanet.jato.view.html.OptionList)

Example 3 with CCRadioButton

use of com.sun.web.ui.view.html.CCRadioButton in project OpenAM by OpenRock.

the class SubSchemaTypeSelectViewBean method beginDisplay.

public void beginDisplay(DisplayEvent event) throws ModelControlException {
    super.beginDisplay(event);
    SubConfigModel model = (SubConfigModel) getModel();
    Map createables = model.getCreateableSubSchemaNames();
    CCRadioButton rb = (CCRadioButton) getChild(RB_SUBCONFIG);
    OptionList optList = AMFormatUtils.getSortedOptionList(createables, model.getUserLocale());
    rb.setOptions(optList);
    String val = (String) rb.getValue();
    if ((val == null) || (val.length() == 0)) {
        rb.setValue(optList.getValue(0));
    }
}
Also used : CCRadioButton(com.sun.web.ui.view.html.CCRadioButton) SubConfigModel(com.sun.identity.console.service.model.SubConfigModel) Map(java.util.Map) OptionList(com.iplanet.jato.view.html.OptionList)

Example 4 with CCRadioButton

use of com.sun.web.ui.view.html.CCRadioButton in project OpenAM by OpenRock.

the class AMPropertySheet method init.

public void init() {
    ViewBean parent = getParentViewBean();
    AMPropertySheetModel model = (AMPropertySheetModel) getModel();
    Map radioComponents = model.getRadioDefaultValues();
    if ((radioComponents != null) && !radioComponents.isEmpty()) {
        for (Iterator i = radioComponents.keySet().iterator(); i.hasNext(); ) {
            String name = (String) i.next();
            CCRadioButton rb = (CCRadioButton) parent.getChild(name);
            Object value = rb.getValue();
            if (value == null) {
                rb.setValue(radioComponents.get(name));
            }
        }
    }
}
Also used : CCRadioButton(com.sun.web.ui.view.html.CCRadioButton) AMPropertySheetModel(com.sun.identity.console.base.model.AMPropertySheetModel) Iterator(java.util.Iterator) ViewBean(com.iplanet.jato.view.ViewBean) HashMap(java.util.HashMap) Map(java.util.Map)

Example 5 with CCRadioButton

use of com.sun.web.ui.view.html.CCRadioButton in project OpenAM by OpenRock.

the class ActionTiledView method displayRadioAction.

private boolean displayRadioAction(ActionSchema actionSchema, String childName, int type, int syntax) {
    boolean display = false;
    RuleOpViewBeanBase parentVB = (RuleOpViewBeanBase) getParentViewBean();
    String serviceType = (String) parentVB.propertySheetModel.getValue(RuleOpViewBeanBase.SERVICE_TYPE);
    if ((type == AMDisplayType.TYPE_SINGLE) && (syntax == AMDisplayType.SYNTAX_RADIO)) {
        CCRadioButton rb = (CCRadioButton) getChild(childName);
        OptionList optList = parentVB.getChoiceValues(serviceType, actionSchema);
        rb.setOptions(optList);
        if ((optList != null) && (optList.size() > 0)) {
            Set set = parentVB.isSubmitCycle() ? parentVB.getCurrentActionValues(actionSchema) : parentVB.getDefaultActionValues(actionSchema);
            String value = ((set == null) || set.isEmpty()) ? optList.getValue(0) : (String) set.iterator().next();
            rb.setValue(value);
            display = true;
        }
    }
    return display;
}
Also used : CCRadioButton(com.sun.web.ui.view.html.CCRadioButton) Set(java.util.Set) OptionList(com.iplanet.jato.view.html.OptionList)

Aggregations

CCRadioButton (com.sun.web.ui.view.html.CCRadioButton)11 OptionList (com.iplanet.jato.view.html.OptionList)6 Map (java.util.Map)4 AMPropertySheet (com.sun.identity.console.base.AMPropertySheet)3 AMConsoleException (com.sun.identity.console.base.model.AMConsoleException)3 Iterator (java.util.Iterator)3 Set (java.util.Set)3 View (com.iplanet.jato.view.View)2 SubConfigModel (com.sun.identity.console.service.model.SubConfigModel)2 CCPageTitle (com.sun.web.ui.view.pagetitle.CCPageTitle)2 ViewBean (com.iplanet.jato.view.ViewBean)1 AbstractAuditModel (com.sun.identity.console.audit.model.AbstractAuditModel)1 AMPropertySheetModel (com.sun.identity.console.base.model.AMPropertySheetModel)1 IDRepoModel (com.sun.identity.console.realm.model.IDRepoModel)1 ServicesModel (com.sun.identity.console.realm.model.ServicesModel)1 MAPCreateDeviceModel (com.sun.identity.console.service.model.MAPCreateDeviceModel)1 SubSchemaModel (com.sun.identity.console.service.model.SubSchemaModel)1 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 HashSet (java.util.HashSet)1