use of org.eclipse.scout.rt.shared.data.basic.table.SortSpec in project scout.rt by eclipse.
the class ColumnSet method getSortSpec.
public SortSpec getSortSpec() {
ArrayList<IColumn<?>> sortColumns = new ArrayList<IColumn<?>>();
for (IColumn c : getSortColumns()) {
sortColumns.add(c);
}
if (sortColumns.size() > 0) {
int[] indexes = new int[sortColumns.size()];
boolean[] asc = new boolean[sortColumns.size()];
for (int i = 0; i < sortColumns.size(); i++) {
indexes[i] = sortColumns.get(i).getColumnIndex();
asc[i] = sortColumns.get(i).isSortAscending();
}
return new SortSpec(indexes, asc);
} else {
return null;
}
}