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;
}
Aggregations