diff options
author | Henri Sara <henri.sara@itmill.com> | 2011-02-28 14:37:24 +0000 |
---|---|---|
committer | Henri Sara <henri.sara@itmill.com> | 2011-02-28 14:37:24 +0000 |
commit | 5d278e372b7b431e3fd4dcc60417ec1cda313c2c (patch) | |
tree | e100ac14bdc8b67f8844c5bd647d7030a04ba618 /src/com/vaadin/data/util/AbstractBeanContainer.java | |
parent | 87b14ef3366f71c7cc29f371bb44d1c09d3d7c1d (diff) | |
download | vaadin-framework-5d278e372b7b431e3fd4dcc60417ec1cda313c2c.tar.gz vaadin-framework-5d278e372b7b431e3fd4dcc60417ec1cda313c2c.zip |
#6521 Container refactoring: AbstractContainer handling listener registrations and event firing
svn changeset:17504/svn branch:6.6
Diffstat (limited to 'src/com/vaadin/data/util/AbstractBeanContainer.java')
-rw-r--r-- | src/com/vaadin/data/util/AbstractBeanContainer.java | 57 |
1 files changed, 9 insertions, 48 deletions
diff --git a/src/com/vaadin/data/util/AbstractBeanContainer.java b/src/com/vaadin/data/util/AbstractBeanContainer.java index 7adc57257a..f8ea7ebdd1 100644 --- a/src/com/vaadin/data/util/AbstractBeanContainer.java +++ b/src/com/vaadin/data/util/AbstractBeanContainer.java @@ -60,9 +60,9 @@ import com.vaadin.data.Property.ValueChangeNotifier; * * @since 6.5 */ -public abstract class AbstractBeanContainer<IDTYPE, BEANTYPE> implements - Indexed, Filterable, Sortable, ValueChangeListener, - ItemSetChangeNotifier { +public abstract class AbstractBeanContainer<IDTYPE, BEANTYPE> extends + AbstractContainer implements Indexed, Filterable, Sortable, + ValueChangeListener, ItemSetChangeNotifier { /** * Resolver that maps beans to their (item) identifiers, removing the need @@ -183,12 +183,6 @@ public abstract class AbstractBeanContainer<IDTYPE, BEANTYPE> implements private transient LinkedHashMap<String, PropertyDescriptor> model; /** - * Collection of listeners interested in - * {@link Container.ItemSetChangeEvent ItemSetChangeEvent} events. - */ - private List<ItemSetChangeListener> itemSetChangeListeners; - - /** * Constructs a {@code AbstractBeanContainer} for beans of the given type. * * @param type @@ -274,47 +268,14 @@ public abstract class AbstractBeanContainer<IDTYPE, BEANTYPE> implements throw new UnsupportedOperationException(); } - /* - * (non-Javadoc) - * - * @see - * com.vaadin.data.Container.ItemSetChangeNotifier#addListener(com.vaadin - * .data.Container.ItemSetChangeListener) - */ - public void addListener(ItemSetChangeListener listener) { - if (itemSetChangeListeners == null) { - itemSetChangeListeners = new LinkedList<ItemSetChangeListener>(); - } - itemSetChangeListeners.add(listener); - } - - /* - * (non-Javadoc) - * - * @see - * com.vaadin.data.Container.ItemSetChangeNotifier#removeListener(com.vaadin - * .data.Container.ItemSetChangeListener) - */ - public void removeListener(ItemSetChangeListener listener) { - if (itemSetChangeListeners != null) { - itemSetChangeListeners.remove(listener); - } + @Override + public void addListener(Container.ItemSetChangeListener listener) { + super.addListener(listener); } - /** - * Send an ItemSetChange event to all listeners. - */ - protected void fireItemSetChange() { - if (itemSetChangeListeners != null) { - final Container.ItemSetChangeEvent event = new Container.ItemSetChangeEvent() { - public Container getContainer() { - return AbstractBeanContainer.this; - } - }; - for (ItemSetChangeListener listener : itemSetChangeListeners) { - listener.containerItemSetChange(event); - } - } + @Override + public void removeListener(Container.ItemSetChangeListener listener) { + super.removeListener(listener); } /* |