use of org.uberfire.ext.wires.core.grids.client.model.impl.BaseGridData in project kie-wb-common by kiegroup.
the class AddRelationColumnCommandTest method setup.
@Before
public void setup() {
this.relation = new Relation();
this.informationItem = new InformationItem();
this.uiModel = new BaseGridData();
this.uiModel.appendColumn(uiRowNumberColumn);
this.uiModelMapper = new RelationUIModelMapper(() -> uiModel, () -> Optional.of(relation), listSelector, DEFAULT_HEIGHT);
makeCommand(1);
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 AddRelationRowCommandTest method setup.
@Before
public void setup() {
this.relation = new Relation();
this.row = new List();
this.uiModelRow = new BaseGridRow();
this.uiModel = new BaseGridData();
this.uiModel.appendColumn(uiRowNumberColumn);
this.uiModelMapper = new RelationUIModelMapper(() -> uiModel, () -> Optional.of(relation), listSelector, DEFAULT_HEIGHT);
makeCommand(0);
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 DeleteRelationRowCommandTest method setup.
@Before
public void setup() {
this.relation = new Relation();
this.rowList = new List();
this.relation.getRow().add(rowList);
this.uiModel = new BaseGridData();
this.uiModel.appendRow(new BaseGridRow());
this.uiModel.appendColumn(uiRowNumberColumn);
this.uiModelMapper = new RelationUIModelMapper(() -> uiModel, () -> Optional.of(relation), listSelector, DEFAULT_HEIGHT);
makeCommand(0);
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 SetKindCommandTest method setup.
@Before
public void setup() {
this.function = new FunctionDefinition();
this.function.setKind(originalKind);
this.function.setExpression(originalExpression);
this.uiModel = new BaseGridData();
this.uiModel.appendColumn(mockColumn);
this.uiModel.appendRow(new BaseGridRow());
this.uiModel.setCellValue(0, 0, new ExpressionCellValue(Optional.of(originalEditor)));
doReturn(uiModel).when(gridWidget).getModel();
doReturn(ruleManager).when(handler).getRuleManager();
}
use of org.uberfire.ext.wires.core.grids.client.model.impl.BaseGridData in project kie-wb-common by kiegroup.
the class DMNGridLayerTest method testSelectGridWidget.
@Test
public void testSelectGridWidget() {
when(expressionGrid.getModel()).thenReturn(new BaseGridData(false));
when(expressionGrid.asNode()).thenReturn(mock(Node.class));
assertThat(gridLayer.getSelectedGridWidget().isPresent()).isFalse();
gridLayer.add(expressionGrid);
gridLayer.select(expressionGrid);
assertThat(gridLayer.getSelectedGridWidget().isPresent()).isTrue();
assertThat(gridLayer.getSelectedGridWidget().get()).isEqualTo(expressionGrid);
verify(expressionGrid).select();
}
Aggregations