Search in sources :

Example 1 with AddListRowCommand

use of org.kie.workbench.common.dmn.client.commands.expressions.types.list.AddListRowCommand in project kie-wb-common by kiegroup.

the class ListGridTest method addListRow.

private void addListRow(final int index) {
    grid.addRow(index);
    verify(sessionCommandManager).execute(eq(canvasHandler), addListRowCommandCaptor.capture());
    final AddListRowCommand addContextEntryCommand = addListRowCommandCaptor.getValue();
    addContextEntryCommand.execute(canvasHandler);
}
Also used : AddListRowCommand(org.kie.workbench.common.dmn.client.commands.expressions.types.list.AddListRowCommand)

Example 2 with AddListRowCommand

use of org.kie.workbench.common.dmn.client.commands.expressions.types.list.AddListRowCommand in project kie-wb-common by kiegroup.

the class ListGrid method addRow.

void addRow(final int index) {
    getExpression().get().ifPresent(list -> {
        final GridRow listRow = new ExpressionEditorGridRow();
        final HasExpression hasExpression = HasExpression.wrap(list, new LiteralExpression());
        sessionCommandManager.execute((AbstractCanvasHandler) sessionManager.getCurrentSession().getCanvasHandler(), new AddListRowCommand(list, hasExpression, model, listRow, index, uiModelMapper, () -> resize(BaseExpressionGrid.RESIZE_EXISTING)));
    });
}
Also used : HasExpression(org.kie.workbench.common.dmn.api.definition.HasExpression) AddListRowCommand(org.kie.workbench.common.dmn.client.commands.expressions.types.list.AddListRowCommand) LiteralExpression(org.kie.workbench.common.dmn.api.definition.model.LiteralExpression) ExpressionEditorGridRow(org.kie.workbench.common.dmn.client.widgets.grid.model.ExpressionEditorGridRow) GridRow(org.uberfire.ext.wires.core.grids.client.model.GridRow) ExpressionEditorGridRow(org.kie.workbench.common.dmn.client.widgets.grid.model.ExpressionEditorGridRow)

Aggregations

AddListRowCommand (org.kie.workbench.common.dmn.client.commands.expressions.types.list.AddListRowCommand)2 HasExpression (org.kie.workbench.common.dmn.api.definition.HasExpression)1 LiteralExpression (org.kie.workbench.common.dmn.api.definition.model.LiteralExpression)1 ExpressionEditorGridRow (org.kie.workbench.common.dmn.client.widgets.grid.model.ExpressionEditorGridRow)1 GridRow (org.uberfire.ext.wires.core.grids.client.model.GridRow)1