Class GroupByTreeFormat<T>
- java.lang.Object
-
- org.eclipse.nebula.widgets.nattable.extension.glazedlists.groupBy.GroupByTreeFormat<T>
-
- Type Parameters:
T
- The type of the base objects carried in the TreeList.
- All Implemented Interfaces:
ca.odell.glazedlists.TreeList.Format<Object>
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 Summary
Constructors Constructor Description GroupByTreeFormat(GroupByModel model, IColumnAccessor<T> columnAccessor)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
allowsChildren(Object element)
void
clearComparatorCache()
Clear the comparator local cache of summary information that is used to increase performance on sorting.Comparator<Object>
getComparator(int depth)
protected GroupByObject
getGroupByObject(Object columnValue, Map<Integer,Object> descriptor)
void
getPath(List<Object> path, Object element)
ISortModel
getSortModel()
void
setComparator(IGroupByComparator<T> comparator)
void
setSortModel(ISortModel model)
-
-
-
Constructor Detail
-
GroupByTreeFormat
public GroupByTreeFormat(GroupByModel model, IColumnAccessor<T> columnAccessor)
- Parameters:
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 Detail
-
getPath
public void getPath(List<Object> path, Object element)
- Specified by:
getPath
in interfaceca.odell.glazedlists.TreeList.Format<T>
-
getGroupByObject
protected GroupByObject getGroupByObject(Object columnValue, Map<Integer,Object> descriptor)
- Parameters:
columnValue
- The column value that is used to create theGroupByObject
. Specifies the groupBy value.descriptor
- The descriptor that is used to create theGroupByObject
. Specifies the groupBy depth.- Returns:
- The
GroupByObject
for the given value and descriptor.
-
allowsChildren
public boolean allowsChildren(Object element)
- Specified by:
allowsChildren
in interfaceca.odell.glazedlists.TreeList.Format<T>
-
getComparator
public Comparator<Object> getComparator(int depth)
- Specified by:
getComparator
in interfaceca.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)
- Parameters:
model
- TheISortModel
that should be set to theIGroupByComparator
.- See Also:
IGroupByComparator.setSortModel(ISortModel)
-
getSortModel
public ISortModel getSortModel()
- Returns:
- The
ISortModel
that is set to theIGroupByComparator
. - See Also:
IGroupByComparator.getSortModel()
-
setComparator
public void setComparator(IGroupByComparator<T> comparator)
- Parameters:
comparator
- TheIGroupByComparator
that should be used to sort theTreeList
in order to be able to build the tree structure correctly.
-
-