boolean sortAsc = true;
// is there any sorting
if (query.getSortState().getColumns().size() > 0) {
// get the most relevant column
ISortStateColumn state = query.getSortState().getColumns().get(0);
// get the column sort properties
sortProperty = state.getPropertyName();
sortAsc = state.getDirection() == IGridSortState.Direction.ASC;
}
// since we don't know the actual item count we try to load one item more than requested
// if there are n+1 items we know there will be something on the next page