M
- the model typepublic class TreeGridDropTarget<M> extends DropTarget
TreeGrid
to act as the target of a drag and drop operation.
Use DropTarget.setFeedback(com.sencha.gxt.dnd.core.client.DND.Feedback)
to specify whether to allow inserting
items between items, appending items to the end, or both (defaults to
DND.Feedback.BOTH
).
Use DropTarget.setOperation(com.sencha.gxt.dnd.core.client.DND.Operation)
to specify whether to move items or copy
them (defaults to DND.Operation.MOVE
).
Modifier and Type | Class and Description |
---|---|
static interface |
TreeGridDropTarget.TreeGridDropTargetResources
The tree drop target resources.
|
Modifier and Type | Field and Description |
---|---|
protected Tree.TreeNode<M> |
activeItem |
protected Tree.TreeNode<M> |
appendItem |
protected TreeGridDropTarget.TreeGridDropTargetResources |
resources |
protected int |
status |
dropWidget, feedback, operation, overStyle
Constructor and Description |
---|
TreeGridDropTarget(TreeGrid<M> tree)
Creates a drop target for the specified tree grid.
|
Modifier and Type | Method and Description |
---|---|
protected void |
appendModel(M p,
List<?> items,
int index) |
protected void |
bind(TreeGrid<M> tree) |
protected void |
clearStyle(Tree.TreeNode<M> node) |
TreeGrid<M> |
getWidget()
Returns the target's widget.
|
protected void |
handleAppend(DndDragMoveEvent event,
Tree.TreeNode<M> item) |
protected void |
handleAppendDrop(DndDropEvent event,
Tree.TreeNode<M> item) |
protected void |
handleInsert(DndDragMoveEvent event,
Tree.TreeNode<M> item) |
protected void |
handleInsertDrop(DndDropEvent event,
Tree.TreeNode<M> item,
int index) |
boolean |
isAddChildren()
Returns true if children are being added when inserting into the TreeStore.
|
boolean |
isAllowDropOnLeaf()
Returns whether drops are allowed on leaf nodes.
|
boolean |
isAutoExpand()
Returns true if auto expand is enabled (defaults to true).
|
boolean |
isAutoScroll()
Returns true if auto scroll is enabled (defaults to true).
|
protected void |
onDragCancelled(DndDragCancelEvent event)
Called if the user cancels the drag operations while the mouse is over the
target.
|
protected void |
onDragDrop(DndDropEvent event)
Called when the user releases the mouse over the target widget.
|
protected void |
onDragEnter(DndDragEnterEvent event)
Called when the cursor first enters the bounds of the drop target.
|
protected void |
onDragFail(DndDropEvent event)
Called when a drop fails.
|
protected void |
onDragLeave(DndDragLeaveEvent event)
Called when the cursor leaves the target.
|
protected void |
onDragMove(DndDragMoveEvent event)
Called when the cursor is moved within the target widget.
|
void |
setAddChildren(boolean addChildren)
True to add children when inserting models into the TreeStore (defaults to
false).
|
void |
setAllowDropOnLeaf(boolean allowDropOnLeaf)
True to allow drops on leaf nodes (defaults to false).
|
void |
setAutoExpand(boolean autoExpand)
True to automatically expand the active tree item when the user hovers over
a collapsed item (defaults to true).
|
void |
setAutoExpandDelay(int autoExpandDelay)
Sets the delay used to auto expand items (defaults to 800).
|
void |
setAutoScroll(boolean autoScroll)
True to automatically scroll the tree when the user hovers over the top and
bottom of the tree grid (defaults to true).
|
protected void |
showFeedback(DndDragMoveEvent event)
Called as the mouse is moved over the target widget.
|
addDragCancelHandler, addDragEnterHandler, addDragLeaveHandler, addDragMoveHandler, addDropHandler, disable, enable, getElementFromEvent, getFeedback, getGroup, getOperation, getOverStyle, isAllowSelfAsSource, isEnabled, onDropWidgetAttach, onDropWidgetDetach, prepareDropData, release, setAllowSelfAsSource, setFeedback, setGroup, setOperation, setOverStyle
protected Tree.TreeNode<M> activeItem
protected Tree.TreeNode<M> appendItem
protected int status
protected TreeGridDropTarget.TreeGridDropTargetResources resources
public TreeGrid<M> getWidget()
DropTarget
getWidget
in class DropTarget
public boolean isAddChildren()
public boolean isAllowDropOnLeaf()
public boolean isAutoExpand()
public boolean isAutoScroll()
public void setAddChildren(boolean addChildren)
addChildren
- true to add childrenpublic void setAllowDropOnLeaf(boolean allowDropOnLeaf)
allowDropOnLeaf
- true to enable drops on leaf nodespublic void setAutoExpand(boolean autoExpand)
setAutoExpandDelay(int)
to set the delay.autoExpand
- true to auto expandpublic void setAutoExpandDelay(int autoExpandDelay)
autoExpandDelay
- the delay in millisecondspublic void setAutoScroll(boolean autoScroll)
autoScroll
- true to enable auto scrollScrollSupport
protected void clearStyle(Tree.TreeNode<M> node)
protected void handleAppend(DndDragMoveEvent event, Tree.TreeNode<M> item)
protected void handleAppendDrop(DndDropEvent event, Tree.TreeNode<M> item)
protected void handleInsert(DndDragMoveEvent event, Tree.TreeNode<M> item)
protected void handleInsertDrop(DndDropEvent event, Tree.TreeNode<M> item, int index)
protected void onDragCancelled(DndDragCancelEvent event)
DropTarget
onDragCancelled
in class DropTarget
event
- the drag cancel eventprotected void onDragDrop(DndDropEvent event)
DropTarget
onDragDrop
in class DropTarget
event
- the drop eventprotected void onDragEnter(DndDragEnterEvent event)
DropTarget
onDragEnter
in class DropTarget
event
- the drag enter eventprotected void onDragFail(DndDropEvent event)
DropTarget
onDragFail
in class DropTarget
event
- the drop eventprotected void onDragLeave(DndDragLeaveEvent event)
DropTarget
onDragLeave
in class DropTarget
event
- the drag leave eventprotected void onDragMove(DndDragMoveEvent event)
DropTarget
CancellableEvent.setCancelled(boolean)
to true,
DropTarget.showFeedback(DndDragMoveEvent)
will be called.onDragMove
in class DropTarget
event
- the dd eventprotected void showFeedback(DndDragMoveEvent event)
DropTarget
showFeedback
in class DropTarget
event
- the dd eventCopyright © 2018. All rights reserved.