Mercurial > dive4elements > river
view artifacts/src/main/java/org/dive4elements/river/artifacts/uinfo/salix/ScenarioTypeState.java @ 9511:73819a194bfd
Wrong/not translated column
author | gernotbelger |
---|---|
date | Fri, 28 Sep 2018 18:12:11 +0200 |
parents | 1a4d2ce77423 |
children |
line wrap: on
line source
package org.dive4elements.river.artifacts.uinfo.salix; import java.util.LinkedHashMap; import org.dive4elements.artifactdatabase.ProtocolUtils; import org.dive4elements.artifactdatabase.data.StateData; import org.dive4elements.artifacts.Artifact; import org.dive4elements.artifacts.CallContext; import org.dive4elements.artifacts.CallMeta; import org.dive4elements.artifacts.common.utils.XMLUtils; import org.dive4elements.artifacts.common.utils.XMLUtils.ElementCreator; import org.dive4elements.river.artifacts.resources.Resources; import org.dive4elements.river.artifacts.states.RadioSelect; import org.w3c.dom.Element; /** * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> */ public class ScenarioTypeState extends RadioSelect { private static final long serialVersionUID = 1L; public ScenarioTypeState() { super(); } @Override protected LinkedHashMap<String, String> makeEntries(final CallMeta meta, final Artifact artifact) { final LinkedHashMap<String, String> entries = new LinkedHashMap<>(); entries.put("scenarioType.option1", null); entries.put("scenarioType.option2", null); entries.put("scenarioType.option3", null); return entries; } @Override protected Element createData(final XMLUtils.ElementCreator cr, final Artifact artifact, final StateData data, final CallContext context) { return changeHeaderForCurrentState("state.uinfo.load.scenario_type", data.getName(), cr, context); } /// dieser nervige Teil dient lediglich dazu, in create() im client die Überschrift zu ändern... :-( // Die Überschrift soll anders sein als in createOld() (links) public static final Element changeHeaderForCurrentState(final String msgKey, final String dataName, final ElementCreator cr, final CallContext context) { final Element select = ProtocolUtils.createArtNode(cr, "select", null, null); cr.addAttr(select, "name", dataName, true); final Element label = ProtocolUtils.createArtNode(cr, "label", null, null); label.setTextContent(Resources.getMsg(context.getMeta(), msgKey)); final Element description = ProtocolUtils.createArtNode(cr, "description", null, null); description.setTextContent("TEST"); select.appendChild(description); select.appendChild(label); return select; } @Override protected String getDatakey() { return "scenario_selection"; } @Override protected String getUIProvider() { return "salix_scenariotype_radio_panel"; } }