Mercurial > dive4elements > river
comparison gwt-client/src/main/java/org/dive4elements/river/client/client/ui/stationinfo/MeasurementStationRecord.java @ 6418:c702bac7f72e
Make wiki url configurable in gwt client (flys/#1197). It's probably better to retrieve
that config from the server but this solution is faster ;) (ServerInfoService wip)
author | Christian Lins <christian.lins@intevation.de> |
---|---|
date | Wed, 26 Jun 2013 10:39:10 +0200 |
parents | e08303469a64 |
children | 17db08570637 |
comparison
equal
deleted
inserted
replaced
6417:14b5674e57a4 | 6418:c702bac7f72e |
---|---|
6 * documentation coming with Dive4Elements River for details. | 6 * documentation coming with Dive4Elements River for details. |
7 */ | 7 */ |
8 | 8 |
9 package org.dive4elements.river.client.client.ui.stationinfo; | 9 package org.dive4elements.river.client.client.ui.stationinfo; |
10 | 10 |
11 import java.util.Date; | |
12 | |
13 import com.google.gwt.core.client.GWT; | 11 import com.google.gwt.core.client.GWT; |
14 import com.smartgwt.client.widgets.grid.ListGridRecord; | 12 import com.smartgwt.client.widgets.grid.ListGridRecord; |
15 | 13 |
14 import java.util.Date; | |
15 | |
16 import org.dive4elements.river.client.client.Config; | |
16 import org.dive4elements.river.client.client.FLYSConstants; | 17 import org.dive4elements.river.client.client.FLYSConstants; |
17 import org.dive4elements.river.client.shared.model.MeasurementStation; | 18 import org.dive4elements.river.client.shared.model.MeasurementStation; |
18 | 19 |
19 /** | 20 /** |
20 * @author <a href="mailto:bjoern.ricks@intevation.de">Björn Ricks</a> | 21 * @author <a href="mailto:bjoern.ricks@intevation.de">Björn Ricks</a> |
22 public class MeasurementStationRecord | 23 public class MeasurementStationRecord |
23 extends ListGridRecord | 24 extends ListGridRecord |
24 implements MeasurementStation { | 25 implements MeasurementStation { |
25 | 26 |
26 /** The message class that provides i18n strings.*/ | 27 /** The message class that provides i18n strings.*/ |
27 private FLYSConstants MSG = GWT.create(FLYSConstants.class); | 28 private final FLYSConstants MSG = GWT.create(FLYSConstants.class); |
28 | 29 |
29 public MeasurementStationRecord(MeasurementStation station) { | 30 public MeasurementStationRecord(MeasurementStation station) { |
30 this.setCanExpand(true); | 31 this.setCanExpand(true); |
32 | |
33 String wikiBaseUrl = Config.getInstance().getWikiUrl(); | |
31 | 34 |
32 Integer number = station.getID(); | 35 Integer number = station.getID(); |
33 String stationName = station.getName(); | 36 String stationName = station.getName(); |
34 String stationIdent = stationName.replaceAll("\\W", ""); | 37 String stationIdent = stationName.replaceAll("\\W", ""); |
35 String stationType = station.getMeasurementType(); | 38 String stationType = station.getMeasurementType(); |
36 String link = MSG.measurement_station_url() + | 39 String link = wikiBaseUrl + MSG.measurement_station_url() + |
37 stationIdent + stationType; | 40 stationIdent + stationType; |
38 this.setLink(link); | 41 this.setLink(link); |
39 this.setLinkText(MSG.measurement_station_info_link()); | 42 this.setLinkText(MSG.measurement_station_info_link()); |
40 this.setCurveLink(MSG.static_sqrelation()); | 43 this.setCurveLink(MSG.static_sqrelation()); |
41 this.setID(number); | 44 this.setID(number); |