comparison flys-client/src/main/java/de/intevation/flys/client/client/ui/MultipleLocationPanel.java @ 4221:480de0dbca8e

Extended location input helper. The locationpicker has now an attribute whether the input is distance or location to display one or two clickable columns. Replaced the record click handler with cell click handler.
author Raimund Renkert <rrenkert@intevation.de>
date Tue, 23 Oct 2012 13:17:20 +0200
parents 03de5c424f95
children e70ff0a600a3
comparison
equal deleted inserted replaced
4220:a30647abf009 4221:480de0dbca8e
7 import com.smartgwt.client.util.SC; 7 import com.smartgwt.client.util.SC;
8 import com.smartgwt.client.widgets.Canvas; 8 import com.smartgwt.client.widgets.Canvas;
9 import com.smartgwt.client.widgets.Label; 9 import com.smartgwt.client.widgets.Label;
10 import com.smartgwt.client.widgets.form.fields.events.BlurEvent; 10 import com.smartgwt.client.widgets.form.fields.events.BlurEvent;
11 import com.smartgwt.client.widgets.form.fields.events.BlurHandler; 11 import com.smartgwt.client.widgets.form.fields.events.BlurHandler;
12 import com.smartgwt.client.widgets.grid.events.RecordClickEvent; 12 import com.smartgwt.client.widgets.grid.events.CellClickEvent;
13 import com.smartgwt.client.widgets.grid.events.RecordClickHandler; 13 import com.smartgwt.client.widgets.grid.events.CellClickHandler;
14 import com.smartgwt.client.widgets.layout.HLayout; 14 import com.smartgwt.client.widgets.layout.HLayout;
15 import com.smartgwt.client.widgets.layout.VLayout; 15 import com.smartgwt.client.widgets.layout.VLayout;
16 16
17 import de.intevation.flys.client.client.Config; 17 import de.intevation.flys.client.client.Config;
18 import de.intevation.flys.client.client.services.DistanceInfoService; 18 import de.intevation.flys.client.client.services.DistanceInfoService;
35 * 35 *
36 * @author <a href="mailto:raimund.renkert@intevation.de">Raimund Renkert</a> 36 * @author <a href="mailto:raimund.renkert@intevation.de">Raimund Renkert</a>
37 */ 37 */
38 public class MultipleLocationPanel 38 public class MultipleLocationPanel
39 extends LocationPanel 39 extends LocationPanel
40 implements RecordClickHandler 40 implements CellClickHandler
41 { 41 {
42 private static final long serialVersionUID = -3359966826794082718L; 42 private static final long serialVersionUID = -3359966826794082718L;
43 43
44 /** The DistanceInfoService used to retrieve locations about rivers. */ 44 /** The DistanceInfoService used to retrieve locations about rivers. */
45 protected DistanceInfoServiceAsync distanceInfoService = 45 protected DistanceInfoServiceAsync distanceInfoService =
315 * Callback when an item from the input helper was clicked. 315 * Callback when an item from the input helper was clicked.
316 * Set the respective km-value in the location value field. 316 * Set the respective km-value in the location value field.
317 * @param e event passed. 317 * @param e event passed.
318 */ 318 */
319 @Override 319 @Override
320 public void onRecordClick (RecordClickEvent e) { 320 public void onCellClick (CellClickEvent e) {
321 Record record = e.getRecord(); 321 Record record = e.getRecord();
322 double[] old = getLocationValues(); 322 double[] old = getLocationValues();
323 double[] selected = DoubleUtils.copyOf(old, old.length + 1); 323 double[] selected = DoubleUtils.copyOf(old, old.length + 1);
324 try { 324 try {
325 selected[old.length] = 325 selected[old.length] =

http://dive4elements.wald.intevation.org