M
- the model typepublic class TreeDragSource<M> extends DragSource
Enables a Tree
to act as the source of a drag and drop operation.
Use setTreeSource(com.sencha.gxt.dnd.core.client.DND.TreeSource)
to specify whether leaf nodes, non-leaf
nodes or both types of nodes can be dragged (defaults to DND.TreeSource.BOTH
). The drag operation is cancelled
if the user attempts to drag a node type that is not permitted.
The drag data consists of a list of items of type <M>
. It is optimized to remove children of parents that are
also in the list (i.e. if a parent is the subject of a drag operation then all of its children are implicitly part of
the drag operation).
data, draggable, handler, statusProxy, widget
Constructor and Description |
---|
TreeDragSource(Tree<M,?> tree)
Creates a drag source for the specified tree.
|
Modifier and Type | Method and Description |
---|---|
DND.TreeSource |
getTreeSource()
Returns the tree associated with this drag source.
|
Tree<M,?> |
getWidget()
Returns the source widget.
|
protected void |
onDragDrop(DndDropEvent event) |
protected void |
onDragStart(DndDragStartEvent event)
Called when a drag operation begins on the target widget.
|
void |
setTreeSource(DND.TreeSource treeSource)
Sets the tree source (defaults to
DND.TreeSource.BOTH ). |
addDragCancelHandler, addDragStartHandler, addDropHandler, disable, enable, getData, getDraggable, getGroup, getStatusText, isEnabled, onDragCancelled, onDragFail, release, setData, setGroup, setStatusText
public DND.TreeSource getTreeSource()
public Tree<M,?> getWidget()
DragSource
getWidget
in class DragSource
public void setTreeSource(DND.TreeSource treeSource)
DND.TreeSource.BOTH
).treeSource
- the tree sourceprotected void onDragDrop(DndDropEvent event)
onDragDrop
in class DragSource
protected void onDragStart(DndDragStartEvent event)
DragSource
CancellableEvent.setCancelled(boolean)
.onDragStart
in class DragSource
event
- the dnd eventCopyright © 2018. All rights reserved.