Class ColumnSortEvent.ListHandler<T>
- java.lang.Object
-
- com.google.gwt.user.cellview.client.ColumnSortEvent.ListHandler<T>
-
- Type Parameters:
T
- the data type of the list
- All Implemented Interfaces:
EventHandler
,ColumnSortEvent.Handler
- Enclosing class:
- ColumnSortEvent
public 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 associatedComparator
, the list is sorted using the comparator.This can be used in conjunction with
ListDataProvider
.
-
-
Constructor Summary
Constructors Constructor Description ListHandler(java.util.List<T> list)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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 whenColumnSortEvent
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)
-
-
-
Constructor Detail
-
ListHandler
public ListHandler(java.util.List<T> list)
-
-
Method Detail
-
getComparator
public 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.- Parameters:
column
- theColumn
-
getList
public java.util.List<T> getList()
-
onColumnSort
public void onColumnSort(ColumnSortEvent event)
Description copied from interface:ColumnSortEvent.Handler
Called whenColumnSortEvent
is fired.- Specified by:
onColumnSort
in interfaceColumnSortEvent.Handler
- Parameters:
event
- theColumnSortEvent
that was fired
-
setComparator
public void setComparator(Column<T,?> column, java.util.Comparator<T> comparator)
Set the comparator used to sort the specified column in ascending order.
-
setList
public void setList(java.util.List<T> list)
-
-