Search in sources :

Example 16 with DMNGridData

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

the class AddOutputClauseCommandTest method setUp.

@Before
public void setUp() throws Exception {
    this.dtable = new DecisionTable();
    this.uiModel = new DMNGridData();
    this.uiModel.appendColumn(uiRowNumberColumn);
    this.outputClause = new OutputClause();
    this.uiModelMapper = new DecisionTableUIModelMapper(() -> uiModel, () -> Optional.of(dtable), listSelector);
    doReturn(0).when(uiRowNumberColumn).getIndex();
    doReturn(1).when(uiOutputClauseColumn).getIndex();
}
Also used : OutputClause(org.kie.workbench.common.dmn.api.definition.v1_1.OutputClause) DecisionTable(org.kie.workbench.common.dmn.api.definition.v1_1.DecisionTable) DecisionTableUIModelMapper(org.kie.workbench.common.dmn.client.editors.expressions.types.dtable.DecisionTableUIModelMapper) DMNGridData(org.kie.workbench.common.dmn.client.widgets.grid.model.DMNGridData) Before(org.junit.Before)

Example 17 with DMNGridData

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

the class DeleteInputClauseCommandTest method setup.

@Before
public void setup() {
    this.dtable = new DecisionTable();
    this.inputClause = new InputClause();
    this.dtable.getInput().add(inputClause);
    this.uiModel = new DMNGridData();
    this.uiModel.appendColumn(uiRowNumberColumn);
    this.uiModel.appendColumn(uiInputClauseColumn);
    this.uiModel.appendColumn(uiDescriptionColumn);
    this.uiModelMapper = new DecisionTableUIModelMapper(() -> uiModel, () -> Optional.of(dtable), listSelector);
    this.command = spy(new DeleteInputClauseCommand(dtable, uiModel, DecisionTableUIModelMapperHelper.ROW_INDEX_COLUMN_COUNT, uiModelMapper, canvasOperation));
    doReturn(0).when(uiRowNumberColumn).getIndex();
    doReturn(1).when(uiInputClauseColumn).getIndex();
    doReturn(2).when(uiDescriptionColumn).getIndex();
}
Also used : DecisionTable(org.kie.workbench.common.dmn.api.definition.v1_1.DecisionTable) DecisionTableUIModelMapper(org.kie.workbench.common.dmn.client.editors.expressions.types.dtable.DecisionTableUIModelMapper) DMNGridData(org.kie.workbench.common.dmn.client.widgets.grid.model.DMNGridData) InputClause(org.kie.workbench.common.dmn.api.definition.v1_1.InputClause) Before(org.junit.Before)

Example 18 with DMNGridData

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

the class MoveRowsCommandTest method setup.

@Before
public void setup() {
    this.context = new Context();
    this.uiModel = new DMNGridData();
    doReturn(ruleManager).when(handler).getRuleManager();
    doReturn(0).when(uiRowNumberColumn).getIndex();
    doReturn(1).when(uiNameColumn).getIndex();
    doReturn(2).when(uiExpressionEditorColumn).getIndex();
    addContextEntry(II1);
    addContextEntry(II2);
    addUiModelColumn(uiRowNumberColumn);
    addUiModelColumn(uiNameColumn);
    addUiModelColumn(uiExpressionEditorColumn);
    addUiModelRow(0);
    addUiModelRow(1);
}
Also used : Context(org.kie.workbench.common.dmn.api.definition.v1_1.Context) GraphCommandExecutionContext(org.kie.workbench.common.stunner.core.graph.command.GraphCommandExecutionContext) DMNGridData(org.kie.workbench.common.dmn.client.widgets.grid.model.DMNGridData) Before(org.junit.Before)

Example 19 with DMNGridData

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

the class MoveRowsCommandTest method setup.

