teichmann@5863: /* Copyright (C) 2011, 2012, 2013 by Bundesanstalt für Gewässerkunde teichmann@5863: * Software engineering by Intevation GmbH teichmann@5863: * teichmann@5863: * This file is Free Software under the GNU AGPL (>=v3) teichmann@5863: * and comes with ABSOLUTELY NO WARRANTY! Check out the teichmann@5863: * documentation coming with Dive4Elements River for details. teichmann@5863: */ teichmann@5863: teichmann@5831: package org.dive4elements.river.artifacts.states.minfo; raimund@3614: raimund@3614: import org.w3c.dom.Element; raimund@3614: teichmann@5831: import org.dive4elements.artifacts.Artifact; teichmann@5831: import org.dive4elements.artifacts.CallContext; teichmann@5831: import org.dive4elements.artifacts.CallMeta; teichmann@5831: import org.dive4elements.artifacts.common.utils.XMLUtils; teichmann@5867: import org.dive4elements.river.artifacts.D4EArtifact; teichmann@5831: import org.dive4elements.river.artifacts.resources.Resources; teichmann@5831: import org.dive4elements.river.artifacts.states.DefaultState; raimund@3614: raimund@3614: /** raimund@3614: * @author Raimund Renkert raimund@3614: */ raimund@3614: public class YearEpochSelect extends DefaultState { raimund@3614: raimund@3614: /** raimund@3614: * The default constructor that initializes an empty State object. raimund@3614: */ raimund@3614: public YearEpochSelect() { raimund@3614: } raimund@3614: raimund@3614: @Override raimund@3614: protected String getUIProvider() { raimund@3614: return "minfo.bed.year_epoch"; raimund@3614: } raimund@3614: raimund@3614: @Override raimund@3614: protected Element[] createItems( raimund@3614: XMLUtils.ElementCreator ec, raimund@3614: Artifact artifact, raimund@3614: String name, raimund@3614: CallContext context) raimund@3614: { raimund@3614: CallMeta meta = context.getMeta(); rrenkert@4220: Element[] elements; teichmann@5867: if (((D4EArtifact)artifact).getCurrentStateId() rrenkert@4220: .equals("state.minfo.sediment.load.year_epoch") rrenkert@4220: ) { rrenkert@4220: elements = new Element[3]; rrenkert@4220: elements[2] = createItem( rrenkert@4220: ec, rrenkert@4220: new String[] { rrenkert@4220: Resources.getMsg(meta, rrenkert@4220: "state.minfo.off_epoch", rrenkert@4220: "state.minfo.off_epoch"), rrenkert@4220: "off_epoch"}); rrenkert@4220: } rrenkert@4220: else { rrenkert@4220: elements = new Element[2]; rrenkert@4220: } raimund@3614: elements[0] = createItem( raimund@3614: ec, raimund@3614: new String[] { raimund@3614: Resources.getMsg(meta, raimund@3614: "state.minfo.year", raimund@3614: "state.minfo.year"), raimund@3614: "year"}); raimund@3614: raimund@3614: elements[1] = createItem( raimund@3614: ec, raimund@3614: new String[] { raimund@3614: Resources.getMsg(meta, raimund@3614: "state.minfo.epoch", raimund@3614: "state.minfo.epoch"), raimund@3614: "epoch"}); raimund@3614: rrenkert@4220: return elements; raimund@3614: } raimund@3614: } teichmann@4049: // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 :