teichmann@5863: /* Copyright (C) 2011, 2012, 2013 by Bundesanstalt für Gewässerkunde teichmann@5863: * Software engineering by Intevation GmbH teichmann@5863: * teichmann@5994: * This file is Free Software under the GNU AGPL (>=v3) teichmann@5863: * and comes with ABSOLUTELY NO WARRANTY! Check out the teichmann@5994: * documentation coming with Dive4Elements River for details. teichmann@5863: */ teichmann@5863: teichmann@5831: package org.dive4elements.river.artifacts.states.minfo; raimund@3614: teichmann@5831: import org.dive4elements.artifacts.CallContext; teichmann@5831: import org.dive4elements.artifacts.common.utils.XMLUtils.ElementCreator; teichmann@5867: import org.dive4elements.river.artifacts.D4EArtifact; andre@8720: import org.dive4elements.river.artifacts.states.WaterlevelPairSelectState; gernotbelger@9580: import org.w3c.dom.Element; raimund@3614: raimund@3614: /** raimund@3614: * @author Raimund Renkert raimund@3614: */ andre@8720: public class DifferenceSelect extends WaterlevelPairSelectState { raimund@3614: raimund@3614: /** raimund@3614: * The default constructor that initializes an empty State object. raimund@3614: */ raimund@3614: public DifferenceSelect() { raimund@3614: } andre@8720: raimund@3614: @Override raimund@3614: protected String getUIProvider() { raimund@3614: return "bedheights_twin_panel"; raimund@3614: } raimund@3614: raimund@3614: /** raimund@3614: * Creates the data element used for the static part of DESCRIBE document. raimund@3614: */ raimund@3614: @Override gernotbelger@9580: protected Element createStaticData(final D4EArtifact flys, final ElementCreator creator, final CallContext cc, final String name, final String value, gernotbelger@9580: final String type) { gernotbelger@9580: final Element dataElement = creator.create("data"); raimund@3614: creator.addAttr(dataElement, "name", name, true); raimund@3614: creator.addAttr(dataElement, "type", type, true); raimund@3614: gernotbelger@9580: final Element itemElement = creator.create("item"); raimund@3614: creator.addAttr(itemElement, "value", value, true); raimund@3614: gernotbelger@9580: final String[] labels = getLabels(cc, value, false); raimund@3614: gernotbelger@9580: creator.addAttr(itemElement, "label", labels[0], true); raimund@3614: dataElement.appendChild(itemElement); raimund@3614: raimund@3614: return dataElement; raimund@3614: } raimund@3614: } raimund@3614: // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 :