Mercurial > dive4elements > river
comparison flys-artifacts/src/main/java/de/intevation/flys/exports/VisibleAttribute.java @ 3318:dbe2f85bf160
merged flys-artifacts/2.8
author | Thomas Arendsen Hein <thomas@intevation.de> |
---|---|
date | Fri, 28 Sep 2012 12:14:35 +0200 |
parents | 7a7c5cad4fe1 |
children | 58bdf95df5e4 |
comparison
equal
deleted
inserted
replaced
2987:98c7a46ec5ae | 3318:dbe2f85bf160 |
---|---|
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 import de.intevation.artifactdatabase.state.DefaultAttribute; | |
8 | |
9 | |
10 /** | |
11 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> | |
12 */ | |
13 public class VisibleAttribute extends DefaultAttribute { | |
14 | |
15 protected boolean visible; | |
16 | |
17 | |
18 public VisibleAttribute(String name, Object value, boolean visible) { | |
19 super(name, value); | |
20 this.visible = visible; | |
21 } | |
22 | |
23 | |
24 /** | |
25 * This implementation of Attribute calls DefaultAttribute.toXML() first. | |
26 * After this, a new Attr <i>display</i> is added to the resulting Node. | |
27 * | |
28 * @param parent The parent Node. | |
29 * | |
30 * @return a new Node that represents this Attribute. | |
31 */ | |
32 @Override | |
33 public Node toXML(Node parent) { | |
34 Document owner = parent.getOwnerDocument(); | |
35 | |
36 Element ele = (Element) super.toXML(parent); | |
37 ele.setAttribute("display", String.valueOf(visible)); | |
38 | |
39 return ele; | |
40 } | |
41 } | |
42 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |