public class XdevEntityLazyQueryContainer extends Object implements Container.Indexed, Container.Sortable, Container.ItemSetChangeNotifier, Container.PropertySetChangeNotifier, Buffered, Container.Filterable, Serializable
Container.Indexed.ItemAddEvent, Container.Indexed.ItemRemoveEvent
Container.Editor, Container.Filter, Container.Filterable, Container.Hierarchical, Container.Indexed, Container.ItemSetChangeEvent, Container.ItemSetChangeListener, Container.ItemSetChangeNotifier, Container.Ordered, Container.PropertySetChangeEvent, Container.PropertySetChangeListener, Container.PropertySetChangeNotifier, Container.SimpleFilterable, Container.Sortable, Container.Viewer
Buffered.SourceException
Constructor and Description |
---|
XdevEntityLazyQueryContainer(EntityLazyQueryView queryView)
Constructs LazyQueryContainer with the given QueryView.
|
XdevEntityLazyQueryContainer(org.vaadin.addons.lazyquerycontainer.QueryDefinition queryDefinition,
org.vaadin.addons.lazyquerycontainer.QueryFactory queryFactory)
Constructs LazyQueryContainer with LazyQueryView and given queryFactory
and queryDefinition.
|
XdevEntityLazyQueryContainer(org.vaadin.addons.lazyquerycontainer.QueryFactory queryFactory,
Object idPropertyId,
int batchSize,
boolean compositeItems)
Constructs LazyQueryContainer with LazyQueryView and given queryFactory.
|
Modifier and Type | Method and Description |
---|---|
void |
addContainerFilter(Container.Filter filter) |
boolean |
addContainerProperty(Object propertyId,
Class<?> type,
Object defaultValue)
Adds a new property to the definition.
|
boolean |
addContainerProperty(Object propertyId,
Class<?> type,
Object defaultValue,
boolean readOnly,
boolean sortable)
Adds a new property to the definition.
|
void |
addDefaultFilter(Container.Filter filter)
Adds default filter to underlying QueryDefinition.
|
Object |
addItem()
Constructs and adds new item.
|
Item |
addItem(Object itemId)
Not supported.
|
Object |
addItemAfter(Object previousItemId)
Not supported.
|
Item |
addItemAfter(Object previousItemId,
Object newItemId)
Not supported.
|
Object |
addItemAt(int index)
Not supported.
|
Item |
addItemAt(int index,
Object newItemId)
Not supported.
|
void |
addItemSetChangeListener(Container.ItemSetChangeListener listener) |
void |
addListener(Container.ItemSetChangeListener listener)
Deprecated.
|
void |
addListener(Container.PropertySetChangeListener listener)
Deprecated.
|
void |
addPropertySetChangeListener(Container.PropertySetChangeListener listener) |
void |
commit()
Commits changed and refreshes container.
|
boolean |
containsId(Object itemId)
True if container contains the given index.
|
void |
discard()
Discards changes and refreshes container.
|
Object |
firstItemId() |
Collection<Container.Filter> |
getContainerFilters() |
Property<?> |
getContainerProperty(Object itemId,
Object propertyId)
Gets property of an item.
|
Collection<?> |
getContainerPropertyIds()
Lists of the property IDs queried.
|
Object |
getIdByIndex(int index)
Gets ID of given index.
|
Item |
getItem(Object itemId)
Gets item at given index.
|
Collection<?> |
getItemIds()
Gets list of item indexes in the container.
|
List<?> |
getItemIds(int startIndex,
int numberOfItems) |
EntityLazyQueryView |
getQueryView() |
Collection<?> |
getSortableContainerPropertyIds()
List of the property IDs which can be sorted.
|
Class<?> |
getType(Object propertyId)
Gets the property value class of the given property.
|
int |
indexOfId(Object itemId)
Gets index of given ID.
|
boolean |
isBuffered() |
boolean |
isFirstId(Object itemId)
Check if given index is first i.e.
|
boolean |
isLastId(Object itemId)
Check if given index is first i.e.
|
boolean |
isModified() |
Object |
lastItemId() |
Object |
nextItemId(Object itemId) |
Object |
prevItemId(Object itemId) |
void |
refresh()
Refreshes container.
|
void |
removeAllContainerFilters() |
boolean |
removeAllItems()
Removes all items.
|
void |
removeContainerFilter(Container.Filter filter) |
boolean |
removeContainerProperty(Object propertyId)
Removes the given property from the definition.
|
void |
removeDefaultFilter(Container.Filter filter)
Removes default filter from underlying QueryDefinition.
|
void |
removeDefaultFilters()
Removes all default filters from underlying QueryDefinition.
|
boolean |
removeItem(Object itemId)
Removes Item at given index.
|
void |
removeItemSetChangeListener(Container.ItemSetChangeListener listener) |
void |
removeListener(Container.ItemSetChangeListener listener)
Deprecated.
|
void |
removeListener(Container.PropertySetChangeListener listener)
Deprecated.
|
void |
removePropertySetChangeListener(Container.PropertySetChangeListener listener) |
void |
setBuffered(boolean buffered) |
int |
size()
Number of items in the container.
|
void |
sort(Object[] sortPropertyIds,
boolean[] ascendingStates)
Sets new sort state and refreshes container.
|
public XdevEntityLazyQueryContainer(org.vaadin.addons.lazyquerycontainer.QueryFactory queryFactory, Object idPropertyId, int batchSize, boolean compositeItems)
queryFactory
- The query factory to be used.idPropertyId
- The ID of the ID property or null if item index is used as ID.batchSize
- The batch size to be used when loading data.compositeItems
- True if items are wrapped to CompositeItems.public XdevEntityLazyQueryContainer(org.vaadin.addons.lazyquerycontainer.QueryDefinition queryDefinition, org.vaadin.addons.lazyquerycontainer.QueryFactory queryFactory)
queryFactory
- The query factory to be used.queryDefinition
- The query definition to be used.public XdevEntityLazyQueryContainer(EntityLazyQueryView queryView)
queryView
- The query view to be used.public final void sort(Object[] sortPropertyIds, boolean[] ascendingStates)
sort
in interface Container.Sortable
sortPropertyIds
- The IDs of the properties participating in sort.ascendingStates
- The sort state of the properties participating in sort. True
means ascending.public final Collection<?> getContainerPropertyIds()
getContainerPropertyIds
in interface Container
public final Collection<?> getSortableContainerPropertyIds()
getSortableContainerPropertyIds
in interface Container.Sortable
public final Class<?> getType(Object propertyId)
public final boolean addContainerProperty(Object propertyId, Class<?> type, Object defaultValue)
addContainerProperty
in interface Container
propertyId
- Id of the property.type
- Value class of the property.defaultValue
- Default value of the property.public final boolean addContainerProperty(Object propertyId, Class<?> type, Object defaultValue, boolean readOnly, boolean sortable)
propertyId
- Id of the property.type
- Value class of the property.defaultValue
- Default value of the property.readOnly
- Read only state of the property.sortable
- Sortable state of the property.public final boolean removeContainerProperty(Object propertyId)
removeContainerProperty
in interface Container
propertyId
- If of the property to be removed.public final int size()
public final Collection<?> getItemIds()
getItemIds
in interface Container
public final Property<?> getContainerProperty(Object itemId, Object propertyId)
getContainerProperty
in interface Container
itemId
- The index of the item.propertyId
- ID of the property.public final Object getIdByIndex(int index)
getIdByIndex
in interface Container.Indexed
index
- The index of the item.public final int indexOfId(Object itemId)
indexOfId
in interface Container.Indexed
itemId
- the item ID.public final boolean containsId(Object itemId)
containsId
in interface Container
itemId
- Item index.public final boolean isFirstId(Object itemId)
isFirstId
in interface Container.Ordered
itemId
- the object index.public final boolean isLastId(Object itemId)
isLastId
in interface Container.Ordered
itemId
- the object index.public final Object firstItemId()
firstItemId
in interface Container.Ordered
public final Object lastItemId()
lastItemId
in interface Container.Ordered
public final Object nextItemId(Object itemId)
nextItemId
in interface Container.Ordered
itemId
- the item indexnull
if no such itempublic final Object prevItemId(Object itemId)
prevItemId
in interface Container.Ordered
itemId
- the item indexnull
if no such itempublic final Object addItemAt(int index)
addItemAt
in interface Container.Indexed
index
- item indexpublic final Object addItemAfter(Object previousItemId)
addItemAfter
in interface Container.Ordered
previousItemId
- ID of previous item.public final Item addItemAt(int index, Object newItemId)
addItemAt
in interface Container.Indexed
index
- item indexnewItemId
- ID of new itempublic final Item addItemAfter(Object previousItemId, Object newItemId)
addItemAfter
in interface Container.Ordered
previousItemId
- ID of previous item.newItemId
- ID of new itempublic final Object addItem()
public final boolean removeItem(Object itemId)
removeItem
in interface Container
itemId
- Item index.public final boolean removeAllItems()
removeAllItems
in interface Container
@Deprecated public final void addListener(Container.ItemSetChangeListener listener)
addListener
in interface Container.ItemSetChangeNotifier
listener
- ItemSetChangeListener to be added.@Deprecated public final void removeListener(Container.ItemSetChangeListener listener)
removeListener
in interface Container.ItemSetChangeNotifier
listener
- ItemSetChangeListener to be removed.public final void removeItemSetChangeListener(Container.ItemSetChangeListener listener)
removeItemSetChangeListener
in interface Container.ItemSetChangeNotifier
public final void refresh()
@Deprecated public final void addListener(Container.PropertySetChangeListener listener)
addListener
in interface Container.PropertySetChangeNotifier
listener
- PropertySetChangeListener to be added.public final void addItemSetChangeListener(Container.ItemSetChangeListener listener)
addItemSetChangeListener
in interface Container.ItemSetChangeNotifier
public final void addPropertySetChangeListener(Container.PropertySetChangeListener listener)
addPropertySetChangeListener
in interface Container.PropertySetChangeNotifier
@Deprecated public final void removeListener(Container.PropertySetChangeListener listener)
removeListener
in interface Container.PropertySetChangeNotifier
listener
- PropertySetChangeListener to be removed.public final void removePropertySetChangeListener(Container.PropertySetChangeListener listener)
removePropertySetChangeListener
in interface Container.PropertySetChangeNotifier
public final void addContainerFilter(Container.Filter filter)
addContainerFilter
in interface Container.Filterable
public final void removeContainerFilter(Container.Filter filter)
removeContainerFilter
in interface Container.Filterable
public final void removeAllContainerFilters()
removeAllContainerFilters
in interface Container.Filterable
public Collection<Container.Filter> getContainerFilters()
getContainerFilters
in interface Container.Filterable
public final void addDefaultFilter(Container.Filter filter)
filter
- the default filterpublic final void removeDefaultFilter(Container.Filter filter)
filter
- the default filterpublic final void removeDefaultFilters()
public final void commit()
public final void discard()
public final boolean isModified()
isModified
in interface Buffered
public final EntityLazyQueryView getQueryView()
public final void setBuffered(boolean buffered)
setBuffered
in interface Buffered
public final boolean isBuffered()
isBuffered
in interface Buffered
public final List<?> getItemIds(int startIndex, int numberOfItems)
getItemIds
in interface Container.Indexed