Mercurial > dive4elements > river
comparison gwt-client/src/main/java/org/dive4elements/river/client/client/ui/stationinfo/GaugeRecord.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 | ea9eef426962 |
children |
comparison
equal
deleted
inserted
replaced
6417:14b5674e57a4 | 6418:c702bac7f72e |
---|---|
9 package org.dive4elements.river.client.client.ui.stationinfo; | 9 package org.dive4elements.river.client.client.ui.stationinfo; |
10 | 10 |
11 import com.google.gwt.core.client.GWT; | 11 import com.google.gwt.core.client.GWT; |
12 import com.smartgwt.client.widgets.grid.ListGridRecord; | 12 import com.smartgwt.client.widgets.grid.ListGridRecord; |
13 | 13 |
14 import org.dive4elements.river.client.client.Config; | |
14 import org.dive4elements.river.client.client.FLYSConstants; | 15 import org.dive4elements.river.client.client.FLYSConstants; |
15 import org.dive4elements.river.client.shared.model.GaugeInfo; | 16 import org.dive4elements.river.client.shared.model.GaugeInfo; |
16 | 17 |
17 /** | 18 /** |
18 * @author <a href="mailto:bjoern.ricks@intevation.de">Björn Ricks</a> | 19 * @author <a href="mailto:bjoern.ricks@intevation.de">Björn Ricks</a> |
19 */ | 20 */ |
20 public class GaugeRecord extends ListGridRecord implements GaugeInfo { | 21 public class GaugeRecord extends ListGridRecord implements GaugeInfo { |
21 | 22 |
22 /** The message class that provides i18n strings.*/ | 23 /** The message class that provides i18n strings.*/ |
23 private FLYSConstants MSG = GWT.create(FLYSConstants.class); | 24 private final FLYSConstants MSG = GWT.create(FLYSConstants.class); |
24 | 25 |
25 public GaugeRecord(GaugeInfo gauge) { | 26 public GaugeRecord(GaugeInfo gauge) { |
27 String wikiBaseUrl = Config.getInstance().getWikiUrl(); | |
28 | |
26 setCanExpand(true); | 29 setCanExpand(true); |
27 Long number = gauge.getOfficialNumber(); | 30 Long number = gauge.getOfficialNumber(); |
28 String url = number != null ? | 31 String url = number != null ? |
29 MSG.gauge_url() + number : | 32 MSG.gauge_url() + number : |
30 MSG.gauge_url(); | 33 MSG.gauge_url(); |
31 setLink(url); | 34 setLink(wikiBaseUrl + url); |
32 setLinkText(MSG.gauge_info_link()); | 35 setLinkText(MSG.gauge_info_link()); |
33 setName(gauge.getName()); | 36 setName(gauge.getName()); |
34 setKmStart(gauge.getKmStart()); | 37 setKmStart(gauge.getKmStart()); |
35 setKmEnd(gauge.getKmEnd()); | 38 setKmEnd(gauge.getKmEnd()); |
36 setMinQ(gauge.getMinQ()); | 39 setMinQ(gauge.getMinQ()); |
57 | 60 |
58 public String getLink() { | 61 public String getLink() { |
59 return this.getAttributeAsString("link"); | 62 return this.getAttributeAsString("link"); |
60 } | 63 } |
61 | 64 |
65 @Override | |
62 public String getName() { | 66 public String getName() { |
63 return this.getAttributeAsString("name"); | 67 return this.getAttributeAsString("name"); |
64 } | 68 } |
65 | 69 |
66 private void setName(String value) { | 70 private void setName(String value) { |
67 this.setAttribute("name", value); | 71 this.setAttribute("name", value); |
68 } | 72 } |
69 | 73 |
74 @Override | |
70 public Double getKmStart() { | 75 public Double getKmStart() { |
71 return this.getAttributeAsDouble("kmstart"); | 76 return this.getAttributeAsDouble("kmstart"); |
72 } | 77 } |
73 | 78 |
74 private void setKmStart(Double value) { | 79 private void setKmStart(Double value) { |
75 this.setAttribute("kmstart", value); | 80 this.setAttribute("kmstart", value); |
76 } | 81 } |
77 | 82 |
83 @Override | |
78 public Double getKmEnd() { | 84 public Double getKmEnd() { |
79 return this.getAttributeAsDouble("kmend"); | 85 return this.getAttributeAsDouble("kmend"); |
80 } | 86 } |
81 | 87 |
82 private void setKmEnd(Double value) { | 88 private void setKmEnd(Double value) { |
83 this.setAttribute("kmend", value); | 89 this.setAttribute("kmend", value); |
84 } | 90 } |
85 | 91 |
92 @Override | |
86 public Double getMinQ() { | 93 public Double getMinQ() { |
87 return this.getAttributeAsDouble("minq"); | 94 return this.getAttributeAsDouble("minq"); |
88 } | 95 } |
89 | 96 |
90 private void setMinQ(Double value) { | 97 private void setMinQ(Double value) { |
91 this.setAttribute("minq", value); | 98 this.setAttribute("minq", value); |
92 } | 99 } |
93 | 100 |
101 @Override | |
94 public Double getMaxQ() { | 102 public Double getMaxQ() { |
95 return this.getAttributeAsDouble("maxq"); | 103 return this.getAttributeAsDouble("maxq"); |
96 } | 104 } |
97 | 105 |
98 private void setMaxQ(Double value) { | 106 private void setMaxQ(Double value) { |
99 this.setAttribute("maxq", value); | 107 this.setAttribute("maxq", value); |
100 } | 108 } |
101 | 109 |
110 @Override | |
102 public Double getMinW() { | 111 public Double getMinW() { |
103 return this.getAttributeAsDouble("minw"); | 112 return this.getAttributeAsDouble("minw"); |
104 } | 113 } |
105 | 114 |
106 private void setMinW(Double value) { | 115 private void setMinW(Double value) { |
107 this.setAttribute("minw", value); | 116 this.setAttribute("minw", value); |
108 } | 117 } |
109 | 118 |
119 @Override | |
110 public Double getMaxW() { | 120 public Double getMaxW() { |
111 return this.getAttributeAsDouble("maxw"); | 121 return this.getAttributeAsDouble("maxw"); |
112 } | 122 } |
113 | 123 |
114 private void setMaxW(Double value) { | 124 private void setMaxW(Double value) { |
115 this.setAttribute("maxw", value); | 125 this.setAttribute("maxw", value); |
116 } | 126 } |
117 | 127 |
128 @Override | |
118 public Double getDatum() { | 129 public Double getDatum() { |
119 return this.getAttributeAsDouble("datum"); | 130 return this.getAttributeAsDouble("datum"); |
120 } | 131 } |
121 | 132 |
122 private void setDatum(Double value) { | 133 private void setDatum(Double value) { |
123 this.setAttribute("datum", value); | 134 this.setAttribute("datum", value); |
124 } | 135 } |
125 | 136 |
137 @Override | |
126 public Double getAeo() { | 138 public Double getAeo() { |
127 return this.getAttributeAsDouble("aeo"); | 139 return this.getAttributeAsDouble("aeo"); |
128 } | 140 } |
129 | 141 |
130 private void setAeo(Double value) { | 142 private void setAeo(Double value) { |
131 this.setAttribute("aeo", value); | 143 this.setAttribute("aeo", value); |
132 } | 144 } |
133 | 145 |
146 @Override | |
134 public boolean isKmUp() { | 147 public boolean isKmUp() { |
135 return this.getAttributeAsBoolean("kmup"); | 148 return this.getAttributeAsBoolean("kmup"); |
136 } | 149 } |
137 | 150 |
138 private void setKmUp(boolean value) { | 151 private void setKmUp(boolean value) { |
139 this.setAttribute("kmup", value); | 152 this.setAttribute("kmup", value); |
140 } | 153 } |
141 | 154 |
155 @Override | |
142 public Double getStation() { | 156 public Double getStation() { |
143 return this.getAttributeAsDouble("station"); | 157 return this.getAttributeAsDouble("station"); |
144 } | 158 } |
145 | 159 |
146 private void setStation(Double value) { | 160 private void setStation(Double value) { |
147 this.setAttribute("station", value); | 161 this.setAttribute("station", value); |
148 } | 162 } |
149 | 163 |
164 @Override | |
150 public String getWstUnit() { | 165 public String getWstUnit() { |
151 return this.getAttributeAsString("wstunit"); | 166 return this.getAttributeAsString("wstunit"); |
152 } | 167 } |
153 | 168 |
154 private void setWstUnit(String value) { | 169 private void setWstUnit(String value) { |
155 this.setAttribute("wstunit", value); | 170 this.setAttribute("wstunit", value); |
156 } | 171 } |
157 | 172 |
173 @Override | |
158 public Long getOfficialNumber() { | 174 public Long getOfficialNumber() { |
159 return this.getAttributeAsLong("officialnumber"); | 175 return this.getAttributeAsLong("officialnumber"); |
160 } | 176 } |
161 | 177 |
162 private void setOfficialNumber(Long number) { | 178 private void setOfficialNumber(Long number) { |
163 this.setAttribute("officialnumber", number); | 179 this.setAttribute("officialnumber", number); |
164 } | 180 } |
165 | 181 |
182 @Override | |
166 public String getRiverName() { | 183 public String getRiverName() { |
167 return this.getAttributeAsString("rivername"); | 184 return this.getAttributeAsString("rivername"); |
168 } | 185 } |
169 | 186 |
170 private void setRiverName(String rivername) { | 187 private void setRiverName(String rivername) { |