use of org.uberfire.ext.wires.core.grids.client.model.GridRow in project kie-wb-common by kiegroup.
the class RelationGrid method addRow.
void addRow(final int index) {
getExpression().get().ifPresent(relation -> {
final GridRow relationRow = new LiteralExpressionGridRow();
sessionCommandManager.execute((AbstractCanvasHandler) sessionManager.getCurrentSession().getCanvasHandler(), new AddRelationRowCommand(relation, new List(), model, relationRow, index, uiModelMapper, () -> resize(BaseExpressionGrid.RESIZE_EXISTING)));
});
}
use of org.uberfire.ext.wires.core.grids.client.model.GridRow in project kie-wb-common by kiegroup.
the class DecisionTableGrid method duplicateDecisionRule.
void duplicateDecisionRule(final int index) {
getExpression().get().ifPresent(dtable -> {
final GridRow decisionTableRow = new LiteralExpressionGridRow();
final DecisionRule decisionRule = DecisionRuleFactory.duplicateDecisionRule(index, dtable);
sessionCommandManager.execute((AbstractCanvasHandler) sessionManager.getCurrentSession().getCanvasHandler(), new AddDecisionRuleCommand(dtable, decisionRule, model, decisionTableRow, index, uiModelMapper, () -> resize(BaseExpressionGrid.RESIZE_EXISTING)));
});
}
use of org.uberfire.ext.wires.core.grids.client.model.GridRow 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.GridRow 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.GridRow 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));
}
Aggregations