view gwt-client/src/main/java/org/dive4elements/river/client/client/ui/sinfo/CollisionLoadYearPanel.java @ 9078:fc02833dbcc1

SingleInputItem abstract
author gernotbelger
date Tue, 22 May 2018 17:44:05 +0200
parents 2b13de1b0897
children aafae1ab25f0
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.AbstractSingleItemPanel;

public class CollisionLoadYearPanel extends AbstractSingleItemPanel {

    @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);
        }
    }

    @Override
    protected boolean getTitleVisible() {
        return true;
    }

    @Override
    protected String errorForItemMsg() {
        return this.MSG.no_data_for_year();
    }
}

http://dive4elements.wald.intevation.org