Package org.jdesktop.swingx.sort
Class SortUtils
java.lang.Object
org.jdesktop.swingx.sort.SortUtils
Collection of convenience methods.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic RowSorter.SortKey
getFirstSortingKey
(List<? extends RowSorter.SortKey> keys) Returns the first SortKey in the list which is sorted.static RowSorter.SortKey
getFirstSortKeyForColumn
(List<? extends RowSorter.SortKey> keys, int modelColumn) Returns the first SortKey in the list for the given column, or null if the column has no SortKey.static boolean
isAscending
(SortOrder sortOrder) Convenience to check for ascending sort order.static boolean
static boolean
static RowSorter.SortKey
removeFirstSortKeyForColumn
(List<? extends RowSorter.SortKey> keys, int modelColumn) Removes and returns the first SortKey in the list for the given column, or null if the column has no SortKey.
-
Constructor Details
-
SortUtils
private SortUtils()
-
-
Method Details
-
getFirstSortingKey
Returns the first SortKey in the list which is sorted. If none is sorted, null is returned.- Parameters:
keys
- a list of SortKeys to search- Returns:
- the first SortKey which is sorted or null, if no is found.
-
getFirstSortKeyForColumn
public static RowSorter.SortKey getFirstSortKeyForColumn(List<? extends RowSorter.SortKey> keys, int modelColumn) Returns the first SortKey in the list for the given column, or null if the column has no SortKey.- Parameters:
keys
- a list of SortKeys to searchmodelColumn
- the column index in model coordinates- Returns:
- the first SortKey for the given column or null if none is found.
-
removeFirstSortKeyForColumn
public static RowSorter.SortKey removeFirstSortKeyForColumn(List<? extends RowSorter.SortKey> keys, int modelColumn) Removes and returns the first SortKey in the list for the given column, or null if the column has no SortKey.- Parameters:
keys
- a list of SortKeys to searchmodelColumn
- the column index in model coordinates- Returns:
- the first SortKey for the given column or null if none is found.
-
isSorted
-
isAscending
Convenience to check for ascending sort order. PENDING: is this helpful at all?- Returns:
- true if ascendingly sorted, false for unsorted/descending.
-
isSorted
-