view flys-client/src/main/java/de/intevation/flys/client/client/ui/MeasurementStationPanel.java @ 4568:bbd82bd8e541

flys-client: Cosmetics and warnings.
author Christian Lins <christian.lins@intevation.de>
date Mon, 19 Nov 2012 00:07:53 +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