use of org.uberfire.ext.wires.core.grids.client.widget.grid.columns.RowNumberColumn in project kie-wb-common by kiegroup.
the class BaseExpressionGridGeneralTest method testAdjustSelectionHandling_MoveDownWhenAtBottomAlready.
@Test
public void testAdjustSelectionHandling_MoveDownWhenAtBottomAlready() {
grid.getModel().appendColumn(new RowNumberColumn());
grid.getModel().appendRow(new BaseGridRow());
grid.selectCell(0, 0, false, false);
reset(grid);
grid.adjustSelection(SelectionExtension.DOWN, false);
verify(grid, never()).doAfterSelectionChange(anyInt(), anyInt());
}
use of org.uberfire.ext.wires.core.grids.client.widget.grid.columns.RowNumberColumn in project kie-wb-common by kiegroup.
the class DMNGridPanelCellSelectionHandlerTest method mockGridWidget.
private BaseExpressionGrid mockGridWidget() {
final BaseExpressionGrid gridWidget = mock(BaseExpressionGrid.class);
final GridData gridData = new DMNGridData();
when(gridWidget.getModel()).thenReturn(gridData);
gridData.appendColumn(new RowNumberColumn());
IntStream.range(0, 3).forEach(i -> {
final GridColumn gridColumn = mock(GridColumn.class);
final List<GridColumn.HeaderMetaData> headerMetaData = Collections.singletonList(mock(GridColumn.HeaderMetaData.class));
when(gridColumn.getIndex()).thenReturn(i);
when(gridColumn.getHeaderMetaData()).thenReturn(headerMetaData);
gridData.appendColumn(gridColumn);
});
gridData.appendRow(new BaseGridRow());
gridData.appendRow(new BaseGridRow());
gridData.appendRow(new BaseGridRow());
return gridWidget;
}
use of org.uberfire.ext.wires.core.grids.client.widget.grid.columns.RowNumberColumn in project kie-wb-common by kiegroup.
the class CommandUtilsTest method testUpdateParentInformation_WithMultipleColumns.
@Test
@SuppressWarnings("unchecked")
public void testUpdateParentInformation_WithMultipleColumns() {
setupUiModel(Pair.newPair(new ExpressionEditorColumn(gridLayer, new BaseHeaderMetaData("column"), ExpressionEditorColumn.DEFAULT_WIDTH, gridWidget), (rowIndex) -> {
final BaseExpressionGrid grid = mock(BaseExpressionGrid.class);
final GridCellTuple gct = new GridCellTuple(rowIndex, 0, mock(GridWidget.class));
when(grid.getParentInformation()).thenReturn(gct);
return new ExpressionCellValue(Optional.of(grid));
}), Pair.newPair(new RowNumberColumn(), (rowIndex) -> new BaseGridCellValue<>(rowIndex + 1)));
assertParentInformationValues(0);
gridData.moveColumnTo(0, gridData.getColumns().get(1));
CommandUtils.updateParentInformation(gridData);
assertParentInformationValues(1);
}
use of org.uberfire.ext.wires.core.grids.client.widget.grid.columns.RowNumberColumn in project kie-wb-common by kiegroup.
the class RelationGrid method initialiseUiColumns.
@Override
public void initialiseUiColumns() {
int uiColumnIndex = 0;
final RowNumberColumn rowNumberColumn = new RowNumberColumn();
rowNumberColumn.setWidth(getAndSetInitialWidth(uiColumnIndex++, rowNumberColumn.getWidth()));
if (getExpression().get().isPresent()) {
model.appendColumn(rowNumberColumn);
final Relation e = getExpression().get().get();
for (int index = 0; index < e.getColumn().size(); index++) {
final GridColumn relationColumn = makeRelationColumn(uiColumnIndex++, e.getColumn().get(index));
model.appendColumn(relationColumn);
}
}
getRenderer().setColumnRenderConstraint((isSelectionLayer, gridColumn) -> true);
}
use of org.uberfire.ext.wires.core.grids.client.widget.grid.columns.RowNumberColumn in project kie-wb-common by kiegroup.
the class RelationGridTest method testInitialiseUiColumns.
@Test
public void testInitialiseUiColumns() {
final String columnHeader = "first column";
relation.getColumn().add(new InformationItem() {
{
getName().setValue(columnHeader);
}
});
expression = Optional.of(relation);
setupGrid(0);
assertEquals(2, grid.getModel().getColumns().size());
assertTrue(grid.getModel().getColumns().get(0) instanceof RowNumberColumn);
assertEquals(columnHeader, grid.getModel().getColumns().get(1).getHeaderMetaData().get(0).getTitle());
}
Aggregations