Set<String> invertedNodes = request.getInvertedNodes();
int numRows = request.getNumRows();
int startRow = request.getStartRow();
int currentRow = 0;
ColumnSortList columnSortList = request.getColumnSortList();
ColumnSortInfo columnSortInfo = columnSortList.getPrimaryColumnSortInfo();
TreeItemComparator treeItemComparator = null;
if (columnSortInfo != null) {
List<ColumnDefinition<RowType, ?>> visibleColumnDefinitions = tableDefinition.getVisibleColumnDefinitions();
ColumnDefinition<RowType, ?> sortableColumnDefinition = null;
for (ColumnDefinition<RowType, ?> columnDefinition : visibleColumnDefinitions) {
// if (columnDefinition.getColumnFilter() != null
// && columnSortInfo != null) {
// if (columnDefinition.getColumnFilter().getColumn() ==
// columnSortInfo.getColumn()) {
// sortableColumnDefinition = columnDefinition;
// }
// }
}
if (sortableColumnDefinition != null) {
treeItemComparator = new TreeItemComparator(sortableColumnDefinition,
columnSortInfo.isAscending());
if (flattened) {
Collections.sort(flattenedItems, treeItemComparator);
} else {
Collections.sort(rootItems, treeItemComparator);
}