com.vaadin.data.util
Class AbstractBeanContainer<IDTYPE,BEANTYPE>

java.lang.Object
  extended by com.vaadin.data.util.AbstractContainer
      extended by com.vaadin.data.util.AbstractInMemoryContainer<IDTYPE,String,BeanItem<BEANTYPE>>
          extended by com.vaadin.data.util.AbstractBeanContainer<IDTYPE,BEANTYPE>
Type Parameters:
IDTYPE - The type of the item identifier
BEANTYPE - The type of the Bean
All Implemented Interfaces:
Container, Container.Filterable, Container.Indexed, Container.ItemSetChangeNotifier, Container.Ordered, Container.PropertySetChangeNotifier, Container.SimpleFilterable, Container.Sortable, Property.ValueChangeListener, Serializable
Direct Known Subclasses:
BeanContainer, BeanItemContainer

public abstract class AbstractBeanContainer<IDTYPE,BEANTYPE>
extends AbstractInMemoryContainer<IDTYPE,String,BeanItem<BEANTYPE>>
implements Container.Filterable, Container.SimpleFilterable, Container.Sortable, Property.ValueChangeListener, Container.PropertySetChangeNotifier

An abstract base class for in-memory containers for JavaBeans.

The properties of the container are determined automatically by introspecting the used JavaBean class and explicitly adding or removing properties is not supported. Only beans of the same type can be added to the container.

Subclasses should implement any public methods adding items to the container, typically calling the protected methods addItem(Object, Object), addItemAfter(Object, Object, Object) and addItemAt(int, Object, Object).

Since:
6.5
See Also:
Serialized Form

Nested Class Summary
static interface AbstractBeanContainer.BeanIdResolver<IDTYPE,BEANTYPE>
          Resolver that maps beans to their (item) identifiers, removing the need to explicitly specify item identifiers when there is no need to customize this.
protected  class AbstractBeanContainer.PropertyBasedBeanIdResolver
          A item identifier resolver that returns the value of a bean property.
 
Nested classes/interfaces inherited from class com.vaadin.data.util.AbstractContainer
AbstractContainer.BaseItemSetChangeEvent, AbstractContainer.BasePropertySetChangeEvent
 
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
protected AbstractBeanContainer(Class<? super BEANTYPE> type)
          Constructs a AbstractBeanContainer for beans of the given type.
 
Method Summary
protected  void addAll(Collection<? extends BEANTYPE> collection)
          Adds all the beans from a Collection in one operation using the bean item identifier resolver.
protected  BeanItem<BEANTYPE> addBean(BEANTYPE bean)
          Adds a bean to the container using the bean item id resolver to find its identifier.
protected  BeanItem<BEANTYPE> addBeanAfter(IDTYPE previousItemId, BEANTYPE bean)
          Adds a bean to the container after a specified item identifier, using the bean item id resolver to find its identifier.
protected  BeanItem<BEANTYPE> addBeanAt(int index, BEANTYPE bean)
          Adds a bean at a specified (filtered view) position in the container using the bean item id resolver to find its identifier.
 void addContainerFilter(Container.Filter filter)
          Adds a filter for the container.
 void addContainerFilter(Object propertyId, String filterString, boolean ignoreCase, boolean onlyMatchPrefix)
          Add a filter for given property.
 boolean addContainerProperty(Object propertyId, Class<?> type, Object defaultValue)
          Adds a new Property to all Items in the Container.
protected  boolean addContainerProperty(String propertyId, VaadinPropertyDescriptor<BEANTYPE> propertyDescriptor)
          Adds a property for the container and all its items.
protected  BeanItem<BEANTYPE> addItem(IDTYPE itemId, BEANTYPE bean)
          Adds the bean to the Container.
protected  BeanItem<BEANTYPE> addItemAfter(IDTYPE previousItemId, IDTYPE newItemId, BEANTYPE bean)
          Adds the bean after the given bean.
protected  BeanItem<BEANTYPE> addItemAt(int index, IDTYPE newItemId, BEANTYPE bean)
          Adds a new bean at the given index.
 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.
 void addNestedContainerBean(String propertyId)
          Adds a nested container properties for all sub-properties of a named property to the container.
 boolean addNestedContainerProperty(String propertyId)
          Adds a nested container property for the container, e.g.
