view gwt-client/src/main/java/org/dive4elements/river/client/client/ui/sinfo/CollisionLoadYearPanel.java @ 9077:2b13de1b0897

moved single_year/multi_year common code to AbstractPanel
author gernotbelger
date Tue, 22 May 2018 15:32:00 +0200
parents 22d8928895a1
children fc02833dbcc1
line wrap: on
line source
/* Copyright (C) 2011, 2012, 2013 by Bundesanstalt für Gewässerkunde
 * Software engineering by Intevation GmbH
 *
 * This file is Free Software under the GNU AGPL (>=v3)
 * and comes with ABSOLUTELY NO WARRANTY! Check out the
 * documentation coming with Dive4Elements River for details.
 */

package org.dive4elements.river.client.client.ui.sinfo;

import org.dive4elements.river.client.client.ui.AbstractPanel;

public class CollisionLoadYearPanel extends AbstractPanel {

    @Override
    protected String getDatakey() {
        return "years"; // MULTIPLE; get From server (sinfo.xml data for state)
    }

    public CollisionLoadYearPanel() {
    }

    @Override
    protected final void appendValue(final String value) { // APPEND = ADD to existing -> MULTI YEAR
        final String oldYears = super.inputItem.getValueAsString();
        if (oldYears != null && !oldYears.isEmpty()) {
            super.inputItem.setValue(oldYears.trim() + " " + value);
        } else {
            super.inputItem.setValue(value);
        }
    }
}

http://dive4elements.wald.intevation.org