|
| Components |
|
| |||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||||
public interface TreeDnDDelegateInterface
TreeDnDDelegateInterface defines the methods that are required for a TreeView object to perform drag-drop operations with its nodes. Since objects provided by a model to a TreeView that implement SimpleNodeInterface can be non-unique, it is not always sufficient for a single node to determine if it is draggable or dropable. Therefore, a complete path is required to (and including) each node to fully describe it. A delegate object that implements TreeDnDDelegateInterface can then interpret the nodes described by the paths to determine whether or not drag-drop operations are allowed.
The paths used to describe nodes are ordered with the top most ancestor occupying the first index. For example, a root node "Parent" has two children, "Child 1" and "Child 2". "Child 1" has one child "Grandchild". The path describing "Granchild" would look like: path[0] == "Parent", path[1] == "Child 1", and path[2] == "Grandchild".
MutableSimpleNodeInterface,
SimpleNodeInterface,
TreeView| Method Summary | |
|---|---|
abstract boolean |
isDraggable(SimpleNodeInterface[] nodePath)
Indicates whether a node is draggable. |
abstract boolean |
isDropSite(SimpleNodeInterface[] dragNodePath,
SimpleNodeInterface[] dropNodeParentPath,
int position)
Indicates whether a node is dropable on another node. |
abstract boolean |
performDrop(SimpleNodeInterface[] dragNodePath,
SimpleNodeInterface[] dropNodePath,
int position)
Drops one node on another at position. |
| Method Detail |
|---|
boolean isDraggable(SimpleNodeInterface[] nodePath)
nodePath - complete path to and including the node to be dragged
boolean isDropSite(SimpleNodeInterface[] dragNodePath,
SimpleNodeInterface[] dropNodeParentPath,
int position)
dragNodePath - complete path to and including the node to be draggeddropNodeParentPath - complete path to and including the node to be dropped onposition - position in the 0-based child list of the node described by dropNodePath
in which to insert the node described by dragNodePath. The value -1 can be specified to
append the node being dragged to the child list of the node being dropped on.
boolean performDrop(SimpleNodeInterface[] dragNodePath,
SimpleNodeInterface[] dropNodePath,
int position)
dragNodePath - complete path to and including the node being draggeddropNodeParentPath - complete path to and including the node being dropped onposition - The position in the 0-based child list of the node described by dropNodePath
in which to insert the node described by dragNodePath. The value -1 can be specified
to append the node being dragged to the child list of the node being dropped on
|
| Components |
|
| |||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||||