Search in sources :

Example 1 with ClearExpressionTypeCommand

use of org.kie.workbench.common.dmn.client.commands.general.ClearExpressionTypeCommand in project kie-wb-common by kiegroup.

the class ContextGridTest method testClearExpressionType.

@Test
public void testClearExpressionType() {
    setupGrid(0);
    grid.clearExpressionType(0);
    verify(sessionCommandManager).execute(eq(canvasHandler), clearExpressionTypeCommandCaptor.capture());
    final ClearExpressionTypeCommand clearExpressionTypeCommand = clearExpressionTypeCommandCaptor.getValue();
    clearExpressionTypeCommand.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) ClearExpressionTypeCommand(org.kie.workbench.common.dmn.client.commands.general.ClearExpressionTypeCommand) Test(org.junit.Test)

Example 2 with ClearExpressionTypeCommand

use of org.kie.workbench.common.dmn.client.commands.general.ClearExpressionTypeCommand in project kie-wb-common by kiegroup.

the class ContextGrid method clearExpressionType.

void clearExpressionType(final int uiRowIndex) {
    final GridCellTuple gc = new GridCellTuple(uiRowIndex, ContextUIModelMapperHelper.EXPRESSION_COLUMN_INDEX, this);
    final HasExpression hasExpression = expression.get().getContextEntry().get(uiRowIndex);
    sessionCommandManager.execute((AbstractCanvasHandler) sessionManager.getCurrentSession().getCanvasHandler(), new ClearExpressionTypeCommand(gc, hasExpression, uiModelMapper, () -> synchroniseViewWhenExpressionEditorChanged(this)));
}
Also used : HasExpression(org.kie.workbench.common.dmn.api.definition.HasExpression) GridCellTuple(org.kie.workbench.common.dmn.client.widgets.grid.model.GridCellTuple) ClearExpressionTypeCommand(org.kie.workbench.common.dmn.client.commands.general.ClearExpressionTypeCommand)

Example 3 with ClearExpressionTypeCommand

use of org.kie.workbench.common.dmn.client.commands.general.ClearExpressionTypeCommand in project kie-wb-common by kiegroup.

the class InvocationGridTest method testClearExpressionType.

@Test
public void testClearExpressionType() {
    setupGrid(0);
    grid.clearExpressionType(0);
    verify(sessionCommandManager).execute(eq(canvasHandler), clearExpressionTypeCommandCaptor.capture());
    final ClearExpressionTypeCommand clearExpressionTypeCommand = clearExpressionTypeCommandCaptor.getValue();
    clearExpressionTypeCommand.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) ClearExpressionTypeCommand(org.kie.workbench.common.dmn.client.commands.general.ClearExpressionTypeCommand) Test(org.junit.Test)

Example 4 with ClearExpressionTypeCommand

use of org.kie.workbench.common.dmn.client.commands.general.ClearExpressionTypeCommand in project kie-wb-common by kiegroup.

the class InvocationGrid method clearExpressionType.

void clearExpressionType(final int uiRowIndex) {
    final GridCellTuple gc = new GridCellTuple(uiRowIndex, InvocationUIModelMapper.BINDING_EXPRESSION_COLUMN_INDEX, this);
    final HasExpression hasExpression = expression.get().getBinding().get(uiRowIndex);
    sessionCommandManager.execute((AbstractCanvasHandler) sessionManager.getCurrentSession().getCanvasHandler(), new ClearExpressionTypeCommand(gc, hasExpression, uiModelMapper, () -> synchroniseViewWhenExpressionEditorChanged(this)));
}
Also used : HasExpression(org.kie.workbench.common.dmn.api.definition.HasExpression) GridCellTuple(org.kie.workbench.common.dmn.client.widgets.grid.model.GridCellTuple) ClearExpressionTypeCommand(org.kie.workbench.common.dmn.client.commands.general.ClearExpressionTypeCommand)

Aggregations

ClearExpressionTypeCommand (org.kie.workbench.common.dmn.client.commands.general.ClearExpressionTypeCommand)4 Test (org.junit.Test)2 HasExpression (org.kie.workbench.common.dmn.api.definition.HasExpression)2 GridCellTuple (org.kie.workbench.common.dmn.client.widgets.grid.model.GridCellTuple)2 GridLayerRedrawManager (org.uberfire.ext.wires.core.grids.client.widget.layer.impl.GridLayerRedrawManager)2