T
- the data type of the listpublic static class ColumnSortEvent.ListHandler<T> extends 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 |
---|
ColumnSortEvent.ListHandler(List<T> list) |
Modifier and Type | Method and Description |
---|---|
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.
|
List<T> |
getList() |
void |
onColumnSort(ColumnSortEvent event)
Called when
ColumnSortEvent is fired. |
void |
setComparator(Column<T,?> column,
Comparator<T> comparator)
Set the comparator used to sort the specified column in ascending order.
|
void |
setList(List<T> list) |
public Comparator<T> getComparator(Column<T,?> column)
column
- the Column
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, Comparator<T> comparator)
column
- the Column
comparator
- the Comparator
to use for the Column
Copyright © 2016. All rights reserved.