use of org.uberfire.ext.wires.core.grids.client.util.GridHighlightHelper in project drools-wb by kiegroup.
the class GuidedDecisionTableEditorPresenter method highlightHelper.
private GridHighlightHelper highlightHelper() {
final GuidedDecisionTableModellerView view = modeller.getView();
final GridWidget gridWidget = view.getGridWidgets().iterator().next();
return new GridHighlightHelper(view.getGridPanel(), gridWidget);
}
use of org.uberfire.ext.wires.core.grids.client.util.GridHighlightHelper in project drools-wb by kiegroup.
the class GuidedDecisionTableGraphEditorPresenter method highlightHelper.
private GridHighlightHelper highlightHelper() {
final GuidedDecisionTableModellerView view = modeller.getView();
final GridWidget gridWidget = view.getGridWidgets().iterator().next();
return new GridHighlightHelper(view.getGridPanel(), gridWidget);
}
use of org.uberfire.ext.wires.core.grids.client.util.GridHighlightHelper in project drools-wb by kiegroup.
the class GuidedDecisionTableGridHighlightHelperTest method testOnFound.
@Test
public void testOnFound() {
final GridHighlightHelper highlightHelper = mock(GridHighlightHelper.class);
final GridData model = mock(GridData.class);
final GridColumn<?> column1 = mock(GridColumn.class);
final GridColumn<?> column2 = mock(GridColumn.class);
final GridRow gridRow1 = mock(GridRow.class);
final GridRow gridRow2 = mock(GridRow.class);
final GridRow gridRow3 = mock(GridRow.class);
final GridRow gridRow4 = mock(GridRow.class);
final double gridRow1Height = 100;
final double gridRow2Height = 101;
final double gridRow3Height = 102;
final double gridRow4Height = 103;
final double column1Width = 90;
final double column2Width = 110;
final int row = 3;
final int column = 1;
final GuidedDecisionTableView widget = mock(GuidedDecisionTableView.class);
final double paddingX = 310;
final double paddingY = 406;
doReturn(highlightHelper).when(helper).highlightHelper(modeller, widget);
when(gridWidget2.getModel()).thenReturn(model);
when(model.getColumns()).thenReturn(asList(column1, column2));
when(model.getRows()).thenReturn(asList(gridRow1, gridRow2, gridRow3, gridRow4));
when(gridRow1.getHeight()).thenReturn(gridRow1Height);
when(gridRow2.getHeight()).thenReturn(gridRow2Height);
when(gridRow3.getHeight()).thenReturn(gridRow3Height);
when(gridRow4.getHeight()).thenReturn(gridRow4Height);
when(column1.getWidth()).thenReturn(column1Width);
when(column2.getWidth()).thenReturn(column2Width);
when(highlightHelper.withPaddingX(paddingX)).thenReturn(highlightHelper);
when(highlightHelper.withPaddingY(paddingY)).thenReturn(highlightHelper);
doReturn(paddingX).when(helper).getPaddingX(column, modeller, widget);
doReturn(paddingY).when(helper).getPaddingY(row, modeller, widget);
helper.highlight(row, column, widget, modeller);
verify(highlightHelper).highlight(row, column);
}
Aggregations