Icon icon = client.getIcon(iconUrl);
itemHtml = icon.getElement().getString() + itemHtml;
}
String key = opUidl.getStringAttribute("key");
CheckBox op = keysToOptions.get(key);
// Need to recreate object if isMultiselect is changed (#10451)
// OR if htmlContentAllowed changed due to Safari 5 issue
if ((op == null) || (htmlContentAllowed != wasHtmlContentAllowed)
|| (isMultiselect() != wasMultiselect)) {
// Create a new element
if (isMultiselect()) {
op = new VCheckBox();
} else {
op = new RadioButton(paintableId);
op.setStyleName("v-radiobutton");
}
if (iconUrl != null && iconUrl.length() != 0) {
Util.sinkOnloadForImages(op.getElement());
op.addHandler(iconLoadHandler, LoadEvent.getType());
}
op.addStyleName(CLASSNAME_OPTION);
op.addClickHandler(this);
optionsToKeys.put(op, key);
}
op.setHTML(itemHtml);
op.setValue(opUidl.getBooleanAttribute("selected"));
boolean optionEnabled = !opUidl
.getBooleanAttribute(OptionGroupConstants.ATTRIBUTE_OPTION_DISABLED);
boolean enabled = optionEnabled && !isReadonly() && isEnabled();
op.setEnabled(enabled);
optionsEnabled.put(op, optionEnabled);
setStyleName(op.getElement(),
ApplicationConnection.DISABLED_CLASSNAME,
!(optionEnabled && isEnabled()));
newwidgets.add(op);
}