Mercurial > dive4elements > river
comparison flys-client/src/main/java/de/intevation/flys/client/client/ui/stationinfo/MeasurementStationPanel.java @ 4956:f46a07c11324
Refactor Pegel- and Messtelleninfo in client ui
Use SmartGWT ListGrid instead of GWT Tree to display the station entires.
author | Björn Ricks <bjoern.ricks@intevation.de> |
---|---|
date | Fri, 01 Feb 2013 16:32:48 +0100 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
4950:4c7acc3a4ae1 | 4956:f46a07c11324 |
---|---|
1 package de.intevation.flys.client.client.ui.stationinfo; | |
2 | |
3 import com.google.gwt.core.client.GWT; | |
4 import com.google.gwt.user.client.rpc.AsyncCallback; | |
5 import de.intevation.flys.client.client.FLYS; | |
6 import de.intevation.flys.client.shared.model.RiverInfo; | |
7 | |
8 /** | |
9 * A Panel to show info about the MeasurementStations of a river | |
10 * | |
11 * @author <a href="mailto:bjoern.ricks@intevation.de">Björn Ricks</a> | |
12 */ | |
13 public class MeasurementStationPanel extends InfoPanel { | |
14 | |
15 /** | |
16 * MeasurementStationPanel loads the MeasurementStations from the | |
17 * RiverInfoService and displays them in a tree underneath a RiverInfoPanel | |
18 * | |
19 * @param flys The FLYS object | |
20 */ | |
21 public MeasurementStationPanel(FLYS flys) { | |
22 super(new MeasurementStationListGrid(flys)); | |
23 } | |
24 | |
25 /** | |
26 * Returns the title which should be displayed in the section | |
27 */ | |
28 @Override | |
29 public String getSectionTitle() { | |
30 return MSG.measurementStationPanelTitle(); | |
31 } | |
32 | |
33 /** | |
34 * Loads the river info and renders it afterwards | |
35 */ | |
36 @Override | |
37 public void refresh() { | |
38 GWT.log("MeasurementStationPanel - refresh"); | |
39 contract(); | |
40 | |
41 riverInfoService.getMeasurementStations(this.river, | |
42 new AsyncCallback<RiverInfo>() { | |
43 @Override | |
44 public void onFailure(Throwable e) { | |
45 GWT.log("Could not load the river info." + e); | |
46 } | |
47 | |
48 @Override | |
49 public void onSuccess(RiverInfo riverinfo) { | |
50 GWT.log("MeasurementStationPanel - Loaded river info"); | |
51 render(riverinfo); | |
52 expand(); | |
53 } | |
54 }); | |
55 } | |
56 } |