Search in sources :

Example 1 with AddContextEntryCommand

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

the class ContextGrid method addContextEntry.

void addContextEntry(final int index) {
    expression.ifPresent(c -> {
        final ContextEntry ce = new ContextEntry();
        ce.setVariable(new InformationItem());
        sessionCommandManager.execute((AbstractCanvasHandler) sessionManager.getCurrentSession().getCanvasHandler(), new AddContextEntryCommand(c, ce, model, new DMNGridRow(), index, uiModelMapper, this::synchroniseView));
    });
}
Also used : AddContextEntryCommand(org.kie.workbench.common.dmn.client.commands.expressions.types.context.AddContextEntryCommand) DMNGridRow(org.kie.workbench.common.dmn.client.widgets.grid.model.DMNGridRow) InformationItem(org.kie.workbench.common.dmn.api.definition.v1_1.InformationItem) ContextEntry(org.kie.workbench.common.dmn.api.definition.v1_1.ContextEntry)

Example 2 with AddContextEntryCommand

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

the class ContextGridTest method testAddContextEntry.

@Test
public void testAddContextEntry() {
    setupGrid(0);
    grid.addContextEntry(0);
    verify(sessionCommandManager).execute(eq(canvasHandler), addContextEntryCommandCaptor.capture());
    final AddContextEntryCommand addContextEntryCommand = addContextEntryCommandCaptor.getValue();
    addContextEntryCommand.execute(canvasHandler);
    verify(parent).onResize();
    verify(gridPanel).refreshScrollPosition();
    verify(gridPanel).updatePanelSize();
    verify(gridLayer).batch(redrawCommandCaptor.capture());
    final GridLayerRedrawManager.PrioritizedCommand redrawCommand = redrawCommandCaptor.getValue();
    redrawCommand.execute();
    verify(gridLayer).draw();
}
Also used : GridLayerRedrawManager(org.uberfire.ext.wires.core.grids.client.widget.layer.impl.GridLayerRedrawManager) AddContextEntryCommand(org.kie.workbench.common.dmn.client.commands.expressions.types.context.AddContextEntryCommand) Test(org.junit.Test)

Aggregations

AddContextEntryCommand (org.kie.workbench.common.dmn.client.commands.expressions.types.context.AddContextEntryCommand)2 Test (org.junit.Test)1 ContextEntry (org.kie.workbench.common.dmn.api.definition.v1_1.ContextEntry)1 InformationItem (org.kie.workbench.common.dmn.api.definition.v1_1.InformationItem)1 DMNGridRow (org.kie.workbench.common.dmn.client.widgets.grid.model.DMNGridRow)1 GridLayerRedrawManager (org.uberfire.ext.wires.core.grids.client.widget.layer.impl.GridLayerRedrawManager)1