comparison flys-client/src/main/java/de/intevation/flys/client/client/ui/LocationDistancePanel.java @ 588:809756dda091

#132 Set the initial mode of the location/distance panel to 'distance'. flys-client/trunk@2183 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Tue, 21 Jun 2011 16:41:09 +0000
parents 78907f0fb939
children ba1b27b7d282
comparison
equal deleted inserted replaced
587:53ad6dd2cb2b 588:809756dda091
502 DataItem sDef = s.getDefault(); 502 DataItem sDef = s.getDefault();
503 503
504 String mDefValue = mDef != null ? mDef.getStringValue() : null; 504 String mDefValue = mDef != null ? mDef.getStringValue() : null;
505 String theMode = mDefValue != null && mDefValue.length() > 0 505 String theMode = mDefValue != null && mDefValue.length() > 0
506 ? mDef.getStringValue() 506 ? mDef.getStringValue()
507 : FIELD_VALUE_LOCATION; 507 : FIELD_VALUE_DISTANCE;
508 508
509 mode.setValue(FIELD_MODE, theMode); 509 mode.setValue(FIELD_MODE, theMode);
510 510
511 String fDefValue = fDef != null ? fDef.getStringValue() : null; 511 String fDefValue = fDef != null ? fDef.getStringValue() : null;
512 setFrom(fDefValue != null && fDefValue.length() > 0 512 setFrom(fDefValue != null && fDefValue.length() > 0
531 } 531 }
532 } 532 }
533 533
534 if (theMode.equals(FIELD_VALUE_DISTANCE)) { 534 if (theMode.equals(FIELD_VALUE_DISTANCE)) {
535 enableDistancePanel(); 535 enableDistancePanel();
536 inputTables.selectTab(1);
536 } 537 }
537 } 538 }
538 539
539 540
540 protected Canvas createWidget(DataList data) { 541 protected Canvas createWidget(DataList data) {
1001 LinkedHashMap values = new LinkedHashMap(); 1002 LinkedHashMap values = new LinkedHashMap();
1002 values.put(FIELD_VALUE_LOCATION, MESSAGES.location()); 1003 values.put(FIELD_VALUE_LOCATION, MESSAGES.location());
1003 values.put(FIELD_VALUE_DISTANCE, MESSAGES.distance()); 1004 values.put(FIELD_VALUE_DISTANCE, MESSAGES.distance());
1004 1005
1005 LinkedHashMap initial = new LinkedHashMap(); 1006 LinkedHashMap initial = new LinkedHashMap();
1006 initial.put(FIELD_MODE, FIELD_VALUE_LOCATION); 1007 initial.put(FIELD_MODE, FIELD_VALUE_DISTANCE);
1007 1008
1008 radio.setValueMap(values); 1009 radio.setValueMap(values);
1009 radio.addChangeHandler(this); 1010 radio.addChangeHandler(this);
1010 1011
1011 mode.setFields(radio); 1012 mode.setFields(radio);

http://dive4elements.wald.intevation.org