Search in sources :

Example 1 with EditCellCommand

use of net.sourceforge.nattable.edit.command.EditCellCommand in project translationstudio8 by heartsome.

the class CellEditDragMode method mouseUp.

public void mouseUp(NatTable natTable, MouseEvent event) {
    super.mouseUp(natTable, event);
    int columnPosition = natTable.getColumnPositionByX(event.x);
    int rowPosition = natTable.getRowPositionByY(event.y);
    if (columnPosition == originalColumnPosition && rowPosition == originalRowPosition) {
        natTable.doCommand(new EditCellCommand(natTable, natTable.getConfigRegistry(), natTable.getCellByPosition(columnPosition, rowPosition)));
    }
}
Also used : EditCellCommand(net.sourceforge.nattable.edit.command.EditCellCommand)

Example 2 with EditCellCommand

use of net.sourceforge.nattable.edit.command.EditCellCommand in project translationstudio8 by heartsome.

the class MouseEditAction method run.

public void run(NatTable natTable, MouseEvent event) {
    int columnPosition = natTable.getColumnPositionByX(event.x);
    int rowPosition = natTable.getRowPositionByY(event.y);
    boolean withShiftMask = (event.stateMask & SWT.SHIFT) != 0;
    boolean withCtrlMask = (event.stateMask & SWT.CTRL) != 0;
    natTable.doCommand(new SelectCellCommand(natTable, columnPosition, rowPosition, withShiftMask, withCtrlMask));
    natTable.doCommand(new EditCellCommand(natTable, natTable.getConfigRegistry(), natTable.getCellByPosition(columnPosition, rowPosition)));
}
Also used : SelectCellCommand(net.sourceforge.nattable.selection.command.SelectCellCommand) EditCellCommand(net.sourceforge.nattable.edit.command.EditCellCommand)

Aggregations

EditCellCommand (net.sourceforge.nattable.edit.command.EditCellCommand)2 SelectCellCommand (net.sourceforge.nattable.selection.command.SelectCellCommand)1