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));
}
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());
}
Aggregations