use of com.iplanet.jato.view.html.OptionList in project OpenAM by OpenRock.
the class SelectTypeViewBeanBase method setDefaultServiceOption.
protected void setDefaultServiceOption(CCRadioButton rb) {
OptionList optList = rb.getOptions();
if ((optList != null) && (optList.size() > 0)) {
Option opt = optList.get(0);
rb.setValue(opt.getValue());
}
}
use of com.iplanet.jato.view.html.OptionList 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());
}
}
use of com.iplanet.jato.view.html.OptionList in project OpenAM by OpenRock.
the class MAPDeviceProfileViewBean method initializedClassificationDropDownList.
private void initializedClassificationDropDownList() {
MAPDeviceProfileModel model = (MAPDeviceProfileModel) getModel();
String[] classification = model.getAttributeClassification(deviceName);
if (classification != null) {
Map localizedLabels = model.getLocalizedClassificationLabels(classification);
OptionList optList = new OptionList();
for (int i = 0; i < classification.length; i++) {
String c = classification[i];
String label = (String) localizedLabels.get(c);
if ((label == null) || (label.trim().length() == 0)) {
label = c;
}
optList.add(label, c);
}
CCDropDownMenu cb = (CCDropDownMenu) getChild(SINGLECHOICE_CLASSIFICATION);
cb.setOptions(optList);
String value = (String) cb.getValue();
if ((value == null) || (value.length() == 0)) {
cb.setValue(classification[0]);
setDisplayFieldValue(TF_CLASSIFICATION, classification[0]);
} else {
setDisplayFieldValue(TF_CLASSIFICATION, value);
}
}
}
use of com.iplanet.jato.view.html.OptionList in project OpenAM by OpenRock.
the class MAPClientManagerViewBean method setStyles.
private void setStyles() {
MAPServiceModel model = (MAPServiceModel) getModel();
Set styles = model.getStyleNames(getProfileName());
if ((styles != null) && !styles.isEmpty()) {
OptionList styleList = new OptionList();
for (Iterator iter = styles.iterator(); iter.hasNext(); ) {
String name = (String) iter.next();
styleList.add(name, name);
}
CCDropDownMenu menu = (CCDropDownMenu) getChild(SINGLECHOICE_STYLE);
menu.setOptions(styleList);
}
}
use of com.iplanet.jato.view.html.OptionList in project OpenAM by OpenRock.
the class TimeConditionHelper method setTimeZone.
public void setTimeZone(ConditionOpViewBeanBase viewBean, boolean canModify, String tz) {
if ((tz != null) && (tz.trim().length() > 0)) {
AMPropertySheetModel propModel = viewBean.getPropertySheetModel();
if (canModify) {
CCDropDownMenu list = (CCDropDownMenu) viewBean.getChild(STANDARDTIMEZONE);
OptionList optList = list.getOptions();
if ((optList != null) && optList.hasValue(tz)) {
propModel.setValue(STANDARDTIMEZONE, tz);
propModel.setValue(RADIOTIMEZONE, "standard");
} else {
propModel.setValue(CUSTOMTIMEZONE, tz);
propModel.setValue(RADIOTIMEZONE, "custom");
}
} else {
String[] ids = TimeZone.getAvailableIDs();
boolean contains = false;
for (int i = 0; (i < ids.length) && !contains; i++) {
contains = ids[i].equals(tz);
}
if (contains) {
propModel.setValue(STANDARDTIMEZONE, tz);
propModel.setValue(RADIOTIMEZONE, "standard");
} else {
propModel.setValue(CUSTOMTIMEZONE, tz);
propModel.setValue(RADIOTIMEZONE, "custom");
}
}
}
}
Aggregations