Search in sources :

Example 1 with SortSpec

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;
    }
}
Also used : IColumn(org.eclipse.scout.rt.client.ui.basic.table.columns.IColumn) ArrayList(java.util.ArrayList) SortSpec(org.eclipse.scout.rt.shared.data.basic.table.SortSpec)

Aggregations

ArrayList (java.util.ArrayList)1 IColumn (org.eclipse.scout.rt.client.ui.basic.table.columns.IColumn)1 SortSpec (org.eclipse.scout.rt.shared.data.basic.table.SortSpec)1