Package org.jdesktop.swingx.decorator
Class ShuttleSorter
- java.lang.Object
-
- org.jdesktop.swingx.decorator.Filter
-
- org.jdesktop.swingx.decorator.Sorter
-
- org.jdesktop.swingx.decorator.ShuttleSorter
-
public class ShuttleSorter extends Sorter
Pluggable sorting filter.
-
-
Field Summary
-
Fields inherited from class org.jdesktop.swingx.decorator.Filter
adapter, fromPrevious, pipeline
-
-
Constructor Summary
Constructors Constructor Description ShuttleSorter()ShuttleSorter(int col, boolean ascending)ShuttleSorter(int col, boolean ascending, java.util.Comparator comparator)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected booleancanFilter()This is a quickfix for #55-swingx: NPE if sorter is in pipeline.protected voidfilter()Performs the sort.intgetSize()Returns the number of records that remain in this filter's output ("view") after the input records have been filtered.protected voidinit()Provides filter-specific initialization.protected intmapTowardModel(int row)PRE: 0 <= row <getSize();protected voidreset()Resets the internal row mappings from this filter to the previous filter.protected voidsort(int[] from, int[] to, int low, int high)-
Methods inherited from class org.jdesktop.swingx.decorator.Sorter
compare, getCollator, getComparator, getSortKey, getSortOrder, isAscending, refresh, refreshCollator, setAscending, setComparator, setSortKey, toggle
-
Methods inherited from class org.jdesktop.swingx.decorator.Filter
assign, convertRowIndexToModel, convertRowIndexToView, fireFilterChanged, getColumnIndex, getColumnName, getInputSize, getInputString, getInputValue, getMappingFilter, getPipeline, getStringAt, getValueAt, isCellEditable, mapTowardView, refresh, setColumnIndex, setValueAt
-
-
-
-
Method Detail
-
init
protected void init()
Description copied from class:FilterProvides filter-specific initialization. Called from theFilterconstructor.
-
reset
protected void reset()
Resets the internal row mappings from this filter to the previous filter.
-
filter
protected void filter()
Performs the sort. Calls sort only if canFilter(), regards all values as equal (== doesn't sort) otherwise.- Specified by:
filterin classFilter- See Also:
canFilter()
-
canFilter
protected boolean canFilter()
This is a quickfix for #55-swingx: NPE if sorter is in pipeline. No way to automatically cleanup "from the outside" if the sorter is hooked to a columnIndex which is no longer valid. So we check here for assigned and valid index.PENDING: should be done higher up?
- Returns:
- boolean to indicate whether accessing the values is valid.
-
getSize
public int getSize()
Description copied from class:FilterReturns the number of records that remain in this filter's output ("view") after the input records have been filtered.
-
mapTowardModel
protected int mapTowardModel(int row)
Description copied from class:FilterPRE: 0 <= row <getSize();- Specified by:
mapTowardModelin classFilter- Returns:
- TODO:
-
sort
protected void sort(int[] from, int[] to, int low, int high)
-
-