com.vaadin.data.util.
Class AbstractContainer
java.lang.Object
com.vaadin.data.util.AbstractContainer
All Implemented Interfaces:
Direct Known Subclasses:
Abstract container class that manages event listeners and sending events to
them (PropertySetChangeNotifier
, ItemSetChangeNotifier
).
Note that this class provides the internal implementations for both types of
events and notifiers as protected methods, but does not implement the
PropertySetChangeNotifier
and ItemSetChangeNotifier
interfaces directly. This way, subclasses can choose not to implement them.
Subclasses implementing those interfaces should also override the
corresponding #addListener()
and #removeListener()
methods to
make them public.
Since:
6.6
See Also:
Nested Class Summary | |
---|---|
protected static class |
AbstractContainer.BaseItemSetChangeEvent
An event object specifying the container whose Item set has
changed. |
protected static class |
AbstractContainer.BasePropertySetChangeEvent
An event object specifying the container whose Property set
has changed. |
Nested classes/interfaces inherited from interface com.vaadin.data.Container |
---|
Container.Editor, Container.Filter, Container.Filterable, Container.Hierarchical, Container.Indexed, Container.ItemSetChangeEvent, Container.ItemSetChangeListener, Container.ItemSetChangeNotifier, Container.Ordered, Container.PropertySetChangeEvent, Container.PropertySetChangeListener, Container.PropertySetChangeNotifier, Container.SimpleFilterable, Container.Sortable, Container.Viewer |
Constructor Summary | |
---|---|
AbstractContainer()
|
Method Summary | |
---|---|
protected void |
addListener(Container.ItemSetChangeListener listener)
Implementation of the corresponding method in ItemSetChangeNotifier , override with the corresponding public
method and implement the interface to use this. |
protected void |
addListener(Container.PropertySetChangeListener listener)
Implementation of the corresponding method in PropertySetChangeNotifier , override with the corresponding public
method and implement the interface to use this. |
protected void |
fireContainerPropertySetChange()
Sends a simple Property set change event to all interested listeners. |
protected void |
fireContainerPropertySetChange(Container.PropertySetChangeEvent event)
Sends a Property set change event to all interested listeners. |
protected void |
fireItemSetChange()
Sends a simple Item set change event to all interested listeners, indicating that anything in the contents may have changed (items added, removed etc.). |
protected void |
fireItemSetChange(Container.ItemSetChangeEvent event)
Sends an Item set change event to all registered interested listeners. |
protected Collection<Container.ItemSetChangeListener> |
getItemSetChangeListeners()
Returns the item set change listener collection. |
Collection<?> |
getListeners(Class<?> eventType)
|
protected Collection<Container.PropertySetChangeListener> |
getPropertySetChangeListeners()
Returns the property set change listener collection. |
protected void |
removeListener(Container.ItemSetChangeListener listener)
Implementation of the corresponding method in ItemSetChangeNotifier , override with the corresponding public
method and implement the interface to use this. |
protected void |
removeListener(Container.PropertySetChangeListener listener)
Implementation of the corresponding method in PropertySetChangeNotifier , override with the corresponding public
method and implement the interface to use this. |
protected void |
setItemSetChangeListeners(Collection<Container.ItemSetChangeListener> itemSetChangeListeners)
Sets the item set change listener collection. |
protected void |
setPropertySetChangeListeners(Collection<Container.PropertySetChangeListener> propertySetChangeListeners)
Sets the property set change listener collection. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.vaadin.data.Container |
---|
addContainerProperty, addItem, addItem, containsId, getContainerProperty, getContainerPropertyIds, getItem, getItemIds, getType, removeAllItems, removeContainerProperty, removeItem, size |
Constructor Detail |
---|
AbstractContainer
public AbstractContainer()
Method Detail |
---|
addListener
protected void addListener(Container.PropertySetChangeListener listener)
- See Also:
PropertySetChangeNotifier#addListener(com.vaadin.data.Container.PropertySetChangeListener)
Implementation of the corresponding method in
PropertySetChangeNotifier
, override with the corresponding public
method and implement the interface to use this.
removeListener
protected void removeListener(Container.PropertySetChangeListener listener)
- See Also:
PropertySetChangeNotifier#removeListener(com.vaadin.data.Container. PropertySetChangeListener)
Implementation of the corresponding method in
PropertySetChangeNotifier
, override with the corresponding public
method and implement the interface to use this.
addListener
protected void addListener(Container.ItemSetChangeListener listener)
- See Also:
ItemSetChangeNotifier#addListener(com.vaadin.data.Container.ItemSetChangeListener)
Implementation of the corresponding method in
ItemSetChangeNotifier
, override with the corresponding public
method and implement the interface to use this.
removeListener
protected void removeListener(Container.ItemSetChangeListener listener)
- See Also:
ItemSetChangeNotifier#removeListener(com.vaadin.data.Container.ItemSetChangeListener)
Implementation of the corresponding method in
ItemSetChangeNotifier
, override with the corresponding public
method and implement the interface to use this.
fireContainerPropertySetChange
protected void fireContainerPropertySetChange()
Sends a simple Property set change event to all interested listeners.
fireContainerPropertySetChange
protected void fireContainerPropertySetChange(Container.PropertySetChangeEvent event)
- Parameters:
event
- the property change event to send, optionally with additional information
Sends a Property set change event to all interested listeners.
Use fireContainerPropertySetChange()
instead of this method
unless additional information about the exact changes is available and
should be included in the event.
fireItemSetChange
protected void fireItemSetChange()
Sends a simple Item set change event to all interested listeners, indicating that anything in the contents may have changed (items added, removed etc.).
fireItemSetChange
protected void fireItemSetChange(Container.ItemSetChangeEvent event)
- Parameters:
event
- the item set change event to send, optionally with additional information
Sends an Item set change event to all registered interested listeners.
setPropertySetChangeListeners
protected void setPropertySetChangeListeners(Collection<Container.PropertySetChangeListener> propertySetChangeListeners)
- Parameters:
propertySetChangeListeners
-
Sets the property set change listener collection. For internal use only.
getPropertySetChangeListeners
protected Collection<Container.PropertySetChangeListener> getPropertySetChangeListeners()
Returns the property set change listener collection. For internal use only.
setItemSetChangeListeners
protected void setItemSetChangeListeners(Collection<Container.ItemSetChangeListener> itemSetChangeListeners)
- Parameters:
itemSetChangeListeners
-
Sets the item set change listener collection. For internal use only.
getItemSetChangeListeners
protected Collection<Container.ItemSetChangeListener> getItemSetChangeListeners()
Returns the item set change listener collection. For internal use only.
getListeners
public Collection<?> getListeners(Class<?> eventType)