Java 类com.google.gwt.event.dom.client.DragStartHandler 实例源码

项目:empiria.player    文件:DragStartEndHandlerWrapperTest.java   
@Test
public void dragStartHandlerTest() {
    DragStartHandler dragStartHandler = mock(DragStartHandler.class);
    ArgumentCaptor<DragStartEventWrapper> captor = ArgumentCaptor.forClass(DragStartEventWrapper.class);
    when(draggableWidget.addDragStartHandler(Matchers.any(DragStartEventHandler.class))).then(new Answer<HandlerRegistration>() {
        @Override
        public HandlerRegistration answer(InvocationOnMock invocation) throws Throwable {
            startHandler = (DragStartEventHandler) invocation.getArguments()[0];
            return null;
        }
    });
    doNothing().when(instance).setData(Matchers.anyString(), Matchers.anyString());
    doReturn(null).when(instance).getData(Matchers.anyString());
    instance.wrap(dragStartHandler);
    startHandler.onDragStart(Mockito.mock(DragStartEvent.class));
    verify(dragStartHandler).onDragStart(captor.capture());
    DragStartEventWrapper event = captor.getValue();
    event.setData("text", "text");
    event.getData("text");
    verify(instance).setData(Matchers.eq("text"), Matchers.eq("text"));
    verify(instance).getData(Matchers.eq("text"));
}
项目:empiria.player    文件:DragGapViewImpl.java   
private void addDragStartHandlerToItem(DraggableObject<FlowPanel> draggableObject) {
    draggableObject.addDragStartHandler(new DragStartHandler() {
        @Override
        public void onDragStart(DragStartEvent event) {
            touchController.setTouchReservation(true);
            event.getDataTransfer().setDragImage(itemWrapper.getElement(), 0, 0);
            dragStartHandlerOptional.get().onDragStart(event);
        }
    });
}
项目:empiria.player    文件:SourceListViewItem.java   
private void addDragStartHandler() {
    draggable.addDragStartHandler(new DragStartHandler() {
        @Override
        public void onDragStart(DragStartEvent event) {
            scormScrollPanel.lockScroll();
            touchController.setTouchReservation(true);
            getElement().addClassName(styleNames.QP_DRAGGED_DRAG());
            event.getDataTransfer().setDragImage(getElement(), 0, 0);
            sourceListView.onDragEvent(DragDropEventTypes.DRAG_START, SourceListViewItem.this, event);
        }
    });
}
项目:empiria.player    文件:DragStartEndHandlerWrapper.java   
public HandlerRegistration wrap(final DragStartHandler dragHandlers) {
    HandlerRegistration addDragStartHandler = draggableWidget.addDragStartHandler(new DragStartEventHandler() {
        @Override
        public void onDragStart(DragStartEvent event) {
            dragHandlers.onDragStart(new DragStartEventWrapper(DragStartEndHandlerWrapper.this));
        }
    });
    return addDragStartHandler;
}
项目:appformer    文件:PartListDropdown.java   
public void disableDragAndDrop() {
    this.dndEnabled = false;
    // Prevent from dragging title element around
    if (noDragHandler == null) {
        noDragHandler = this.addDomHandler(new DragStartHandler() {
                                               @Override
                                               public void onDragStart(DragStartEvent event) {
                                                   event.preventDefault();
                                               }
                                           },
                                           DragStartEvent.getType());
    }
}
项目:empiria.player    文件:DragGapViewImpl.java   
@Override
public void setDragStartHandler(DragStartHandler dragStartHandler) {
    dragStartHandlerOptional = Optional.fromNullable(dragStartHandler);
}
项目:empiria.player    文件:DragStartEndHandlerWrapperTest.java   
@Test
public void wrapDragStartHandlerTest() {
    DragStartHandler startHandler = mock(DragStartHandler.class);
    instance.wrap(startHandler);
    verify(draggableWidget).addDragStartHandler(Matchers.any(DragStartEventHandler.class));
}
项目:appinventor-extensions    文件:HandlerPanel.java   
public HandlerRegistration addDragStartHandler(DragStartHandler handler) {
  return addBitlessDomHandler(handler, DragStartEvent.getType());
}
项目:putnami-web-toolkit    文件:AbstractInput.java   
@Override
public com.google.gwt.event.shared.HandlerRegistration addDragStartHandler(DragStartHandler handler) {
    return this.addBitlessDomHandler(handler, DragStartEvent.getType());
}
项目:putnami-web-toolkit    文件:ListItem.java   
@Override
public HandlerRegistration addDragStartHandler(DragStartHandler handler) {
    return this.addBitlessDomHandler(handler, DragStartEvent.getType());
}
项目:putnami-web-toolkit    文件:Anchor.java   
@Override
public HandlerRegistration addDragStartHandler(DragStartHandler handler) {
    return this.addBitlessDomHandler(handler, DragStartEvent.getType());
}
项目:swarm    文件:BaseButton.java   
public void addDragStartHandler(DragStartHandler handler)
{
    addBitlessDomHandler(handler, DragStartEvent.getType());
}
项目:empiria.player    文件:DragGapView.java   
void setDragStartHandler(DragStartHandler dragGapStartDragHandler);
项目:empiria.player    文件:HasDragHandlers.java   
public HandlerRegistration addDragStartHandler(DragStartHandler handler);