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

项目: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    文件:SourceListConnectedDragHandler.java   
@Override
public void onDragStart(DragStartEvent event) {
    sourceListManagerAdapter.dragStart();

    DragDataObject dataObject = overlayTypesParser.<NativeDragDataObject>get();
    dataObject.setItemId(itemIdWrapper.getInstance());
    dataObject.setSourceId(moduleIdentifier);
    event.setData("json", dataObject.toJSON());
}
项目: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    文件:SourceListConnectedDragHandlerTest.java   
@Test
public void shouldInformSourcelistManagerAndExtendEventDataOnDragStart() throws Exception {
    DragStartEvent event = Mockito.mock(DragStartEvent.class);

    NativeDragDataObject dragDataObject = Mockito.mock(NativeDragDataObject.class);
    when(overlayTypesParser.get()).thenReturn(dragDataObject);

    String jsonString = "jsonString";
    when(dragDataObject.toJSON()).thenReturn(jsonString);

    dragHandler.onDragStart(event);

    verify(sourcelistManagerAdapter).dragStart();

    InOrder inOrder = Mockito.inOrder(overlayTypesParser, dragDataObject);
    inOrder.verify(overlayTypesParser)
            .get();
    inOrder.verify(dragDataObject)
            .setItemId(itemIdWrapper.getInstance());
    inOrder.verify(dragDataObject)
            .setSourceId(moduleIdentifier);
}
项目: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());
    }
}
项目:Peergos    文件:DesktopTaskEditView.java   
/**
 * Handles "drag-start" events inside the element named "root".
*/
@UiHandler({"root"})
void onDragStart(DragStartEvent event, Element parent, Context context) {
  // Save the ID of the TaskProxy.
  DataTransfer dataTransfer = event.getDataTransfer();
  dataTransfer.setData("text", String.valueOf(context.getIndex()));

  // Set the image.
  dataTransfer.setDragImage(parent, 25, 15);
}
项目:swarm    文件:DesktopTaskEditView.java   
/**
 * Handles "drag-start" events inside the element named "root".
*/
@UiHandler({"root"})
void onDragStart(DragStartEvent event, Element parent, Context context) {
  // Save the ID of the TaskProxy.
  DataTransfer dataTransfer = event.getDataTransfer();
  dataTransfer.setData("text", String.valueOf(context.getIndex()));

  // Set the image.
  dataTransfer.setDragImage(parent, 25, 15);
}
项目: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());
}