protected  BeanItem<BEANTYPE> createBeanItem(BEANTYPE bean)
          Create a BeanItem for a bean using pre-parsed bean metadata (based on getBeanType()).
protected  AbstractBeanContainer.BeanIdResolver<IDTYPE,BEANTYPE> createBeanPropertyResolver(Object propertyId)
          Create an item identifier resolver using a named bean property.
 AbstractBeanContainer.BeanIdResolver<IDTYPE,BEANTYPE> getBeanIdResolver()
          Returns the resolver that finds the item ID for a bean.
 Class<? super BEANTYPE> getBeanType()
          Returns the type of beans this Container can contain.
 Property<?> getContainerProperty(Object itemId, Object propertyId)
          Gets the Property identified by the given itemId and propertyId from the Container.
 Collection<String> getContainerPropertyIds()
          Gets the ID's of all Properties stored in the Container.
 BeanItem<BEANTYPE> getItem(Object itemId)
          Gets the Item with the given Item ID from the Container.
 List<IDTYPE> getItemIds()
          Gets the ID's of all visible (after filtering and sorting) Items stored in the Container.
 ItemSorter getItemSorter()
          Returns the ItemSorter used for comparing items in a sort.
 Collection<?> getSortableContainerPropertyIds()
          Gets the container property IDs which can be used to sort the items.
 Class<?> getType(Object propertyId)
          Gets the data type of all Properties identified by the given Property ID.
protected  BeanItem<BEANTYPE> getUnfilteredItem(Object itemId)
          Get an item even if filtered out.
protected  void registerNewItem(int position, IDTYPE itemId, BeanItem<BEANTYPE> item)
          Registers a new item as having been added to the container.
 void removeAllContainerFilters()
          Remove all active filters from the container.
 boolean removeAllItems()
          Removes all Items from the Container.
 void removeContainerFilter(Container.Filter filter)
          Removes a filter from the container.
 void removeContainerFilters(Object propertyId)
          Remove all filters from the given property.
 boolean removeContainerProperty(Object propertyId)
          Removes a Property specified by the given Property ID from the Container.
 boolean removeItem(Object itemId)
          Removes the Item identified by ItemId from the Container.
 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  IDTYPE resolveBeanId(BEANTYPE bean)
          Use the bean resolver to get the identifier for a bean.
protected  void setBeanIdResolver(AbstractBeanContainer.BeanIdResolver<IDTYPE,BEANTYPE> beanIdResolver)
          Sets the resolver that finds the item id for a bean, or null not to use automatic resolving.
 void setItemSorter(ItemSorter itemSorter)
          Sets the ItemSorter used for comparing items in a sort.
 void sort(Object[] propertyId, boolean[] ascending)
          Sort method.
 void valueChange(Property.ValueChangeEvent event)
          Re-filter the container when one of the monitored properties changes.
 
Methods inherited from class com.vaadin.data.util.AbstractInMemoryContainer
addFilter, addItem, addItem, addItemAfter, addItemAfter, addItemAt, addItemAt, addListener, containsId, doFilterContainer, doSort, filterAll, fireItemAdded, fireItemRemoved, firstItemId, getAllItemIds, getFilteredItemIds, getFilters, getIdByIndex, getSortablePropertyIds, getVisibleItemIds, indexOfId, internalAddItemAfter, internalAddItemAt, internalAddItemAtEnd, internalRemoveAllItems, internalRemoveItem, isFiltered, isFirstId, isLastId, isPropertyFiltered, lastItemId, nextItemId, passesFilters, prevItemId, removeAllFilters, removeFilter, removeFilters, removeListener, setAllItemIds, setFilteredItemIds, setFilters, size, sortContainer
 
Methods inherited from class com.vaadin.data.util.AbstractContainer
fireContainerPropertySetChange, fireContainerPropertySetChange, fireItemSetChange, fireItemSetChange, getItemSetChangeListeners, getListeners, getPropertySetChangeListeners, setItemSetChangeListeners, setPropertySetChangeListeners
 
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.Ordered
addItemAfter, addItemAfter, firstItemId, isFirstId, isLastId, lastItemId, nextItemId, prevItemId
 
Methods inherited from interface com.vaadin.data.Container
addItem, addItem, containsId, size
 

Constructor Detail

AbstractBeanContainer

