Class VDragEvent


  • @Deprecated
    public class VDragEvent
    extends Object
    Deprecated.
    Since 8.1, no direct replacement, see DropTargetExtensionConnector
    DragEvent used by Vaadin client side engine. Supports components, items, properties and custom payload (HTML5 style).
    • Method Detail

      • getTransferable

        public VTransferable getTransferable()
        Deprecated.
        Returns the VTransferable instance that represents the original dragged element.
        Returns:
        the transferable instance
      • getCurrentGwtEvent

        public com.google.gwt.dom.client.NativeEvent getCurrentGwtEvent()
        Deprecated.
        Returns the latest NativeEvent that relates to this drag and drop operation. For example on VDropHandler.dragEnter(VDragEvent) this is commonly a MouseOverEvent.
        Returns:
        the latest event
      • setCurrentGwtEvent

        public void setCurrentGwtEvent​(com.google.gwt.dom.client.NativeEvent event)
        Deprecated.
        Sets the latest NativeEvent that relates to this drag and drop operation. For example on VDropHandler.dragEnter(VDragEvent) this is commonly a MouseOverEvent.
        Parameters:
        event - the latest event
      • getElementOver

        public com.google.gwt.user.client.Element getElementOver()
        Deprecated.
        Detecting the element on which the the event is happening may be problematic during drag and drop operation. This is especially the case if a drag image (often called also drag proxy) is kept under the mouse cursor (see createDragImage(Element, boolean). Drag and drop event handlers (like the one provided by VDragAndDropManager ) should set elmentOver field to reflect the the actual element on which the pointer currently is (drag image excluded). VDropHandlers can then more easily react properly on drag events by reading the element via this method.
        Returns:
        the element in VDropHandler on which mouse cursor is on
      • setElementOver

        @Deprecated
        public void setElementOver​(com.google.gwt.user.client.Element targetElement)
        Deprecated.
        As of 7.2, call or override setElementOver(Element) instead
        Parameters:
        targetElement - target element over which DnD event has happened
        See Also:
        getElementOver()
      • setElementOver

        public void setElementOver​(com.google.gwt.dom.client.Element targetElement)
        Deprecated.
        Parameters:
        targetElement - target element over which DnD event has happened
        Since:
        7.2
        See Also:
        getElementOver()
      • setDragImage

        @Deprecated
        public void setDragImage​(com.google.gwt.user.client.Element node)
        Deprecated.
        As of 7.2, call or override setDragImage(Element) instead
        Sets the drag image used for current drag and drop operation. Drag image is displayed next to mouse cursor during drag and drop.

        The element to be used as drag image will automatically get CSS style name "v-drag-element". TODO decide if this method should be here or in VTransferable (in HTML5 it is in DataTransfer) or VDragAndDropManager TODO should be possible to override behavior. Like to proxy the element to HTML5 DataTransfer

        Parameters:
        node - a cloned node or other representation of the original element that is dragged
      • setDragImage

        public void setDragImage​(com.google.gwt.dom.client.Element node)
        Deprecated.
        Sets the drag image used for current drag and drop operation. Drag image is displayed next to mouse cursor during drag and drop.

        The element to be used as drag image will automatically get CSS style name "v-drag-element". TODO decide if this method should be here or in VTransferable (in HTML5 it is in DataTransfer) or VDragAndDropManager TODO should be possible to override behavior. Like to proxy the element to HTML5 DataTransfer

        Parameters:
        node - a cloned node or other representation of the original element that is dragged
        Since:
        7.2
      • getDropDetails

        public Map<String,​Object> getDropDetails()
        Deprecated.
        Returns the details of the drag and drop operation. TODO consider using similar smaller (than map) API as in Transferable TODO clean up when drop handler changes
        Returns:
        the drop details
      • setDragImage

        @Deprecated
        public void setDragImage​(com.google.gwt.user.client.Element element,
                                 int offsetX,
                                 int offsetY)
        Deprecated.
        As of 7.2, call or override setDragImage(Element,int,int) instead
        Sets the drag image used for current drag and drop operation. Drag image is displayed next to mouse cursor during drag and drop.

        The element to be used as drag image will automatically get CSS style name "v-drag-element".

        Parameters:
        element - the dom element to be positioned next to mouse cursor
        offsetX - the horizontal offset of drag image from mouse cursor
        offsetY - the vertical offset of drag image from mouse cursor
      • setDragImage

        public void setDragImage​(com.google.gwt.dom.client.Element element,
                                 int offsetX,
                                 int offsetY)
        Deprecated.
        Sets the drag image used for current drag and drop operation. Drag image is displayed next to mouse cursor during drag and drop.

        The element to be used as drag image will automatically get CSS style name "v-drag-element".

        Parameters:
        element - the dom element to be positioned next to mouse cursor
        offsetX - the horizontal offset of drag image from mouse cursor
        offsetY - the vertical offset of drag image from mouse cursor
        Since:
        7.2
      • getDragImage

        public com.google.gwt.user.client.Element getDragImage()
        Deprecated.
        Returns:
        the current Element used as a drag image (aka drag proxy) or null if drag image is not currently set for this drag operation.
      • createDragImage

        @Deprecated
        public void createDragImage​(com.google.gwt.user.client.Element element,
                                    boolean alignImageToEvent)
        Deprecated.
        As of 7.2, call or override createDragImage(Element,boolean) instead
        Automatically tries to create a proxy image from given element.
        Parameters:
        element - the original element that is dragged
        alignImageToEvent - if true, proxy image is aligned to start event, else next to mouse cursor
      • createDragImage

        public void createDragImage​(com.google.gwt.dom.client.Element element,
                                    boolean alignImageToEvent)
        Deprecated.
        Automatically tries to create a proxy image from given element.
        Parameters:
        element - the original element that is dragged
        alignImageToEvent - if true, proxy image is aligned to start event, else next to mouse cursor
        Since:
        7.2