Search in sources :

Example 1 with SortDirectionEnum

use of net.sourceforge.nattable.sort.SortDirectionEnum in project translationstudio8 by heartsome.

the class SortCommandHandler method doCommand.

@Override
public boolean doCommand(final SortColumnCommand command) {
    final int columnIndex = command.getLayer().getColumnIndexByPosition(command.getColumnPosition());
    final SortDirectionEnum newSortDirection = sortModel.getSortDirection(columnIndex).getNextSortDirection();
    // Fire command - with busy indicator
    Runnable sortRunner = new Runnable() {

        public void run() {
            sortModel.sort(columnIndex, newSortDirection, command.isAccumulate());
        }
    };
    BusyIndicator.showWhile(null, sortRunner);
    // Fire event
    SortColumnEvent sortEvent = new SortColumnEvent(sortHeaderLayer, command.getColumnPosition());
    sortHeaderLayer.fireLayerEvent(sortEvent);
    return true;
}
Also used : SortColumnEvent(net.sourceforge.nattable.sort.event.SortColumnEvent) SortDirectionEnum(net.sourceforge.nattable.sort.SortDirectionEnum)

Aggregations

SortDirectionEnum (net.sourceforge.nattable.sort.SortDirectionEnum)1 SortColumnEvent (net.sourceforge.nattable.sort.event.SortColumnEvent)1