Package com.vaadin.ui.components.grid
Class TreeGridDropTarget<T>
- java.lang.Object
-
- com.vaadin.server.AbstractClientConnector
-
- com.vaadin.server.AbstractExtension
-
- com.vaadin.ui.dnd.DropTargetExtension<Grid<T>>
-
- com.vaadin.ui.components.grid.GridDropTarget<T>
-
- com.vaadin.ui.components.grid.TreeGridDropTarget<T>
-
- Type Parameters:
T- Type of the TreeGrid bean.
- All Implemented Interfaces:
MethodEventSource,ClientConnector,Extension,Connector,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
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.vaadin.server.ClientConnector
ClientConnector.AttachEvent, ClientConnector.AttachListener, ClientConnector.ConnectorErrorEvent, ClientConnector.DetachEvent, ClientConnector.DetachListener
-
-
Constructor Summary
Constructors Constructor Description TreeGridDropTarget(TreeGrid<T> target, DropMode dropMode)Extends a TreeGrid and makes it's rows drop targets for HTML5 drag and drop.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description RegistrationaddTreeGridDropListener(TreeGridDropListener<T> listener)Attaches drop listener for the current drop target.TreeGrid<T>getParent()Returns the component this extension is attached to.protected TreeGridDropTargetStategetState()Returns the shared state for this connector.protected TreeGridDropTargetStategetState(boolean markAsDirty)Returns the shared state for this connector.protected voidregisterDropTargetRpc()Registers the server side RPC methods invoked from client side ondropevent.-
Methods inherited from class com.vaadin.ui.components.grid.GridDropTarget
addGridDropListener, getDropMode, getDropThreshold, getGrid, isDropAllowedOnRowsWhenSorted, remove, setDropAllowedOnRowsWhenSorted, setDropMode, setDropThreshold
-
Methods inherited from class com.vaadin.ui.dnd.DropTargetExtension
addDropListener, attach, getDropCriteriaScript, getDropEffect, onDrop, setDropCriteria, setDropCriteriaScript, setDropCriterion, setDropCriterion, setDropCriterion, setDropEffect
-
Methods inherited from class com.vaadin.server.AbstractExtension
extend, getSupportedParentType, setParent
-
Methods inherited from class com.vaadin.server.AbstractClientConnector
addAttachListener, addDetachListener, addExtension, addListener, addListener, addListener, addListener, addListener, addListener, addMethodInvocationToQueue, beforeClientResponse, createState, detach, encodeState, equals, fireEvent, getAllChildrenIterable, getConnectorId, getErrorHandler, getExtensions, getListeners, getResource, getRpcManager, getRpcProxy, getSession, getStateType, getUI, handleConnectorRequest, hashCode, hasListeners, isAttached, isConnectorEnabled, isThis, markAsDirty, markAsDirtyRecursive, registerRpc, registerRpc, removeAttachListener, removeDetachListener, removeExtension, removeListener, removeListener, removeListener, removeListener, removeListener, requestRepaint, requestRepaintAll, retrievePendingRpcCalls, setErrorHandler, setResource, updateDiffstate
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.vaadin.server.ClientConnector
addAttachListener, addDetachListener, beforeClientResponse, detach, encodeState, getErrorHandler, getExtensions, getRpcManager, getStateType, getUI, handleConnectorRequest, isAttached, isConnectorEnabled, markAsDirty, markAsDirtyRecursive, removeAttachListener, removeDetachListener, removeExtension, requestRepaint, requestRepaintAll, retrievePendingRpcCalls, setErrorHandler
-
Methods inherited from interface com.vaadin.shared.Connector
getConnectorId
-
-
-
-
Method Detail
-
addTreeGridDropListener
public 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.
-
registerDropTargetRpc
protected void registerDropTargetRpc()
Description copied from class:DropTargetExtensionRegisters the server side RPC methods invoked from client side ondropevent.Override this method if you need to have a custom RPC interface for transmitting the drop event with more data. If just need to do additional things before firing the drop event, then you should override
DropTargetExtension.onDrop(List, Map, DropEffect, MouseEventDetails)instead.- Overrides:
registerDropTargetRpcin classGridDropTarget<T>
-
getParent
public TreeGrid<T> getParent()
Description copied from class:DropTargetExtensionReturns the component this extension is attached to.- Specified by:
getParentin interfaceClientConnector- Specified by:
getParentin interfaceConnector- Overrides:
getParentin classDropTargetExtension<Grid<T>>- Returns:
- Extended component.
-
getState
protected TreeGridDropTargetState getState()
Description copied from class:AbstractClientConnectorReturns 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:
getStatein classGridDropTarget<T>- Returns:
- The shared state for this connector. Never null.
-
getState
protected TreeGridDropTargetState getState(boolean markAsDirty)
Description copied from class:AbstractClientConnectorReturns the shared state for this connector.- Overrides:
getStatein classGridDropTarget<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()
-
-