diff options
author | Henri Sara <henri.sara@itmill.com> | 2011-06-16 07:19:43 +0000 |
---|---|---|
committer | Henri Sara <henri.sara@itmill.com> | 2011-06-16 07:19:43 +0000 |
commit | 79c52ac3d4756a6f8cbb94b9e7dc264ba61c5430 (patch) | |
tree | d2ede4345c21d3caffe5dd2873f10ccb4aabbfff /src/com/vaadin/data/util | |
parent | 3239587ad38fb20df82a235d732c10d88aebe5b8 (diff) | |
parent | 3547a37b82a25f2f8a7ecf4ca012094d62159ab3 (diff) | |
download | vaadin-framework-79c52ac3d4756a6f8cbb94b9e7dc264ba61c5430.tar.gz vaadin-framework-79c52ac3d4756a6f8cbb94b9e7dc264ba61c5430.zip |
Merge from 6.6
svn changeset:19412/svn branch:6.7
Diffstat (limited to 'src/com/vaadin/data/util')
-rw-r--r-- | src/com/vaadin/data/util/HierarchicalContainer.java | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/src/com/vaadin/data/util/HierarchicalContainer.java b/src/com/vaadin/data/util/HierarchicalContainer.java index d671dbc833..99de7a1352 100644 --- a/src/com/vaadin/data/util/HierarchicalContainer.java +++ b/src/com/vaadin/data/util/HierarchicalContainer.java @@ -471,6 +471,9 @@ public class HierarchicalContainer extends IndexedContainer implements if (filteredChildren != null) { filteredChildren = null; } + if (filteredParent != null) { + filteredParent = null; + } } enableAndFireContentsChangeEvents(); return success; @@ -516,18 +519,30 @@ public class HierarchicalContainer extends IndexedContainer implements if (c != null) { c.remove(itemId); + if (c.isEmpty()) { + children.remove(parentItemId); + } + // Found in the children list so might also be in the // filteredChildren list if (filteredChildren != null) { LinkedList<Object> f = filteredChildren .get(parentItemId); if (f != null) { - f.remove(parentItemId); + f.remove(itemId); + if (f.isEmpty()) { + filteredChildren.remove(parentItemId); + } } } } } parent.remove(itemId); + if (filteredParent != null) { + // Item id no longer has a parent as the item id is not in the + // container. + filteredParent.remove(itemId); + } noChildrenAllowed.remove(itemId); } @@ -642,6 +657,7 @@ public class HierarchicalContainer extends IndexedContainer implements // All filters removed filteredRoots = null; filteredChildren = null; + filteredParent = null; return super.doFilterContainer(hasFilters); } |