Class GlazedListsSortModel<T>
java.lang.Object
org.eclipse.nebula.widgets.nattable.extension.glazedlists.GlazedListsSortModel<T>
- All Implemented Interfaces:
ILayerListener
,ISortModel
-
Field Summary
Modifier and TypeFieldDescriptionprotected final IColumnAccessor<T>
protected final ILayer
protected final IColumnPropertyResolver
protected final IConfigRegistry
protected final ca.odell.glazedlists.SortedList<T>
-
Constructor Summary
ConstructorDescriptionGlazedListsSortModel
(ca.odell.glazedlists.SortedList<T> sortedList, IColumnAccessor<T> columnAccessor, IColumnPropertyResolver columnPropertyResolver, IConfigRegistry configRegistry, ILayer dataLayer) GlazedListsSortModel
(ca.odell.glazedlists.SortedList<T> sortedList, IColumnPropertyAccessor<T> columnPropertyAccessor, IConfigRegistry configRegistry, ILayer dataLayer) -
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
Remove all sortingComparator<?>
getColumnComparator
(int columnIndex) protected NatTableComparatorChooser<T>
getComparatorsForColumnIndex
(int columnIndex) getSortDirection
(int columnIndex) int
getSortOrder
(int columnIndex) void
handleLayerEvent
(ILayerEvent event) Handle an event notification from anILayer
boolean
isColumnIndexSorted
(int columnIndex) void
refresh()
Helper method to re-apply the sorting.void
sort
(int columnIndex, SortDirectionEnum sortDirection, boolean accumulate) This method is called by theSortCommandHandler
in response to a sort command.
-
Field Details
-
sortedList
-
columnAccessor
-
columnPropertyResolver
-
configRegistry
-
columnHeaderDataLayer
-
-
Constructor Details
-
GlazedListsSortModel
public GlazedListsSortModel(ca.odell.glazedlists.SortedList<T> sortedList, IColumnPropertyAccessor<T> columnPropertyAccessor, IConfigRegistry configRegistry, ILayer dataLayer) -
GlazedListsSortModel
public GlazedListsSortModel(ca.odell.glazedlists.SortedList<T> sortedList, IColumnAccessor<T> columnAccessor, IColumnPropertyResolver columnPropertyResolver, IConfigRegistry configRegistry, ILayer dataLayer)
-
-
Method Details
-
getComparatorChooser
-
getSortedColumnIndexes
- Specified by:
getSortedColumnIndexes
in interfaceISortModel
- Returns:
- List of column indexes that are sorted.
-
getSortOrder
public int getSortOrder(int columnIndex) - Specified by:
getSortOrder
in interfaceISortModel
- Parameters:
columnIndex
- The column index for which the sort order is requested.- Returns:
- when multiple columns are sorted, this returns the order of the
column index in the sort
Example: If column indexes 3, 6, 9 are sorted (in that order) the sort order for index 6 is 1.
-
getSortDirection
- Specified by:
getSortDirection
in interfaceISortModel
- Parameters:
columnIndex
- The column index for which the sort direction is requested.- Returns:
- the direction in which the column with the given index is currently sorted
-
isColumnIndexSorted
public boolean isColumnIndexSorted(int columnIndex) - Specified by:
isColumnIndexSorted
in interfaceISortModel
- Parameters:
columnIndex
- The column index to check.- Returns:
true
if the column with the given index is sorted at the moment.
-
getComparatorsForColumnIndex
- Specified by:
getComparatorsForColumnIndex
in interfaceISortModel
- Parameters:
columnIndex
- The index of the column for which the row objects should be sorted.- Returns:
- The collection of Comparators used to sort row objects by column values.
-
getColumnComparator
- Specified by:
getColumnComparator
in interfaceISortModel
- Parameters:
columnIndex
- The index of the column for which theComparator
is requested.- Returns:
- The
Comparator
that is used for sorting the values of a specified column. Needed in case of data model wrapping, e.g. GroupBy
-
sort
Description copied from interface:ISortModel
This method is called by theSortCommandHandler
in response to a sort command. It is responsible for sorting the requested column.- Specified by:
sort
in interfaceISortModel
- Parameters:
columnIndex
- The column index to sort.sortDirection
- The sort direction to apply.accumulate
- flag indicating if the column should added to a previous sort.
-
clear
public void clear()Description copied from interface:ISortModel
Remove all sorting- Specified by:
clear
in interfaceISortModel
-
handleLayerEvent
Description copied from interface:ILayerListener
Handle an event notification from anILayer
- Specified by:
handleLayerEvent
in interfaceILayerListener
- Parameters:
event
- the event
-
refresh
public void refresh()Helper method to re-apply the sorting.- Since:
- 1.6
-