comparison artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/flood_duration/FloodInfrastructure.java @ 9624:02ca823ec9c6

zu Pos 20 Nachtrag; infrastructureChoice
author dnt_bjoernsen <d.tironi@bjoernsen.de>
date Fri, 11 Oct 2019 18:30:36 +0200
parents 8ed6c45136fa
children f51e23eb036a
comparison
equal deleted inserted replaced
9623:677ff7ed9a60 9624:02ca823ec9c6
6 * documentation coming with Dive4Elements River for details. 6 * documentation coming with Dive4Elements River for details.
7 */ 7 */
8 8
9 package org.dive4elements.river.artifacts.sinfo.flood_duration; 9 package org.dive4elements.river.artifacts.sinfo.flood_duration;
10 10
11 import org.dive4elements.artifactdatabase.ProtocolUtils;
12 import org.dive4elements.artifacts.Artifact;
13 import org.dive4elements.artifacts.CallContext;
14 import org.dive4elements.artifacts.common.utils.XMLUtils.ElementCreator;
15 import org.dive4elements.river.artifacts.D4EArtifact;
16 import org.dive4elements.river.artifacts.access.RiverAccess;
11 import org.dive4elements.river.artifacts.states.DefaultState; 17 import org.dive4elements.river.artifacts.states.DefaultState;
18 import org.dive4elements.river.model.River;
19 import org.w3c.dom.Element;
12 20
13 /** 21 /**
14 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> 22 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a>
15 */ 23 */
16 public class FloodInfrastructure extends DefaultState { 24 public class FloodInfrastructure extends DefaultState {
24 @Override 32 @Override
25 protected String getUIProvider() { 33 protected String getUIProvider() {
26 34
27 return "flood_infrastructure_panel"; 35 return "flood_infrastructure_panel";
28 } 36 }
37
38 @Override
39 protected Element[] createItems(final ElementCreator cr, final Artifact artifact, final String name, final CallContext context) {
40 if (name.equals(getDatakey())) {
41 final Element item = ProtocolUtils.createArtNode(cr, "item", null, null);
42 final Element label = ProtocolUtils.createArtNode(cr, "label", null, null);
43 final Element value = ProtocolUtils.createArtNode(cr, "value", null, null);
44 final D4EArtifact flys = (D4EArtifact) artifact;
45 final River river = new RiverAccess(flys).getRiver();
46 final String s = flys.getDataAsString(getDatakey());
47
48 value.setTextContent(s);
49 item.appendChild(label);
50 item.appendChild(value);
51 return new Element[] { item };
52 }
53 return new Element[] {};
54 }
29 } 55 }

http://dive4elements.wald.intevation.org