view flys-client/src/main/java/de/intevation/flys/client/client/ui/MeasurementStationPanel.java @ 4627:d5821c6f0ab0

Fixed validation in parameter matrix panel. Single selections are allowed now. Avoid adding duplicates of user selection in parameter matrix.
author Raimund Renkert <rrenkert@intevation.de>
date Mon, 03 Dec 2012 17:25:49 +0100
parents 0c766c475805
children
line wrap: on
line source
package de.intevation.flys.client.client.ui;

import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.rpc.AsyncCallback;
import de.intevation.flys.client.client.FLYS;
import de.intevation.flys.client.shared.model.RiverInfo;

/**
 * A Panel to show info about the MeasurementStations of a river
 *
 * @author <a href="mailto:bjoern.ricks@intevation.de">Björn Ricks</a>
 */
public class MeasurementStationPanel extends InfoPanel {

    /**
     * MeasurementStationPanel loads the MeasurementStations from the
     * RiverInfoService and displays them in a tree underneath a RiverInfoPanel
     *
     * @param flys The FLYS object
     */
    public MeasurementStationPanel(FLYS flys) {
        super(new MeasurementStationTree(flys));
    }

    /**
     * Returns the title which should be displayed in the section
     */
    @Override
    public String getSectionTitle() {
        return MSG.measurementStationPanelTitle();
    }

    /**
     * Loads the river info and renders it afterwards
     */
    @Override
    public void refresh() {
        contract();

        riverInfoService.getMeasurementStations(this.river,
            new AsyncCallback<RiverInfo>() {
                @Override
                public void onFailure(Throwable e) {
                    GWT.log("Could not load the river info." + e);
                }

                @Override
                public void onSuccess(RiverInfo riverinfo) {
                    GWT.log("Loaded river info");
                    render(riverinfo);
                    expand();
                }
        });
    }
}

http://dive4elements.wald.intevation.org