T
- The type of the elements in the container.K
- the key of the elements in the container.public abstract class OnmsVaadinContainer<T,K extends Serializable> extends Object implements com.vaadin.v7.data.Container, com.vaadin.v7.data.Container.Sortable, com.vaadin.v7.data.Container.Ordered, com.vaadin.v7.data.Container.Indexed, com.vaadin.v7.data.Container.ItemSetChangeNotifier, SelectionChangedListener
Modifier and Type | Class and Description |
---|---|
protected class |
OnmsVaadinContainer.Cache |
protected static class |
OnmsVaadinContainer.Page |
protected static class |
OnmsVaadinContainer.Size |
protected static interface |
OnmsVaadinContainer.SizeReloadStrategy |
protected static class |
OnmsVaadinContainer.SortEntry |
com.vaadin.v7.data.Container.Indexed.ItemAddEvent, com.vaadin.v7.data.Container.Indexed.ItemRemoveEvent
SelectionChangedListener.AlarmNodeIdSelection, SelectionChangedListener.IdSelection<T extends Serializable>, SelectionChangedListener.Selection
Modifier and Type | Field and Description |
---|---|
protected static int |
DEFAULT_PAGE_SIZE |
Constructor and Description |
---|
OnmsVaadinContainer(Class<T> itemClass,
OnmsContainerDatasource<T,K> datasource) |
Modifier and Type | Method and Description |
---|---|
protected void |
addAdditionalCriteriaOptions(Criteria criteria,
OnmsVaadinContainer.Page page,
boolean doOrder) |
void |
addBeanToHibernatePropertyMapping(String key,
String value) |
boolean |
addContainerProperty(Object propertyId,
Class<?> type,
Object defaultValue) |
Object |
addItem()
Can be overridden if you want to support adding items.
|
com.vaadin.v7.data.Item |
addItem(Object itemId)
Can be overridden if you want to support adding items.
|
Object |
addItemAfter(Object previousItemId) |
com.vaadin.v7.data.Item |
addItemAfter(Object previousItemId,
Object newItemId) |
Object |
addItemAt(int index) |
com.vaadin.v7.data.Item |
addItemAt(int index,
Object newItemId) |
void |
addItemSetChangeListener(com.vaadin.v7.data.Container.ItemSetChangeListener listener) |
void |
addListener(com.vaadin.v7.data.Container.ItemSetChangeListener listener) |
boolean |
containsId(Object itemId) |
protected List<OnmsVaadinContainer.SortEntry> |
createSortEntries(Object[] propertyId,
boolean[] ascending) |
protected void |
fireItemSetChangedEvent() |
Object |
firstItemId() |
protected OnmsVaadinContainer.Cache |
getCache() |
com.vaadin.v7.data.Property<?> |
getContainerProperty(Object itemId,
Object propertyId) |
Collection<?> |
getContainerPropertyIds() |
protected abstract ContentType |
getContentType() |
protected Criteria |
getCriteria(OnmsVaadinContainer.Page page,
boolean doOrder)
Creates a
Criteria object to get data from database. |
protected abstract K |
getId(T bean) |
K |
getIdByIndex(int index) |
com.vaadin.v7.data.Item |
getItem(Object itemId) |
Class<T> |
getItemClass() |
Collection<?> |
getItemIds() |
List<K> |
getItemIds(int startIndex,
int numberOfItems) |
protected List<T> |
getItemsForCache(OnmsContainerDatasource<T,K> datasource,
OnmsVaadinContainer.Page page) |
protected OnmsVaadinContainer.Page |
getPage() |
List<Restriction> |
getRestrictions() |
Collection<?> |
getSortableContainerPropertyIds()
This function returns
getContainerPropertyIds() . |
Class<?> |
getType(Object propertyId) |
int |
indexOfId(Object itemId) |
boolean |
isFirstId(Object itemId) |
boolean |
isLastId(Object itemId) |
Object |
lastItemId() |
Object |
nextItemId(Object itemId) |
Object |
prevItemId(Object itemId) |
boolean |
removeAllItems() |
boolean |
removeContainerProperty(Object propertyId) |
boolean |
removeItem(Object itemId) |
void |
removeItemSetChangeListener(com.vaadin.v7.data.Container.ItemSetChangeListener listener) |
void |
removeListener(com.vaadin.v7.data.Container.ItemSetChangeListener listener) |
void |
selectionChanged(SelectionChangedListener.Selection newSelection)
Provide a new
SelectionChangedListener.Selection object if the selection has changed. |
void |
setRestrictions(List<Restriction> newRestrictions) |
int |
size() |
void |
sort(Object[] propertyId,
boolean[] ascending) |
protected void |
updateContainerPropertyIds(Map<Object,Class<?>> properties) |
protected static final int DEFAULT_PAGE_SIZE
public OnmsVaadinContainer(Class<T> itemClass, OnmsContainerDatasource<T,K> datasource)
public boolean containsId(Object itemId)
containsId
in interface com.vaadin.v7.data.Container
public com.vaadin.v7.data.Property<?> getContainerProperty(Object itemId, Object propertyId)
getContainerProperty
in interface com.vaadin.v7.data.Container
public Collection<?> getContainerPropertyIds()
getContainerPropertyIds
in interface com.vaadin.v7.data.Container
public com.vaadin.v7.data.Item getItem(Object itemId)
getItem
in interface com.vaadin.v7.data.Container
public Class<?> getType(Object propertyId)
getType
in interface com.vaadin.v7.data.Container
public boolean removeAllItems() throws UnsupportedOperationException
removeAllItems
in interface com.vaadin.v7.data.Container
UnsupportedOperationException
public boolean removeItem(Object itemId) throws UnsupportedOperationException
removeItem
in interface com.vaadin.v7.data.Container
UnsupportedOperationException
public int size()
size
in interface com.vaadin.v7.data.Container
public Object firstItemId()
firstItemId
in interface com.vaadin.v7.data.Container.Ordered
public Object lastItemId()
lastItemId
in interface com.vaadin.v7.data.Container.Ordered
public boolean isFirstId(Object itemId)
isFirstId
in interface com.vaadin.v7.data.Container.Ordered
public boolean isLastId(Object itemId)
isLastId
in interface com.vaadin.v7.data.Container.Ordered
public Object nextItemId(Object itemId)
nextItemId
in interface com.vaadin.v7.data.Container.Ordered
public Object prevItemId(Object itemId)
prevItemId
in interface com.vaadin.v7.data.Container.Ordered
public Collection<?> getSortableContainerPropertyIds()
getContainerPropertyIds()
.getSortableContainerPropertyIds
in interface com.vaadin.v7.data.Container.Sortable
public void sort(Object[] propertyId, boolean[] ascending)
sort
in interface com.vaadin.v7.data.Container.Sortable
protected List<OnmsVaadinContainer.SortEntry> createSortEntries(Object[] propertyId, boolean[] ascending)
public void addListener(com.vaadin.v7.data.Container.ItemSetChangeListener listener)
addListener
in interface com.vaadin.v7.data.Container.ItemSetChangeNotifier
public void removeListener(com.vaadin.v7.data.Container.ItemSetChangeListener listener)
removeListener
in interface com.vaadin.v7.data.Container.ItemSetChangeNotifier
public void addItemSetChangeListener(com.vaadin.v7.data.Container.ItemSetChangeListener listener)
addItemSetChangeListener
in interface com.vaadin.v7.data.Container.ItemSetChangeNotifier
public void removeItemSetChangeListener(com.vaadin.v7.data.Container.ItemSetChangeListener listener)
removeItemSetChangeListener
in interface com.vaadin.v7.data.Container.ItemSetChangeNotifier
protected void fireItemSetChangedEvent()
public void setRestrictions(List<Restriction> newRestrictions)
public List<Restriction> getRestrictions()
public void addBeanToHibernatePropertyMapping(String key, String value)
public Collection<?> getItemIds()
getItemIds
in interface com.vaadin.v7.data.Container
public List<K> getItemIds(int startIndex, int numberOfItems)
getItemIds
in interface com.vaadin.v7.data.Container.Indexed
public int indexOfId(Object itemId)
indexOfId
in interface com.vaadin.v7.data.Container.Indexed
public K getIdByIndex(int index)
getIdByIndex
in interface com.vaadin.v7.data.Container.Indexed
public Object addItemAt(int index) throws UnsupportedOperationException
addItemAt
in interface com.vaadin.v7.data.Container.Indexed
UnsupportedOperationException
public com.vaadin.v7.data.Item addItemAt(int index, Object newItemId) throws UnsupportedOperationException
addItemAt
in interface com.vaadin.v7.data.Container.Indexed
UnsupportedOperationException
public Object addItemAfter(Object previousItemId) throws UnsupportedOperationException
addItemAfter
in interface com.vaadin.v7.data.Container.Ordered
UnsupportedOperationException
public com.vaadin.v7.data.Item addItemAfter(Object previousItemId, Object newItemId) throws UnsupportedOperationException
addItemAfter
in interface com.vaadin.v7.data.Container.Ordered
UnsupportedOperationException
public final boolean addContainerProperty(Object propertyId, Class<?> type, Object defaultValue) throws UnsupportedOperationException
addContainerProperty
in interface com.vaadin.v7.data.Container
UnsupportedOperationException
public Object addItem() throws UnsupportedOperationException
addItem
in interface com.vaadin.v7.data.Container
UnsupportedOperationException
public com.vaadin.v7.data.Item addItem(Object itemId) throws UnsupportedOperationException
addItem
in interface com.vaadin.v7.data.Container
UnsupportedOperationException
public final boolean removeContainerProperty(Object propertyId) throws UnsupportedOperationException
removeContainerProperty
in interface com.vaadin.v7.data.Container
UnsupportedOperationException
public void selectionChanged(SelectionChangedListener.Selection newSelection)
SelectionChangedListener
SelectionChangedListener.Selection
object if the selection has changed.selectionChanged
in interface SelectionChangedListener
newSelection
- The new selection.protected void updateContainerPropertyIds(Map<Object,Class<?>> properties)
protected Criteria getCriteria(OnmsVaadinContainer.Page page, boolean doOrder)
Criteria
object to get data from database.
If considerPaging is set Limit and offset values are added as restriction.page
- doOrder
- protected void addAdditionalCriteriaOptions(Criteria criteria, OnmsVaadinContainer.Page page, boolean doOrder)
protected List<T> getItemsForCache(OnmsContainerDatasource<T,K> datasource, OnmsVaadinContainer.Page page)
protected OnmsVaadinContainer.Cache getCache()
protected OnmsVaadinContainer.Page getPage()
protected abstract ContentType getContentType()
Copyright © 2021. All rights reserved.