[PATCH 3 of 3] (issue1733) Fix switch between location and distance
Wald Commits
scm-commit at wald.intevation.org
Mon Oct 27 14:37:22 CET 2014
# HG changeset patch
# User Andre Heinecke <andre.heinecke at intevation.de>
# Date 1414410720 -3600
# Node ID e98dbf72c9ecc05d6b4435f4646bbc0f8c560924
# Parent 4b315e5d2d4f6de88cfab53fdbc25b9a6f867b58
(issue1733) Fix switch between location and distance
This changes the enable methods to state switchers. Combining
them avoids the problem that they could be out of sync.
diff -r 4b315e5d2d4f -r e98dbf72c9ec gwt-client/src/main/java/org/dive4elements/river/client/client/ui/LocationDistancePanel.java
--- a/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/LocationDistancePanel.java Mon Oct 27 12:38:22 2014 +0100
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/LocationDistancePanel.java Mon Oct 27 12:52:00 2014 +0100
@@ -692,7 +692,7 @@
}
if (theMode.equals(FIELD_VALUE_DISTANCE)) {
- enableDistancePanel();
+ enableDistanceMode();
inputTables.selectTab(1);
}
currentFiltered = (ListGrid)inputTables.getSelectedTab().getPane();
@@ -734,6 +734,13 @@
filterRange.clear();
filterResultCount.setValue("");
+ // The assumption is that location is tab 0 and distance tab 1
+ if (inputTables.getSelectedTabNumber() == 0) {
+ enableLocationMode();
+ } else {
+ enableDistanceMode();
+ }
+
Canvas c = evt.getTabPane();
if(c instanceof ListGrid) {
currentFiltered = (ListGrid)c;
@@ -1157,7 +1164,8 @@
/**
* Activates the location panel.
*/
- protected void enableLocationPanel() {
+ protected void enableLocationMode() {
+ mode.setValue(FIELD_MODE, FIELD_VALUE_LOCATION);
container.hideMember(distancePanel);
container.showMember(locationPanel);
}
@@ -1166,7 +1174,8 @@
/**
* Activates the distance panel.
*/
- protected void enableDistancePanel() {
+ protected void enableDistanceMode() {
+ mode.setValue(FIELD_MODE, FIELD_VALUE_DISTANCE);
container.hideMember(locationPanel);
container.showMember(distancePanel);
}
@@ -1185,8 +1194,7 @@
return;
}
if (value.equals(FIELD_VALUE_LOCATION)) {
- event.getItem().setValue(FIELD_VALUE_LOCATION);
- enableLocationPanel();
+ enableLocationMode();
filterDescription.clear();
filterRange.clear();
filterResultCount.setValue("");
@@ -1195,8 +1203,7 @@
inputTables.selectTab(0);
}
else {
- event.getItem().setValue(FIELD_VALUE_DISTANCE);
- enableDistancePanel();
+ enableDistanceMode();
filterDescription.clear();
filterRange.clear();
filterResultCount.setValue("");
More information about the Dive4Elements-commits
mailing list