/** * Returns the SortOrder. * * @return the interactive sorter's SortOrder * or SortOrder.UNSORTED */ public SortOrder getSortOrder() { SortController sortController = getSortController(); if (sortController == null) return SortOrder.UNSORTED; SortKey sortKey = SortKey.getFirstSortKeyForColumn(sortController.getSortKeys(), 0); return sortKey != null ? sortKey.getSortOrder() : SortOrder.UNSORTED; }
/** * Returns the SortOrder of the given column. * * @param columnIndex the column index in view coordinates. * @return the interactive sorter's SortOrder if matches the column or * SortOrder.UNSORTED */ public SortOrder getSortOrder(int columnIndex) { SortController sortController = getSortController(); if (sortController == null) return SortOrder.UNSORTED; SortKey sortKey = SortKey.getFirstSortKeyForColumn(sortController .getSortKeys(), convertColumnIndexToModel(columnIndex)); return sortKey != null ? sortKey.getSortOrder() : SortOrder.UNSORTED; }
/** * Returns the SortOrder of the given column. * * PENDING: JW - define the behaviour if the identifier is not found. This * can happen if either there's no column at all with the identifier or if * there's no column of type TableColumnExt. Currently returns * SortOrder.UNSORTED. * * @param identifier the column's identifier. * @return the interactive sorter's SortOrder if matches the column or * SortOrder.UNSORTED */ public SortOrder getSortOrder(Object identifier) { SortController sortController = getSortController(); if (sortController == null) return SortOrder.UNSORTED; TableColumnExt columnExt = getColumnExt(identifier); if (columnExt == null) return SortOrder.UNSORTED; int modelIndex = columnExt.getModelIndex(); SortKey sortKey = SortKey.getFirstSortKeyForColumn(sortController .getSortKeys(), modelIndex); return sortKey != null ? sortKey.getSortOrder() : SortOrder.UNSORTED; }