Search in sources :

Example 6 with BaseGridData

use of org.uberfire.ext.wires.core.grids.client.model.impl.BaseGridData in project drools-wb by kiegroup.

the class GuidedDecisionTablePresenterTest method linkTables.

@SuppressWarnings("unchecked")
private void linkTables() {
    final GridData uiModel1 = spy(new BaseGridData());
    final GridData uiModel2 = spy(new BaseGridData());
    final GridData uiModel3 = spy(new BaseGridData());
    final GuidedDecisionTableView dtView2 = mock(GuidedDecisionTableView.class);
    final GuidedDecisionTableView dtView3 = mock(GuidedDecisionTableView.class);
    final GuidedDecisionTableView.Presenter dtPresenter2 = setupPresenter();
    final GuidedDecisionTableView.Presenter dtPresenter3 = setupPresenter();
    final Set<GuidedDecisionTableView.Presenter> dtPresenters = new HashSet<GuidedDecisionTableView.Presenter>() {

        {
            add(dtPresenter);
            add(dtPresenter2);
            add(dtPresenter3);
        }
    };
    when(dtPresenter.getModel()).thenReturn(model1);
    when(dtPresenter2.getModel()).thenReturn(model2);
    when(dtPresenter3.getModel()).thenReturn(model3);
    when(dtPresenter2.getView()).thenReturn(dtView2);
    when(dtPresenter3.getView()).thenReturn(dtView3);
    when(view.getModel()).thenReturn(uiModel1);
    when(dtView2.getModel()).thenReturn(uiModel2);
    when(dtView3.getModel()).thenReturn(uiModel3);
    when(uiModel1.getColumns()).thenReturn(uiModel1Columns);
    when(uiModel2.getColumns()).thenReturn(uiModel2Columns);
    when(uiModel3.getColumns()).thenReturn(uiModel3Columns);
    when(uiModel1Columns.get(anyInt())).thenReturn(uiModel1MockColumn);
    when(uiModel2Columns.get(anyInt())).thenReturn(uiModel2MockColumn);
    when(uiModel3Columns.get(anyInt())).thenReturn(uiModel3MockColumn);
    dtPresenter.link(dtPresenters);
    dtPresenter2.link(dtPresenters);
    dtPresenter3.link(dtPresenters);
}
Also used : GridData(org.uberfire.ext.wires.core.grids.client.model.GridData) BaseGridData(org.uberfire.ext.wires.core.grids.client.model.impl.BaseGridData) BaseGridData(org.uberfire.ext.wires.core.grids.client.model.impl.BaseGridData) HashSet(java.util.HashSet)

Aggregations

BaseGridData (org.uberfire.ext.wires.core.grids.client.model.impl.BaseGridData)6 GuidedDecisionTable52 (org.drools.workbench.models.guided.dtable.shared.model.GuidedDecisionTable52)3 Before (org.junit.Before)3 GridData (org.uberfire.ext.wires.core.grids.client.model.GridData)3 BaseGridRendererHelper (org.uberfire.ext.wires.core.grids.client.widget.grid.renderers.grids.impl.BaseGridRendererHelper)2 NodeMouseMoveHandler (com.ait.lienzo.client.core.event.NodeMouseMoveHandler)1 NodeMouseOutHandler (com.ait.lienzo.client.core.event.NodeMouseOutHandler)1 Point2D (com.ait.lienzo.client.core.types.Point2D)1 Style (com.google.gwt.dom.client.Style)1 ContextMenuHandler (com.google.gwt.event.dom.client.ContextMenuHandler)1 KeyDownHandler (com.google.gwt.event.dom.client.KeyDownHandler)1 MouseDownHandler (com.google.gwt.event.dom.client.MouseDownHandler)1 HandlerRegistration (com.google.gwt.event.shared.HandlerRegistration)1 Widget (com.google.gwt.user.client.ui.Widget)1 ArrayList (java.util.ArrayList)1 HashSet (java.util.HashSet)1 ColumnDefinitionBuilder (org.drools.workbench.screens.guided.dtable.client.widget.table.popovers.definitions.ColumnDefinitionBuilder)1 ColumnDefinitionFactory (org.drools.workbench.screens.guided.dtable.client.widget.table.popovers.definitions.ColumnDefinitionFactory)1 Path (org.uberfire.backend.vfs.Path)1 BaseGridRow (org.uberfire.ext.wires.core.grids.client.model.impl.BaseGridRow)1