summaryrefslogtreecommitdiffstats
path: root/server/src
diff options
context:
space:
mode:
authorAnna Koskinen <anna@vaadin.com>2013-01-11 13:14:56 +0200
committerAnna Koskinen <anna@vaadin.com>2013-01-11 13:14:56 +0200
commit96845bea4d6d1f01dc0d22d2a3f19058a883eb4a (patch)
treeb633721f3652985ec7faa5bbc9e0a68b6107942f /server/src
parentf9dca2ef3f4b25ef5516fefc5cf3b037e75996cd (diff)
downloadvaadin-framework-96845bea4d6d1f01dc0d22d2a3f19058a883eb4a.tar.gz
vaadin-framework-96845bea4d6d1f01dc0d22d2a3f19058a883eb4a.zip
Merge of (#5681) to Vaadin 7.
Column collapsing optimization. Change-Id: I3b27024569ee2c5aa464ff6a63e50dcf4a90a8ba
Diffstat (limited to 'server/src')
-rw-r--r--server/src/com/vaadin/ui/Table.java17
1 files changed, 12 insertions, 5 deletions
diff --git a/server/src/com/vaadin/ui/Table.java b/server/src/com/vaadin/ui/Table.java
index 7b6ccc00db..57f196d704 100644
--- a/server/src/com/vaadin/ui/Table.java
+++ b/server/src/com/vaadin/ui/Table.java
@@ -2717,13 +2717,20 @@ public class Table extends AbstractSelect implements Action.Container,
try {
final Object[] ids = (Object[]) variables
.get("collapsedcolumns");
+ Set<Object> idSet = new HashSet<Object>();
+ for (Object id : ids) {
+ idSet.add(columnIdMap.get(id.toString()));
+ }
for (final Iterator<Object> it = visibleColumns.iterator(); it
.hasNext();) {
- setColumnCollapsed(it.next(), false);
- }
- for (int i = 0; i < ids.length; i++) {
- setColumnCollapsed(columnIdMap.get(ids[i].toString()),
- true);
+ Object propertyId = it.next();
+ if (isColumnCollapsed(propertyId)) {
+ if (!idSet.contains(propertyId)) {
+ setColumnCollapsed(propertyId, false);
+ }
+ } else if (idSet.contains(propertyId)) {
+ setColumnCollapsed(propertyId, true);
+ }
}
} catch (final Exception e) {
// FIXME: Handle exception