Search in sources :

Example 1 with RendererCommand

use of org.uberfire.ext.wires.core.grids.client.widget.grid.renderers.grids.GridRenderer.RendererCommand in project drools-wb by kiegroup.

the class GuidedDecisionTableRendererTest method testRenderHeaderBodyDivider.

@Test
public void testRenderHeaderBodyDivider() {
    final RendererCommand command = renderer.renderHeaderBodyDivider(10.0);
    assertRenderingCommands(Collections.singletonList(command), RenderHeaderGridLinesCommand.class);
}
Also used : RendererCommand(org.uberfire.ext.wires.core.grids.client.widget.grid.renderers.grids.GridRenderer.RendererCommand) Test(org.junit.Test)

Example 2 with RendererCommand

use of org.uberfire.ext.wires.core.grids.client.widget.grid.renderers.grids.GridRenderer.RendererCommand in project kie-wb-common by kiegroup.

the class BaseExpressionGridRenderingTest method setup.

@Before
@Override
public void setup() {
    super.setup();
    doReturn(false).when(context).isSelection();
    doReturn(new BaseBounds(0, 0, 1000, 1000)).when(gridLayer).getVisibleBounds();
    grid.getModel().appendColumn(new RowNumberColumn());
    grid.getModel().appendRow(new DMNGridRow());
    doReturn(renderSelectorCommand).when(renderer).renderSelector(anyDouble(), anyDouble(), any(BaseGridRendererHelper.RenderingInformation.class));
    doReturn(renderSelectedCellsCommand).when(renderer).renderSelectedCells(any(GridData.class), any(GridBodyRenderContext.class), any(BaseGridRendererHelper.class));
    final List<RendererCommand> renderHeaderCommands = new ArrayList<>();
    renderHeaderCommands.add(renderHeaderBackgroundCommand);
    renderHeaderCommands.add(renderHeaderGridLinesCommand);
    renderHeaderCommands.add(renderHeaderContentCommand);
    doReturn(renderHeaderCommands).when(renderer).renderHeader(any(GridData.class), any(GridHeaderRenderContext.class), any(BaseGridRendererHelper.class), any(BaseGridRendererHelper.RenderingInformation.class));
    final List<RendererCommand> renderBodyCommands = new ArrayList<>();
    renderBodyCommands.add(renderBodyGridBackgroundCommand);
    renderBodyCommands.add(renderBodyGridLinesCommand);
    renderBodyCommands.add(renderBodyGridContentCommand);
    doReturn(renderBodyCommands).when(renderer).renderBody(any(GridData.class), any(GridBodyRenderContext.class), any(BaseGridRendererHelper.class), any(BaseGridRendererHelper.RenderingInformation.class));
    doReturn(renderHeaderBodyDividerCommand).when(renderer).renderHeaderBodyDivider(anyDouble());
    doReturn(renderGridBoundaryCommand).when(renderer).renderGridBoundary(any(GridBoundaryRenderContext.class));
    doReturn(BaseExpressionGridRenderer.HEADER_HEIGHT).when(renderer).getHeaderHeight();
}
Also used : RowNumberColumn(org.uberfire.ext.wires.core.grids.client.widget.grid.columns.RowNumberColumn) DMNGridRow(org.kie.workbench.common.dmn.client.widgets.grid.model.DMNGridRow) GridHeaderRenderContext(org.uberfire.ext.wires.core.grids.client.widget.context.GridHeaderRenderContext) RendererCommand(org.uberfire.ext.wires.core.grids.client.widget.grid.renderers.grids.GridRenderer.RendererCommand) DMNGridData(org.kie.workbench.common.dmn.client.widgets.grid.model.DMNGridData) GridData(org.uberfire.ext.wires.core.grids.client.model.GridData) GridBodyRenderContext(org.uberfire.ext.wires.core.grids.client.widget.context.GridBodyRenderContext) ArrayList(java.util.ArrayList) BaseBounds(org.uberfire.ext.wires.core.grids.client.model.impl.BaseBounds) BaseGridRendererHelper(org.uberfire.ext.wires.core.grids.client.widget.grid.renderers.grids.impl.BaseGridRendererHelper) GridBoundaryRenderContext(org.uberfire.ext.wires.core.grids.client.widget.context.GridBoundaryRenderContext) Before(org.junit.Before)

