// the Sun 1.2 jdk compiler
String title = getPlainText(
option.getPrompt());
option.setTitle(title);
ContainerInstance entryContainerInstance =
option.getEntryContainerInstance();
if (entryContainerInstance == null) {
entryContainerInstance =
attributes.getEntryContainerInstance();
}
// Get the appropriate buffer based on the entry-containerInstance
DOMOutputBuffer dom = getCurrentBuffer(entryContainerInstance);
String value = option.getValue();
// Try using the caption from the option, otherwise use value
// Need to fully qualify access to outer class due to bug in
// the Sun 1.2 jdk compiler.
String caption = getPlainText(
option.getCaption());
if (caption == null) {
caption = value;
}
if (attributes.isMultiple()) {
// open the option element
Element optionElement =
dom.openElement(VDXMLConstants.INPUT_FIELD_ELEMENT);
optionElement.setAttribute(VDXMLConstants.NAME_ATTRIBUTE,
attributes.getName());
optionElement.setAttribute(VDXMLConstants.LIBREVAL_ATTRIBUTE,
VDXMLConstants.NO_VALUE);
addStandardColours(attributes, optionElement,
VDXMLConstants.INPUT_FIELD_ELEMENT);
// Set a suitable initial value
if (option.isSelected()) {
optionElement.setAttribute(
VDXMLConstants.INIT_ATTRIBUTE,
VDXMLConstants.CHOICE_CAPITAL);
} else {
optionElement.setAttribute(
VDXMLConstants.INIT_ATTRIBUTE,
VDXMLConstants.CHOICE_EMPTY);
}
// Add selected ALIASes
VDXMLVersion2_0.this.addAliasElement(
dom,
VDXMLConstants.CHOICE_CAPITAL,
VDXMLConstants.ENCODED_FIELD_VALUE +
option.getValue());
VDXMLVersion2_0.this.addAliasElement(
dom,
VDXMLConstants.CHOICE_LOWERCASE,
VDXMLConstants.ENCODED_FIELD_VALUE +
option.getValue());
// Add not selected alias
addAliasElement(dom,
VDXMLConstants.CHOICE_EMPTY,
VDXMLConstants.CHOICE_EMPTY);
// Add any helpful prompt set for this node
addPrompt(dom, option.getPrompt());
// Add the caption for this option
ContainerInstance captionContainerInstance =
option.getCaptionContainerInstance();
if (captionContainerInstance == null) {
captionContainerInstance =
attributes.getCaptionContainerInstance();
}