@Before
public void setup() {
    this.invocation = new Invocation();
    this.uiModel = new DMNGridData();
    doReturn(ruleManager).when(handler).getRuleManager();
    doReturn(0).when(uiRowNumberColumn).getIndex();
    doReturn(1).when(uiNameColumn).getIndex();
    doReturn(2).when(uiExpressionEditorColumn).getIndex();
    addParameterBinding(II1);
    addParameterBinding(II2);
    addUiModelColumn(uiRowNumberColumn);
    addUiModelColumn(uiNameColumn);
    addUiModelColumn(uiExpressionEditorColumn);
    addUiModelRow(0);
    addUiModelRow(1);
}
Also used : Invocation(org.kie.workbench.common.dmn.api.definition.v1_1.Invocation) DMNGridData(org.kie.workbench.common.dmn.client.widgets.grid.model.DMNGridData) Before(org.junit.Before)

Example 20 with DMNGridData

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

the class CommandUtilsTest method setUp.

@Before
public void setUp() throws Exception {
    decisionRuleOne = new DecisionRule();
    decisionRuleTwo = new DecisionRule();
    decisionRuleThree = new DecisionRule();
    decisionRuleOne.setId(new Id("1"));
    decisionRuleTwo.setId(new Id("2"));
    decisionRuleThree.setId(new Id("3"));
    allRows.clear();
    allRows.add(decisionRuleOne);
    allRows.add(decisionRuleTwo);
    allRows.add(decisionRuleThree);
    rowsToMove.clear();
    uiModel = new DMNGridData();
    gridWidget = new BaseGridWidget(uiModel, selectionManager, pinnedModeManager, renderer);
}
Also used : BaseGridWidget(org.uberfire.ext.wires.core.grids.client.widget.grid.impl.BaseGridWidget) Id(org.kie.workbench.common.dmn.api.property.dmn.Id) DMNGridData(org.kie.workbench.common.dmn.client.widgets.grid.model.DMNGridData) DecisionRule(org.kie.workbench.common.dmn.api.definition.v1_1.DecisionRule) Before(org.junit.Before)

Aggregations

DMNGridData (org.kie.workbench.common.dmn.client.widgets.grid.model.DMNGridData)21 Before (org.junit.Before)15 DecisionTable (org.kie.workbench.common.dmn.api.definition.v1_1.DecisionTable)8 DecisionTableUIModelMapper (org.kie.workbench.common.dmn.client.editors.expressions.types.dtable.DecisionTableUIModelMapper)5 GridDataCache (org.kie.workbench.common.dmn.client.widgets.grid.model.GridDataCache)5 DecisionRule (org.kie.workbench.common.dmn.api.definition.v1_1.DecisionRule)4 LiteralExpression (org.kie.workbench.common.dmn.api.definition.v1_1.LiteralExpression)4 Test (org.junit.Test)3 HasExpression (org.kie.workbench.common.dmn.api.definition.HasExpression)3 HasName (org.kie.workbench.common.dmn.api.definition.HasName)3 Context (org.kie.workbench.common.dmn.api.definition.v1_1.Context)2 InputClause (org.kie.workbench.common.dmn.api.definition.v1_1.InputClause)2 OutputClause (org.kie.workbench.common.dmn.api.definition.v1_1.OutputClause)2 Relation (org.kie.workbench.common.dmn.api.definition.v1_1.Relation)2 DMNGridRow (org.kie.workbench.common.dmn.client.widgets.grid.model.DMNGridRow)2 GridCellTuple (org.kie.workbench.common.dmn.client.widgets.grid.model.GridCellTuple)2 GraphCommandExecutionContext (org.kie.workbench.common.stunner.core.graph.command.GraphCommandExecutionContext)2 BaseGridWidget (org.uberfire.ext.wires.core.grids.client.widget.grid.impl.BaseGridWidget)2 Invocation (org.kie.workbench.common.dmn.api.definition.v1_1.Invocation)1 UnaryTests (org.kie.workbench.common.dmn.api.definition.v1_1.UnaryTests)1