use of org.kie.workbench.common.dmn.client.commands.expressions.types.dtable.AddInputClauseCommand in project kie-wb-common by kiegroup.
the class DecisionTableGrid method addInputClause.
void addInputClause(final int index) {
expression.ifPresent(dtable -> {
final InputClause clause = new InputClause();
final LiteralExpression le = new LiteralExpression();
le.setText("input");
clause.setInputExpression(le);
sessionCommandManager.execute((AbstractCanvasHandler) sessionManager.getCurrentSession().getCanvasHandler(), new AddInputClauseCommand(dtable, clause, model, makeInputClauseColumn(clause), index, uiModelMapper, () -> synchroniseViewWhenExpressionEditorChanged(this)));
});
}
use of org.kie.workbench.common.dmn.client.commands.expressions.types.dtable.AddInputClauseCommand in project kie-wb-common by kiegroup.
the class DecisionTableGridTest method testAddInputClause.
@Test
public void testAddInputClause() {
setupGrid(makeHasNameForDecision(), 0);
grid.addInputClause(1);
verify(sessionCommandManager).execute(eq(canvasHandler), addInputClauseCommandCaptor.capture());
final AddInputClauseCommand addInputClauseCommand = addInputClauseCommandCaptor.getValue();
addInputClauseCommand.execute(canvasHandler);
verify(parent).proposeContainingColumnWidth(eq(grid.getWidth() + grid.getPadding() * 2));
verifyGridPanelRefresh();
}
Aggregations