protected AbstractBeanContainer(Class<? super BEANTYPE> type)
Constructs a AbstractBeanContainer for beans of the given type.

Parameters:
type - the type of the beans that will be added to the container.
Throws:
IllegalArgumentException - If type is null
Method Detail

getType

public Class<?> getType(Object propertyId)
Description copied from interface: Container
Gets the data type of all Properties identified by the given Property ID.

Specified by:
getType in interface Container
Parameters:
propertyId - ID identifying the Properties
Returns:
data type of the Properties

createBeanItem

protected BeanItem<BEANTYPE> createBeanItem(BEANTYPE bean)
Create a BeanItem for a bean using pre-parsed bean metadata (based on getBeanType()).

Parameters:
bean -
Returns:
created BeanItem or null if bean is null

getBeanType

public Class<? super BEANTYPE> getBeanType()
Returns the type of beans this Container can contain. This comes from the bean type constructor parameter, and bean metadata (including container properties) is based on this.

Returns:

getContainerPropertyIds

public Collection<String> getContainerPropertyIds()
Description copied from interface: Container
Gets the ID's of all Properties stored in the Container. The ID's cannot be modified through the returned collection.

Specified by:
getContainerPropertyIds in interface Container
Returns:
unmodifiable collection of Property IDs

removeAllItems

public boolean removeAllItems()
Description copied from interface: Container
Removes all Items from the Container.

Note that Property ID and type information is preserved. This functionality is optional.

Specified by:
removeAllItems in interface Container
Overrides:
removeAllItems in class AbstractInMemoryContainer<IDTYPE,String,BeanItem<BEANTYPE>>
Returns:
true if the operation succeeded, false if not

getItem

public BeanItem<BEANTYPE> getItem(Object itemId)
Description copied from interface: Container
Gets the Item with the given Item ID from the Container. If the Container does not contain the requested Item, null is returned. Containers should not return Items that are filtered out.

Specified by:
getItem in interface Container
Overrides:
getItem in class AbstractInMemoryContainer<IDTYPE,String,BeanItem<BEANTYPE>>
Parameters:
itemId - ID of the Item to retrieve
Returns:
the Item with the given ID or null if the Item is not found in the Container

getUnfilteredItem

protected BeanItem<BEANTYPE> getUnfilteredItem(Object itemId)
Description copied from class: AbstractInMemoryContainer
Get an item even if filtered out. For internal use only.

Specified by:
getUnfilteredItem in class AbstractInMemoryContainer<IDTYPE,String,BeanItem<BEANTYPE>>
Returns:

getItemIds

public List<IDTYPE> getItemIds()
Description copied from interface: Container
Gets the ID's of all visible (after filtering and sorting) Items stored in the Container. The ID's cannot be modified through the returned collection. If the container is Container.Ordered, the collection returned by this method should follow that order. If the container is Container.Sortable, the items should be in the sorted order. Calling this method for large lazy containers can be an expensive operation and should be avoided when practical.

Specified by:
getItemIds in interface Container
Overrides:
getItemIds in class AbstractInMemoryContainer<IDTYPE,String,BeanItem<BEANTYPE>>
Returns:
unmodifiable collection of Item IDs

getContainerProperty

public Property<?> getContainerProperty(Object itemId,
                                        Object propertyId)
Description copied from interface: Container
Gets the Property identified by the given itemId and propertyId from the Container. If the Container does not contain the item or it is filtered out, or the Container does not have the Property, null is returned.

Specified by:
getContainerProperty in interface Container
Parameters:
itemId - ID of the visible Item which contains the Property
propertyId - ID of the Property to retrieve
Returns:
Property with the given ID or null

removeItem

public boolean removeItem(Object itemId)
Description copied from interface: Container
Removes the Item identified by ItemId from the Container.

Containers that support filtering should also allow removing an item that is currently filtered out.

This functionality is optional.

Specified by:
removeItem in interface Container
Overrides:
removeItem in class AbstractInMemoryContainer<IDTYPE,String,BeanItem<BEANTYPE>>
Parameters:
itemId - ID of the Item to remove
Returns:
true if the operation succeeded, false if not

valueChange

public void valueChange(Property.ValueChangeEvent event)
Re-filter the container when one of the monitored properties changes.

