Mercurial > dive4elements > river
comparison flys-artifacts/src/main/java/de/intevation/flys/exports/ChoiceStringAttribute.java @ 3651:06a65baae494
merged flys-artifacts/2.9
author | Thomas Arendsen Hein <thomas@intevation.de> |
---|---|
date | Fri, 28 Sep 2012 12:14:43 +0200 |
parents | ebfce31c7eec |
children | 58bdf95df5e4 |
comparison
equal
deleted
inserted
replaced
3549:6a8f83c538e3 | 3651:06a65baae494 |
---|---|
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 : |