Search in sources :

Example 1 with NameColumnHeaderMetaData

use of org.kie.workbench.common.dmn.client.editors.expressions.types.context.NameColumnHeaderMetaData in project kie-wb-common by kiegroup.

the class InvocationGrid method initialiseUiColumns.

@Override
protected void initialiseUiColumns() {
    final TextBoxSingletonDOMElementFactory headerFactory = getHeaderHasNameTextBoxFactory();
    final InvocationColumnExpressionHeaderMetaData expressionHeaderMetaData = new InvocationColumnExpressionHeaderMetaData(this::getExpressionText, this::setExpressionText, headerFactory);
    final NameColumn nameColumn = new NameColumn(Arrays.asList(new NameColumnHeaderMetaData(() -> hasName.orElse(HasName.NOP).getName().getValue(), (s) -> hasName.orElse(HasName.NOP).getName().setValue(s), headerFactory), expressionHeaderMetaData), getBodyTextBoxFactory(), this);
    final ExpressionEditorColumn expressionColumn = new ExpressionEditorColumn(gridLayer, Arrays.asList(new BaseHeaderMetaData("", EXPRESSION_COLUMN_GROUP), expressionHeaderMetaData), this);
    model.appendColumn(new RowNumberColumn());
    model.appendColumn(nameColumn);
    model.appendColumn(expressionColumn);
    getRenderer().setColumnRenderConstraint((isSelectionLayer, gridColumn) -> !isSelectionLayer || gridColumn.equals(expressionColumn));
}
Also used : RowNumberColumn(org.uberfire.ext.wires.core.grids.client.widget.grid.columns.RowNumberColumn) ExpressionEditorColumn(org.kie.workbench.common.dmn.client.editors.expressions.types.context.ExpressionEditorColumn) NameColumnHeaderMetaData(org.kie.workbench.common.dmn.client.editors.expressions.types.context.NameColumnHeaderMetaData) BaseHeaderMetaData(org.uberfire.ext.wires.core.grids.client.model.impl.BaseHeaderMetaData) TextBoxSingletonDOMElementFactory(org.kie.workbench.common.dmn.client.widgets.grid.columns.factory.TextBoxSingletonDOMElementFactory)

Example 2 with NameColumnHeaderMetaData

use of org.kie.workbench.common.dmn.client.editors.expressions.types.context.NameColumnHeaderMetaData in project kie-wb-common by kiegroup.

the class InvocationGridTest method testNameColumnMetaData.

@Test
public void testNameColumnMetaData() {
    setupGrid(0);
    final GridColumn<?> column = grid.getModel().getColumns().get(InvocationUIModelMapper.BINDING_PARAMETER_COLUMN_INDEX);
    final List<GridColumn.HeaderMetaData> header = column.getHeaderMetaData();
    assertEquals(2, header.size());
    assertTrue(header.get(0) instanceof NameColumnHeaderMetaData);
    assertTrue(header.get(1) instanceof InvocationColumnExpressionHeaderMetaData);
    final NameColumnHeaderMetaData md1 = (NameColumnHeaderMetaData) header.get(0);
    final InvocationColumnExpressionHeaderMetaData md2 = (InvocationColumnExpressionHeaderMetaData) header.get(1);
    assertEquals("name", md1.getTitle());
    assertEquals("invocation-expression", md2.getTitle());
}
Also used : NameColumnHeaderMetaData(org.kie.workbench.common.dmn.client.editors.expressions.types.context.NameColumnHeaderMetaData) BaseHeaderMetaData(org.uberfire.ext.wires.core.grids.client.model.impl.BaseHeaderMetaData) NameColumnHeaderMetaData(org.kie.workbench.common.dmn.client.editors.expressions.types.context.NameColumnHeaderMetaData) Test(org.junit.Test)

Aggregations

NameColumnHeaderMetaData (org.kie.workbench.common.dmn.client.editors.expressions.types.context.NameColumnHeaderMetaData)2 BaseHeaderMetaData (org.uberfire.ext.wires.core.grids.client.model.impl.BaseHeaderMetaData)2 Test (org.junit.Test)1 ExpressionEditorColumn (org.kie.workbench.common.dmn.client.editors.expressions.types.context.ExpressionEditorColumn)1 TextBoxSingletonDOMElementFactory (org.kie.workbench.common.dmn.client.widgets.grid.columns.factory.TextBoxSingletonDOMElementFactory)1 RowNumberColumn (org.uberfire.ext.wires.core.grids.client.widget.grid.columns.RowNumberColumn)1