comparison flys-artifacts/src/main/java/de/intevation/flys/exports/ChoiceStringAttribute.java @ 3615:f84854eba0b3

Preparations for logo inclusion in charts. flys-artifacts/trunk@5278 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Tue, 28 Aug 2012 12:47:11 +0000
parents
children ebfce31c7eec
comparison
equal deleted inserted replaced
3614:68beaa827751 3615:f84854eba0b3
1 package de.intevation.flys.exports;
2
3 import org.w3c.dom.Document;
4 import org.w3c.dom.Element;
5 import org.w3c.dom.Node;
6
7
8 /**
9 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a>
10 */
11 public class ChoiceStringAttribute extends StringAttribute {
12
13 /** Indicator which type of choice is dealt with. */
14 protected String choiceType;
15
16
17 public ChoiceStringAttribute(String name,
18 String value,
19 boolean visible,
20 String choiceType) {
21 super(name, value, visible);
22 this.choiceType = choiceType;
23 }
24
25
26 /**
27 * Calls VisibleAttribute.toXML() and appends afterwards an attribute
28 * <i>type</i> with value <i>string</i>.
29 *
30 * @param parent The parent Node.
31 *
32 * @return the new Node that represents this Attribute.
33 */
34 @Override
35 public Node toXML(Node parent) {
36 Document owner = parent.getOwnerDocument();
37
38 Element ele = (Element) super.toXML(parent);
39 ele.setAttribute("type", "string");
40 ele.setAttribute("choice", choiceType);
41
42 return ele;
43 }
44 }
45 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org