Search in sources :

Example 1 with ClearAllSelectionsCommand

use of org.eclipse.nebula.widgets.nattable.selection.command.ClearAllSelectionsCommand in project nebula.widgets.nattable by eclipse.

the class RowReorderDragMode method mouseDown.

@Override
public void mouseDown(NatTable natTable, MouseEvent event) {
    this.natTable = natTable;
    this.initialEvent = event;
    this.currentEvent = this.initialEvent;
    this.dragFromGridRowPosition = getDragFromGridRowPosition();
    natTable.addOverlayPainter(this.targetOverlayPainter);
    natTable.doCommand(new ClearAllSelectionsCommand());
    fireMoveStartCommand(natTable, this.dragFromGridRowPosition);
}
Also used : ClearAllSelectionsCommand(org.eclipse.nebula.widgets.nattable.selection.command.ClearAllSelectionsCommand)

Example 2 with ClearAllSelectionsCommand

use of org.eclipse.nebula.widgets.nattable.selection.command.ClearAllSelectionsCommand in project nebula.widgets.nattable by eclipse.

the class SingleRowSelectionDragMode method mouseMove.

@Override
public void mouseMove(NatTable natTable, MouseEvent event) {
    natTable.doCommand(new ClearAllSelectionsCommand());
    if (event.x > natTable.getWidth()) {
        return;
    }
    int selectedColumnPosition = natTable.getColumnPositionByX(event.x);
    int selectedRowPosition = natTable.getRowPositionByY(event.y);
    if (selectedColumnPosition > -1 && selectedRowPosition > -1) {
        fireSelectionCommand(natTable, selectedColumnPosition, selectedRowPosition, false, false);
    }
}
Also used : ClearAllSelectionsCommand(org.eclipse.nebula.widgets.nattable.selection.command.ClearAllSelectionsCommand)

Example 3 with ClearAllSelectionsCommand

use of org.eclipse.nebula.widgets.nattable.selection.command.ClearAllSelectionsCommand in project nebula.widgets.nattable by eclipse.

the class SearchDialog method doSelect.

private void doSelect(SelectionItem selection) {
    ILayerCommand command;
    if (selection.pos.columnPosition != SelectionLayer.NO_SELECTION) {
        command = createSelectCellCommand(selection.pos);
    } else {
        command = new ClearAllSelectionsCommand();
    }
    final ILayerCommand finalCommand = command;
    BusyIndicator.showWhile(getShell().getDisplay(), new Runnable() {

        @Override
        public void run() {
            SearchDialog.this.natTable.doCommand(finalCommand);
        }
    });
}
Also used : ClearAllSelectionsCommand(org.eclipse.nebula.widgets.nattable.selection.command.ClearAllSelectionsCommand) ILayerCommand(org.eclipse.nebula.widgets.nattable.command.ILayerCommand)

Example 4 with ClearAllSelectionsCommand

use of org.eclipse.nebula.widgets.nattable.selection.command.ClearAllSelectionsCommand in project nebula.widgets.nattable by eclipse.

the class ColumnReorderDragMode method mouseDown.

@Override
public void mouseDown(NatTable natTable, MouseEvent event) {
    this.natTable = natTable;
    this.initialEvent = event;
    this.currentEvent = this.initialEvent;
    this.dragFromGridColumnPosition = getDragFromGridColumnPosition();
    natTable.addOverlayPainter(this.targetOverlayPainter);
    natTable.doCommand(new ClearAllSelectionsCommand());
    fireMoveStartCommand(natTable, this.dragFromGridColumnPosition);
}
Also used : ClearAllSelectionsCommand(org.eclipse.nebula.widgets.nattable.selection.command.ClearAllSelectionsCommand)

Example 5 with ClearAllSelectionsCommand

use of org.eclipse.nebula.widgets.nattable.selection.command.ClearAllSelectionsCommand in project nebula.widgets.nattable by eclipse.

the class SingleRowSelectionDragMode method mouseMove.

@Override
public void mouseMove(NatTable natTable, MouseEvent event) {
    natTable.doCommand(new ClearAllSelectionsCommand());
    if (event.x > natTable.getWidth()) {
        return;
    }
    int selectedColumnPosition = natTable.getColumnPositionByX(event.x);
    int selectedRowPosition = natTable.getRowPositionByY(event.y);
    if (selectedColumnPosition > -1 && selectedRowPosition > -1) {
        fireSelectionCommand(natTable, selectedColumnPosition, selectedRowPosition, false, false);
    }
}
Also used : ClearAllSelectionsCommand(org.eclipse.nebula.widgets.nattable.selection.command.ClearAllSelectionsCommand)

Aggregations

ClearAllSelectionsCommand (org.eclipse.nebula.widgets.nattable.selection.command.ClearAllSelectionsCommand)5 ILayerCommand (org.eclipse.nebula.widgets.nattable.command.ILayerCommand)1