use of org.kie.workbench.common.dmn.client.editors.expressions.types.context.ContextGridRowNumberColumn in project kie-wb-common by kiegroup.
the class ListGridTest method testInitialSetupFromDefinition.
@Test
public void testInitialSetupFromDefinition() {
setupGrid();
final GridData uiModel = grid.getModel();
assertTrue(uiModel instanceof ListGridData);
assertEquals(2, uiModel.getColumnCount());
assertTrue(uiModel.getColumns().get(ROW_COLUMN_INDEX) instanceof ContextGridRowNumberColumn);
assertTrue(uiModel.getColumns().get(EXPRESSION_COLUMN_INDEX) instanceof ExpressionEditorColumn);
assertEquals(1, uiModel.getRowCount());
assertEquals(1, uiModel.getCell(0, ROW_COLUMN_INDEX).getValue().getValue());
assertTrue(uiModel.getCell(0, EXPRESSION_COLUMN_INDEX).getValue() instanceof ExpressionCellValue);
final ExpressionCellValue dcv0 = (ExpressionCellValue) uiModel.getCell(0, EXPRESSION_COLUMN_INDEX).getValue();
assertEquals(literalExpressionEditor, dcv0.getValue().get());
}
use of org.kie.workbench.common.dmn.client.editors.expressions.types.context.ContextGridRowNumberColumn in project kie-wb-common by kiegroup.
the class ListGrid method initialiseUiColumns.
@Override
public void initialiseUiColumns() {
final ContextGridRowNumberColumn rowNumberColumn = new ContextGridRowNumberColumn(Collections.emptyList(), getAndSetInitialWidth(ListUIModelMapperHelper.ROW_COLUMN_INDEX, ContextGridRowNumberColumn.DEFAULT_WIDTH));
final GridColumn listColumn = new ListExpressionEditorColumn(gridLayer, getAndSetInitialWidth(ListUIModelMapperHelper.EXPRESSION_COLUMN_INDEX, ExpressionEditorColumn.DEFAULT_WIDTH), this);
model.appendColumn(rowNumberColumn);
model.appendColumn(listColumn);
getRenderer().setColumnRenderConstraint((isSelectionLayer, gridColumn) -> true);
}
use of org.kie.workbench.common.dmn.client.editors.expressions.types.context.ContextGridRowNumberColumn in project kie-wb-common by kiegroup.
the class FunctionSupplementaryGrid method initialiseUiColumns.
@Override
public void initialiseUiColumns() {
final ContextGridRowNumberColumn rowNumberColumn = new ContextGridRowNumberColumn(Collections.emptyList(), getAndSetInitialWidth(0, ContextGridRowNumberColumn.DEFAULT_WIDTH));
final NameColumn nameColumn = new NameColumn(getAndSetInitialWidth(1, DMNGridColumn.DEFAULT_WIDTH), this);
final ExpressionEditorColumn expressionColumn = new ExpressionEditorColumn(gridLayer, Collections.emptyList(), getAndSetInitialWidth(2, ExpressionEditorColumn.DEFAULT_WIDTH), this);
model.appendColumn(rowNumberColumn);
model.appendColumn(nameColumn);
model.appendColumn(expressionColumn);
getRenderer().setColumnRenderConstraint((isSelectionLayer, gridColumn) -> !isSelectionLayer || gridColumn.equals(expressionColumn));
}
use of org.kie.workbench.common.dmn.client.editors.expressions.types.context.ContextGridRowNumberColumn in project kie-wb-common by kiegroup.
the class JavaFunctionSupplementaryGridTest method testInitialSetupFromDefinition.
@Test
public void testInitialSetupFromDefinition() {
setupGrid(0);
final GridData uiModel = grid.getModel();
assertTrue(uiModel instanceof FunctionSupplementaryGridData);
assertEquals(3, uiModel.getColumnCount());
assertTrue(uiModel.getColumns().get(0) instanceof ContextGridRowNumberColumn);
assertTrue(uiModel.getColumns().get(1) instanceof NameColumn);
assertTrue(uiModel.getColumns().get(2) instanceof ExpressionEditorColumn);
assertEquals(2, uiModel.getRowCount());
final String[] expectedNames = getExpectedNames();
for (int i = 0; i < uiModel.getRowCount(); i++) {
assertEquals(i + 1, uiModel.getCell(i, 0).getValue().getValue());
assertEquals(expectedNames[i], ((InformationItemCell.HasNameAndDataTypeCell) uiModel.getCell(i, 1).getValue().getValue()).getName().getValue());
assertTrue(uiModel.getCell(i, 2).getValue() instanceof ExpressionCellValue);
final ExpressionCellValue dcv = (ExpressionCellValue) uiModel.getCell(i, 2).getValue();
assertEquals(literalExpressionEditor, dcv.getValue().get());
}
}
use of org.kie.workbench.common.dmn.client.editors.expressions.types.context.ContextGridRowNumberColumn in project kie-wb-common by kiegroup.
the class PMMLFunctionSupplementaryGridTest method testInitialSetupFromDefinition.
@Test
public void testInitialSetupFromDefinition() {
setupGrid(0);
final GridData uiModel = grid.getModel();
assertTrue(uiModel instanceof FunctionSupplementaryGridData);
assertEquals(3, uiModel.getColumnCount());
assertTrue(uiModel.getColumns().get(0) instanceof ContextGridRowNumberColumn);
assertTrue(uiModel.getColumns().get(1) instanceof NameColumn);
assertTrue(uiModel.getColumns().get(2) instanceof ExpressionEditorColumn);
assertEquals(2, uiModel.getRowCount());
final String[] expectedNames = getExpectedNames();
for (int i = 0; i < uiModel.getRowCount(); i++) {
assertEquals(i + 1, uiModel.getCell(i, 0).getValue().getValue());
assertEquals(expectedNames[i], ((InformationItemCell.HasNameAndDataTypeCell) uiModel.getCell(i, 1).getValue().getValue()).getName().getValue());
assertTrue(uiModel.getCell(i, 2).getValue() instanceof ExpressionCellValue);
}
final ExpressionCellValue dcv0 = (ExpressionCellValue) uiModel.getCell(0, 2).getValue();
assertEquals(literalExpressionPMMLDocumentEditor, dcv0.getValue().get());
final ExpressionCellValue dcv1 = (ExpressionCellValue) uiModel.getCell(1, 2).getValue();
assertEquals(literalExpressionPMMLDocumentModelEditor, dcv1.getValue().get());
}
Aggregations