use of net.heartsome.cat.ts.ui.xliffeditor.nattable.undoable.UpdateDataOperation in project translationstudio8 by heartsome.
the class UpdateDataAndAutoResizeCommandHandler method doCommand.
@Override
protected boolean doCommand(UpdateDataAndAutoResizeCommand command) {
try {
// int columnPosition = command.getColumnPosition();
// int rowPosition = command.getRowPosition();
// dataLayer.getDataProvider().setDataValue(columnPosition, rowPosition, command.getNewValue());
// dataLayer.fireLayerEvent(new CellVisualChangeEvent(dataLayer, columnPosition, rowPosition));
//
// int currentRow = command.getRowPosition() + 1; // 修改行在当前一屏显示的几行中的相对位置
// table.doCommand(new AutoResizeCurrentRowsCommand(table, new int[] { currentRow },
// table.getConfigRegistry(), new GC(table)));
IOperationHistory operationHistory = OperationHistoryFactory.getOperationHistory();
operationHistory.execute(new UpdateDataOperation(table, dataLayer, command), null, null);
return true;
} catch (UnsupportedOperationException e) {
LOGGER.error(MessageFormat.format(Messages.getString("handler.UpdateDataAndAutoResizeCommandHandler.logger1"), command.getNewValue()), e);
e.printStackTrace(System.err);
System.err.println("Failed to update value to: " + command.getNewValue());
} catch (ExecutionException e) {
LOGGER.error("", e);
e.printStackTrace();
}
return false;
}
Aggregations