@Override public List<RendererCommand> renderBody(final GridData model, final GridBodyRenderContext context, final BaseGridRendererHelper rendererHelper, final BaseGridRendererHelper.RenderingInformation renderingInformation) { final List<RendererCommand> commands = super.renderBody(model, context, rendererHelper, renderingInformation); if (!(rowHighlightRowIndexes == null || rowHighlightRowIndexes.isEmpty())) { commands.addAll(renderRowHighlights(model, context, rendererHelper, renderingInformation)); } return commands; }
@Override public List<RendererCommand> renderBody(final GridData model, final GridBodyRenderContext context, final BaseGridRendererHelper rendererHelper, final BaseGridRendererHelper.RenderingInformation renderingInformation) { final List<RendererCommand> commands = super.renderBody(model, context, rendererHelper, renderingInformation); if (!(rowHighlightRowIndexes == null || rowHighlightRowIndexes.isEmpty())) { commands.addAll(renderRowHighlights(model, context, rendererHelper, renderingInformation)); } return commands; }
@Test @SuppressWarnings("unchecked") public void checkRenderBody() { final BaseGridRendererHelper.RenderingInformation ri = makeRenderingInformation(model, Arrays.asList(0d, HEADER_ROW_HEIGHT, HEADER_ROW_HEIGHT * 2)); final GridBodyRenderContext context = mock(GridBodyRenderContext.class); doReturn(0).when(context).getMinVisibleRowIndex(); doReturn(model.getRowCount() - 1).when(context).getMaxVisibleRowIndex(); doReturn(model.getColumns()).when(context).getBlockColumns(); final List<RendererCommand> commands = renderer.renderBody(model, context, rendererHelper, ri); assertThat(commands).isNotNull(); assertThat(commands).asList().hasSize(1); assertThat(commands).asList().hasOnlyOneElementSatisfying(o -> assertTrue(o instanceof RenderBodyGridBackgroundCommand)); //Check the ColumnRenderer was asked to contribute towards the rendering //It is mocked in this test and hence we cannot verify it actually did anything. verify(columnRenderer).renderColumn(eq(column), any(GridBodyColumnRenderContext.class), eq(rendererHelper), eq(ri), any(BiFunction.class)); commands.get(0).execute(rc); verify(parent, never()).add(anyObject()); }
doReturn(model.getColumns()).when(context).getBlockColumns(); final List<RendererCommand> commands = renderer.renderBody(model, context, rendererHelper,
@Test @SuppressWarnings("unchecked") public void checkRenderBody() { final BaseGridRendererHelper.RenderingInformation ri = makeRenderingInformation(model, Arrays.asList(0d, HEADER_ROW_HEIGHT, HEADER_ROW_HEIGHT * 2)); final GridBodyRenderContext context = mock(GridBodyRenderContext.class); doReturn(0).when(context).getMinVisibleRowIndex(); doReturn(model.getRowCount() - 1).when(context).getMaxVisibleRowIndex(); doReturn(model.getColumns()).when(context).getBlockColumns(); final List<RendererCommand> commands = renderer.renderBody(model, context, rendererHelper, ri); assertThat(commands).isNotNull(); assertThat(commands).asList().hasSize(1); assertThat(commands).asList().hasOnlyOneElementSatisfying(o -> assertTrue(o instanceof RenderBodyGridBackgroundCommand)); //Check the ColumnRenderer was asked to contribute towards the rendering //It is mocked in this test and hence we cannot verify it actually did anything. verify(columnRenderer).renderColumn(eq(column), any(GridBodyColumnRenderContext.class), eq(rendererHelper), eq(ri), any(BiFunction.class)); commands.get(0).execute(rc); verify(parent, never()).add(anyObject()); }
doReturn(model.getColumns()).when(context).getBlockColumns(); final List<RendererCommand> commands = renderer.renderBody(model, context, rendererHelper,