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