Search in sources :

Example 1 with NodeMouseClickEvent

use of com.ait.lienzo.client.core.event.NodeMouseClickEvent in project lienzo-core by ahome-it.

the class LienzoHandlerManager method addHandlers.

private final void addHandlers() {
    m_lienzo.addClickHandler(new ClickHandler() {

        @Override
        public void onClick(final ClickEvent event) {
            if (!m_viewport.getOnEventHandlers().getOnMouseClickEventHandle().onMouseEventBefore(event)) {
                // could have been set previously by a mousedown, it will need cleaning up
                m_dragging_mouse_pressed = false;
                m_dragging_ignore_clicks = false;
                m_dragging = false;
                return;
            }
            onNodeMouseClick(new NodeMouseClickEvent(event));
            m_mouse_button_left = (event.getNativeButton() == NativeEvent.BUTTON_LEFT);
            m_mouse_button_middle = (event.getNativeButton() == NativeEvent.BUTTON_MIDDLE);
            m_mouse_button_right = (event.getNativeButton() == NativeEvent.BUTTON_RIGHT);
            event.preventDefault();
            m_viewport.getOnEventHandlers().getOnMouseClickEventHandle().onMouseEventAfter(event);
        }
    });
    m_lienzo.addDoubleClickHandler(new DoubleClickHandler() {

        @Override
        public void onDoubleClick(final DoubleClickEvent event) {
            if (!m_viewport.getOnEventHandlers().getOnMouseDoubleClickEventHandle().onMouseEventBefore(event)) {
                return;
            }
            onNodeMouseDoubleClick(new NodeMouseDoubleClickEvent(event));
            m_mouse_button_left = (event.getNativeButton() == NativeEvent.BUTTON_LEFT);
            m_mouse_button_middle = (event.getNativeButton() == NativeEvent.BUTTON_MIDDLE);
            m_mouse_button_right = (event.getNativeButton() == NativeEvent.BUTTON_RIGHT);
            event.preventDefault();
            m_viewport.getOnEventHandlers().getOnMouseDoubleClickEventHandle().onMouseEventBefore(event);
        }
    });
    m_lienzo.addMouseMoveHandler(new MouseMoveHandler() {

        @Override
        public void onMouseMove(final MouseMoveEvent event) {
            if (!m_viewport.getOnEventHandlers().getOnMouseMoveEventHandle().onMouseEventBefore(event)) {
                return;
            }
            if ((m_dragging) && (m_dragging_using_touches)) {
                event.preventDefault();
                // Ignore weird Mouse Move (0,0) in the middle of a Touch Drag on iOS/Safari
                return;
            }
            final NodeMouseMoveEvent nevent = new NodeMouseMoveEvent(event);
            if (m_mediators.handleEvent(nevent)) {
                event.preventDefault();
                return;
            }
            m_mouse_button_left = (event.getNativeButton() == NativeEvent.BUTTON_LEFT);
            m_mouse_button_middle = (event.getNativeButton() == NativeEvent.BUTTON_MIDDLE);
            m_mouse_button_right = (event.getNativeButton() == NativeEvent.BUTTON_RIGHT);
            onNodeMouseMove(nevent);
            event.preventDefault();
            m_viewport.getOnEventHandlers().getOnMouseMoveEventHandle().onMouseEventBefore(event);
        }
    });
    m_lienzo.addMouseUpHandler(new MouseUpHandler() {

        @Override
        public void onMouseUp(final MouseUpEvent event) {
            if (!m_viewport.getOnEventHandlers().getOnMouseUpEventHandle().onMouseEventBefore(event)) {
                // could have been set previously by a mousedown, it will need cleaning up
                m_dragging_mouse_pressed = false;
                m_dragging_ignore_clicks = false;
                m_dragging = false;
                return;
            }
            final NodeMouseUpEvent nevent = new NodeMouseUpEvent(event);
            if (m_mediators.handleEvent(nevent)) {
                return;
            }
            m_mouse_button_left = (event.getNativeButton() == NativeEvent.BUTTON_LEFT);
            m_mouse_button_middle = (event.getNativeButton() == NativeEvent.BUTTON_MIDDLE);
            m_mouse_button_right = (event.getNativeButton() == NativeEvent.BUTTON_RIGHT);
            onNodeMouseUp(nevent);
            m_viewport.getOnEventHandlers().getOnMouseUpEventHandle().onMouseEventBefore(event);
        }
    });
    m_lienzo.addMouseDownHandler(new MouseDownHandler() {

        @Override
        public void onMouseDown(final MouseDownEvent event) {
            if (!m_viewport.getOnEventHandlers().getOnMouseDownEventHandle().onMouseEventBefore(event)) {
                return;
            }
            final NodeMouseDownEvent nevent = new NodeMouseDownEvent(event);
            if (m_mediators.handleEvent(nevent)) {
                event.preventDefault();
                return;
            }
            m_mouse_button_left = (event.getNativeButton() == NativeEvent.BUTTON_LEFT);
            m_mouse_button_middle = (event.getNativeButton() == NativeEvent.BUTTON_MIDDLE);
            m_mouse_button_right = (event.getNativeButton() == NativeEvent.BUTTON_RIGHT);
            onNodeMouseDown(nevent);
            event.preventDefault();
            m_viewport.getOnEventHandlers().getOnMouseDownEventHandle().onMouseEventBefore(event);
        }
    });
    m_lienzo.addMouseOutHandler(new MouseOutHandler() {

        @Override
        public void onMouseOut(final MouseOutEvent event) {
            final NodeMouseOutEvent nevent = new NodeMouseOutEvent(event);
            if (m_mediators.handleEvent(nevent)) {
                return;
            }
            onNodeMouseOut(nevent);
        }
    });
    m_lienzo.addMouseOverHandler(new MouseOverHandler() {

        @Override
        public void onMouseOver(final MouseOverEvent event) {
            final NodeMouseOverEvent nevent = new NodeMouseOverEvent(event);
            if (m_mediators.handleEvent(nevent)) {
                return;
            }
            onNodeMouseOver(nevent);
        }
    });
    m_lienzo.addMouseWheelHandler(new MouseWheelHandler() {

        @Override
        public void onMouseWheel(final MouseWheelEvent event) {
            final NodeMouseWheelEvent nevent = new NodeMouseWheelEvent(event);
            if (m_mediators.handleEvent(nevent)) {
                event.preventDefault();
                event.stopPropagation();
            } else {
                fireEvent(nevent);
            }
        }
    });
    m_lienzo.addTouchCancelHandler(new TouchCancelHandler() {

        @Override
        public void onTouchCancel(final TouchCancelEvent event) {
            final NodeTouchCancelEvent nevent = new NodeTouchCancelEvent(event, getTouches(event));
            if (m_mediators.handleEvent(event)) {
                event.preventDefault();
                return;
            }
            onNodeMouseOut(nevent);
            event.preventDefault();
        }
    });
    m_lienzo.addTouchEndHandler(new TouchEndHandler() {

        @Override
        public void onTouchEnd(final TouchEndEvent event) {
            final NodeTouchEndEvent nevent = new NodeTouchEndEvent(event, m_touches);
            if (m_mediators.handleEvent(nevent)) {
                event.preventDefault();
                return;
            }
            onNodeMouseUp(nevent);
            event.preventDefault();
        }
    });
    m_lienzo.addTouchMoveHandler(new TouchMoveHandler() {

        @Override
        public void onTouchMove(final TouchMoveEvent event) {
            m_touches = getTouches(event);
            final NodeTouchMoveEvent nevent = new NodeTouchMoveEvent(event, m_touches);
            if (m_mediators.handleEvent(nevent)) {
                event.preventDefault();
                return;
            }
            onNodeMouseMove(nevent);
            event.preventDefault();
        }
    });
    m_lienzo.addTouchStartHandler(new TouchStartHandler() {

        @Override
        public void onTouchStart(final TouchStartEvent event) {
            m_touches = getTouches(event);
            final NodeTouchStartEvent nevent = new NodeTouchStartEvent(event, m_touches);
            if (m_mediators.handleEvent(nevent)) {
                event.preventDefault();
                return;
            }
            onNodeMouseDown(nevent);
            event.preventDefault();
        }
    });
    m_lienzo.addGestureStartHandler(new GestureStartHandler() {

        @Override
        public void onGestureStart(final GestureStartEvent event) {
            final NodeGestureStartEvent nevent = new NodeGestureStartEvent(event.getScale(), event.getRotation());
            if (m_mediators.handleEvent(nevent)) {
                event.preventDefault();
                return;
            }
            fireEvent(nevent);
            event.preventDefault();
        }
    });
    m_lienzo.addGestureEndHandler(new GestureEndHandler() {

        @Override
        public void onGestureEnd(final GestureEndEvent event) {
            final NodeGestureEndEvent nevent = new NodeGestureEndEvent(event.getScale(), event.getRotation());
            if (m_mediators.handleEvent(nevent)) {
                event.preventDefault();
                return;
            }
            fireEvent(nevent);
            event.preventDefault();
        }
    });
    m_lienzo.addGestureChangeHandler(new GestureChangeHandler() {

        @Override
        public void onGestureChange(final GestureChangeEvent event) {
            final NodeGestureChangeEvent nevent = new NodeGestureChangeEvent(event.getScale(), event.getRotation());
            if (m_mediators.handleEvent(nevent)) {
                event.preventDefault();
                return;
            }
            fireEvent(nevent);
            event.preventDefault();
        }
    });
}
Also used : MouseUpHandler(com.google.gwt.event.dom.client.MouseUpHandler) NodeMouseClickEvent(com.ait.lienzo.client.core.event.NodeMouseClickEvent) NodeMouseDoubleClickEvent(com.ait.lienzo.client.core.event.NodeMouseDoubleClickEvent) ClickEvent(com.google.gwt.event.dom.client.ClickEvent) DoubleClickEvent(com.google.gwt.event.dom.client.DoubleClickEvent) NodeGestureStartEvent(com.ait.lienzo.client.core.event.NodeGestureStartEvent) NodeMouseClickEvent(com.ait.lienzo.client.core.event.NodeMouseClickEvent) MouseOutEvent(com.google.gwt.event.dom.client.MouseOutEvent) NodeMouseOutEvent(com.ait.lienzo.client.core.event.NodeMouseOutEvent) MouseOutHandler(com.google.gwt.event.dom.client.MouseOutHandler) TouchStartHandler(com.google.gwt.event.dom.client.TouchStartHandler) TouchStartEvent(com.google.gwt.event.dom.client.TouchStartEvent) NodeTouchStartEvent(com.ait.lienzo.client.core.event.NodeTouchStartEvent) MouseOverEvent(com.google.gwt.event.dom.client.MouseOverEvent) NodeMouseOverEvent(com.ait.lienzo.client.core.event.NodeMouseOverEvent) GestureStartHandler(com.google.gwt.event.dom.client.GestureStartHandler) MouseOverHandler(com.google.gwt.event.dom.client.MouseOverHandler) GestureChangeHandler(com.google.gwt.event.dom.client.GestureChangeHandler) NodeGestureChangeEvent(com.ait.lienzo.client.core.event.NodeGestureChangeEvent) NodeMouseOverEvent(com.ait.lienzo.client.core.event.NodeMouseOverEvent) NodeMouseWheelEvent(com.ait.lienzo.client.core.event.NodeMouseWheelEvent) MouseWheelHandler(com.google.gwt.event.dom.client.MouseWheelHandler) TouchMoveHandler(com.google.gwt.event.dom.client.TouchMoveHandler) NodeMouseMoveEvent(com.ait.lienzo.client.core.event.NodeMouseMoveEvent) TouchCancelEvent(com.google.gwt.event.dom.client.TouchCancelEvent) NodeTouchCancelEvent(com.ait.lienzo.client.core.event.NodeTouchCancelEvent) NodeMouseMoveEvent(com.ait.lienzo.client.core.event.NodeMouseMoveEvent) MouseMoveEvent(com.google.gwt.event.dom.client.MouseMoveEvent) GestureEndHandler(com.google.gwt.event.dom.client.GestureEndHandler) NodeMouseUpEvent(com.ait.lienzo.client.core.event.NodeMouseUpEvent) NodeTouchEndEvent(com.ait.lienzo.client.core.event.NodeTouchEndEvent) NodeMouseDownEvent(com.ait.lienzo.client.core.event.NodeMouseDownEvent) MouseDownEvent(com.google.gwt.event.dom.client.MouseDownEvent) NodeMouseDoubleClickEvent(com.ait.lienzo.client.core.event.NodeMouseDoubleClickEvent) DoubleClickEvent(com.google.gwt.event.dom.client.DoubleClickEvent) NodeMouseDownEvent(com.ait.lienzo.client.core.event.NodeMouseDownEvent) NodeMouseUpEvent(com.ait.lienzo.client.core.event.NodeMouseUpEvent) MouseUpEvent(com.google.gwt.event.dom.client.MouseUpEvent) TouchMoveEvent(com.google.gwt.event.dom.client.TouchMoveEvent) NodeTouchMoveEvent(com.ait.lienzo.client.core.event.NodeTouchMoveEvent) NodeTouchMoveEvent(com.ait.lienzo.client.core.event.NodeTouchMoveEvent) NodeMouseDoubleClickEvent(com.ait.lienzo.client.core.event.NodeMouseDoubleClickEvent) MouseMoveHandler(com.google.gwt.event.dom.client.MouseMoveHandler) NodeTouchStartEvent(com.ait.lienzo.client.core.event.NodeTouchStartEvent) NodeGestureEndEvent(com.ait.lienzo.client.core.event.NodeGestureEndEvent) NodeTouchCancelEvent(com.ait.lienzo.client.core.event.NodeTouchCancelEvent) GestureStartEvent(com.google.gwt.event.dom.client.GestureStartEvent) NodeGestureStartEvent(com.ait.lienzo.client.core.event.NodeGestureStartEvent) DoubleClickHandler(com.google.gwt.event.dom.client.DoubleClickHandler) ClickHandler(com.google.gwt.event.dom.client.ClickHandler) MouseWheelEvent(com.google.gwt.event.dom.client.MouseWheelEvent) NodeMouseWheelEvent(com.ait.lienzo.client.core.event.NodeMouseWheelEvent) DoubleClickHandler(com.google.gwt.event.dom.client.DoubleClickHandler) NodeGestureChangeEvent(com.ait.lienzo.client.core.event.NodeGestureChangeEvent) GestureChangeEvent(com.google.gwt.event.dom.client.GestureChangeEvent) NodeMouseOutEvent(com.ait.lienzo.client.core.event.NodeMouseOutEvent) TouchEndEvent(com.google.gwt.event.dom.client.TouchEndEvent) NodeTouchEndEvent(com.ait.lienzo.client.core.event.NodeTouchEndEvent) MouseDownHandler(com.google.gwt.event.dom.client.MouseDownHandler) TouchCancelHandler(com.google.gwt.event.dom.client.TouchCancelHandler) TouchEndHandler(com.google.gwt.event.dom.client.TouchEndHandler) NodeGestureEndEvent(com.ait.lienzo.client.core.event.NodeGestureEndEvent) GestureEndEvent(com.google.gwt.event.dom.client.GestureEndEvent)

