Search in sources :

Example 1 with ExpressionEditorGridRow

use of org.kie.workbench.common.dmn.client.widgets.grid.model.ExpressionEditorGridRow 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)

Example 2 with ExpressionEditorGridRow

use of org.kie.workbench.common.dmn.client.widgets.grid.model.ExpressionEditorGridRow in project kie-wb-common by kiegroup.

the class ContextGrid method addContextEntry.

void addContextEntry(final int index) {
    getExpression().get().ifPresent(c -> {
        final ContextEntry ce = new ContextEntry();
        final InformationItem informationItem = new InformationItem();
        informationItem.setName(new Name());
        ce.setVariable(informationItem);
        final CommandResult<CanvasViolation> result = sessionCommandManager.execute((AbstractCanvasHandler) sessionManager.getCurrentSession().getCanvasHandler(), new AddContextEntryCommand(c, ce, model, new ExpressionEditorGridRow(), index, uiModelMapper, () -> resize(BaseExpressionGrid.RESIZE_EXISTING)));
        if (!CommandUtils.isError(result)) {
            selectCell(index, ContextUIModelMapperHelper.NAME_COLUMN_INDEX, false, false);
            startEditingCell(index, ContextUIModelMapperHelper.NAME_COLUMN_INDEX);
        }
    });
}
Also used : CanvasViolation(org.kie.workbench.common.stunner.core.client.command.CanvasViolation) AddContextEntryCommand(org.kie.workbench.common.dmn.client.commands.expressions.types.context.AddContextEntryCommand) InformationItem(org.kie.workbench.common.dmn.api.definition.model.InformationItem) ExpressionEditorGridRow(org.kie.workbench.common.dmn.client.widgets.grid.model.ExpressionEditorGridRow) ContextEntry(org.kie.workbench.common.dmn.api.definition.model.ContextEntry) HasName(org.kie.workbench.common.dmn.api.definition.HasName) Name(org.kie.workbench.common.dmn.api.property.dmn.Name)

Example 3 with ExpressionEditorGridRow

use of org.kie.workbench.common.dmn.client.widgets.grid.model.ExpressionEditorGridRow in project kie-wb-common by kiegroup.

the class InvocationGrid method addParameterBinding.

void addParameterBinding(final int index) {
    getExpression().get().ifPresent(invocation -> {
        final Binding binding = new Binding();
        final InformationItem parameter = new InformationItem();
        parameter.setName(new Name());
        binding.setParameter(parameter);
        final CommandResult<CanvasViolation> result = sessionCommandManager.execute((AbstractCanvasHandler) sessionManager.getCurrentSession().getCanvasHandler(), new AddParameterBindingCommand(invocation, binding, model, new ExpressionEditorGridRow(), index, uiModelMapper, () -> resize(BaseExpressionGrid.RESIZE_EXISTING)));
        if (!CommandUtils.isError(result)) {
            selectCell(index, InvocationUIModelMapper.BINDING_PARAMETER_COLUMN_INDEX, false, false);
            startEditingCell(index, InvocationUIModelMapper.BINDING_PARAMETER_COLUMN_INDEX);
        }
    });
}
Also used : Binding(org.kie.workbench.common.dmn.api.definition.model.Binding) CanvasViolation(org.kie.workbench.common.stunner.core.client.command.CanvasViolation) AddParameterBindingCommand(org.kie.workbench.common.dmn.client.commands.expressions.types.invocation.AddParameterBindingCommand) InformationItem(org.kie.workbench.common.dmn.api.definition.model.InformationItem) ExpressionEditorGridRow(org.kie.workbench.common.dmn.client.widgets.grid.model.ExpressionEditorGridRow) HasName(org.kie.workbench.common.dmn.api.definition.HasName) Name(org.kie.workbench.common.dmn.api.property.dmn.Name)

Aggregations

ExpressionEditorGridRow (org.kie.workbench.common.dmn.client.widgets.grid.model.ExpressionEditorGridRow)3 HasName (org.kie.workbench.common.dmn.api.definition.HasName)2 InformationItem (org.kie.workbench.common.dmn.api.definition.model.InformationItem)2 Name (org.kie.workbench.common.dmn.api.property.dmn.Name)2 CanvasViolation (org.kie.workbench.common.stunner.core.client.command.CanvasViolation)2 HasExpression (org.kie.workbench.common.dmn.api.definition.HasExpression)1 Binding (org.kie.workbench.common.dmn.api.definition.model.Binding)1 ContextEntry (org.kie.workbench.common.dmn.api.definition.model.ContextEntry)1 LiteralExpression (org.kie.workbench.common.dmn.api.definition.model.LiteralExpression)1 AddContextEntryCommand (org.kie.workbench.common.dmn.client.commands.expressions.types.context.AddContextEntryCommand)1 AddParameterBindingCommand (org.kie.workbench.common.dmn.client.commands.expressions.types.invocation.AddParameterBindingCommand)1 AddListRowCommand (org.kie.workbench.common.dmn.client.commands.expressions.types.list.AddListRowCommand)1 GridRow (org.uberfire.ext.wires.core.grids.client.model.GridRow)1