com.sas.models
Interface TreeDnDDelegateInterface

All Known Implementing Classes:
DefaultTreeDnDDelegate

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".

See Also:
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

isDraggable

boolean isDraggable(SimpleNodeInterface[] nodePath)
Indicates whether a node is draggable.

Parameters:
nodePath - complete path to and including the node to be dragged
Returns:
true if the node can be dragged, false otherwise

isDropSite

boolean isDropSite(SimpleNodeInterface[] dragNodePath,
                   SimpleNodeInterface[] dropNodeParentPath,
                   int position)
Indicates whether a node is dropable on another node.

Parameters:
dragNodePath - complete path to and including the node to be dragged
dropNodeParentPath - complete path to and including the node to be dropped on
position - 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.
Returns:
true if the node specified by dropNodePath allows the node specified by dragNodePath to be dropped on it, false otherwise

performDrop

boolean performDrop(SimpleNodeInterface[] dragNodePath,
                    SimpleNodeInterface[] dropNodePath,
                    int position)
Drops one node on another at position. A position of -1 can be specified to append the node being dragged to the child list of the node being dropped on.

Parameters:
dragNodePath - complete path to and including the node being dragged
dropNodeParentPath - complete path to and including the node being dropped on
position - 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
Returns:
true if the drop operation was successfully performed, false otherwise



Copyright © 2009 SAS Institute Inc. All Rights Reserved.