Mercurial > dive4elements > river
comparison artifacts/src/main/java/org/dive4elements/river/artifacts/uinfo/vegetationzones/VegetationZonesTableState.java @ 9133:af73fdd96920
Title current/historical diff pair; limit on entries in diff'pair twin_panel
author | gernotbelger |
---|---|
date | Thu, 07 Jun 2018 11:41:10 +0200 |
parents | 28c50f5efceb |
children | e511eb935ccd |
comparison
equal
deleted
inserted
replaced
9132:8cc192731c7d | 9133:af73fdd96920 |
---|---|
7 * and comes with ABSOLUTELY NO WARRANTY! Check out the | 7 * and comes with ABSOLUTELY NO WARRANTY! Check out the |
8 * documentation coming with Dive4Elements River for details. | 8 * documentation coming with Dive4Elements River for details. |
9 */ | 9 */ |
10 package org.dive4elements.river.artifacts.uinfo.vegetationzones; | 10 package org.dive4elements.river.artifacts.uinfo.vegetationzones; |
11 | 11 |
12 import org.dive4elements.artifactdatabase.ProtocolUtils; | |
13 import org.dive4elements.artifacts.Artifact; | |
14 import org.dive4elements.artifacts.CallContext; | |
15 import org.dive4elements.artifacts.common.utils.XMLUtils.ElementCreator; | |
16 import org.dive4elements.river.artifacts.D4EArtifact; | |
12 import org.dive4elements.river.artifacts.states.DefaultState; | 17 import org.dive4elements.river.artifacts.states.DefaultState; |
18 import org.w3c.dom.Element; | |
13 | 19 |
14 /** | 20 /** |
15 * @author Domenico Nardi Tironi | 21 * @author Domenico Nardi Tironi |
16 */ | 22 */ |
17 public class VegetationZonesTableState extends DefaultState { | 23 public class VegetationZonesTableState extends DefaultState { |
20 | 26 |
21 @Override | 27 @Override |
22 protected String getUIProvider() { | 28 protected String getUIProvider() { |
23 return "uinfo.vegetationzones.table"; | 29 return "uinfo.vegetationzones.table"; |
24 } | 30 } |
31 | |
32 // TODO GET REAL DATA | |
33 @Override | |
34 protected Element[] createItems(final ElementCreator cr, final Artifact artifact, final String name, final CallContext context) { | |
35 final String datakey = "vegzones"; | |
36 if (name.equals(datakey)) { | |
37 final Element item = ProtocolUtils.createArtNode(cr, "item", null, null); | |
38 final Element label = ProtocolUtils.createArtNode(cr, "label", null, null); | |
39 final Element value = ProtocolUtils.createArtNode(cr, "value", null, null); | |
40 final D4EArtifact flys = (D4EArtifact) artifact; | |
41 final String s = flys.getDataAsString(datakey) == null ? VegetationZone.parseListToDataString(VegetationZone.getStandardList()) | |
42 : flys.getDataAsString(datakey); | |
43 | |
44 value.setTextContent(s); | |
45 item.appendChild(label); | |
46 item.appendChild(value); | |
47 return new Element[] { item }; | |
48 } | |
49 return new Element[] {}; | |
50 } | |
25 } | 51 } |