Mercurial > dive4elements > river
comparison flys-client/src/main/java/de/intevation/flys/client/client/ui/SingleLocationPanel.java @ 2938:0de3665daf36
Fix issue706.
flys-client/trunk@4892 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Felix Wolfsteller <felix.wolfsteller@intevation.de> |
---|---|
date | Sun, 08 Jul 2012 07:44:34 +0000 |
parents | 133820d1e6bf |
children | 8e6b1df7c3b0 |
comparison
equal
deleted
inserted
replaced
2937:a30d77d86386 | 2938:0de3665daf36 |
---|---|
1 package de.intevation.flys.client.client.ui; | 1 package de.intevation.flys.client.client.ui; |
2 | 2 |
3 import java.util.ArrayList; | 3 import java.util.ArrayList; |
4 import java.util.List; | 4 import java.util.List; |
5 | 5 |
6 import com.google.gwt.core.client.GWT; | |
6 import com.google.gwt.i18n.client.NumberFormat; | 7 import com.google.gwt.i18n.client.NumberFormat; |
7 | 8 |
8 import de.intevation.flys.client.shared.model.Data; | 9 import de.intevation.flys.client.shared.model.Data; |
10 | |
11 import com.smartgwt.client.widgets.grid.events.RecordClickHandler; | |
12 import com.smartgwt.client.widgets.grid.events.RecordClickEvent; | |
13 | |
14 import com.smartgwt.client.data.Record; | |
9 | 15 |
10 | 16 |
11 /** | 17 /** |
12 * This UIProvider creates a widget to enter a single location (km). | 18 * This UIProvider creates a widget to enter a single location (km). |
13 */ | 19 */ |
87 | 93 |
88 data[values.length] = createDataArray("ld_mode", "locations"); | 94 data[values.length] = createDataArray("ld_mode", "locations"); |
89 | 95 |
90 return data; | 96 return data; |
91 } | 97 } |
98 | |
99 | |
100 /* This is a copy of super.super.onRecordClick. Straighten out | |
101 this weird family. */ | |
102 /** | |
103 * Callback when an item from the input helper was clicked. | |
104 * Set the respective km-value in the location value field. | |
105 * @param e event passed. | |
106 */ | |
107 public void onRecordClick (RecordClickEvent e) { | |
108 Record record = e.getRecord(); | |
109 double[] selected = new double[1]; | |
110 try { | |
111 selected[0] = | |
112 Double.parseDouble(record.getAttribute("from")); | |
113 } | |
114 catch(NumberFormatException nfe) { | |
115 // Is there anything else to do here? | |
116 } | |
117 setLocationValues(selected); | |
118 } | |
92 } | 119 } |
93 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : | 120 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |