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, Serializable

    public class SelectableBeanItemContainer<T>
    extends com.vaadin.v7.data.util.AbstractInMemoryContainer<T,​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​(Object propertyId, Class<?> type, Object defaultValue)
      We do not allow adding additional properties to the container.
      com.vaadin.v7.data.Item addItem​(Object itemId)  
      com.vaadin.v7.data.Item addItemAfter​(Object previousItemId, Object newItemId)  
      com.vaadin.v7.data.Item addItemAt​(int index, Object newItemId)  
      com.vaadin.v7.data.Property getContainerProperty​(Object itemId, Object propertyId)  
      Collection<String> getContainerPropertyIds()  
      Collection<T> getSelectedAttributes()  
      Class<?> getType​(Object propertyId)  
      protected SelectableItem<T> getUnfilteredItem​(Object itemId)  
      boolean isSelected​(T itemId)  
      protected void registerNewItem​(int position, T itemId, SelectableItem<T> item)  
      boolean removeAllItems()  
      boolean removeContainerProperty​(Object propertyId)
      We do not allow removing properties from the container.
      boolean removeItem​(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
    • Constructor Detail

      • SelectableBeanItemContainer

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

      • getContainerProperty

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

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

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

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

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

        public boolean removeItem​(Object itemId)
        Specified by:
        removeItem in interface com.vaadin.v7.data.Container
        Overrides:
        removeItem in class com.vaadin.v7.data.util.AbstractInMemoryContainer<T,​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,​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,​String,​SelectableItem<T>>
      • removeContainerProperty

        public boolean removeContainerProperty​(Object propertyId)
                                        throws 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,​String,​SelectableItem<T>>
        Throws:
        UnsupportedOperationException
      • isSelected

        public boolean isSelected​(T itemId)
      • getSelectedAttributes

        public Collection<T> getSelectedAttributes()
      • selectAllItems

        public void selectAllItems​(boolean select)