view artifacts/src/main/java/org/dive4elements/river/artifacts/uinfo/salix/ScenarioTypeState.java @ 9271:f48a8dc78529

uinfo.salix details
author gernotbelger
date Thu, 19 Jul 2018 13:39:27 +0200
parents 2f5052835b76
children 1b2623dff742
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.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) {
        final Element select = ProtocolUtils.createArtNode(cr, "select", null, null);

        cr.addAttr(select, "name", data.getName(), true);

        final Element label = ProtocolUtils.createArtNode(cr, "label", null, null);

        label.setTextContent(Resources.getMsg(context.getMeta(), "state.uinfo.load.scenario_type"));

        final Element description = ProtocolUtils.createArtNode(cr, "description", null, null);
        description.setTextContent("TEST");
        select.appendChild(description);
        select.appendChild(label);

        return select;
    }
}

http://dive4elements.wald.intevation.org