Class SelectableBeanItemContainer<T>
- java.lang.Object
-
- com.vaadin.v7.data.util.AbstractContainer
-
- com.vaadin.v7.data.util.AbstractInMemoryContainer<T,String,SelectableItem<T>>
-
- org.opennms.features.vaadin.jmxconfiggenerator.data.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 extendsAbstractInMemoryContainer. UsuallyBeanItemContainerorAbstractBeanContainerwould 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 theBeanItemContainerbut 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
-
-
Constructor Summary
Constructors Constructor Description SelectableBeanItemContainer(Class<? super T> type)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanaddContainerProperty(Object propertyId, Class<?> type, Object defaultValue)We do not allow adding additional properties to the container.com.vaadin.v7.data.ItemaddItem(Object itemId)com.vaadin.v7.data.ItemaddItemAfter(Object previousItemId, Object newItemId)com.vaadin.v7.data.ItemaddItemAt(int index, Object newItemId)com.vaadin.v7.data.PropertygetContainerProperty(Object itemId, Object propertyId)Collection<String>getContainerPropertyIds()Collection<T>getSelectedAttributes()Class<?>getType(Object propertyId)protected SelectableItem<T>getUnfilteredItem(Object itemId)booleanisSelected(T itemId)protected voidregisterNewItem(int position, T itemId, SelectableItem<T> item)booleanremoveAllItems()booleanremoveContainerProperty(Object propertyId)We do not allow removing properties from the container.booleanremoveItem(Object itemId)voidselectAllItems(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
-
-
-
-
Method Detail
-
getUnfilteredItem
protected SelectableItem<T> getUnfilteredItem(Object itemId)
- Specified by:
getUnfilteredItemin classcom.vaadin.v7.data.util.AbstractInMemoryContainer<T,String,SelectableItem<T>>
-
getContainerPropertyIds
public Collection<String> getContainerPropertyIds()
-
getContainerProperty
public com.vaadin.v7.data.Property getContainerProperty(Object itemId, Object propertyId)
-
addItemAt
public com.vaadin.v7.data.Item addItemAt(int index, Object newItemId)- Specified by:
addItemAtin interfacecom.vaadin.v7.data.Container.Indexed- Overrides:
addItemAtin classcom.vaadin.v7.data.util.AbstractInMemoryContainer<T,String,SelectableItem<T>>
-
addItemAfter
public com.vaadin.v7.data.Item addItemAfter(Object previousItemId, Object newItemId)
- Specified by:
addItemAfterin interfacecom.vaadin.v7.data.Container.Ordered- Overrides:
addItemAfterin classcom.vaadin.v7.data.util.AbstractInMemoryContainer<T,String,SelectableItem<T>>
-
addItem
public com.vaadin.v7.data.Item addItem(Object itemId)
- Specified by:
addItemin interfacecom.vaadin.v7.data.Container- Overrides:
addItemin classcom.vaadin.v7.data.util.AbstractInMemoryContainer<T,String,SelectableItem<T>>
-
removeItem
public boolean removeItem(Object itemId)
- Specified by:
removeItemin interfacecom.vaadin.v7.data.Container- Overrides:
removeItemin classcom.vaadin.v7.data.util.AbstractInMemoryContainer<T,String,SelectableItem<T>>
-
removeAllItems
public boolean removeAllItems()
- Specified by:
removeAllItemsin interfacecom.vaadin.v7.data.Container- Overrides:
removeAllItemsin classcom.vaadin.v7.data.util.AbstractInMemoryContainer<T,String,SelectableItem<T>>
-
registerNewItem
protected void registerNewItem(int position, T itemId, SelectableItem<T> item)- Overrides:
registerNewItemin classcom.vaadin.v7.data.util.AbstractInMemoryContainer<T,String,SelectableItem<T>>
-
addContainerProperty
public boolean addContainerProperty(Object propertyId, Class<?> type, Object defaultValue) throws UnsupportedOperationException
We do not allow adding additional properties to the container.- Specified by:
addContainerPropertyin interfacecom.vaadin.v7.data.Container- Overrides:
addContainerPropertyin classcom.vaadin.v7.data.util.AbstractInMemoryContainer<T,String,SelectableItem<T>>- Throws:
UnsupportedOperationException
-
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:
removeContainerPropertyin interfacecom.vaadin.v7.data.Container- Overrides:
removeContainerPropertyin classcom.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)
-
-