public abstract class OnmsDaoContainer<T,K extends Serializable> extends Object implements com.vaadin.data.Container, com.vaadin.data.Container.Sortable, com.vaadin.data.Container.Ordered, com.vaadin.data.Container.Indexed, com.vaadin.data.Container.ItemSetChangeNotifier, VerticesUpdateManager.VerticesUpdateListener
Modifier and Type | Class and Description |
---|---|
protected class |
OnmsDaoContainer.Cache |
protected static class |
OnmsDaoContainer.Page |
protected static class |
OnmsDaoContainer.Size |
protected static interface |
OnmsDaoContainer.SizeReloadStrategy |
protected static class |
OnmsDaoContainer.SortEntry |
Modifier and Type | Field and Description |
---|---|
protected static int |
DEFAULT_PAGE_SIZE |
protected static int |
DEFAULT_SIZE_RELOAD_TIME |
Constructor and Description |
---|
OnmsDaoContainer(Class<T> itemClass,
OnmsDao<T,K> dao) |
Modifier and Type | Method and Description |
---|---|
protected void |
addAdditionalCriteriaOptions(Criteria criteria,
OnmsDaoContainer.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.data.Item |
addItem(Object itemId)
Can be overridden if you want to support adding items.
|
Object |
addItemAfter(Object previousItemId) |
com.vaadin.data.Item |
addItemAfter(Object previousItemId,
Object newItemId) |
Object |
addItemAt(int index) |
com.vaadin.data.Item |
addItemAt(int index,
Object newItemId) |
void |
addItemSetChangeListener(com.vaadin.data.Container.ItemSetChangeListener listener) |
void |
addListener(com.vaadin.data.Container.ItemSetChangeListener listener) |
boolean |
containsId(Object itemId) |
protected List<OnmsDaoContainer.SortEntry> |
createSortEntries(Object[] propertyId,
boolean[] ascending) |
protected void |
doItemAddedCallBack(int rowNumber,
K id,
T eachBean) |
protected List<Integer> |
extractNodeIds(Collection<VertexRef> vertices)
Gets the node ids from the given vertices.
|
protected void |
fireItemSetChangedEvent() |
Object |
firstItemId() |
protected OnmsDaoContainer.Cache |
getCache() |
com.vaadin.data.Property<?> |
getContainerProperty(Object itemId,
Object propertyId) |
Collection<?> |
getContainerPropertyIds() |
protected Criteria |
getCriteria(OnmsDaoContainer.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.data.Item |
getItem(Object itemId) |
Class<T> |
getItemClass() |
Collection<?> |
getItemIds() |
List<K> |
getItemIds(int startIndex,
int numberOfItems) |
protected List<T> |
getItemsForCache(OnmsDao<T,K> dao,
OnmsDaoContainer.Page page) |
protected OnmsDaoContainer.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.data.Container.ItemSetChangeListener listener) |
void |
removeListener(com.vaadin.data.Container.ItemSetChangeListener listener) |
void |
setRestrictions(List<Restriction> newRestrictions) |
int |
size() |
void |
sort(Object[] propertyId,
boolean[] ascending) |
protected void |
updateContainerPropertyIds(Map<Object,Class<?>> properties) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
verticesUpdated
protected static final int DEFAULT_PAGE_SIZE
protected static final int DEFAULT_SIZE_RELOAD_TIME
public boolean containsId(Object itemId)
containsId
in interface com.vaadin.data.Container
public com.vaadin.data.Property<?> getContainerProperty(Object itemId, Object propertyId)
getContainerProperty
in interface com.vaadin.data.Container
public Collection<?> getContainerPropertyIds()
getContainerPropertyIds
in interface com.vaadin.data.Container
public com.vaadin.data.Item getItem(Object itemId)
getItem
in interface com.vaadin.data.Container
public Class<?> getType(Object propertyId)
getType
in interface com.vaadin.data.Container
public boolean removeAllItems() throws UnsupportedOperationException
removeAllItems
in interface com.vaadin.data.Container
UnsupportedOperationException
public boolean removeItem(Object itemId) throws UnsupportedOperationException
removeItem
in interface com.vaadin.data.Container
UnsupportedOperationException
public int size()
size
in interface com.vaadin.data.Container
public Object firstItemId()
firstItemId
in interface com.vaadin.data.Container.Ordered
public Object lastItemId()
lastItemId
in interface com.vaadin.data.Container.Ordered
public boolean isFirstId(Object itemId)
isFirstId
in interface com.vaadin.data.Container.Ordered
public boolean isLastId(Object itemId)
isLastId
in interface com.vaadin.data.Container.Ordered
public Object nextItemId(Object itemId)
nextItemId
in interface com.vaadin.data.Container.Ordered
public Object prevItemId(Object itemId)
prevItemId
in interface com.vaadin.data.Container.Ordered
public Collection<?> getSortableContainerPropertyIds()
getContainerPropertyIds()
.getSortableContainerPropertyIds
in interface com.vaadin.data.Container.Sortable
public void sort(Object[] propertyId, boolean[] ascending)
sort
in interface com.vaadin.data.Container.Sortable
protected List<OnmsDaoContainer.SortEntry> createSortEntries(Object[] propertyId, boolean[] ascending)
public void addListener(com.vaadin.data.Container.ItemSetChangeListener listener)
addListener
in interface com.vaadin.data.Container.ItemSetChangeNotifier
public void removeListener(com.vaadin.data.Container.ItemSetChangeListener listener)
removeListener
in interface com.vaadin.data.Container.ItemSetChangeNotifier
public void addItemSetChangeListener(com.vaadin.data.Container.ItemSetChangeListener listener)
addItemSetChangeListener
in interface com.vaadin.data.Container.ItemSetChangeNotifier
public void removeItemSetChangeListener(com.vaadin.data.Container.ItemSetChangeListener listener)
removeItemSetChangeListener
in interface com.vaadin.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.data.Container
public List<K> getItemIds(int startIndex, int numberOfItems)
getItemIds
in interface com.vaadin.data.Container.Indexed
public int indexOfId(Object itemId)
indexOfId
in interface com.vaadin.data.Container.Indexed
public K getIdByIndex(int index)
getIdByIndex
in interface com.vaadin.data.Container.Indexed
public Object addItemAt(int index) throws UnsupportedOperationException
addItemAt
in interface com.vaadin.data.Container.Indexed
UnsupportedOperationException
public com.vaadin.data.Item addItemAt(int index, Object newItemId) throws UnsupportedOperationException
addItemAt
in interface com.vaadin.data.Container.Indexed
UnsupportedOperationException
public Object addItemAfter(Object previousItemId) throws UnsupportedOperationException
addItemAfter
in interface com.vaadin.data.Container.Ordered
UnsupportedOperationException
public com.vaadin.data.Item addItemAfter(Object previousItemId, Object newItemId) throws UnsupportedOperationException
addItemAfter
in interface com.vaadin.data.Container.Ordered
UnsupportedOperationException
public final boolean addContainerProperty(Object propertyId, Class<?> type, Object defaultValue) throws UnsupportedOperationException
addContainerProperty
in interface com.vaadin.data.Container
UnsupportedOperationException
public Object addItem() throws UnsupportedOperationException
addItem
in interface com.vaadin.data.Container
UnsupportedOperationException
public com.vaadin.data.Item addItem(Object itemId) throws UnsupportedOperationException
addItem
in interface com.vaadin.data.Container
UnsupportedOperationException
public final boolean removeContainerProperty(Object propertyId) throws UnsupportedOperationException
removeContainerProperty
in interface com.vaadin.data.Container
UnsupportedOperationException
protected void updateContainerPropertyIds(Map<Object,Class<?>> properties)
protected Criteria getCriteria(OnmsDaoContainer.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, OnmsDaoContainer.Page page, boolean doOrder)
protected OnmsDaoContainer.Cache getCache()
protected OnmsDaoContainer.Page getPage()
protected List<Integer> extractNodeIds(Collection<VertexRef> vertices)
vertices
- Copyright © 2015. All rights reserved.