DragListener Tree componant.
Extends AsWing JTree componant.
Features :
Use
new FvTree()static public DND_NONE:Numberstatic public DND_MOVE:Numberstatic public DND_COPY:Numberstatic public DND_MIX:Numberstatic public DEFAULT_EXPAND_TIMER:Numberstatic public ITEM_LINK_MODE:Numberstatic public ITEM_CLONE_MODE:Numberpublic function setModel(m:FvTreeModel):Void
Sets the FvTreeModel that will provide the data.
public function setDragAndDropType(type:Number):VoidSets auto drag and drop type.
Available mode are :
public function getDragAndDropType():NumberReturns the auto drag and drop type.
Return value can be :
public function setAutoDragAndDropEnabled(b:Boolean):VoidAllows auto Drag'n Drop.
Means allow Drag'n Drop inside the current tree.
public function getAutoDragAndDropEnabled():Boolean
Returns true if Drag'n Drop is allowed inside
current component.
public function setCopyItemMode(n:Number):VoidSets copy item mode.
Available mode are :
public function getCopyItemMode():NumberReturns copy item mode.
Returns value can be :
public function setRuntimeCopySelection(b:Boolean):Void
Defines if user can choose between copy item mode.
Default is false.
If true a popupmenu is opened when user press Shift key.
public function getRuntimeCopySelection():BooleanReturns if user can choose between copy item mode.
public function setRemoveOutsideEnabled(b:Boolean):VoidSets if dropped node(s) can be removed from tree when usser drop them outside the tree component.
Use {link #setPreventBeforeRemoving()} method to determine if a confirmation dialog appear ( or not ) before removing dropped node(s).
public function getRemoveOutsideEnabled():Boolean
Returns true if node(s) can be removed when user dropped them
outside the tree component.
Use
public function setPreventRemovingEnabled(b:Boolean):Void
Indicates if a confirmation dialog appear before removing node
in
public function getPreventRemovingEnabled():Boolean
Returns true if confirmation dialog is needed.
public function setOrderArrangementEnabled(b:Boolean):Void
Sets if user can arrange nodes order ( in childnode structure ) using
Dran'n Drop process. ( default is false )
public function getOrderArrangementEnabled():Boolean
Returns true if user can arrange nodes order ( in childnode structure ) using
Dran'n Drop process.
public function setAutoExpandTimer(n:Number):Void
Sets necessary time before expand a target node during Dnd process.
Must be > 0.
Default is 2000 ms.
public function getAutoExpandTimer():NumberReturns necessary time before expand a target node during Dnd process.
public function isAcceptableTreeSourceData(dragInitiator:Component, sd:SourceData):BooleanReturns is the source data is acceptale to drop in this tree as build-in support
public function isEditable():BooleanReturns true if the tree is editable.
If node is selelected check the node.isEditable() property
true if the tree is editable
public function sort():VoidSorts all tree nodes.
Use
public function sortNode(node:FvTreeNode):Void
Sorts passed-in node childnodes.
Use
public function sortPath(path:TreePath):Void
Sorts passed-in path treepath.
Use
public function setAutoSortingEnabled(b:Boolean):VoidSets if childnodes are automatically reorder ( sort ).
public function getAutoSortingEnabled():Boolean
Returns true if auto sorting is enabled.
public function getNodeById(nodeID:Number):FvTreeNode
Returns tree node resgitred with passed-in nodeID in
current tree.
If not, return null
public function removePaths(paths:Array):Void
Removes passed-in paths list from tree model.
public function removeNodes(nodes:Array):Void
Removes passed-in nodes list from tree model.
public function isValidEditingValue(newValue):Boolean
Returns true if newValue is a valid value for current
edited cell.
Override this method to implement your own value checking process.
public function onDragStart(dragInitiator:Component, sourceData:SourceData, pos:Point):VoidNull. Implemented for DragListener interface.
public function onDragEnter(dragInitiator:Component, sourceData:SourceData, pos:Point, targetComponent:Component):VoidNull. Implemented for DragListener interface.
public function onDragOverring(dragInitiator:Component, sourceData:SourceData, pos:Point, targetComponent:Component):VoidNull. Implemented for DragListener interface.
public function onDragExit(dragInitiator:Component, sourceData:SourceData, pos:Point, targetComponent:Component):VoidNull. Implemented for DragListener interface.
public function onDragDrop(dragInitiator:Component, sourceData:SourceData, pos:Point, targetComponent:Component):VoidCalled when drag operation finished outside the component.
Allow detection of component initiator outside drop.
If you overrides method, think about call the super.onDragDrop() method to keep outside dropping detection.
dragInitiator | the drag initiator component |
pos | a Point indicating the cursor location in global space |
targetComponent | dropped component, it may be null if droped on a non-drag-trigger space. |
static public function getDefaultTreeModel():FvTreeModel
Creates and returns a sample FvTreeModel.
Overrides JTree method.
the default FvTreeModel