Specified by:
valueChange in interface Property.ValueChangeListener
Parameters:
event - value change event object

addContainerFilter

public void addContainerFilter(Object propertyId,
                               String filterString,
                               boolean ignoreCase,
                               boolean onlyMatchPrefix)
Description copied from interface: Container.SimpleFilterable
Add a filter for given property. The API Filterable#addContainerFilter(Filter) is recommended instead of this method. A SimpleStringFilter can be used with the new API to implement the old string filtering functionality. The filter accepts items for which toString() of the value of the given property contains or starts with given filterString. Other items are not visible in the container when filtered. If a container has multiple filters, only items accepted by all filters are visible.

Specified by:
addContainerFilter in interface Container.SimpleFilterable
Parameters:
propertyId - Property for which the filter is applied to.
filterString - String that must match the value of the property
ignoreCase - Determine if the casing can be ignored when comparing strings.
onlyMatchPrefix - Only match prefixes; no other matches are included.

removeAllContainerFilters

public void removeAllContainerFilters()
Description copied from interface: Container.Filterable
Remove all active filters from the container.

Specified by:
removeAllContainerFilters in interface Container.Filterable
Specified by:
removeAllContainerFilters in interface Container.SimpleFilterable

removeContainerFilters

public void removeContainerFilters(Object propertyId)
Description copied from interface: Container.SimpleFilterable
Remove all filters from the given property.

Specified by:
removeContainerFilters in interface Container.SimpleFilterable
Parameters:
propertyId - for which to remove filters

addContainerFilter

public void addContainerFilter(Container.Filter filter)
                        throws UnsupportedFilterException
Description copied from interface: Container.Filterable
Adds a filter for the container. If a container has multiple filters, only items accepted by all filters are visible.

Specified by:
addContainerFilter in interface Container.Filterable
Throws:
UnsupportedFilterException - if the filter is not supported by the container

removeContainerFilter

public void removeContainerFilter(Container.Filter filter)
Description copied from interface: Container.Filterable
Removes a filter from the container. This requires that the equals() method considers the filters as equivalent (same instance or properly implemented equals() method).

Specified by:
removeContainerFilter in interface Container.Filterable

getSortableContainerPropertyIds

public Collection<?> getSortableContainerPropertyIds()
Description copied from interface: Container.Sortable
Gets the container property IDs which can be used to sort the items.

Specified by:
getSortableContainerPropertyIds in interface Container.Sortable
Returns:
the IDs of the properties that can be used for sorting the container

sort

public void sort(Object[] propertyId,
                 boolean[] ascending)
Description copied from interface: Container.Sortable
Sort method. Sorts the container items. Sorting a container can irreversibly change the order of its items or only change the order temporarily, depending on the container.

Specified by:
sort in interface Container.Sortable
Parameters:
propertyId - Array of container property IDs, whose values are used to sort the items in container as primary, secondary, ... sorting criterion. All of the item IDs must be in the collection returned by Container.Sortable.getSortableContainerPropertyIds()
ascending - Array of sorting order flags corresponding to each property ID used in sorting. If this array is shorter than propertyId array, ascending order is assumed for items where the order is not specified. Use true to sort in ascending order, false to use descending order.

getItemSorter

public ItemSorter getItemSorter()
Description copied from class: AbstractInMemoryContainer
Returns the ItemSorter used for comparing items in a sort. See AbstractInMemoryContainer.setItemSorter(ItemSorter) for more information.

Overrides:
getItemSorter in class AbstractInMemoryContainer<IDTYPE,String,BeanItem<BEANTYPE>>
Returns:
The ItemSorter used for comparing two items in a sort.

setItemSorter

public void setItemSorter(ItemSorter itemSorter)
Description copied from class: AbstractInMemoryContainer
Sets the ItemSorter used for comparing items in a sort. The ItemSorter.compare(Object, Object) method is called with item ids to perform the sorting. A default ItemSorter is used if this is not explicitly set.

Overrides:
setItemSorter in class AbstractInMemoryContainer<IDTYPE,String,BeanItem<BEANTYPE>>
Parameters:
itemSorter - The ItemSorter used for comparing two items in a sort (not null).

registerNewItem

protected void registerNewItem(int position,
                               IDTYPE itemId,
                               BeanItem<BEANTYPE> item)
