Class SelectableBeanItemContainer<T>

  • Type Parameters:
    T - the type of the bean we want to store in SelectableItem
    All Implemented Interfaces:
    com.vaadin.v7.data.Container, com.vaadin.v7.data.Container.Indexed, com.vaadin.v7.data.Container.ItemSetChangeNotifier, com.vaadin.v7.data.Container.Ordered, java.io.Serializable

    public class SelectableBeanItemContainer<T>
    extends com.vaadin.v7.data.util.AbstractInMemoryContainer<T,​java.lang.String,​SelectableItem<T>>
    This class represents a vaadin container (data source). Therefore it extends AbstractInMemoryContainer. Usually BeanItemContainer or AbstractBeanContainer would be the best container to use. But we need to add a property to the container items which indicates if any item is selected. Due to some limitations we cannot inherit BeanItemContainer or AbstractBeanContainer to fulfill this requirement. Therefore this class is mainly a rough copy of the BeanItemContainer but does not support any kind of filtering. This may be included in future releases.
    Author:
    Markus von RĂ¼den
    See Also:
    SelectableItem, Serialized Form
    • Nested Class Summary

      • Nested classes/interfaces inherited from class com.vaadin.v7.data.util.AbstractInMemoryContainer

        com.vaadin.v7.data.util.AbstractInMemoryContainer.BaseItemAddEvent, com.vaadin.v7.data.util.AbstractInMemoryContainer.BaseItemRemoveEvent
      • Nested classes/interfaces inherited from class com.vaadin.v7.data.util.AbstractContainer

        com.vaadin.v7.data.util.AbstractContainer.BaseItemSetChangeEvent, com.vaadin.v7.data.util.AbstractContainer.BasePropertySetChangeEvent
      • Nested classes/interfaces inherited from interface com.vaadin.v7.data.Container

        com.vaadin.v7.data.Container.Editor, com.vaadin.v7.data.Container.Filter, com.vaadin.v7.data.Container.Filterable, com.vaadin.v7.data.Container.Hierarchical, com.vaadin.v7.data.Container.Indexed, com.vaadin.v7.data.Container.ItemSetChangeEvent, com.vaadin.v7.data.Container.ItemSetChangeListener, com.vaadin.v7.data.Container.ItemSetChangeNotifier, com.vaadin.v7.data.Container.Ordered, com.vaadin.v7.data.Container.PropertySetChangeEvent, com.vaadin.v7.data.Container.PropertySetChangeListener, com.vaadin.v7.data.Container.PropertySetChangeNotifier, com.vaadin.v7.data.Container.SimpleFilterable, com.vaadin.v7.data.Container.Sortable, com.vaadin.v7.data.Container.Viewer
      • Nested classes/interfaces inherited from interface com.vaadin.v7.data.Container.Indexed

        com.vaadin.v7.data.Container.Indexed.ItemAddEvent, com.vaadin.v7.data.Container.Indexed.ItemRemoveEvent
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean addContainerProperty​(java.lang.Object propertyId, java.lang.Class<?> type, java.lang.Object defaultValue)
      We do not allow adding additional properties to the container.
      com.vaadin.v7.data.Item addItem​(java.lang.Object itemId)  
      com.vaadin.v7.data.Item addItemAfter​(java.lang.Object previousItemId, java.lang.Object newItemId)  
      com.vaadin.v7.data.Item addItemAt​(int index, java.lang.Object newItemId)  
      com.vaadin.v7.data.Property getContainerProperty​(java.lang.Object itemId, java.lang.Object propertyId)  
      java.util.Collection<java.lang.String> getContainerPropertyIds()  
      java.util.Collection<T> getSelectedAttributes()  
      java.lang.Class<?> getType​(java.lang.Object propertyId)  
      protected SelectableItem<T> getUnfilteredItem​(java.lang.Object itemId)  
      boolean isSelected​(T itemId)  
      protected void registerNewItem​(int position, T itemId, SelectableItem<T> item)  
      boolean removeAllItems()  
      boolean removeContainerProperty​(java.lang.Object propertyId)
      We do not allow removing properties from the container.
      boolean removeItem​(java.lang.Object itemId)  
      void selectAllItems​(boolean select)  
      • Methods inherited from class com.vaadin.v7.data.util.AbstractInMemoryContainer

        addFilter, addItem, addItemAfter, addItemAt, addItemSetChangeListener, addListener, containsId, doFilterContainer, doSort, filterAll, fireItemAdded, fireItemRemoved, fireItemsAdded, fireItemsRemoved, firstItemId, getAllItemIds, getContainerFilters, getFilteredItemIds, getFilters, getFirstVisibleItem, getIdByIndex, getItem, getItemIds, getItemIds, getItemSorter, getSortablePropertyIds, getVisibleItemIds, hasContainerFilters, indexOfId, internalAddItemAfter, internalAddItemAt, internalAddItemAtEnd, internalRemoveAllItems, internalRemoveItem, isFiltered, isFirstId, isLastId, isPropertyFiltered, lastItemId, nextItemId, passesFilters, prevItemId, removeAllFilters, removeFilter, removeFilters, removeItemSetChangeListener, removeListener, setAllItemIds, setFilteredItemIds, setFilters, setItemSorter, size, sortContainer
      • Methods inherited from class com.vaadin.v7.data.util.AbstractContainer

        addListener, addPropertySetChangeListener, fireContainerPropertySetChange, fireContainerPropertySetChange, fireItemSetChange, fireItemSetChange, getItemSetChangeListeners, getListeners, getPropertySetChangeListeners, removeListener, removePropertySetChangeListener, setItemSetChangeListeners, setPropertySetChangeListeners
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • SelectableBeanItemContainer

        public SelectableBeanItemContainer​(java.lang.Class<? super T> type)
    • Method Detail

      • getUnfilteredItem

        protected SelectableItem<T> getUnfilteredItem​(java.lang.Object itemId)
        Specified by:
        getUnfilteredItem in class com.vaadin.v7.data.util.AbstractInMemoryContainer<T,​java.lang.String,​SelectableItem<T>>
      • getContainerPropertyIds

        public java.util.Collection<java.lang.String> getContainerPropertyIds()
      • getContainerProperty

        public com.vaadin.v7.data.Property getContainerProperty​(java.lang.Object itemId,
                                                                java.lang.Object propertyId)
      • getType

        public java.lang.Class<?> getType​(java.lang.Object propertyId)
      • addItemAt

        public com.vaadin.v7.data.Item addItemAt​(int index,
                                                 java.lang.Object newItemId)
        Specified by:
        addItemAt in interface com.vaadin.v7.data.Container.Indexed
        Overrides:
        addItemAt in class com.vaadin.v7.data.util.AbstractInMemoryContainer<T,​java.lang.String,​SelectableItem<T>>
      • addItemAfter

        public com.vaadin.v7.data.Item addItemAfter​(java.lang.Object previousItemId,
                                                    java.lang.Object newItemId)
        Specified by:
        addItemAfter in interface com.vaadin.v7.data.Container.Ordered
        Overrides:
        addItemAfter in class com.vaadin.v7.data.util.AbstractInMemoryContainer<T,​java.lang.String,​SelectableItem<T>>
      • addItem

        public com.vaadin.v7.data.Item addItem​(java.lang.Object itemId)
        Specified by:
        addItem in interface com.vaadin.v7.data.Container
        Overrides:
        addItem in class com.vaadin.v7.data.util.AbstractInMemoryContainer<T,​java.lang.String,​SelectableItem<T>>
      • removeItem

        public boolean removeItem​(java.lang.Object itemId)
        Specified by:
        removeItem in interface com.vaadin.v7.data.Container
        Overrides:
        removeItem in class com.vaadin.v7.data.util.AbstractInMemoryContainer<T,​java.lang.String,​SelectableItem<T>>
      • removeAllItems

        public boolean removeAllItems()
        Specified by:
        removeAllItems in interface com.vaadin.v7.data.Container
        Overrides:
        removeAllItems in class com.vaadin.v7.data.util.AbstractInMemoryContainer<T,​java.lang.String,​SelectableItem<T>>
      • registerNewItem

        protected void registerNewItem​(int position,
                                       T itemId,
                                       SelectableItem<T> item)
        Overrides:
        registerNewItem in class com.vaadin.v7.data.util.AbstractInMemoryContainer<T,​java.lang.String,​SelectableItem<T>>
      • addContainerProperty

        public boolean addContainerProperty​(java.lang.Object propertyId,
                                            java.lang.Class<?> type,
                                            java.lang.Object defaultValue)
                                     throws java.lang.UnsupportedOperationException
        We do not allow adding additional properties to the container.
        Specified by:
        addContainerProperty in interface com.vaadin.v7.data.Container
        Overrides:
        addContainerProperty in class com.vaadin.v7.data.util.AbstractInMemoryContainer<T,​java.lang.String,​SelectableItem<T>>
        Throws:
        java.lang.UnsupportedOperationException
      • removeContainerProperty

        public boolean removeContainerProperty​(java.lang.Object propertyId)
                                        throws java.lang.UnsupportedOperationException
        We do not allow removing properties from the container. This may change in future releases.
        Specified by:
        removeContainerProperty in interface com.vaadin.v7.data.Container
        Overrides:
        removeContainerProperty in class com.vaadin.v7.data.util.AbstractInMemoryContainer<T,​java.lang.String,​SelectableItem<T>>
        Throws:
        java.lang.UnsupportedOperationException
      • isSelected

        public boolean isSelected​(T itemId)
      • getSelectedAttributes

        public java.util.Collection<T> getSelectedAttributes()
      • selectAllItems

        public void selectAllItems​(boolean select)