Search in sources :

Example 56 with GridCellTuple

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

the class ListUIModelMapperTest method assertFromDMNModelLiteralExpression.

private void assertFromDMNModelLiteralExpression(final boolean isOnlyVisualChangeAllowed) {
    assertTrue(uiModel.getCell(0, EXPRESSION_COLUMN_INDEX).getValue() instanceof ExpressionCellValue);
    final ExpressionCellValue dcv = (ExpressionCellValue) uiModel.getCell(0, EXPRESSION_COLUMN_INDEX).getValue();
    assertEquals(literalExpressionEditor, dcv.getValue().get());
    verify(literalExpressionEditorDefinition).getEditor(parentCaptor.capture(), eq(Optional.empty()), eq(list.getExpression().get(0)), eq(Optional.empty()), eq(isOnlyVisualChangeAllowed), eq(1));
    final GridCellTuple parent = parentCaptor.getValue();
    assertEquals(0, parent.getRowIndex());
    assertEquals(EXPRESSION_COLUMN_INDEX, parent.getColumnIndex());
    assertEquals(gridWidget, parent.getGridWidget());
}
Also used : GridCellTuple(org.kie.workbench.common.dmn.client.widgets.grid.model.GridCellTuple) ExpressionCellValue(org.kie.workbench.common.dmn.client.editors.expressions.types.context.ExpressionCellValue)

Example 57 with GridCellTuple

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

the class ListUIModelMapperTest method assertFromDMNModelUndefinedExpression.

private void assertFromDMNModelUndefinedExpression(final boolean isOnlyVisualChangeAllowed) {
    assertTrue(uiModel.getCell(0, EXPRESSION_COLUMN_INDEX).getValue() instanceof ExpressionCellValue);
    final ExpressionCellValue dcv = (ExpressionCellValue) uiModel.getCell(0, EXPRESSION_COLUMN_INDEX).getValue();
    assertEquals(undefinedExpressionEditor, dcv.getValue().get());
    verify(undefinedExpressionEditorDefinition).getEditor(parentCaptor.capture(), eq(Optional.empty()), eq(list.getExpression().get(0)), eq(Optional.empty()), eq(isOnlyVisualChangeAllowed), eq(1));
    final GridCellTuple parent = parentCaptor.getValue();
    assertEquals(0, parent.getRowIndex());
    assertEquals(EXPRESSION_COLUMN_INDEX, parent.getColumnIndex());
    assertEquals(gridWidget, parent.getGridWidget());
}
Also used : GridCellTuple(org.kie.workbench.common.dmn.client.widgets.grid.model.GridCellTuple) ExpressionCellValue(org.kie.workbench.common.dmn.client.editors.expressions.types.context.ExpressionCellValue)

Aggregations

GridCellTuple (org.kie.workbench.common.dmn.client.widgets.grid.model.GridCellTuple)57 Test (org.junit.Test)22 ExpressionCellValue (org.kie.workbench.common.dmn.client.editors.expressions.types.context.ExpressionCellValue)13 GridData (org.uberfire.ext.wires.core.grids.client.model.GridData)13 BaseGridCellValue (org.uberfire.ext.wires.core.grids.client.model.impl.BaseGridCellValue)13 Before (org.junit.Before)12 HasExpression (org.kie.workbench.common.dmn.api.definition.HasExpression)11 BaseExpressionGrid (org.kie.workbench.common.dmn.client.widgets.grid.BaseExpressionGrid)11 GridCellValueTuple (org.kie.workbench.common.dmn.client.widgets.grid.model.GridCellValueTuple)11 Optional (java.util.Optional)10 HasName (org.kie.workbench.common.dmn.api.definition.HasName)9 BaseGridData (org.uberfire.ext.wires.core.grids.client.model.impl.BaseGridData)9 Expression (org.kie.workbench.common.dmn.api.definition.model.Expression)8 DMNGridData (org.kie.workbench.common.dmn.client.widgets.grid.model.DMNGridData)8 Name (org.kie.workbench.common.dmn.api.property.dmn.Name)7 ExpressionEditorDefinition (org.kie.workbench.common.dmn.client.editors.expressions.types.ExpressionEditorDefinition)6 TextBoxSingletonDOMElementFactory (org.kie.workbench.common.dmn.client.widgets.grid.columns.factory.TextBoxSingletonDOMElementFactory)6 BaseUIModelMapper (org.kie.workbench.common.dmn.client.widgets.grid.model.BaseUIModelMapper)6 ExpressionEditorDefinitions (org.kie.workbench.common.dmn.client.editors.expressions.types.ExpressionEditorDefinitions)5 GridWidget (org.uberfire.ext.wires.core.grids.client.widget.grid.GridWidget)5