BaseGridRenderer implements GridRenderer { RendererCommand getRendererCommand(final GridData model, final GridBodyRenderContext context, final BaseGridRendererHelper rendererHelper, final BaseGridRendererHelper.RenderingInformation renderingInformation, final GridColumn<?> column, final int visibleRowIndex) { return (rc) -> { if (!rc.isSelectionLayer()) { if (model.getColumns().size() >= 1) { rc.getGroup().add(makeCellHighlight(getHighlightCellRowIndex(), visibleRowIndex, model, rendererHelper, renderingInformation, column, context)); } } }; } BaseGridRenderer(final GridRendererTheme theme); @Override double getHeaderHeight(); @Override double getHeaderRowHeight(); @Override GridRendererTheme getTheme(); @Override void setTheme(final GridRendererTheme theme); @Override RendererCommand renderSelector(final double width,
                                          final double height,
                                          final BaseGridRendererHelper.RenderingInformation renderingInformation); @Override RendererCommand renderSelectedCells(final GridData model,
                                               final GridBodyRenderContext context,
                                               final BaseGridRendererHelper rendererHelper,
                                               final List<GridData.SelectedCell> selectedCells,
                                               final BiFunction<SelectedRange, Integer, Double> selectedCellsYOffsetStrategy,
                                               final Function<SelectedRange, Double> selectedCellsHeightStrategy); @Override List<RendererCommand> renderHeader(final GridData model,
                                              final GridHeaderRenderContext context,
                                              final BaseGridRendererHelper rendererHelper,
                                              final BaseGridRendererHelper.RenderingInformation renderingInformation); @Override RendererCommand renderHeaderBodyDivider(final double width); @Override List<RendererCommand> renderBody(final GridData model,
                                            final GridBodyRenderContext context,
                                            final BaseGridRendererHelper rendererHelper,
                                            final BaseGridRendererHelper.RenderingInformation renderingInformation); @Override RendererCommand renderGridBoundary(final GridBoundaryRenderContext context); @Override boolean onGroupingToggle(double cellX,
                                    double cellY,
                                    double cellWidth,
                                    double cellHeight); @Override void setColumnRenderConstraint(final BiFunction<Boolean, GridColumn<?>, Boolean> columnRenderingConstraint); void clearCellHighlight(); void highlightCell(final int column, final int row); Integer getHighlightCellColumnIndex(); Integer getHighlightCellRowIndex();  }
@Test public void testGetRendererCommand() { final int highlightCellRowIndex = 0; final GridData dataModel = mock(GridData.class); final int visibleRowIndex = 0; final List<GridColumn<?>> columnsList = new ArrayList<>(); columnsList.add(column); final GridRendererContext rc = mock(GridRendererContext.class); final Group group = mock(Group.class); final Rectangle rectangle = mock(Rectangle.class); doReturn(highlightCellRowIndex).when(renderer).getHighlightCellRowIndex(); when(dataModel.getColumns()).thenReturn(columnsList); when(rc.getGroup()).thenReturn(group); when(rc.isSelectionLayer()).thenReturn(false); doReturn(rectangle).when(renderer).makeCellHighlight(highlightCellRowIndex, visibleRowIndex, dataModel, rendererHelper, renderingInformation, column, context); final GridRenderer.RendererCommand cmd = renderer.getRendererCommand(dataModel, context, rendererHelper, renderingInformation, column, visibleRowIndex); cmd.execute(rc); verify(group).add(rectangle); }