Mercurial > dive4elements > river
comparison artifacts/src/main/java/org/dive4elements/river/artifacts/uinfo/salix/ScenarioTypeState.java @ 9273:1b2623dff742
salix another review
author | gernotbelger |
---|---|
date | Thu, 19 Jul 2018 17:32:27 +0200 |
parents | f48a8dc78529 |
children | 1a4d2ce77423 |
comparison
equal
deleted
inserted
replaced
9272:1d59da89b00d | 9273:1b2623dff742 |
---|---|
7 import org.dive4elements.artifactdatabase.data.StateData; | 7 import org.dive4elements.artifactdatabase.data.StateData; |
8 import org.dive4elements.artifacts.Artifact; | 8 import org.dive4elements.artifacts.Artifact; |
9 import org.dive4elements.artifacts.CallContext; | 9 import org.dive4elements.artifacts.CallContext; |
10 import org.dive4elements.artifacts.CallMeta; | 10 import org.dive4elements.artifacts.CallMeta; |
11 import org.dive4elements.artifacts.common.utils.XMLUtils; | 11 import org.dive4elements.artifacts.common.utils.XMLUtils; |
12 import org.dive4elements.artifacts.common.utils.XMLUtils.ElementCreator; | |
12 import org.dive4elements.river.artifacts.resources.Resources; | 13 import org.dive4elements.river.artifacts.resources.Resources; |
13 import org.dive4elements.river.artifacts.states.RadioSelect; | 14 import org.dive4elements.river.artifacts.states.RadioSelect; |
14 import org.w3c.dom.Element; | 15 import org.w3c.dom.Element; |
15 | 16 |
16 /** | 17 /** |
33 | 34 |
34 } | 35 } |
35 | 36 |
36 @Override | 37 @Override |
37 protected Element createData(final XMLUtils.ElementCreator cr, final Artifact artifact, final StateData data, final CallContext context) { | 38 protected Element createData(final XMLUtils.ElementCreator cr, final Artifact artifact, final StateData data, final CallContext context) { |
39 return changeHeaderForCurrentState("state.uinfo.load.scenario_type", data.getName(), cr, context); | |
40 } | |
41 | |
42 /// dieser nervige Teil dient lediglich dazu, in create() im client die Überschrift zu ändern... :-( | |
43 // Die Überschrift soll anders sein als in createOld() (links) | |
44 public static final Element changeHeaderForCurrentState(final String msgKey, final String dataName, final ElementCreator cr, final CallContext context) { | |
38 final Element select = ProtocolUtils.createArtNode(cr, "select", null, null); | 45 final Element select = ProtocolUtils.createArtNode(cr, "select", null, null); |
39 | 46 |
40 cr.addAttr(select, "name", data.getName(), true); | 47 cr.addAttr(select, "name", dataName, true); |
41 | 48 |
42 final Element label = ProtocolUtils.createArtNode(cr, "label", null, null); | 49 final Element label = ProtocolUtils.createArtNode(cr, "label", null, null); |
43 | 50 |
44 label.setTextContent(Resources.getMsg(context.getMeta(), "state.uinfo.load.scenario_type")); | 51 label.setTextContent(Resources.getMsg(context.getMeta(), msgKey)); |
45 | 52 |
46 final Element description = ProtocolUtils.createArtNode(cr, "description", null, null); | 53 final Element description = ProtocolUtils.createArtNode(cr, "description", null, null); |
47 description.setTextContent("TEST"); | 54 description.setTextContent("TEST"); |
48 select.appendChild(description); | 55 select.appendChild(description); |
49 select.appendChild(label); | 56 select.appendChild(label); |