use of org.kie.workbench.common.dmn.client.editors.expressions.types.context.InformationItemNameCell in project kie-wb-common by kiegroup.
the class InvocationUIModelMapper method fromDMNModel.
@Override
public void fromDMNModel(final int rowIndex, final int columnIndex) {
dmnModel.get().ifPresent(invocation -> {
switch(columnIndex) {
case ROW_NUMBER_COLUMN_INDEX:
uiModel.get().setCell(rowIndex, columnIndex, () -> new InvocationGridCell<>(new BaseGridCellValue<>(rowIndex + 1), listSelector));
uiModel.get().getCell(rowIndex, columnIndex).setSelectionStrategy(RowSelectionStrategy.INSTANCE);
break;
case BINDING_PARAMETER_COLUMN_INDEX:
final InformationItem variable = invocation.getBinding().get(rowIndex).getParameter();
uiModel.get().setCell(rowIndex, columnIndex, () -> new InformationItemNameCell(() -> variable, listSelector));
break;
case BINDING_EXPRESSION_COLUMN_INDEX:
final Binding binding = invocation.getBinding().get(rowIndex);
final Optional<Expression> expression = Optional.ofNullable(binding.getExpression());
final Optional<ExpressionEditorDefinition<Expression>> expressionEditorDefinition = expressionEditorDefinitionsSupplier.get().getExpressionEditorDefinition(expression);
expressionEditorDefinition.ifPresent(ed -> {
final Optional<BaseExpressionGrid> editor = ed.getEditor(new GridCellTuple(rowIndex, columnIndex, gridWidget), Optional.empty(), binding, expression, Optional.ofNullable(binding.getParameter()), nesting + 1);
uiModel.get().setCell(rowIndex, columnIndex, () -> new InvocationGridCell<>(new ExpressionCellValue(editor), listSelector));
});
}
});
}
Aggregations