use of org.uberfire.ext.wires.core.grids.client.model.impl.BaseGridRow in project kie-wb-common by kiegroup.
the class BaseExpressionGridGeneralTest method testSelectFirstCellWithRowAndRowNumberColumnAndAnotherColumn.
@Test
public void testSelectFirstCellWithRowAndRowNumberColumnAndAnotherColumn() {
grid.getModel().appendRow(new BaseGridRow());
appendColumns(RowNumberColumn.class, GridColumn.class);
grid.selectFirstCell();
assertThat(grid.getModel().getSelectedCells()).isNotEmpty();
assertThat(grid.getModel().getSelectedCells()).contains(new GridData.SelectedCell(0, 1));
verify(domainObjectSelectionEvent).fire(domainObjectSelectionEventCaptor.capture());
final DomainObjectSelectionEvent domainObjectSelectionEvent = domainObjectSelectionEventCaptor.getValue();
assertThat(domainObjectSelectionEvent.getDomainObject()).isInstanceOf(NOPDomainObject.class);
}
use of org.uberfire.ext.wires.core.grids.client.model.impl.BaseGridRow in project kie-wb-common by kiegroup.
the class BaseExpressionGridGeneralTest method testAdjustSelectionHandling_MoveUpWhenOnTopAlready.
@Test
public void testAdjustSelectionHandling_MoveUpWhenOnTopAlready() {
grid.getModel().appendColumn(new RowNumberColumn());
grid.getModel().appendRow(new BaseGridRow());
grid.selectHeaderCell(0, 0, false, false);
reset(grid);
grid.adjustSelection(SelectionExtension.UP, false);
verify(grid, never()).doAfterHeaderSelectionChange(anyInt(), anyInt());
}
use of org.uberfire.ext.wires.core.grids.client.model.impl.BaseGridRow in project kie-wb-common by kiegroup.
the class GridCellTupleTest method setup.
@Before
public void setup() {
tuple = new GridCellTuple(0, 0, gridWidget);
gridData = new BaseGridData(false);
gridData.appendColumn(gridColumn);
gridData.appendRow(new BaseGridRow());
when(gridWidget.getModel()).thenReturn(gridData);
}
use of org.uberfire.ext.wires.core.grids.client.model.impl.BaseGridRow in project kie-wb-common by kiegroup.
the class DMNGridPanelContextMenuHandlerTest method mockGridWidget.
private BaseGrid mockGridWidget() {
final BaseGrid gridWidget = spy(new BaseGrid(gridLayer, new BaseGridData(false), renderer, sessionManager, sessionCommandManager, canvasCommandFactory, refreshFormPropertiesEvent, domainObjectSelectionEvent, cellEditorControls, translationService) {
@Override
public Layer getLayer() {
return gridLayer;
}
});
gridWidget.getModel().appendColumn(new RowNumberColumn());
gridWidget.getModel().appendColumn(gridColumn);
gridWidget.getModel().appendRow(new BaseGridRow());
gridWidget.getModel().appendRow(new BaseGridRow());
return gridWidget;
}
use of org.uberfire.ext.wires.core.grids.client.model.impl.BaseGridRow in project kie-wb-common by kiegroup.
the class CommandUtilsTest method setupUiModelNullValues.
@SafeVarargs
private final void setupUiModelNullValues(final Pair<GridColumn, Function<Integer, GridCellValue>>... columns) {
Arrays.asList(columns).forEach(column -> gridData.appendColumn(column.getK1()));
IntStream.range(0, ROW_COUNT).forEach(rowIndex -> {
gridData.appendRow(new BaseGridRow());
});
}
Aggregations