T - the generic type of the Model for the DataProvider.S - the generic type for the SortState.public class AbstractSortableDataProvider<T extends Serializable,S extends Serializable> extends Object implements org.apache.wicket.extensions.markup.html.repeater.data.table.ISortableDataProvider<T,S>
| Constructor and Description |
|---|
AbstractSortableDataProvider()
Default constructor.
|
AbstractSortableDataProvider(List<T> data)
Instantiates a new abstract data provider.
|
| Modifier and Type | Method and Description |
|---|---|
void |
detach() |
List<T> |
getData()
Gets the data.
|
org.apache.wicket.extensions.markup.html.repeater.util.SortParam<S> |
getSort()
Returns current sort state.
|
org.apache.wicket.extensions.markup.html.repeater.data.sort.ISortState<S> |
getSortState()
Gets the sort state.
|
Iterator<? extends T> |
iterator(long first,
long count) |
org.apache.wicket.model.IModel<T> |
model(T object) |
protected void |
setData(List<T> data)
Sets the data.
|
void |
setSort(org.apache.wicket.extensions.markup.html.repeater.util.SortParam<S> param)
Sets the current sort state.
|
void |
setSort(S property,
org.apache.wicket.extensions.markup.html.repeater.data.sort.SortOrder order)
Sets the current sort state.
|
long |
size() |
protected List<T> |
sort()
Sorts the given list by getting the
SortParam.getProperty() and if not null the given
list will be sort. |
protected List<T> |
sort(List<T> unsortedList)
Sorts the given list by getting the
SortParam.getProperty() and if not null the given
list will be sort. |
public AbstractSortableDataProvider()
public final org.apache.wicket.extensions.markup.html.repeater.data.sort.ISortState<S> getSortState()
getSortState in interface org.apache.wicket.extensions.markup.html.repeater.data.sort.ISortStateLocator<S extends Serializable>ISortStateLocator.getSortState()public org.apache.wicket.extensions.markup.html.repeater.util.SortParam<S> getSort()
public void setSort(org.apache.wicket.extensions.markup.html.repeater.util.SortParam<S> param)
param - parameter containing new sorting informationpublic void setSort(S property, org.apache.wicket.extensions.markup.html.repeater.data.sort.SortOrder order)
property - sort propertyorder - sort orderpublic void detach()
detach in interface org.apache.wicket.model.IDetachablepublic Iterator<? extends T> iterator(long first, long count)
iterator in interface org.apache.wicket.markup.repeater.data.IDataProvider<T extends Serializable>protected List<T> sort(List<T> unsortedList)
SortParam.getProperty() and if not null the given
list will be sort.unsortedList - the unsorted listprotected List<T> sort()
SortParam.getProperty() and if not null the given
list will be sort.public org.apache.wicket.model.IModel<T> model(T object)
model in interface org.apache.wicket.markup.repeater.data.IDataProvider<T extends Serializable>public long size()
size in interface org.apache.wicket.markup.repeater.data.IDataProvider<T extends Serializable>Copyright © 2010–2015. All rights reserved.