Description copied from class: AbstractInMemoryContainer
Registers a new item as having been added to the container. This can involve storing the item or any relevant information about it in internal container-specific collections if necessary, as well as registering listeners etc. The full identifier list in AbstractInMemoryContainer has already been updated to reflect the new item when this method is called.

Overrides:
registerNewItem in class AbstractInMemoryContainer<IDTYPE,String,BeanItem<BEANTYPE>>

addItem

protected BeanItem<BEANTYPE> addItem(IDTYPE itemId,
                                     BEANTYPE bean)
Adds the bean to the Container. Note: the behavior of this method changed in Vaadin 6.6 - now items are added at the very end of the unfiltered container and not after the last visible item if filtering is used.

See Also:
Container.addItem(Object)

addItemAfter

protected BeanItem<BEANTYPE> addItemAfter(IDTYPE previousItemId,
                                          IDTYPE newItemId,
                                          BEANTYPE bean)
Adds the bean after the given bean.

See Also:
Container.Ordered.addItemAfter(Object, Object)

addItemAt

protected BeanItem<BEANTYPE> addItemAt(int index,
                                       IDTYPE newItemId,
                                       BEANTYPE bean)
Adds a new bean at the given index. The bean is used both as the item contents and as the item identifier.

Parameters:
index - Index at which the bean should be added.
newItemId - The item id for the bean to add to the container.
bean - The bean to add to the container.
Returns:
Returns the new BeanItem or null if the operation fails.

addBean

protected BeanItem<BEANTYPE> addBean(BEANTYPE bean)
                              throws IllegalStateException,
                                     IllegalArgumentException
Adds a bean to the container using the bean item id resolver to find its identifier. A bean id resolver must be set before calling this method.

Parameters:
bean - the bean to add
Returns:
BeanItem item added or null
Throws:
IllegalStateException - if no bean identifier resolver has been set
IllegalArgumentException - if an identifier cannot be resolved for the bean
See Also:
addItem(Object, Object)

addBeanAfter

protected BeanItem<BEANTYPE> addBeanAfter(IDTYPE previousItemId,
                                          BEANTYPE bean)
                                   throws IllegalStateException,
                                          IllegalArgumentException
Adds a bean to the container after a specified item identifier, using the bean item id resolver to find its identifier. A bean id resolver must be set before calling this method.

Parameters:
previousItemId - the identifier of the bean after which this bean should be added, null to add to the beginning
bean - the bean to add
Returns:
BeanItem item added or null
Throws:
IllegalStateException - if no bean identifier resolver has been set
IllegalArgumentException - if an identifier cannot be resolved for the bean
See Also:
addItemAfter(Object, Object, Object)

addBeanAt

protected BeanItem<BEANTYPE> addBeanAt(int index,
                                       BEANTYPE bean)
                                throws IllegalStateException,
                                       IllegalArgumentException
Adds a bean at a specified (filtered view) position in the container using the bean item id resolver to find its identifier. A bean id resolver must be set before calling this method.

Parameters:
index - the index (in the filtered view) at which to add the item
bean - the bean to add
Returns:
BeanItem item added or null
Throws:
IllegalStateException - if no bean identifier resolver has been set
IllegalArgumentException - if an identifier cannot be resolved for the bean
See Also:
addItemAfter(Object, Object, Object)

addAll

protected void addAll(Collection<? extends BEANTYPE> collection)
               throws IllegalStateException,
                      IllegalArgumentException
Adds all the beans from a Collection in one operation using the bean item identifier resolver. More efficient than adding them one by one. A bean id resolver must be set before calling this method. Note: the behavior of this method changed in Vaadin 6.6 - now items are added at the very end of the unfiltered container and not after the last visible item if filtering is used.

Parameters:
collection - The collection of beans to add. Must not be null.
Throws:
IllegalStateException - if no bean identifier resolver has been set
IllegalArgumentException - if the resolver returns a null itemId for one of the beans in the collection

resolveBeanId

protected IDTYPE resolveBeanId(BEANTYPE bean)
Use the bean resolver to get the identifier for a bean.

Parameters:
bean -
Returns:
resolved bean identifier, null if could not be resolved
Throws:
IllegalStateException - if no bean resolver is set

setBeanIdResolver

