changeset 1537:2b104fa094e2

Added filter criterion and clear filter on tab selection changed and input mode changed. flys-client/trunk@3755 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Raimund Renkert <raimund.renkert@intevation.de>
date Tue, 24 Jan 2012 11:48:46 +0000
parents 4f4d29404dba
children 92f81eac034a
files flys-client/ChangeLog flys-client/src/main/java/de/intevation/flys/client/client/ui/LocationDistancePanel.java
diffstat 2 files changed, 16 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/flys-client/ChangeLog	Tue Jan 24 08:46:33 2012 +0000
+++ b/flys-client/ChangeLog	Tue Jan 24 11:48:46 2012 +0000
@@ -1,3 +1,9 @@
+2012-01-24  Raimund Renkert <raimund.renkert@intevation.de>
+
+	* src/main/java/de/intevation/flys/client/client/ui/LocationDistancePanel.java:
+	  Added filter criterion and clear filter on tab selection changed and
+	  input mode changed.
+
 2012-01-24  Raimund Renkert <raimund.renkert@intevation.de>
 
 	* src/main/java/de/intevation/flys/client/client/ui/LocationDistancePanel.java:
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/LocationDistancePanel.java	Tue Jan 24 08:46:33 2012 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/LocationDistancePanel.java	Tue Jan 24 11:48:46 2012 +0000
@@ -694,6 +694,7 @@
         inputTables.addTabSelectedHandler(new TabSelectedHandler() {
             public void onTabSelected(TabSelectedEvent evt) {
                 filterDescription.clear();
+                filterRange.clear();
             }
         });
 
@@ -827,9 +828,15 @@
                     new Criterion("to", OperatorId.LESS_OR_EQUAL, to)
                 });
 
+            AdvancedCriteria c3 =
+                new AdvancedCriteria(OperatorId.AND, new Criterion[] {
+                    new Criterion("from", OperatorId.LESS_OR_EQUAL, to),
+                    new Criterion("to", OperatorId.GREATER_OR_EQUAL, from)
+                });
+
             combinedFilter =
                 new AdvancedCriteria(OperatorId.OR, new Criterion[] {
-                    c1, c2
+                    c1, c2, c3
                 });
         }
         locationsTable.filterData(combinedFilter);
@@ -1127,6 +1134,7 @@
         if (value.equals(FIELD_VALUE_LOCATION)) {
             enableLocationPanel();
             filterDescription.clear();
+            filterRange.clear();
             // Remove the tab containing the locationDistanceTable.
             // The 'updateTab()' avoids the tab content to be destroyed.
             inputTables.updateTab(0, null);
@@ -1143,6 +1151,7 @@
         else {
             enableDistancePanel();
             filterDescription.clear();
+            filterRange.clear();
             // Remove the tab containing the locationTable.
             // The 'updateTab()' avoids the tab content to be destroyed.
             inputTables.updateTab(0, null);

http://dive4elements.wald.intevation.org