final List<CharSequence> values = field.getValues(); for ( final Option option : field.getOptions() ) { String optionLabel = option.getLabel(); String optionValue = option.getValue(); checkBoxList.addCheckBox(new JCheckBox(optionLabel, values.contains(optionValue)), optionValue);
@Override public String toString() { return getLabel(); }
@Override public XmlStringBuilder toXML(String enclosingNamespace) { XmlStringBuilder xml = new XmlStringBuilder(this); // Add attribute xml.optAttribute("label", getLabel()); xml.rightAngleBracket(); // Add element xml.element("value", getValue()); xml.closeElement(this); return xml; }