protected void setBeanIdResolver(AbstractBeanContainer.BeanIdResolver<IDTYPE,BEANTYPE> beanIdResolver)
Sets the resolver that finds the item id for a bean, or null not to use automatic resolving. Methods that add a bean without specifying an id must not be called if no resolver has been set. Note that methods taking an explicit id can be used whether a resolver has been defined or not.

Parameters:
beanIdResolver - to use or null to disable automatic id resolution

getBeanIdResolver

public AbstractBeanContainer.BeanIdResolver<IDTYPE,BEANTYPE> getBeanIdResolver()
Returns the resolver that finds the item ID for a bean.

Returns:
resolver used or null if automatic item id resolving is disabled

createBeanPropertyResolver

protected AbstractBeanContainer.BeanIdResolver<IDTYPE,BEANTYPE> createBeanPropertyResolver(Object propertyId)
Create an item identifier resolver using a named bean property.

Parameters:
propertyId - property identifier, which must map to a getter in BEANTYPE
Returns:
created resolver

addListener

public void addListener(Container.PropertySetChangeListener listener)
Description copied from class: AbstractContainer
Implementation of the corresponding method in PropertySetChangeNotifier, override with the corresponding public method and implement the interface to use this.

Specified by:
addListener in interface Container.PropertySetChangeNotifier
Overrides:
addListener in class AbstractContainer
Parameters:
listener - The new Listener to be registered
See Also:
PropertySetChangeNotifier#addListener(com.vaadin.data.Container.PropertySetChangeListener)

removeListener

public void removeListener(Container.PropertySetChangeListener listener)
Description copied from class: AbstractContainer
Implementation of the corresponding method in PropertySetChangeNotifier, override with the corresponding public method and implement the interface to use this.

Specified by:
removeListener in interface Container.PropertySetChangeNotifier
Overrides:
removeListener in class AbstractContainer
Parameters:
listener - Listener to be removed
See Also:
PropertySetChangeNotifier#removeListener(com.vaadin.data.Container. PropertySetChangeListener)

addContainerProperty

public boolean addContainerProperty(Object propertyId,
                                    Class<?> type,
                                    Object defaultValue)
                             throws UnsupportedOperationException
Description copied from interface: Container
Adds a new Property to all Items in the Container. The Property ID, data type and default value of the new Property are given as parameters. This functionality is optional.

Specified by:
addContainerProperty in interface Container
Overrides:
addContainerProperty in class AbstractInMemoryContainer<IDTYPE,String,BeanItem<BEANTYPE>>
Parameters:
propertyId - ID of the Property
type - Data type of the new Property
defaultValue - The value all created Properties are initialized to
Returns:
true if the operation succeeded, false if not
Throws:
UnsupportedOperationException - if the container does not support explicitly adding container properties

addContainerProperty

protected final boolean addContainerProperty(String propertyId,
                                             VaadinPropertyDescriptor<BEANTYPE> propertyDescriptor)
Adds a property for the container and all its items. Primarily for internal use, may change in future versions.

Parameters:
propertyId -
propertyDescriptor -
Returns:
true if the property was added

addNestedContainerProperty

public boolean addNestedContainerProperty(String propertyId)
Adds a nested container property for the container, e.g. "manager.address.street". All intermediate getters must exist and must return non-null values when the property value is accessed.

Parameters:
propertyId -
Returns:
true if the property was added
See Also:
NestedMethodProperty

addNestedContainerBean

public void addNestedContainerBean(String propertyId)
Adds a nested container properties for all sub-properties of a named property to the container. The named property itself is removed from the model as its subproperties are added. All intermediate getters must exist and must return non-null values when the property value is accessed.

Parameters:
propertyId -
See Also:
NestedMethodProperty, addNestedContainerProperty(String)

removeContainerProperty

public boolean removeContainerProperty(Object propertyId)
                                throws UnsupportedOperationException
Description copied from interface: Container
Removes a Property specified by the given Property ID from the Container. Note that the Property will be removed from all Items in the Container. This functionality is optional.

Specified by:
removeContainerProperty in interface Container
Overrides:
removeContainerProperty in class AbstractInMemoryContainer<IDTYPE,String,BeanItem<BEANTYPE>>
Parameters:
propertyId - ID of the Property to remove
Returns:
true if the operation succeeded, false if not
Throws:
UnsupportedOperationException - if the container does not support removing container properties


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