com.vaadin.data.util
Class AbstractContainer

java.lang.Object
  extended by com.vaadin.data.util.AbstractContainer
All Implemented Interfaces:
Container, Serializable
Direct Known Subclasses:
AbstractInMemoryContainer

public abstract class AbstractContainer
extends Object
implements Container

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:
Serialized Form

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)
Implementation of the corresponding method in PropertySetChangeNotifier, override with the corresponding public method and implement the interface to use this.

See Also:
PropertySetChangeNotifier#addListener(com.vaadin.data.Container.PropertySetChangeListener)

removeListener

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.

See Also:
PropertySetChangeNotifier#removeListener(com.vaadin.data.Container. PropertySetChangeListener)

addListener

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.

See Also:
ItemSetChangeNotifier#addListener(com.vaadin.data.Container.ItemSetChangeListener)

removeListener

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.

See Also:
ItemSetChangeNotifier#removeListener(com.vaadin.data.Container.ItemSetChangeListener)

fireContainerPropertySetChange

protected void fireContainerPropertySetChange()
Sends a simple Property set change event to all interested listeners.


fireContainerPropertySetChange

protected void fireContainerPropertySetChange(Container.PropertySetChangeEvent event)
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.

Parameters:
event - the property change event to send, optionally with additional information

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)
Sends an Item set change event to all registered interested listeners.

Parameters:
event - the item set change event to send, optionally with additional information

setPropertySetChangeListeners

protected void setPropertySetChangeListeners(Collection<Container.PropertySetChangeListener> propertySetChangeListeners)
Sets the property set change listener collection. For internal use only.

Parameters:
propertySetChangeListeners -

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)
Sets the item set change listener collection. For internal use only.

Parameters:
itemSetChangeListeners -

getItemSetChangeListeners

protected Collection<Container.ItemSetChangeListener> getItemSetChangeListeners()
Returns the item set change listener collection. For internal use only.


getListeners

public Collection<?> getListeners(Class<?> eventType)


Copyright © 2000-2011 Vaadin Ltd. All Rights Reserved.