Example 2 with NodeMouseClickEvent

use of com.ait.lienzo.client.core.event.NodeMouseClickEvent in project kie-wb-common by kiegroup.

the class ViewEventHandlerManagerTest method testClickHandler.

@Test
@SuppressWarnings("unchecked")
public void testClickHandler() {
    final ViewHandler<ViewEvent> clickHandler = mock(ViewHandler.class);
    final HandlerRegistration handlerRegistration = mock(HandlerRegistration.class);
    when(node.addNodeMouseClickHandler(any(NodeMouseClickHandler.class))).thenReturn(handlerRegistration);
    tested.addHandler(ViewEventType.MOUSE_CLICK, clickHandler);
    final ArgumentCaptor<NodeMouseClickHandler> clickHandlerArgumentCaptor = ArgumentCaptor.forClass(NodeMouseClickHandler.class);
    verify(node, times(1)).addNodeMouseClickHandler(clickHandlerArgumentCaptor.capture());
    final NodeMouseClickHandler nodeCLickHandler = clickHandlerArgumentCaptor.getValue();
    final NodeMouseClickEvent clickEvent = mock(NodeMouseClickEvent.class);
    final MouseEvent mouseEvent = mock(MouseEvent.class);
    final int x = 102;
    final int y = 410;
    when(clickEvent.getX()).thenReturn(x);
    when(clickEvent.getY()).thenReturn(y);
    when(clickEvent.isButtonLeft()).thenReturn(true);
    when(clickEvent.isButtonRight()).thenReturn(true);
    when(clickEvent.isButtonMiddle()).thenReturn(true);
    when(clickEvent.isShiftKeyDown()).thenReturn(true);
    when(clickEvent.isAltKeyDown()).thenReturn(true);
    when(clickEvent.isMetaKeyDown()).thenReturn(true);
    when(clickEvent.getMouseEvent()).thenReturn(mouseEvent);
    when(mouseEvent.getClientX()).thenReturn(x);
    when(mouseEvent.getClientY()).thenReturn(y);
    nodeCLickHandler.onNodeMouseClick(clickEvent);
    final ArgumentCaptor<ViewEvent> eventArgumentCaptor = ArgumentCaptor.forClass(ViewEvent.class);
    verify(clickHandler, times(1)).handle(eventArgumentCaptor.capture());
    final MouseClickEvent viewEvent = (MouseClickEvent) eventArgumentCaptor.getValue();
    assertEquals(x, viewEvent.getX(), 0d);
    assertEquals(y, viewEvent.getY(), 0d);
    assertEquals(x, viewEvent.getClientX(), 0d);
    assertEquals(y, viewEvent.getClientY(), 0d);
    assertTrue(viewEvent.isButtonLeft());
    assertTrue(viewEvent.isButtonRight());
    assertTrue(viewEvent.isButtonMiddle());
    assertTrue(viewEvent.isAltKeyDown());
    assertTrue(viewEvent.isMetaKeyDown());
    assertTrue(viewEvent.isShiftKeyDown());
    assertNotNull(tested.getRegistrationMap().get(ViewEventType.MOUSE_CLICK));
}
Also used : HandlerRegistration(com.google.gwt.event.shared.HandlerRegistration) NodeMouseClickHandler(com.ait.lienzo.client.core.event.NodeMouseClickHandler) MouseEvent(com.google.gwt.event.dom.client.MouseEvent) ViewEvent(org.kie.workbench.common.stunner.core.client.shape.view.event.ViewEvent) NodeMouseClickEvent(com.ait.lienzo.client.core.event.NodeMouseClickEvent) NodeMouseClickEvent(com.ait.lienzo.client.core.event.NodeMouseClickEvent) MouseClickEvent(org.kie.workbench.common.stunner.core.client.shape.view.event.MouseClickEvent) Test(org.junit.Test)

