@Override protected void paintItem(PaintTarget target, Object itemId) throws PaintException { super.paintItem(target, itemId); if (!isItemEnabled(itemId)) { target.addAttribute(OptionGroupConstants.ATTRIBUTE_OPTION_DISABLED, true); } }
Set<?> newValueSet = (Set<?>) newValue; for (Object itemId : currentValueSet) { if (!isItemEnabled(itemId) && !newValueSet.contains(itemId)) { markAsDirty(); if (!isItemEnabled(itemId) && !currentValueSet.contains(itemId)) { markAsDirty(); newValue = getNullSelectionItemId(); if (!isItemEnabled(newValue)) { markAsDirty(); return;
@Override protected Element writeItem(Element design, Object itemId, DesignContext context) { Element elem = super.writeItem(design, itemId, context); if (!isItemEnabled(itemId)) { elem.attr("disabled", ""); } if (isHtmlContentAllowed()) { // need to unencode HTML entities. AbstractSelect.writeDesign can't // check if HTML content is allowed, so it always encodes entities // like '>', '<' and '&'; in case HTML content is allowed this is // undesirable so we need to unencode entities. Entities other than // '<' and '>' will be taken care by Jsoup. elem.html(DesignFormatter.decodeFromTextNode(elem.html())); } return elem; }