@Test public void testDelegationToHasRowDragRestrictionsWhenNotPermitted() { final ContextGrid view = mock(ContextGrid.class); doReturn(rendererHelper).when(view).getRendererHelper(); doReturn(false).when(view).isRowDragPermitted(eq(state)); doReturn(Style.Cursor.DEFAULT).when(state).getCursor(); doReturn(viewport).when(gridLayer).getViewport(); doReturn(element).when(viewport).getElement(); doReturn(style).when(element).getStyle(); handler.findMovableRows(view, rendererHelper.getRenderingInformation(), 0, 0); verify(state).reset(); verify(style).setCursor(eq(Style.Cursor.DEFAULT)); }
@Override protected void findMovableRows(final GridWidget view, final BaseGridRendererHelper.RenderingInformation renderingInformation, final double cx, final double cy) { super.findMovableRows(view, renderingInformation, cx, cy); if (view instanceof HasRowDragRestrictions) { final HasRowDragRestrictions hasRowDragRestrictions = (HasRowDragRestrictions) view; if (!hasRowDragRestrictions.isRowDragPermitted(state)) { state.reset(); layer.getViewport().getElement().getStyle().setCursor(state.getCursor()); } } }
DelegatingGridWidgetDndMouseMoveHandler extends GridWidgetDnDMouseMoveHandler { @Override protected void findMovableRows(final GridWidget view, final BaseGridRendererHelper.RenderingInformation renderingInformation, final double cx, final double cy) { super.findMovableRows(view, renderingInformation, cx, cy); if (view instanceof HasRowDragRestrictions) { final HasRowDragRestrictions hasRowDragRestrictions = (HasRowDragRestrictions) view; if (!hasRowDragRestrictions.isRowDragPermitted(state)) { state.reset(); layer.getViewport().getElement().getStyle().setCursor(state.getCursor()); } } } }
DelegatingGridWidgetDndMouseMoveHandler extends GridWidgetDnDMouseMoveHandler { @Override protected void findMovableRows(final GridWidget view, final BaseGridRendererHelper.RenderingInformation renderingInformation, final double cx, final double cy) { super.findMovableRows(view, renderingInformation, cx, cy); if (view instanceof HasRowDragRestrictions) { final HasRowDragRestrictions hasRowDragRestrictions = (HasRowDragRestrictions) view; if (!hasRowDragRestrictions.isRowDragPermitted(state)) { state.reset(); layer.getViewport().getElement().getStyle().setCursor(state.getCursor()); } } } DelegatingGridWidgetDndMouseMoveHandler(final GridLayer layer,
                                                   final GridWidgetDnDHandlersState state); }
DelegatingGridWidgetDndMouseMoveHandler extends GridWidgetDnDMouseMoveHandler { @Override protected void findMovableRows(final GridWidget view, final BaseGridRendererHelper.RenderingInformation renderingInformation, final double cx, final double cy) { super.findMovableRows(view, renderingInformation, cx, cy); if (view instanceof HasRowDragRestrictions) { final HasRowDragRestrictions hasRowDragRestrictions = (HasRowDragRestrictions) view; if (!hasRowDragRestrictions.isRowDragPermitted(state)) { state.reset(); layer.getViewport().getElement().getStyle().setCursor(state.getCursor()); } } } DelegatingGridWidgetDndMouseMoveHandler(final GridLayer layer,
                                                   final GridWidgetDnDHandlersState state);  }
DelegatingGridWidgetDndMouseMoveHandler extends GridWidgetDnDMouseMoveHandler { @Override protected void findMovableRows(final GridWidget view, final BaseGridRendererHelper.RenderingInformation renderingInformation, final double cx, final double cy) { super.findMovableRows(view, renderingInformation, cx, cy); if (view instanceof HasRowDragRestrictions) { final HasRowDragRestrictions hasRowDragRestrictions = (HasRowDragRestrictions) view; if (!hasRowDragRestrictions.isRowDragPermitted(state)) { state.reset(); layer.getViewport().getElement().getStyle().setCursor(state.getCursor()); } } } DelegatingGridWidgetDndMouseMoveHandler(final GridLayer layer,
                                                   final GridWidgetDnDHandlersState state);   }