/** * Setup sort type for this column and recalculate sortOrder of other columns to hold consistent * state. * * @param sortType new sort type */ public void setSortType(final DLSortType sortType) { // if there was setted NATURAL and won't be then active sort order if (DLSortType.NATURAL.equals(this.sortType) && !DLSortType.NATURAL.equals(sortType)) { sortOrder = columnModel.autoIncSortMaxIndex(); } // if there wasn't setted NATURAL and will be then deactive sort order if (!DLSortType.NATURAL.equals(this.sortType) && DLSortType.NATURAL.equals(sortType)) { columnModel.autoDecSortMaxIndex(); for (DLColumnUnitModel unit : columnModel.getColumnModels()) { unit.autodecrementSortOrder(sortOrder); } sortOrder = 0; } setSortTypeDirectly(sortType); }
public boolean isSorted() { return !DLSortType.NATURAL.equals(sortType); }