Class 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 associated Comparator, 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 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)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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 - the Column
      • getList

        public java.util.List<T> getList()
      • setComparator

        public void setComparator​(Column<T,​?> column,
                                  java.util.Comparator<T> comparator)
        Set the comparator used to sort the specified column in ascending order.
        Parameters:
        column - the Column
        comparator - the Comparator to use for the Column
      • setList

        public void setList​(java.util.List<T> list)