Mercurial > dive4elements > river
comparison artifacts/src/main/java/org/dive4elements/river/artifacts/uinfo/vegetationzones/VegetationZonesTableEditState.java @ 9402:e511eb935ccd
Changed hard coded standard vegetation zone table to fetching it from the database, i18n for the standard zone names
author | mschaefer |
---|---|
date | Tue, 14 Aug 2018 14:04:01 +0200 |
parents | 431f1c269be5 |
children | e2da9c8a7c57 |
comparison
equal
deleted
inserted
replaced
9401:361de818f76e | 9402:e511eb935ccd |
---|---|
12 import org.dive4elements.artifactdatabase.ProtocolUtils; | 12 import org.dive4elements.artifactdatabase.ProtocolUtils; |
13 import org.dive4elements.artifacts.Artifact; | 13 import org.dive4elements.artifacts.Artifact; |
14 import org.dive4elements.artifacts.CallContext; | 14 import org.dive4elements.artifacts.CallContext; |
15 import org.dive4elements.artifacts.common.utils.XMLUtils.ElementCreator; | 15 import org.dive4elements.artifacts.common.utils.XMLUtils.ElementCreator; |
16 import org.dive4elements.river.artifacts.D4EArtifact; | 16 import org.dive4elements.river.artifacts.D4EArtifact; |
17 import org.dive4elements.river.artifacts.access.RiverAccess; | |
17 import org.dive4elements.river.artifacts.states.DefaultState; | 18 import org.dive4elements.river.artifacts.states.DefaultState; |
19 import org.dive4elements.river.model.River; | |
18 import org.w3c.dom.Element; | 20 import org.w3c.dom.Element; |
19 | 21 |
20 /** | 22 /** |
21 * @author Domenico Nardi Tironi | 23 * @author Domenico Nardi Tironi |
22 */ | 24 */ |
35 if (name.equals(datakey)) { | 37 if (name.equals(datakey)) { |
36 final Element item = ProtocolUtils.createArtNode(cr, "item", null, null); | 38 final Element item = ProtocolUtils.createArtNode(cr, "item", null, null); |
37 final Element label = ProtocolUtils.createArtNode(cr, "label", null, null); | 39 final Element label = ProtocolUtils.createArtNode(cr, "label", null, null); |
38 final Element value = ProtocolUtils.createArtNode(cr, "value", null, null); | 40 final Element value = ProtocolUtils.createArtNode(cr, "value", null, null); |
39 final D4EArtifact flys = (D4EArtifact) artifact; | 41 final D4EArtifact flys = (D4EArtifact) artifact; |
40 final String s = flys.getDataAsString(datakey) == null ? VegetationZone.parseListToDataString(VegetationZone.getStandardList()) | 42 final River river = new RiverAccess(flys).getRiver(); |
43 final String s = flys.getDataAsString(datakey) == null ? VegetationZone.parseListToDataString(VegetationZone.getStandardList(river, context)) | |
41 : flys.getDataAsString(datakey); | 44 : flys.getDataAsString(datakey); |
42 | 45 |
43 value.setTextContent(s); | 46 value.setTextContent(s); |
44 item.appendChild(label); | 47 item.appendChild(label); |
45 item.appendChild(value); | 48 item.appendChild(value); |