Search in sources :

Example 1 with MoveSelectionCommand

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

the class HsMultiCellEditorHandler method commit.

/**
	 * Just commit the data, will not close the editor control
	 * @see net.sourceforge.nattable.edit.ICellEditHandler#commit(net.sourceforge.nattable.selection.SelectionLayer.MoveDirectionEnum, boolean)
	 */
public boolean commit(MoveDirectionEnum direction, boolean closeEditorAfterCommit) {
    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;
    }
    if (cellEditor.isEditable()) {
        Object canonicalValue = cellEditor.getCanonicalValue();
        DataLayer datalayer = LayerUtil.getLayer((CompositeLayer) layer, DataLayer.class);
        datalayer.doCommand(new UpdateDataAndAutoResizeCommand(layer, cellEditor.getColumnIndex(), cellEditor.getRowIndex(), canonicalValue));
    //			layer.doCommand(new UpdateDataCommand(layer, cellEditor.getColumnPosition(), cellEditor.getRowPosition(), canonicalValue));
    }
    return true;
}
Also used : DataLayer(net.sourceforge.nattable.layer.DataLayer) MoveSelectionCommand(net.sourceforge.nattable.selection.command.MoveSelectionCommand) UpdateDataAndAutoResizeCommand(net.heartsome.cat.ts.ui.xliffeditor.nattable.handler.UpdateDataAndAutoResizeCommand)

Example 2 with MoveSelectionCommand

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

the class MoveSelectionAction method run.

@Override
public void run(NatTable natTable, KeyEvent event) {
    super.run(natTable, event);
    natTable.doCommand(new MoveSelectionCommand(getDirection(), 1, isShiftMask(), isControlMask()));
}
Also used : MoveSelectionCommand(net.sourceforge.nattable.selection.command.MoveSelectionCommand)

Example 3 with MoveSelectionCommand

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

the class MoveToFirstColumnAction method run.

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

Example 4 with MoveSelectionCommand

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

the class MoveToFirstRowAction method run.

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

Example 5 with MoveSelectionCommand

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

the class MoveToLastRowAction method run.

@Override
public void run(NatTable natTable, KeyEvent event) {
    super.run(natTable, event);
    natTable.doCommand(new MoveSelectionCommand(MoveDirectionEnum.DOWN, SelectionLayer.MOVE_ALL, isShiftMask(), isControlMask()));
}
Also used : 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