Example usage for com.vaadin.client.ui.dd VTransferable getDragSource

List of usage examples for com.vaadin.client.ui.dd VTransferable getDragSource

Introduction

In this page you can find the example usage for com.vaadin.client.ui.dd VTransferable getDragSource.

Prototype

public ComponentConnector getDragSource() 

Source Link

Document

Returns the component from which the transferable is created (e.g.

Usage

From source file:org.eclipse.hawkbit.ui.dd.client.criteria.CriterionTestHelper.java

License:Open Source License

static VDragEvent createMockedVDragEvent(String dragSourceId, Widget widget) {
    com.google.gwt.user.client.Element element = Mockito.mock(com.google.gwt.user.client.Element.class);
    when(element.getId()).thenReturn(dragSourceId);
    when(widget.getElement()).thenReturn(element);
    ComponentConnector dragSource = Mockito.mock(ComponentConnector.class);
    when(dragSource.getWidget()).thenReturn(widget);
    VTransferable transferable = Mockito.mock(VTransferable.class);
    when(transferable.getDragSource()).thenReturn(dragSource);
    VDragEvent dragEvent = Mockito.mock(VDragEvent.class);
    when(dragEvent.getTransferable()).thenReturn(transferable);

    return dragEvent;
}