Search in sources :

Example 6 with MoveSelectionCommand

use of net.sourceforge.nattable.selection.command.MoveSelectionCommand in project translationstudio8 by heartsome.

the class MoveToLastColumnAction method run.

public void run(NatTable natTable, KeyEvent event) {
    super.run(natTable, event);
    natTable.doCommand(new MoveSelectionCommand(MoveDirectionEnum.RIGHT, SelectionLayer.MOVE_ALL, isShiftMask(), isControlMask()));
}
Also used : MoveSelectionCommand(net.sourceforge.nattable.selection.command.MoveSelectionCommand)

Example 7 with MoveSelectionCommand

use of net.sourceforge.nattable.selection.command.MoveSelectionCommand in project translationstudio8 by heartsome.

the class SingleEditHandler method commit.

/**
	 * {@inheritDoc}
 	 * Note: Assumes that the value is valid.<br/>
	 */
public boolean commit(MoveDirectionEnum direction, boolean closeEditorAfterCommit) {
    Object canonicalValue = cellEditor.getCanonicalValue();
    switch(direction) {
        case LEFT:
            layer.doCommand(new MoveSelectionCommand(MoveDirectionEnum.LEFT, 1, false, false));
            break;
        case RIGHT:
            layer.doCommand(new MoveSelectionCommand(MoveDirectionEnum.RIGHT, 1, false, false));
            break;
    }
    boolean committed = layer.doCommand(new UpdateDataCommand(layer, columnPosition, rowPosition, canonicalValue));
    if (committed && closeEditorAfterCommit) {
        cellEditor.close();
        return true;
    }
    return committed;
}
Also used : UpdateDataCommand(net.sourceforge.nattable.edit.command.UpdateDataCommand) MoveSelectionCommand(net.sourceforge.nattable.selection.command.MoveSelectionCommand)

Aggregations

MoveSelectionCommand (net.sourceforge.nattable.selection.command.MoveSelectionCommand)7 UpdateDataAndAutoResizeCommand (net.heartsome.cat.ts.ui.xliffeditor.nattable.handler.UpdateDataAndAutoResizeCommand)1 UpdateDataCommand (net.sourceforge.nattable.edit.command.UpdateDataCommand)1 DataLayer (net.sourceforge.nattable.layer.DataLayer)1