org.jdesktop.swingx.decorator
Class Sorter
java.lang.Object
org.jdesktop.swingx.decorator.Filter
org.jdesktop.swingx.decorator.Sorter
- Direct Known Subclasses:
- ShuttleSorter
public abstract class Sorter
- extends Filter
Pluggable sorting filter.
- Author:
- Ramesh Gupta
Constructor Summary |
Sorter()
|
Sorter(int col,
boolean ascending)
|
Sorter(int col,
boolean ascending,
java.util.Comparator comparator)
|
Methods inherited from class org.jdesktop.swingx.decorator.Filter |
convertRowIndexToModel, convertRowIndexToView, getColumnIndex, getColumnName, getSize, getStringAt, getValueAt, isCellEditable, refresh, setColumnIndex, setValueAt |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Sorter
public Sorter()
Sorter
public Sorter(int col,
boolean ascending)
Sorter
public Sorter(int col,
boolean ascending,
java.util.Comparator comparator)
setComparator
public void setComparator(java.util.Comparator comparator)
- set the Comparator to use when comparing values.
If not null every compare will be delegated to it.
If null the compare will follow the internal compare
(no contract, but implemented here as:
first check if the values are Comparable, if so
delegate, then compare the String representation)
- Parameters:
comparator
-
getComparator
public java.util.Comparator getComparator()
isAscending
public boolean isAscending()
setAscending
public void setAscending(boolean ascending)
getSortOrder
public SortOrder getSortOrder()
setSortKey
public void setSortKey(SortKey sortKey)
- Updates itself according to the SortKey's properties.
- Parameters:
sortKey
-
- Throws:
java.lang.IllegalArgumentException
- if sortKey = null
java.lang.IllegalArgumentException
- if !sortKey.sortOrder().isSorted
getSortKey
public SortKey getSortKey()
toggle
public void toggle()