Example 3 with NodeMouseClickEvent

use of com.ait.lienzo.client.core.event.NodeMouseClickEvent in project drools-wb by kiegroup.

the class ScenarioSimulationGridWidgetMouseEventHandlerTest method setup.

@Before
@SuppressWarnings("unchecked")
public void setup() {
    super.setUp();
    this.clickEvent = new NodeMouseClickEvent(nativeClickEvent);
    this.doubleClickEvent = new NodeMouseDoubleClickEvent(nativeDoubleClickEvent);
    when(scenarioGridMock.getRendererHelper()).thenReturn(rendererHelper);
    when(scenarioGridMock.getViewport()).thenReturn(viewportMock);
    when(scenarioGridMock.getComputedLocation()).thenReturn(computedLocation);
    when(rendererHelper.getRenderingInformation()).thenReturn(renderingInformation);
    when(rendererHelper.getColumnInformation(anyDouble())).thenReturn(columnInformation);
    when(columnInformation.getColumn()).thenReturn((GridColumn) gridColumnMock);
    when(renderingInformation.getBodyBlockInformation()).thenReturn(renderingBlockInformation);
    when(renderingInformation.getFloatingBlockInformation()).thenReturn(renderingBlockInformation);
    when(renderingInformation.getAllColumns()).thenReturn(columnsMock);
    when(informationHeaderMetaDataMock.getSupportedEditAction()).thenReturn(GridCellEditAction.SINGLE_CLICK);
    this.handler = spy(new ScenarioSimulationGridWidgetMouseEventHandler());
}
Also used : NodeMouseDoubleClickEvent(com.ait.lienzo.client.core.event.NodeMouseDoubleClickEvent) NodeMouseClickEvent(com.ait.lienzo.client.core.event.NodeMouseClickEvent) Before(org.junit.Before)

