Mercurial > dive4elements > river
comparison flys-client/src/main/java/de/intevation/flys/client/client/ui/LocationDistancePanel.java @ 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 | e2f74131ffc1 |
comparison
equal
deleted
inserted
replaced
1536:4f4d29404dba | 1537:2b104fa094e2 |
---|---|
692 | 692 |
693 inputTables = new TabSet(); | 693 inputTables = new TabSet(); |
694 inputTables.addTabSelectedHandler(new TabSelectedHandler() { | 694 inputTables.addTabSelectedHandler(new TabSelectedHandler() { |
695 public void onTabSelected(TabSelectedEvent evt) { | 695 public void onTabSelected(TabSelectedEvent evt) { |
696 filterDescription.clear(); | 696 filterDescription.clear(); |
697 filterRange.clear(); | |
697 } | 698 } |
698 }); | 699 }); |
699 | 700 |
700 Tab locations = new Tab(MESSAGES.locations()); | 701 Tab locations = new Tab(MESSAGES.locations()); |
701 Tab distances = new Tab(MESSAGES.distance()); | 702 Tab distances = new Tab(MESSAGES.distance()); |
825 new AdvancedCriteria(OperatorId.AND, new Criterion[] { | 826 new AdvancedCriteria(OperatorId.AND, new Criterion[] { |
826 new Criterion("to", OperatorId.GREATER_OR_EQUAL, from), | 827 new Criterion("to", OperatorId.GREATER_OR_EQUAL, from), |
827 new Criterion("to", OperatorId.LESS_OR_EQUAL, to) | 828 new Criterion("to", OperatorId.LESS_OR_EQUAL, to) |
828 }); | 829 }); |
829 | 830 |
831 AdvancedCriteria c3 = | |
832 new AdvancedCriteria(OperatorId.AND, new Criterion[] { | |
833 new Criterion("from", OperatorId.LESS_OR_EQUAL, to), | |
834 new Criterion("to", OperatorId.GREATER_OR_EQUAL, from) | |
835 }); | |
836 | |
830 combinedFilter = | 837 combinedFilter = |
831 new AdvancedCriteria(OperatorId.OR, new Criterion[] { | 838 new AdvancedCriteria(OperatorId.OR, new Criterion[] { |
832 c1, c2 | 839 c1, c2, c3 |
833 }); | 840 }); |
834 } | 841 } |
835 locationsTable.filterData(combinedFilter); | 842 locationsTable.filterData(combinedFilter); |
836 distanceTable.filterData(combinedFilter); | 843 distanceTable.filterData(combinedFilter); |
837 locationDistanceTable.filterData(combinedFilter); | 844 locationDistanceTable.filterData(combinedFilter); |
1125 return; | 1132 return; |
1126 } | 1133 } |
1127 if (value.equals(FIELD_VALUE_LOCATION)) { | 1134 if (value.equals(FIELD_VALUE_LOCATION)) { |
1128 enableLocationPanel(); | 1135 enableLocationPanel(); |
1129 filterDescription.clear(); | 1136 filterDescription.clear(); |
1137 filterRange.clear(); | |
1130 // Remove the tab containing the locationDistanceTable. | 1138 // Remove the tab containing the locationDistanceTable. |
1131 // The 'updateTab()' avoids the tab content to be destroyed. | 1139 // The 'updateTab()' avoids the tab content to be destroyed. |
1132 inputTables.updateTab(0, null); | 1140 inputTables.updateTab(0, null); |
1133 inputTables.removeTab(0); | 1141 inputTables.removeTab(0); |
1134 | 1142 |
1141 inputTables.selectTab(0); | 1149 inputTables.selectTab(0); |
1142 } | 1150 } |
1143 else { | 1151 else { |
1144 enableDistancePanel(); | 1152 enableDistancePanel(); |
1145 filterDescription.clear(); | 1153 filterDescription.clear(); |
1154 filterRange.clear(); | |
1146 // Remove the tab containing the locationTable. | 1155 // Remove the tab containing the locationTable. |
1147 // The 'updateTab()' avoids the tab content to be destroyed. | 1156 // The 'updateTab()' avoids the tab content to be destroyed. |
1148 inputTables.updateTab(0, null); | 1157 inputTables.updateTab(0, null); |
1149 inputTables.removeTab(0); | 1158 inputTables.removeTab(0); |
1150 | 1159 |