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
. UsuallyBeanItemContainer
orAbstractBeanContainer
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 theBeanItemContainer
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
-
-
Constructor Summary
Constructors Constructor Description SelectableBeanItemContainer(Class<? super T> type)
-
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
-
-
-
-
Method Detail
-
getUnfilteredItem
protected SelectableItem<T> getUnfilteredItem(Object itemId)
- Specified by:
getUnfilteredItem
in 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:
addItemAt
in interfacecom.vaadin.v7.data.Container.Indexed
- Overrides:
addItemAt
in classcom.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 interfacecom.vaadin.v7.data.Container.Ordered
- Overrides:
addItemAfter
in classcom.vaadin.v7.data.util.AbstractInMemoryContainer<T,String,SelectableItem<T>>
-
addItem
public com.vaadin.v7.data.Item addItem(Object itemId)
- Specified by:
addItem
in interfacecom.vaadin.v7.data.Container
- Overrides:
addItem
in classcom.vaadin.v7.data.util.AbstractInMemoryContainer<T,String,SelectableItem<T>>
-
removeItem
public boolean removeItem(Object itemId)
- Specified by:
removeItem
in interfacecom.vaadin.v7.data.Container
- Overrides:
removeItem
in classcom.vaadin.v7.data.util.AbstractInMemoryContainer<T,String,SelectableItem<T>>
-
removeAllItems
public boolean removeAllItems()
- Specified by:
removeAllItems
in interfacecom.vaadin.v7.data.Container
- Overrides:
removeAllItems
in classcom.vaadin.v7.data.util.AbstractInMemoryContainer<T,String,SelectableItem<T>>
-
registerNewItem
protected void registerNewItem(int position, T itemId, SelectableItem<T> item)
- Overrides:
registerNewItem
in 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:
addContainerProperty
in interfacecom.vaadin.v7.data.Container
- Overrides:
addContainerProperty
in 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:
removeContainerProperty
in interfacecom.vaadin.v7.data.Container
- Overrides:
removeContainerProperty
in 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)
-
-