felix@3615: package de.intevation.flys.exports;
felix@3615:
felix@3615: import org.w3c.dom.Element;
felix@3615: import org.w3c.dom.Node;
felix@3615:
felix@3615:
felix@3615: /**
felix@3615: * @author Ingo Weinzierl
felix@3615: */
felix@3615: public class ChoiceStringAttribute extends StringAttribute {
felix@3615:
felix@3615: /** Indicator which type of choice is dealt with. */
felix@3615: protected String choiceType;
sascha@3633:
felix@3615:
felix@3615: public ChoiceStringAttribute(String name,
felix@3615: String value,
felix@3615: boolean visible,
felix@3615: String choiceType) {
felix@3615: super(name, value, visible);
felix@3615: this.choiceType = choiceType;
felix@3615: }
felix@3615:
felix@3615:
felix@3615: /**
felix@3615: * Calls VisibleAttribute.toXML() and appends afterwards an attribute
felix@3615: * type with value string.
felix@3615: *
felix@3615: * @param parent The parent Node.
felix@3615: *
felix@3615: * @return the new Node that represents this Attribute.
felix@3615: */
felix@3615: @Override
felix@3615: public Node toXML(Node parent) {
felix@3615: Element ele = (Element) super.toXML(parent);
felix@3615: ele.setAttribute("type", "string");
felix@3615: ele.setAttribute("choice", choiceType);
felix@3615:
felix@3615: return ele;
felix@3615: }
felix@3615: }
felix@3615: // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :