view flys-client/src/main/java/de/intevation/flys/client/client/ui/MeasurementStationPanel.java @ 4573:b87073a05f9d

flys-client: Patch to render combobox options as clickable links. The way of passing data arguments to the links and further to the Artifact feeding service is somewhat hacked and should be refactored (later...).
author Christian Lins <christian.lins@intevation.de>
date Tue, 27 Nov 2012 12:50:10 +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