Example 3 with RendererCommand

use of org.uberfire.ext.wires.core.grids.client.widget.grid.renderers.grids.GridRenderer.RendererCommand in project drools-wb by kiegroup.

the class GuidedDecisionTableRendererTest method testRenderSelectorIsNotSelectionLayer.

@Test
public void testRenderSelectorIsNotSelectionLayer() {
    final RendererCommand command = renderer.renderSelector(10.0, 20.0, renderingInformation);
    command.execute(makeGridRendererContext(false));
    verify(parent).add(any());
}
Also used : RendererCommand(org.uberfire.ext.wires.core.grids.client.widget.grid.renderers.grids.GridRenderer.RendererCommand) Test(org.junit.Test)

Example 4 with RendererCommand

use of org.uberfire.ext.wires.core.grids.client.widget.grid.renderers.grids.GridRenderer.RendererCommand in project drools-wb by kiegroup.

the class GuidedDecisionTableRendererTest method testRenderSelector.

@Test
public void testRenderSelector() {
    final RendererCommand command = renderer.renderSelector(10.0, 20.0, renderingInformation);
    assertRenderingCommands(Collections.singletonList(command), RenderSelectorCommand.class);
}
Also used : RendererCommand(org.uberfire.ext.wires.core.grids.client.widget.grid.renderers.grids.GridRenderer.RendererCommand) Test(org.junit.Test)

Example 5 with RendererCommand

use of org.uberfire.ext.wires.core.grids.client.widget.grid.renderers.grids.GridRenderer.RendererCommand in project drools-wb by kiegroup.

the class GuidedDecisionTableRendererTest method testRenderSelectorIsSelectionLayer.

@Test
public void testRenderSelectorIsSelectionLayer() {
    final RendererCommand command = renderer.renderSelector(10.0, 20.0, renderingInformation);
    command.execute(makeGridRendererContext(true));
    verify(parent, never()).add(any(Group.class));
}
Also used : Group(com.ait.lienzo.client.core.shape.Group) RendererCommand(org.uberfire.ext.wires.core.grids.client.widget.grid.renderers.grids.GridRenderer.RendererCommand) Test(org.junit.Test)

Aggregations

RendererCommand (org.uberfire.ext.wires.core.grids.client.widget.grid.renderers.grids.GridRenderer.RendererCommand)5 Test (org.junit.Test)4 Group (com.ait.lienzo.client.core.shape.Group)1 ArrayList (java.util.ArrayList)1 Before (org.junit.Before)1 DMNGridData (org.kie.workbench.common.dmn.client.widgets.grid.model.DMNGridData)1 DMNGridRow (org.kie.workbench.common.dmn.client.widgets.grid.model.DMNGridRow)1 GridData (org.uberfire.ext.wires.core.grids.client.model.GridData)1 BaseBounds (org.uberfire.ext.wires.core.grids.client.model.impl.BaseBounds)1 GridBodyRenderContext (org.uberfire.ext.wires.core.grids.client.widget.context.GridBodyRenderContext)1 GridBoundaryRenderContext (org.uberfire.ext.wires.core.grids.client.widget.context.GridBoundaryRenderContext)1 GridHeaderRenderContext (org.uberfire.ext.wires.core.grids.client.widget.context.GridHeaderRenderContext)1 RowNumberColumn (org.uberfire.ext.wires.core.grids.client.widget.grid.columns.RowNumberColumn)1 BaseGridRendererHelper (org.uberfire.ext.wires.core.grids.client.widget.grid.renderers.grids.impl.BaseGridRendererHelper)1