|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jdesktop.swingx.decorator.Filter org.jdesktop.swingx.decorator.Sorter
public abstract class Sorter
Pluggable sorting filter.
Field Summary |
---|
Fields inherited from class org.jdesktop.swingx.decorator.Filter |
---|
adapter, fromPrevious, pipeline |
Constructor Summary | |
---|---|
Sorter()
|
|
Sorter(int col,
boolean ascending)
|
|
Sorter(int col,
boolean ascending,
Comparator comparator)
|
Method Summary | |
---|---|
protected int |
compare(int row1,
int row2)
Compares and returns the entries in row1 vs row2 and returns -1, 0, -1 depending on their being <, ==, > in the current sort direction. |
protected Collator |
getCollator()
exposed for testing only! |
Comparator |
getComparator()
|
SortKey |
getSortKey()
|
SortOrder |
getSortOrder()
|
boolean |
isAscending()
|
protected void |
refresh(boolean reset)
Refreshes the internal state of the filter, optionally resetting the cache of existing row mappings from this filter to the previous filter. |
protected void |
refreshCollator()
Subclasses must call this before filtering to guarantee the correct collator! |
void |
setAscending(boolean ascending)
|
void |
setComparator(Comparator comparator)
set the Comparator to use when comparing values. |
void |
setSortKey(SortKey sortKey)
Updates itself according to the SortKey's properties. |
void |
toggle()
|
Methods inherited from class org.jdesktop.swingx.decorator.Filter |
---|
assign, convertRowIndexToModel, convertRowIndexToView, filter, fireFilterChanged, getColumnIndex, getColumnName, getInputSize, getInputString, getInputValue, getMappingFilter, getPipeline, getSize, getStringAt, getValueAt, init, isCellEditable, mapTowardModel, mapTowardView, refresh, reset, setColumnIndex, setValueAt |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Sorter()
public Sorter(int col, boolean ascending)
public Sorter(int col, boolean ascending, Comparator comparator)
Method Detail |
---|
protected void refresh(boolean reset)
Filter
filter
operation and regenerates
row mappings from the previous filter. If this filter is bound to a filter
pipeline (as most filters are), it also triggers a
filterChanged
notification.
refresh
in class Filter
reset
- true if existing row mappings from this filter to the previous
filter should be reset; false, if the existing row mappings should be preserved.protected void refreshCollator()
protected Collator getCollator()
Collator
public void setComparator(Comparator comparator)
comparator
- public Comparator getComparator()
protected int compare(int row1, int row2)
row1
- row2
-
public boolean isAscending()
public void setAscending(boolean ascending)
public SortOrder getSortOrder()
public void setSortKey(SortKey sortKey)
sortKey
-
IllegalArgumentException
- if sortKey = null
IllegalArgumentException
- if !sortKey.sortOrder().isSortedpublic SortKey getSortKey()
public void toggle()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |