Class TreeGridDropTarget<T>

  • Type Parameters:
    T - Type of the TreeGrid bean.
    All Implemented Interfaces:
    MethodEventSource, ClientConnector, Extension, com.vaadin.shared.Connector, java.io.Serializable

    public class TreeGridDropTarget<T>
    extends GridDropTarget<T>
    Makes the rows of a TreeGrid HTML5 drop targets. This is the server side counterpart of GridDropTargetExtensionConnector.
    Since:
    8.1
    Author:
    Vaadin Ltd
    See Also:
    Serialized Form
    • Constructor Detail

      • TreeGridDropTarget

        public TreeGridDropTarget​(TreeGrid<T> target,
                                  com.vaadin.shared.ui.grid.DropMode dropMode)
        Extends a TreeGrid and makes it's rows drop targets for HTML5 drag and drop.
        Parameters:
        target - TreeGrid to be extended.
        dropMode - Drop mode that describes the allowed drop locations within the TreeGrid's row.
    • Method Detail

      • addTreeGridDropListener

        public com.vaadin.shared.Registration addTreeGridDropListener​(TreeGridDropListener<T> listener)
        Attaches drop listener for the current drop target. TreeGridDropListener.drop(TreeGridDropEvent) is called when drop event happens on the client side.
        Parameters:
        listener - Listener to handle drop event.
        Returns:
        Handle to be used to remove this listener.
      • getState

        protected com.vaadin.shared.ui.treegrid.TreeGridDropTargetState getState()
        Description copied from class: AbstractClientConnector
        Returns the shared state for this connector. The shared state object is shared between the server connector and the client connector. Changes are only communicated from the server to the client and not in the other direction.

        As a side effect, marks the connector dirty so any changes done to the state will be sent to the client. Use getState(false) to avoid marking the connector as dirty.

        Overrides:
        getState in class GridDropTarget<T>
        Returns:
        The shared state for this connector. Never null.
      • getState

        protected com.vaadin.shared.ui.treegrid.TreeGridDropTargetState getState​(boolean markAsDirty)
        Description copied from class: AbstractClientConnector
        Returns the shared state for this connector.
        Overrides:
        getState in class GridDropTarget<T>
        Parameters:
        markAsDirty - true if the connector should automatically be marked dirty, false otherwise
        Returns:
        The shared state for this connector. Never null.
        See Also:
        AbstractClientConnector.getState()