Search in sources :

Example 1 with UpdateDataAndAutoResizeCommand

use of net.heartsome.cat.ts.ui.xliffeditor.nattable.handler.UpdateDataAndAutoResizeCommand 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)

Aggregations

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