ColumnRenderingStrategyMerged { protected static boolean isCollapsedCellMixedValue(final GridData model, final int rowIndex, final int columnIndex) { int _rowIndex = rowIndex; GridCell<?> currentCell = model.getCell(_rowIndex, columnIndex); if (currentCell != null) { while (_rowIndex > 0 && currentCell.getMergedCellCount() == 0) { _rowIndex--; currentCell = model.getCell(_rowIndex, columnIndex); } } _rowIndex++; if (_rowIndex > model.getRowCount() - 1) { return false; } while (_rowIndex < model.getRowCount() && model.getRow(_rowIndex).isCollapsed()) { final GridCell<?> nextCell = model.getCell(_rowIndex, columnIndex); if (!Objects.equals(currentCell, nextCell)) { return true; } _rowIndex++; } return false; }  static List<GridRenderer.RendererCommand> render(final GridColumn<?> column,
                                                            final GridBodyColumnRenderContext context,
                                                            final BaseGridRendererHelper rendererHelper,
                                                            final BaseGridRendererHelper.RenderingInformation renderingInformation,
                                                            final BiFunction<Boolean, GridColumn<?>, Boolean> columnRenderingConstraint);  }
@Test public void testIsCollapsedCellMixedValueThreeDifferentValues() { when(gridData.getRow(anyInt())).thenReturn(gridRow); when(gridRow.getHeight()).thenReturn(BaseGridWidgetRenderingTestUtils.HEADER_ROW_HEIGHT); final GridCell<String> cellOne = gridCellWithMockedMergedCellCount("one", 3); final GridCell<String> cellTwo = gridCellWithMockedMergedCellCount("two", 0); final GridCell<String> cellThree = gridCellWithMockedMergedCellCount("three", 0); doReturn(3).when(gridData).getRowCount(); doReturn(cellOne).when(gridData).getCell(0, 0); doReturn(cellTwo).when(gridData).getCell(1, 0); doReturn(cellThree).when(gridData).getCell(2, 0); doReturn(true).when(gridRow).isCollapsed(); assertThat(ColumnRenderingStrategyMerged.isCollapsedCellMixedValue(gridData, 2, 0)).isTrue(); }
@Test public void testIsCollapsedCellMixedValueOneDifferentValue_1() { when(gridData.getRow(anyInt())).thenReturn(gridRow); when(gridRow.getHeight()).thenReturn(BaseGridWidgetRenderingTestUtils.HEADER_ROW_HEIGHT); final GridCell<String> cellOne = gridCellWithMockedMergedCellCount("one", 3); final GridCell<String> cellTwo = gridCellWithMockedMergedCellCount("two", 0); final GridCell<String> cellThree = gridCellWithMockedMergedCellCount("one", 0); doReturn(3).when(gridData).getRowCount(); doReturn(cellOne).when(gridData).getCell(0, 0); doReturn(cellTwo).when(gridData).getCell(1, 0); doReturn(cellThree).when(gridData).getCell(2, 0); doReturn(true).when(gridRow).isCollapsed(); assertThat(ColumnRenderingStrategyMerged.isCollapsedCellMixedValue(gridData, 2, 0)).isTrue(); }
@Test public void testIsCollapsedCellMixedValueOneDifferentValue_2() { when(gridData.getRow(anyInt())).thenReturn(gridRow); when(gridRow.getHeight()).thenReturn(BaseGridWidgetRenderingTestUtils.HEADER_ROW_HEIGHT); final GridCell<String> cellOne = gridCellWithMockedMergedCellCount("two", 3); final GridCell<String> cellTwo = gridCellWithMockedMergedCellCount("one", 0); final GridCell<String> cellThree = gridCellWithMockedMergedCellCount("one", 0); doReturn(3).when(gridData).getRowCount(); doReturn(cellOne).when(gridData).getCell(0, 0); doReturn(cellTwo).when(gridData).getCell(1, 0); doReturn(cellThree).when(gridData).getCell(2, 0); doReturn(true).when(gridRow).isCollapsed(); assertThat(ColumnRenderingStrategyMerged.isCollapsedCellMixedValue(gridData, 2, 0)).isTrue(); }
@Test public void testIsCollapsedCellMixedValueOneDifferentValue_3() { when(gridData.getRow(anyInt())).thenReturn(gridRow); when(gridRow.getHeight()).thenReturn(BaseGridWidgetRenderingTestUtils.HEADER_ROW_HEIGHT); final GridCell<String> cellOne = gridCellWithMockedMergedCellCount("one", 3); final GridCell<String> cellTwo = gridCellWithMockedMergedCellCount("one", 0); final GridCell<String> cellThree = gridCellWithMockedMergedCellCount("two", 0); doReturn(3).when(gridData).getRowCount(); doReturn(cellOne).when(gridData).getCell(0, 0); doReturn(cellTwo).when(gridData).getCell(1, 0); doReturn(cellThree).when(gridData).getCell(2, 0); doReturn(true).when(gridRow).isCollapsed(); assertThat(ColumnRenderingStrategyMerged.isCollapsedCellMixedValue(gridData, 2, 0)).isTrue(); }
@Test public void testIsCollapsedCellMixedValue() { when(gridData.getRow(anyInt())).thenReturn(gridRow); when(gridRow.getHeight()).thenReturn(BaseGridWidgetRenderingTestUtils.HEADER_ROW_HEIGHT); final GridCell<String> cellOne = gridCellWithMockedMergedCellCount("one", 3); final GridCell<String> cellTwo = gridCellWithMockedMergedCellCount("one", 0); final GridCell<String> cellThree = gridCellWithMockedMergedCellCount("one", 0); doReturn(3).when(gridData).getRowCount(); doReturn(cellOne).when(gridData).getCell(0, 0); doReturn(cellTwo).when(gridData).getCell(1, 0); doReturn(cellThree).when(gridData).getCell(2, 0); doReturn(true).when(gridRow).isCollapsed(); assertThat(ColumnRenderingStrategyMerged.isCollapsedCellMixedValue(gridData, 2, 0)).isFalse(); }