Example 4 with NodeMouseClickEvent

use of com.ait.lienzo.client.core.event.NodeMouseClickEvent in project kie-wb-common by kiegroup.

the class AbstractActionsToolboxViewTest method testAddButton.

@SuppressWarnings("unchecked")
protected void testAddButton(final Consumer<MouseClickEvent> clickEventConsumer) {
    // Verify tootlip.
    verify(toolboxTooltip, times(1)).createItem(eq("title1"));
    verify(buttonItem, times(1)).tooltip(any(TooltipItem.class));
    // Verify mouse enter.
    final ArgumentCaptor<NodeMouseEnterHandler> enterHandlerArgumentCaptor = ArgumentCaptor.forClass(NodeMouseEnterHandler.class);
    verify(buttonItem, times(1)).onMouseEnter(enterHandlerArgumentCaptor.capture());
    final NodeMouseEnterHandler enterHandler = enterHandlerArgumentCaptor.getValue();
    final NodeMouseEnterEvent mouseEnterEvent = mock(NodeMouseEnterEvent.class);
    enterHandler.onNodeMouseEnter(mouseEnterEvent);
    verify(canvasView, times(1)).setCursor(eq(AbstractCanvas.Cursors.POINTER));
    // Verify mouse exit.
    final ArgumentCaptor<NodeMouseExitHandler> exitHandlerArgumentCaptor = ArgumentCaptor.forClass(NodeMouseExitHandler.class);
    verify(buttonItem, times(1)).onMouseExit(exitHandlerArgumentCaptor.capture());
    final NodeMouseExitHandler exitHandler = exitHandlerArgumentCaptor.getValue();
    final NodeMouseExitEvent mouseExitEvent = mock(NodeMouseExitEvent.class);
    exitHandler.onNodeMouseExit(mouseExitEvent);
    verify(canvasView, times(1)).setCursor(eq(AbstractCanvas.Cursors.AUTO));
    // Verify mouse click.
    final ArgumentCaptor<NodeMouseClickHandler> clickHandlerArgumentCaptor = ArgumentCaptor.forClass(NodeMouseClickHandler.class);
    verify(buttonItem, times(1)).onClick(clickHandlerArgumentCaptor.capture());
    final NodeMouseClickHandler clickHandler = clickHandlerArgumentCaptor.getValue();
    final NodeMouseClickEvent mouseClickEvent = mock(NodeMouseClickEvent.class);
    when(mouseClickEvent.getMouseEvent()).thenReturn(mock(MouseEvent.class));
    clickHandler.onNodeMouseClick(mouseClickEvent);
    verify(clickEventConsumer, times(1)).accept(any(MouseClickEvent.class));
}
Also used : NodeMouseClickHandler(com.ait.lienzo.client.core.event.NodeMouseClickHandler) MouseEvent(com.google.gwt.event.dom.client.MouseEvent) NodeMouseEnterEvent(com.ait.lienzo.client.core.event.NodeMouseEnterEvent) NodeMouseExitHandler(com.ait.lienzo.client.core.event.NodeMouseExitHandler) NodeMouseEnterHandler(com.ait.lienzo.client.core.event.NodeMouseEnterHandler) TooltipItem(org.kie.workbench.common.stunner.lienzo.toolbox.items.TooltipItem) NodeMouseExitEvent(com.ait.lienzo.client.core.event.NodeMouseExitEvent) NodeMouseClickEvent(com.ait.lienzo.client.core.event.NodeMouseClickEvent) NodeMouseClickEvent(com.ait.lienzo.client.core.event.NodeMouseClickEvent) MouseClickEvent(org.kie.workbench.common.stunner.core.client.shape.view.event.MouseClickEvent)

