Type Parameters:
T - The type of the base objects carried in the TreeList.
All Implemented Interfaces:

public class GroupByTreeFormat<T> extends Object implements ca.odell.glazedlists.TreeList.Format<Object>
The TreeList.Format that is used by the TreeList that is created and used by the GroupByDataLayer. Note that the TreeList created by the GroupByDataLayer is generic for Object because the groupBy functionality will add GroupByObjects to the path for creating the grouping.
  • Constructor Details

    • GroupByTreeFormat

      public GroupByTreeFormat(GroupByModel model, IColumnAccessor<T> columnAccessor)
      model - The GroupByModel that carries the information about the groupBy states.
      columnAccessor - The IColumnAccessor that is used to get the column value for the columns that are grouped by. Needed for compare operations and creating the path in the tree.
  • Method Details

    • getPath

      public void getPath(List<Object> path, Object element)
      Specified by:
      getPath in interface ca.odell.glazedlists.TreeList.Format<T>
    • getGroupByObject

      protected GroupByObject getGroupByObject(Object columnValue, Map<Integer,Object> descriptor)
      columnValue - The column value that is used to create the GroupByObject. Specifies the groupBy value.
      descriptor - The descriptor that is used to create the GroupByObject. Specifies the groupBy depth.
      The GroupByObject for the given value and descriptor.
    • allowsChildren

      public boolean allowsChildren(Object element)
      Specified by:
      allowsChildren in interface ca.odell.glazedlists.TreeList.Format<T>
    • getComparator

      public Comparator<Object> getComparator(int depth)
      Specified by:
      getComparator in interface ca.odell.glazedlists.TreeList.Format<T>
    • clearComparatorCache

      public void clearComparatorCache()
      Clear the comparator local cache of summary information that is used to increase performance on sorting. Can be called often since the cache is only valid for a sorting operation.
    • setSortModel

      public void setSortModel(ISortModel model)
      model - The ISortModel that should be set to the IGroupByComparator.
      See Also:
    • getSortModel

      public ISortModel getSortModel()
      The ISortModel that is set to the IGroupByComparator.
      See Also:
    • setComparator

      public void setComparator(IGroupByComparator<T> comparator)
      comparator - The IGroupByComparator that should be used to sort the TreeList in order to be able to build the tree structure correctly.