Mercurial > dive4elements > river
comparison flys-artifacts/src/main/java/de/intevation/flys/exports/BooleanAttribute.java @ 1986:3632150dbe0b
Implemented a ChartSettings with relevant Sections and Attributes for charts (NOTE: Work still in progress).
flys-artifacts/trunk@3418 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Wed, 14 Dec 2011 14:17:31 +0000 |
parents | |
children | 382e38164200 |
comparison
equal
deleted
inserted
replaced
1985:07b176b14205 | 1986:3632150dbe0b |
---|---|
1 package de.intevation.flys.exports; | |
2 | |
3 import org.w3c.dom.Attr; | |
4 import org.w3c.dom.Document; | |
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 BooleanAttribute extends VisibleAttribute { | |
12 | |
13 | |
14 public BooleanAttribute(String name, boolean value, boolean visible) { | |
15 super(name, value, visible); | |
16 } | |
17 | |
18 | |
19 /** | |
20 * Calls VisibleAttribute.toXML() and appends afterwards an attribute | |
21 * <i>type</i> with value <i>boolean</i>. | |
22 * | |
23 * @param parent The parent Node. | |
24 * | |
25 * @return the new Node that represents this Attribute. | |
26 */ | |
27 @Override | |
28 public Node toXML(Node parent) { | |
29 Document owner = parent.getOwnerDocument(); | |
30 Node node = super.toXML(parent); | |
31 | |
32 Attr attr = owner.createAttribute("type"); | |
33 attr.setValue("boolean"); | |
34 | |
35 node.appendChild(attr); | |
36 | |
37 return node; | |
38 } | |
39 } | |
40 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |