use of org.uberfire.ext.wires.core.grids.client.model.impl.BaseGridRow in project kie-wb-common by kiegroup.
the class DeleteRelationRowCommandTest method testCanvasCommandExecuteRemoveMiddleWithColumns.
@Test
public void testCanvasCommandExecuteRemoveMiddleWithColumns() {
uiModel.appendColumn(uiModelColumn);
final GridRow firstRow = new BaseGridRow();
final GridRow lastRow = new BaseGridRow();
uiModel.insertRow(0, firstRow);
uiModel.appendRow(lastRow);
relation.getRow().add(0, new List());
relation.getRow().add(new List());
makeCommand(1);
final Command<AbstractCanvasHandler, CanvasViolation> cc = command.newCanvasCommand(handler);
assertEquals(CanvasCommandResultBuilder.SUCCESS, cc.execute(handler));
assertEquals(2, uiModel.getRowCount());
assertEquals(firstRow, uiModel.getRow(0));
assertEquals(lastRow, uiModel.getRow(1));
assertEquals(2, uiModel.getColumnCount());
assertEquals(uiRowNumberColumn, uiModel.getColumns().get(0));
assertEquals(uiModelColumn, uiModel.getColumns().get(1));
verify(command).updateRowNumbers();
verify(command).updateParentInformation();
verify(canvasOperation).execute();
}
use of org.uberfire.ext.wires.core.grids.client.model.impl.BaseGridRow in project kie-wb-common by kiegroup.
the class MoveRowsCommandTest method addUiModelRow.
protected void addUiModelRow(final int rowIndex) {
final GridRow uiRow = new BaseGridRow();
uiModel.appendRow(uiRow);
uiModel.setCellValue(rowIndex, 0, new BaseGridCellValue<>(rowIndex + 1));
uiModel.setCellValue(rowIndex, 1, new BaseGridCellValue<>("name" + rowIndex));
uiModel.setCellValue(rowIndex, 2, new BaseGridCellValue<>("editor" + rowIndex));
}
use of org.uberfire.ext.wires.core.grids.client.model.impl.BaseGridRow in project kie-wb-common by kiegroup.
the class MoveRowsCommandTest method addUiModelRow.
protected void addUiModelRow(final int rowIndex) {
final GridRow uiRow = new BaseGridRow();
uiModel.appendRow(uiRow);
uiModel.setCellValue(rowIndex, 0, new BaseGridCellValue<>(rowIndex + 1));
uiModel.setCellValue(rowIndex, 1, new BaseGridCellValue<>("name" + rowIndex));
uiModel.setCellValue(rowIndex, 2, new BaseGridCellValue<>("editor" + rowIndex));
}
use of org.uberfire.ext.wires.core.grids.client.model.impl.BaseGridRow in project kie-wb-common by kiegroup.
the class DeleteRelationColumnCommandTest method testCanvasCommandUndoWithRows.
@Test
public void testCanvasCommandUndoWithRows() {
final List rowList = new List();
relation.getRow().add(rowList);
final LiteralExpression literalExpression = new LiteralExpression();
literalExpression.getText().setValue(VALUE);
relation.getRow().get(0).getExpression().add(HasExpression.wrap(rowList, literalExpression));
uiModel.appendRow(new BaseGridRow());
uiModelMapper.fromDMNModel(0, 1);
makeCommand();
// Delete column and then undo
final Command<AbstractCanvasHandler, CanvasViolation> cc = command.newCanvasCommand(handler);
assertEquals(CanvasCommandResultBuilder.SUCCESS, cc.execute(handler));
reset(command);
assertEquals(CanvasCommandResultBuilder.SUCCESS, cc.undo(handler));
assertEquals(2, uiModel.getColumnCount());
assertEquals(uiRowNumberColumn, uiModel.getColumns().get(0));
assertEquals(uiModelColumn, uiModel.getColumns().get(1));
assertEquals(1, uiModel.getRowCount());
assertEquals(1, uiModel.getRows().get(0).getCells().size());
assertEquals(VALUE, uiModel.getCell(0, 1).getValue().getValue());
verify(command).updateParentInformation();
verify(undoCanvasOperation).execute();
}
use of org.uberfire.ext.wires.core.grids.client.model.impl.BaseGridRow in project kie-wb-common by kiegroup.
the class MoveRowsCommandTest method addUiModelRow.
@Override
protected void addUiModelRow(final int rowIndex) {
final GridRow uiRow = new BaseGridRow();
uiModel.appendRow(uiRow);
uiModel.setCellValue(rowIndex, 0, new BaseGridCellValue<>(rowIndex + 1));
uiModel.setCellValue(rowIndex, 1, new BaseGridCellValue<>("value" + rowIndex));
}
Aggregations