Search in sources :

Example 1 with DMNGridData

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

the class BaseExpressionGridGeneralTest method getGrid.

@Override
@SuppressWarnings("unchecked")
public BaseExpressionGrid getGrid() {
    final HasExpression hasExpression = mock(HasExpression.class);
    final Optional<LiteralExpression> expression = Optional.of(mock(LiteralExpression.class));
    final Optional<HasName> hasName = Optional.of(mock(HasName.class));
    return new BaseExpressionGrid(parentCell, Optional.empty(), hasExpression, expression, hasName, gridPanel, gridLayer, new GridDataCache.CacheResult(new DMNGridData(), false), renderer, definitionUtils, sessionManager, sessionCommandManager, canvasCommandFactory, cellEditorControls, listSelector, translationService, 0) {

        @Override
        protected BaseUIModelMapper makeUiModelMapper() {
            return mapper;
        }

        @Override
        protected void initialiseUiColumns() {
        // Nothing for this test
        }

        @Override
        protected void initialiseUiModel() {
        // Nothing for this test
        }

        @Override
        protected boolean isHeaderHidden() {
            return false;
        }
    };
}
Also used : HasExpression(org.kie.workbench.common.dmn.api.definition.HasExpression) GridDataCache(org.kie.workbench.common.dmn.client.widgets.grid.model.GridDataCache) HasName(org.kie.workbench.common.dmn.api.definition.HasName) LiteralExpression(org.kie.workbench.common.dmn.api.definition.v1_1.LiteralExpression) DMNGridData(org.kie.workbench.common.dmn.client.widgets.grid.model.DMNGridData)

Example 2 with DMNGridData

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

the class BaseDOMElementSingletonColumnTest method setup.

@Before
public void setup() {
    this.model = new DMNGridData();
    this.factory = getFactory();
    this.domElement = getDomElement();
    this.widget = getWidget();
    this.gridWidget = getGridWidget();
    this.column = getColumn();
    when(domElement.getWidget()).thenReturn(widget);
    when(gridWidget.getModel()).thenReturn(model);
}
Also used : DMNGridData(org.kie.workbench.common.dmn.client.widgets.grid.model.DMNGridData) Before(org.junit.Before)

Example 3 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 4 with DMNGridData

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

the class AddDecisionRuleCommandTest method setup.

@Before
public void setup() {
    this.dtable = new DecisionTable();
    this.rule = new DecisionRule();
    this.uiModel = new DMNGridData();
    this.uiModel.appendColumn(uiRowNumberColumn);
    this.uiModelRow = new DMNGridRow();
    this.uiModelMapper = new DecisionTableUIModelMapper(() -> uiModel, () -> Optional.of(dtable), listSelector);
    doReturn(0).when(uiRowNumberColumn).getIndex();
    doReturn(1).when(uiInputClauseColumn).getIndex();
    doReturn(2).when(uiOutputClauseColumn).getIndex();
    doReturn(3).when(uiDescriptionColumn).getIndex();
}
Also used : DecisionTable(org.kie.workbench.common.dmn.api.definition.v1_1.DecisionTable) DMNGridRow(org.kie.workbench.common.dmn.client.widgets.grid.model.DMNGridRow) DecisionTableUIModelMapper(org.kie.workbench.common.dmn.client.editors.expressions.types.dtable.DecisionTableUIModelMapper) 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)

Example 5 with DMNGridData

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

the class DeleteDecisionRuleCommandTest method setup.

@Before
public void setup() {
    this.dtable = new DecisionTable();
    this.rule = new DecisionRule();
    this.dtable.getRule().add(rule);
    this.uiModel = new DMNGridData();
    this.uiModelRow = new DMNGridRow();
    this.uiModel.appendRow(uiModelRow);
}
Also used : DecisionTable(org.kie.workbench.common.dmn.api.definition.v1_1.DecisionTable) DMNGridRow(org.kie.workbench.common.dmn.client.widgets.grid.model.DMNGridRow) 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