T
- the data type of the listpublic static class ColumnSortEvent.ListHandler<T> extends java.lang.Object implements ColumnSortEvent.Handler
A default handler used to sort a List
backing a table. If the
sorted column has an associated Comparator
, the list is sorted
using the comparator.
This can be used in conjunction with
ListDataProvider
.
Constructor and Description |
---|
ListHandler(java.util.List<T> list) |
Modifier and Type | Method and Description |
---|---|
java.util.Comparator<T> |
getComparator(Column<T,?> column)
Returns the comparator that has been set for the specified column, or
null if no comparator has been set.
|
java.util.List<T> |
getList() |
void |
onColumnSort(ColumnSortEvent event)
Called when
ColumnSortEvent is fired. |
void |
setComparator(Column<T,?> column,
java.util.Comparator<T> comparator)
Set the comparator used to sort the specified column in ascending order.
|
void |
setList(java.util.List<T> list) |
public ListHandler(java.util.List<T> list)
public java.util.Comparator<T> getComparator(Column<T,?> column)
column
- the Column
public java.util.List<T> getList()
public void onColumnSort(ColumnSortEvent event)
ColumnSortEvent.Handler
ColumnSortEvent
is fired.onColumnSort
in interface ColumnSortEvent.Handler
event
- the ColumnSortEvent
that was firedpublic void setComparator(Column<T,?> column, java.util.Comparator<T> comparator)
public void setList(java.util.List<T> list)