Example 5 with NodeMouseClickEvent

use of com.ait.lienzo.client.core.event.NodeMouseClickEvent in project kie-wb-common by kiegroup.

the class EditableHeaderGridWidgetEditCellMouseEventHandlerTest method setup.

@Before
@SuppressWarnings("unchecked")
public void setup() {
    this.uiModel = new BaseGridData(false);
    this.uiModel.appendColumn(gridColumn);
    this.clickEvent = new NodeMouseClickEvent(nativeClickEvent);
    this.doubleClickEvent = new NodeMouseDoubleClickEvent(nativeDoubleClickEvent);
    when(gridWidget.getModel()).thenReturn(uiModel);
    when(gridWidget.getRendererHelper()).thenReturn(rendererHelper);
    when(gridWidget.getRenderer()).thenReturn(renderer);
    when(gridWidget.getHeader()).thenReturn(gridWidgetHeader);
    when(gridWidget.getViewport()).thenReturn(viewport);
    when(gridWidget.getComputedLocation()).thenReturn(computedLocation);
    when(gridWidget.getWidth()).thenReturn((double) MOUSE_EVENT_X);
    when(rendererHelper.getRenderingInformation()).thenReturn(renderingInformation);
    when(rendererHelper.getColumnInformation(anyDouble())).thenReturn(columnInformation);
    when(columnInformation.getColumn()).thenReturn(gridColumn);
    when(renderer.getHeaderHeight()).thenReturn((double) MOUSE_EVENT_Y);
    when(renderer.getHeaderRowHeight()).thenReturn((double) MOUSE_EVENT_Y);
    when(renderingInformation.getAllColumns()).thenReturn(uiModel.getColumns());
    when(renderingInformation.getBodyBlockInformation()).thenReturn(renderingBlockInformation);
    when(renderingInformation.getFloatingBlockInformation()).thenReturn(renderingBlockInformation);
    when(editableHeaderMetaData.getSupportedEditAction()).thenReturn(GridCellEditAction.SINGLE_CLICK);
    this.handler = new EditableHeaderGridWidgetEditCellMouseEventHandler();
}
Also used : BaseGridData(org.uberfire.ext.wires.core.grids.client.model.impl.BaseGridData) NodeMouseDoubleClickEvent(com.ait.lienzo.client.core.event.NodeMouseDoubleClickEvent) NodeMouseClickEvent(com.ait.lienzo.client.core.event.NodeMouseClickEvent) Before(org.junit.Before)

