use of org.kie.workbench.common.dmn.client.widgets.grid.model.ExpressionEditorGridRow in project kie-wb-common by kiegroup.
the class ListGrid method addRow.
void addRow(final int index) {
getExpression().get().ifPresent(list -> {
final GridRow listRow = new ExpressionEditorGridRow();
final HasExpression hasExpression = HasExpression.wrap(list, new LiteralExpression());
sessionCommandManager.execute((AbstractCanvasHandler) sessionManager.getCurrentSession().getCanvasHandler(), new AddListRowCommand(list, hasExpression, model, listRow, index, uiModelMapper, () -> resize(BaseExpressionGrid.RESIZE_EXISTING)));
});
}
use of org.kie.workbench.common.dmn.client.widgets.grid.model.ExpressionEditorGridRow in project kie-wb-common by kiegroup.
the class ContextGrid method addContextEntry.
void addContextEntry(final int index) {
getExpression().get().ifPresent(c -> {
final ContextEntry ce = new ContextEntry();
final InformationItem informationItem = new InformationItem();
informationItem.setName(new Name());
ce.setVariable(informationItem);
final CommandResult<CanvasViolation> result = sessionCommandManager.execute((AbstractCanvasHandler) sessionManager.getCurrentSession().getCanvasHandler(), new AddContextEntryCommand(c, ce, model, new ExpressionEditorGridRow(), index, uiModelMapper, () -> resize(BaseExpressionGrid.RESIZE_EXISTING)));
if (!CommandUtils.isError(result)) {
selectCell(index, ContextUIModelMapperHelper.NAME_COLUMN_INDEX, false, false);
startEditingCell(index, ContextUIModelMapperHelper.NAME_COLUMN_INDEX);
}
});
}
use of org.kie.workbench.common.dmn.client.widgets.grid.model.ExpressionEditorGridRow in project kie-wb-common by kiegroup.
the class InvocationGrid method addParameterBinding.
void addParameterBinding(final int index) {
getExpression().get().ifPresent(invocation -> {
final Binding binding = new Binding();
final InformationItem parameter = new InformationItem();
parameter.setName(new Name());
binding.setParameter(parameter);
final CommandResult<CanvasViolation> result = sessionCommandManager.execute((AbstractCanvasHandler) sessionManager.getCurrentSession().getCanvasHandler(), new AddParameterBindingCommand(invocation, binding, model, new ExpressionEditorGridRow(), index, uiModelMapper, () -> resize(BaseExpressionGrid.RESIZE_EXISTING)));
if (!CommandUtils.isError(result)) {
selectCell(index, InvocationUIModelMapper.BINDING_PARAMETER_COLUMN_INDEX, false, false);
startEditingCell(index, InvocationUIModelMapper.BINDING_PARAMETER_COLUMN_INDEX);
}
});
}
Aggregations