Package com.sencha.gxt.dnd.core.client
Class TreeDragSource<M>
- java.lang.Object
-
- com.sencha.gxt.dnd.core.client.DragSource
-
- com.sencha.gxt.dnd.core.client.TreeDragSource<M>
-
- Type Parameters:
M
- the model type
- All Implemented Interfaces:
DndDragCancelEvent.HasDndDragCancelHandlers
,DndDragStartEvent.HasDndDragStartHandlers
,DndDropEvent.HasDndDropHandlers
public 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 toDND.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).
-
-
Constructor Summary
Constructors Constructor Description TreeDragSource(Tree<M,?> tree)
Creates a drag source for the specified tree.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DND.TreeSource
getTreeSource()
Returns the tree associated with this drag source.Tree<M,?>
getWidget()
Returns the source widget.void
setTreeSource(DND.TreeSource treeSource)
Sets the tree source (defaults toDND.TreeSource.BOTH
).-
Methods inherited from class com.sencha.gxt.dnd.core.client.DragSource
addDragCancelHandler, addDragStartHandler, addDropHandler, disable, enable, getData, getDraggable, getGroup, getStatusText, isEnabled, release, setData, setGroup, setStatusText
-
-
-
-
Method Detail
-
getTreeSource
public DND.TreeSource getTreeSource()
Returns the tree associated with this drag source.- Returns:
- the tree associated with this drag source
-
getWidget
public Tree<M,?> getWidget()
Description copied from class:DragSource
Returns the source widget.- Overrides:
getWidget
in classDragSource
- Returns:
- the widget
-
setTreeSource
public void setTreeSource(DND.TreeSource treeSource)
Sets the tree source (defaults toDND.TreeSource.BOTH
).- Parameters:
treeSource
- the tree source
-
-