bjoern@4269: package de.intevation.flys.client.client.ui;
bjoern@4269:
bjoern@4269: import com.google.gwt.core.client.GWT;
bjoern@4269: import com.google.gwt.user.client.rpc.AsyncCallback;
bjoern@4269: import de.intevation.flys.client.client.FLYS;
bjoern@4269: import de.intevation.flys.client.shared.model.RiverInfo;
bjoern@4269:
bjoern@4269: /**
bjoern@4269: * A Panel to show info about the MeasurementStations of a river
bjoern@4269: *
bjoern@4269: * @author Björn Ricks
bjoern@4269: */
bjoern@4269: public class MeasurementStationPanel extends InfoPanel {
bjoern@4269:
bjoern@4269: /**
bjoern@4269: * MeasurementStationPanel loads the MeasurementStations from the
bjoern@4269: * RiverInfoService and displays them in a tree underneath a RiverInfoPanel
bjoern@4269: *
bjoern@4269: * @param flys The FLYS object
bjoern@4269: */
bjoern@4269: public MeasurementStationPanel(FLYS flys) {
bjoern@4269: super(new MeasurementStationTree(flys));
bjoern@4269: }
bjoern@4269:
bjoern@4269: /**
bjoern@4269: * Returns the title which should be displayed in the section
bjoern@4269: */
bjoern@4269: @Override
bjoern@4269: public String getSectionTitle() {
bjoern@4269: return MSG.measurementStationPanelTitle();
bjoern@4269: }
bjoern@4269:
bjoern@4269: /**
bjoern@4269: * Loads the river info and renders it afterwards
bjoern@4269: */
bjoern@4269: @Override
bjoern@4269: public void refresh() {
bjoern@4269: contract();
bjoern@4269:
bjoern@4269: riverInfoService.getMeasurementStations(this.river,
bjoern@4269: new AsyncCallback() {
bjoern@4269: @Override
bjoern@4269: public void onFailure(Throwable e) {
bjoern@4269: GWT.log("Could not load the river info." + e);
bjoern@4269: }
bjoern@4269:
bjoern@4269: @Override
bjoern@4269: public void onSuccess(RiverInfo riverinfo) {
bjoern@4269: GWT.log("Loaded river info");
bjoern@4269: render(riverinfo);
bjoern@4269: expand();
bjoern@4269: }
bjoern@4269: });
bjoern@4269: }
bjoern@4269: }