use of org.uberfire.ext.wires.core.grids.client.model.impl.BaseGridData in project kie-wb-common by kiegroup.
the class DeleteContextEntryCommandTest method setup.
@Before
public void setup() {
this.context = new Context();
this.context.getContextEntry().add(new ContextEntry());
this.uiModel = new BaseGridData(false);
this.uiModel.appendRow(new BaseGridRow());
this.uiModel.appendColumn(uiRowNumberColumn);
doReturn(ruleManager).when(handler).getRuleManager();
doReturn(0).when(uiRowNumberColumn).getIndex();
doReturn(1).when(uiModelColumn).getIndex();
}
use of org.uberfire.ext.wires.core.grids.client.model.impl.BaseGridData in project kie-wb-common by kiegroup.
the class AddParameterBindingCommandTest method setup.
@Before
@SuppressWarnings("unchecked")
public void setup() {
this.invocation = new Invocation();
this.binding = new Binding();
final InformationItem parameter = new InformationItem();
parameter.setName(new Name("p" + invocation.getBinding().size()));
this.binding.setParameter(parameter);
this.uiModel = new BaseGridData(false);
this.uiModelRow = new BaseGridRow();
this.uiModel.appendColumn(uiRowNumberColumn);
this.uiModel.appendColumn(uiNameColumn);
this.uiModel.appendColumn(uiExpressionEditorColumn);
this.uiModelMapper = new InvocationUIModelMapper(gridWidget, () -> uiModel, () -> Optional.of(invocation), () -> false, () -> expressionEditorDefinitions, listSelector, 0);
doReturn(ruleManager).when(handler).getRuleManager();
doReturn(0).when(uiRowNumberColumn).getIndex();
doReturn(1).when(uiNameColumn).getIndex();
doReturn(2).when(uiExpressionEditorColumn).getIndex();
doReturn(uiModel).when(gridWidget).getModel();
doReturn(Optional.empty()).when(expressionEditorDefinitions).getExpressionEditorDefinition(any(Optional.class));
}
use of org.uberfire.ext.wires.core.grids.client.model.impl.BaseGridData in project kie-wb-common by kiegroup.
the class DeleteParameterBindingCommandTest method setup.
@Before
public void setup() {
this.invocation = new Invocation();
this.binding = makeBinding("p" + invocation.getBinding().size());
this.invocation.getBinding().add(binding);
this.uiModel = new BaseGridData(false);
this.uiGridRow = new BaseGridRow();
this.uiModel.appendRow(uiGridRow);
this.uiModel.appendColumn(uiRowNumberColumn);
this.uiModel.appendColumn(uiNameColumn);
this.uiModel.appendColumn(uiExpressionEditorColumn);
doReturn(ruleManager).when(handler).getRuleManager();
doReturn(0).when(uiRowNumberColumn).getIndex();
doReturn(1).when(uiNameColumn).getIndex();
doReturn(2).when(uiExpressionEditorColumn).getIndex();
}
use of org.uberfire.ext.wires.core.grids.client.model.impl.BaseGridData in project kie-wb-common by kiegroup.
the class AddListRowCommandTest method setup.
@Before
@SuppressWarnings("unchecked")
public void setup() {
this.list = new List();
this.hasExpression = HasExpression.wrap(list, new LiteralExpression());
this.uiModel = new BaseGridData();
this.uiModelRow = new BaseGridRow();
this.uiModel.appendColumn(uiRowNumberColumn);
this.uiModel.appendColumn(uiExpressionEditorColumn);
when(gridWidget.getModel()).thenReturn(uiModel);
when(handler.getRuleManager()).thenReturn(ruleManager);
when(uiRowNumberColumn.getIndex()).thenReturn(0);
when(uiExpressionEditorColumn.getIndex()).thenReturn(1);
this.uiModel.setCellValue(0, EXPRESSION_COLUMN_INDEX, new ExpressionCellValue(Optional.of(literalExpressionEditor)));
final ExpressionEditorDefinitions expressionEditorDefinitions = new ExpressionEditorDefinitions();
expressionEditorDefinitions.add(literalExpressionEditorDefinition);
when(literalExpressionEditor.getParentInformation()).thenReturn(parent);
when(literalExpressionEditorDefinition.getModelClass()).thenReturn(Optional.of(new LiteralExpression()));
when(literalExpressionEditorDefinition.getEditor(any(GridCellTuple.class), any(Optional.class), any(HasExpression.class), any(Optional.class), anyBoolean(), anyInt())).thenReturn(Optional.of(literalExpressionEditor));
this.uiModelMapper = spy(new ListUIModelMapper(gridWidget, () -> uiModel, () -> Optional.of(list), () -> false, () -> expressionEditorDefinitions, listSelector, 0));
}
use of org.uberfire.ext.wires.core.grids.client.model.impl.BaseGridData in project kie-wb-common by kiegroup.
the class DeleteListRowCommandTest method setup.
@Before
public void setup() {
this.list = new List();
this.uiModel = new BaseGridData();
this.uiModel.appendColumn(uiRowNumberColumn);
this.uiModel.appendColumn(uiExpressionEditorColumn);
this.uiModel.appendRow(new BaseGridRow());
this.list.getExpression().add(HasExpression.wrap(list, new LiteralExpression()));
doReturn(ruleManager).when(handler).getRuleManager();
doReturn(0).when(uiRowNumberColumn).getIndex();
doReturn(1).when(uiExpressionEditorColumn).getIndex();
}
Aggregations