T
- the type of the bean we want to store in SelectableItempublic class SelectableBeanItemContainer<T> extends com.vaadin.v7.data.util.AbstractInMemoryContainer<T,String,SelectableItem<T>>
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.SelectableItem
,
Serialized Formcom.vaadin.v7.data.util.AbstractInMemoryContainer.BaseItemAddEvent, com.vaadin.v7.data.util.AbstractInMemoryContainer.BaseItemRemoveEvent
com.vaadin.v7.data.util.AbstractContainer.BaseItemSetChangeEvent, com.vaadin.v7.data.util.AbstractContainer.BasePropertySetChangeEvent
com.vaadin.v7.data.Container.Indexed.ItemAddEvent, com.vaadin.v7.data.Container.Indexed.ItemRemoveEvent
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
Constructor and Description |
---|
SelectableBeanItemContainer(Class<? super T> type) |
Modifier and Type | Method and 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) |
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
addListener, addPropertySetChangeListener, fireContainerPropertySetChange, fireContainerPropertySetChange, fireItemSetChange, fireItemSetChange, getItemSetChangeListeners, getListeners, getPropertySetChangeListeners, removeListener, removePropertySetChangeListener, setItemSetChangeListeners, setPropertySetChangeListeners
protected SelectableItem<T> getUnfilteredItem(Object itemId)
getUnfilteredItem
in class com.vaadin.v7.data.util.AbstractInMemoryContainer<T,String,SelectableItem<T>>
public Collection<String> getContainerPropertyIds()
public com.vaadin.v7.data.Property getContainerProperty(Object itemId, Object propertyId)
public com.vaadin.v7.data.Item addItemAt(int index, Object newItemId)
addItemAt
in interface com.vaadin.v7.data.Container.Indexed
addItemAt
in class com.vaadin.v7.data.util.AbstractInMemoryContainer<T,String,SelectableItem<T>>
public com.vaadin.v7.data.Item addItemAfter(Object previousItemId, Object newItemId)
addItemAfter
in interface com.vaadin.v7.data.Container.Ordered
addItemAfter
in class com.vaadin.v7.data.util.AbstractInMemoryContainer<T,String,SelectableItem<T>>
public com.vaadin.v7.data.Item addItem(Object itemId)
addItem
in interface com.vaadin.v7.data.Container
addItem
in class com.vaadin.v7.data.util.AbstractInMemoryContainer<T,String,SelectableItem<T>>
public boolean removeItem(Object itemId)
removeItem
in interface com.vaadin.v7.data.Container
removeItem
in class com.vaadin.v7.data.util.AbstractInMemoryContainer<T,String,SelectableItem<T>>
public boolean removeAllItems()
removeAllItems
in interface com.vaadin.v7.data.Container
removeAllItems
in class com.vaadin.v7.data.util.AbstractInMemoryContainer<T,String,SelectableItem<T>>
protected void registerNewItem(int position, T itemId, SelectableItem<T> item)
registerNewItem
in class com.vaadin.v7.data.util.AbstractInMemoryContainer<T,String,SelectableItem<T>>
public boolean addContainerProperty(Object propertyId, Class<?> type, Object defaultValue) throws UnsupportedOperationException
addContainerProperty
in interface com.vaadin.v7.data.Container
addContainerProperty
in class com.vaadin.v7.data.util.AbstractInMemoryContainer<T,String,SelectableItem<T>>
UnsupportedOperationException
public boolean removeContainerProperty(Object propertyId) throws UnsupportedOperationException
removeContainerProperty
in interface com.vaadin.v7.data.Container
removeContainerProperty
in class com.vaadin.v7.data.util.AbstractInMemoryContainer<T,String,SelectableItem<T>>
UnsupportedOperationException
public boolean isSelected(T itemId)
public Collection<T> getSelectedAttributes()
public void selectAllItems(boolean select)
Copyright © 2021. All rights reserved.