Aggregations

NodeMouseClickEvent (com.ait.lienzo.client.core.event.NodeMouseClickEvent)5 NodeMouseDoubleClickEvent (com.ait.lienzo.client.core.event.NodeMouseDoubleClickEvent)3 NodeMouseClickHandler (com.ait.lienzo.client.core.event.NodeMouseClickHandler)2 MouseEvent (com.google.gwt.event.dom.client.MouseEvent)2 NodeGestureChangeEvent (com.ait.lienzo.client.core.event.NodeGestureChangeEvent)1 NodeGestureEndEvent (com.ait.lienzo.client.core.event.NodeGestureEndEvent)1 NodeGestureStartEvent (com.ait.lienzo.client.core.event.NodeGestureStartEvent)1 NodeMouseDownEvent (com.ait.lienzo.client.core.event.NodeMouseDownEvent)1 NodeMouseEnterEvent (com.ait.lienzo.client.core.event.NodeMouseEnterEvent)1 NodeMouseEnterHandler (com.ait.lienzo.client.core.event.NodeMouseEnterHandler)1 NodeMouseExitEvent (com.ait.lienzo.client.core.event.NodeMouseExitEvent)1 NodeMouseExitHandler (com.ait.lienzo.client.core.event.NodeMouseExitHandler)1 NodeMouseMoveEvent (com.ait.lienzo.client.core.event.NodeMouseMoveEvent)1 NodeMouseOutEvent (com.ait.lienzo.client.core.event.NodeMouseOutEvent)1 NodeMouseOverEvent (com.ait.lienzo.client.core.event.NodeMouseOverEvent)1 NodeMouseUpEvent (com.ait.lienzo.client.core.event.NodeMouseUpEvent)1 NodeMouseWheelEvent (com.ait.lienzo.client.core.event.NodeMouseWheelEvent)1 NodeTouchCancelEvent (com.ait.lienzo.client.core.event.NodeTouchCancelEvent)1 NodeTouchEndEvent (com.ait.lienzo.client.core.event.NodeTouchEndEvent)1 NodeTouchMoveEvent (com.ait.lienzo.client.core.event.NodeTouchMoveEvent)1