diff options
author | Jonatan Kronqvist <jonatan@vaadin.com> | 2014-04-11 14:15:52 +0300 |
---|---|---|
committer | Jonatan Kronqvist <jonatan@vaadin.com> | 2014-04-11 11:16:58 +0000 |
commit | 51c2e93172b0132ead54573c74117efac29c1cec (patch) | |
tree | 8281be1f7f51cd5d0d40717d9547e81edd7fc2c5 /server/src/com/vaadin/data/util/AbstractBeanContainer.java | |
parent | ee4ae9fac8342f51ff5152cf878df125a743aef3 (diff) | |
download | vaadin-framework-51c2e93172b0132ead54573c74117efac29c1cec.tar.gz vaadin-framework-51c2e93172b0132ead54573c74117efac29c1cec.zip |
Revert "Added ItemSetAddEvent and ItemSetRemoveEvent (#2794)"
This reverts commit 85251833de3bd101d388b20fdb9b02c532a9f1c9.
Conflicts:
server/src/com/vaadin/data/util/AbstractInMemoryContainer.java
server/tests/src/com/vaadin/data/util/TestIndexedContainer.java
Change-Id: I49dfdc58ae5841892c6d8e205c520437da9a05e5
Diffstat (limited to 'server/src/com/vaadin/data/util/AbstractBeanContainer.java')
-rw-r--r-- | server/src/com/vaadin/data/util/AbstractBeanContainer.java | 20 |
1 files changed, 4 insertions, 16 deletions
diff --git a/server/src/com/vaadin/data/util/AbstractBeanContainer.java b/server/src/com/vaadin/data/util/AbstractBeanContainer.java index d94588bdc9..b19cdd980c 100644 --- a/server/src/com/vaadin/data/util/AbstractBeanContainer.java +++ b/server/src/com/vaadin/data/util/AbstractBeanContainer.java @@ -222,7 +222,6 @@ public abstract class AbstractBeanContainer<IDTYPE, BEANTYPE> extends @Override public boolean removeAllItems() { int origSize = size(); - IDTYPE firstItem = getFirstVisibleItem(); internalRemoveAllItems(); @@ -235,7 +234,7 @@ public abstract class AbstractBeanContainer<IDTYPE, BEANTYPE> extends // fire event only if the visible view changed, regardless of whether // filtered out items were removed or not if (origSize != 0) { - fireItemsRemoved(0, firstItem, origSize); + fireItemSetChange(); } return true; @@ -680,8 +679,6 @@ public abstract class AbstractBeanContainer<IDTYPE, BEANTYPE> extends protected void addAll(Collection<? extends BEANTYPE> collection) throws IllegalStateException, IllegalArgumentException { boolean modified = false; - int origSize = size(); - for (BEANTYPE bean : collection) { // TODO skipping invalid beans - should not allow them in javadoc? if (bean == null @@ -702,22 +699,13 @@ public abstract class AbstractBeanContainer<IDTYPE, BEANTYPE> extends if (modified) { // Filter the contents when all items have been added if (isFiltered()) { - doFilterContainer(!getFilters().isEmpty()); - } - if (visibleNewItemsWasAdded(origSize)) { - // fire event about added items - int firstPosition = origSize; - IDTYPE firstItemId = getVisibleItemIds().get(firstPosition); - int affectedItems = size() - origSize; - fireItemsAdded(firstPosition, firstItemId, affectedItems); + filterAll(); + } else { + fireItemSetChange(); } } } - private boolean visibleNewItemsWasAdded(int origSize) { - return size() > origSize; - } - /** * Use the bean resolver to get the identifier for a bean. * |