Packagenl.flexperiments.tree
Classpublic class FlpTree
InheritanceFlpTree Inheritance Node Inheritance mx.containers.VBox

FlpTree is a replacement for the default mx:tree. It's more stable because it does not rely on listbased classes. The FlpTree uses VBoxes to build up the tree. For additional information, please see http://labs.flexperiments.nl/ (tags: Tree, component)

Version 2.0 is completely rewritten, using the flex component lifecycle, which should make it faster and more stable, oh, and it's open source now!



Public Properties
 PropertyDefined by
  allowDropOnAllNodes : Boolean
Gets or sets the allowDropOnAllNodes property, when true, you can drop a node on any node, when false, you can only drop on folders (nodes having a 'children' property)
FlpTree
  childrenField : String
Gets or sets the name of the children field of the dataProvider
FlpTree
  closedfoldericon : *
The default icon for a closed folder
FlpTree
  closedicon : *
The default icon of the open / close button for a opened folder
FlpTree
  data : Object
[read-only]
FlpTree
  dataProvider : ArrayCollection
The dataprovider
FlpTree
  dragEnabled : Boolean
Gets or sets the dragEnabled property, when enabled, you can drag items to rearrange them will also set dropenabled to true
FlpTree
  dropEnabled : Boolean
Gets or sets the dropEnabled property, when enabled, you can drop items in the tree, but not rearrange items
FlpTree
  dropIndicator : IFactory
Sets the renderer for the drop thinghy
FlpTree
  hoverDelayValue : uint
[read-only]
FlpTree
  icon : Class
The default icon for a node If it's a string, it sets the icon, if it's an array, it sets the icon and the folder icons if it's an object, it sets the icon and the folder icons, you can use the following names: icon - the icon foldericon - the icon for folders (opened and closed) openedfoldericon - the icon for opened folder closedfoldericon - the icon for closed folders Note: these are the default icons, the tree will look for icons in de dataprovider first.
FlpTree
  iconField : String
Gets or sets the field of the dataprovider which holds the icons
FlpTree
  iconFunction : Function
Gets or sets the function to call for the icons
FlpTree
  indentation : int
Gets or sets the indentation of child nodes
FlpTree
 InheriteditemIcon : *
You can call this function from your renderer to get the correct icon
Node
 InheriteditemLabel : String
You can call this function from your renderer to get the correct label
Node
 Inherited__itemRenderer : *
Node
  itemRenderer : IFactory
The renderer for a node
FlpTree
  labelField : String
Gets or sets the field of the dataprovider which acts as labelfield
FlpTree
  labelFunction : Function
Gets or sets the function to call for the labels
FlpTree
  multiselect : Boolean
Gets or sets the multiple selection allowance
FlpTree
 Inheritedopen : Boolean
Node
  openedfoldericon : *
The default icon for a opened folder
FlpTree
  openedicon : *
The default icon of the open / close button for a opened folder
FlpTree
  openNodeOnHover : Boolean
Gets or sets the openNodeOnHover property, when true, a node will open when you drag a node over it (nodes having a 'children' property)
FlpTree
 InheritedparentNode : Node
Returns the parent node
Node
  rollOverColorValue : uint
[read-only]
FlpTree
 Inheritedselected : Boolean
Selects or deselects the node.
Node
  selectedNode : Node
Gets or sets the selected node
FlpTree
  selectedNodes : Array
Gets the selected nodes
FlpTree
  selectionColorValue : uint
[read-only]
FlpTree
  textRollOverColorValue : uint
[read-only]
FlpTree
  textSelectedColorValue : uint
[read-only]
FlpTree
 Inheritedtree : FlpTree
Node
  verticalGapValue : int
[read-only] Gets the gap between nodes
FlpTree
Protected Properties
 PropertyDefined by
 Inheritedchildren : Array
Node
Public Methods
 MethodDefined by
  
FlpTree
  
__dispatchTreeEvent(eventType:String, data:Object):void
FlpTree
 Inherited
dispose():void
Node
  
findNodes(property:String, value:Node, startingNode:* = null):Array
Finds nodes with the given property and it's value.
FlpTree
 Inherited
refresh(recursive:Boolean = true):void
Node
Protected Methods
 MethodDefined by
 Inherited
_dragBoxEnterHandler(event:DragEvent):void
Gets called when dragging over the childrenBox
Node
 Inherited
_dragEnterHandler(event:DragEvent):void
This method is called when the user drags a node over (the renderer of) this node
Node
 Inherited
addNode(node:Node, index:Number = -1):void
Node
  
FlpTree
 Inherited
Node
 Inherited
Node
 Inherited
forceCommit():void
Node
 Inherited
removeNode(index:Number):void
Node
Events
 EventSummaryDefined by
   Dispatched when the user closes a node The TreeEvent contains a data property with additional information FlpTree
   Dispatched when the user doubleclicks on an item FlpTree
   Dispatched when the user drops an item on the tree which is accepted by the tree The TreeEvent contains a data property with additional information FlpTree
   Dispatched when the user opens a node The TreeEvent contains a data property with additional information FlpTree
   Dispatched when the selected node is changed The TreeEvent contains a data property with additional information FlpTree
Styles
 StyleDescriptionDefined by
  
closedFoldericon
Type: String   Format: Url   CSS Inheritance: yes
Sets the default icon for closed folders
FlpTree
  
closedIcon
Type: String   Format: Url   CSS Inheritance: yes
Sets the default close icon for the open / close button
FlpTree
  
hoverDelay
Type: Number   Format: Length   CSS Inheritance: no
Sets hover delay (how many milliseconds to wait before opening the node when dragging over it)
FlpTree
  
openedFoldericon
Type: String   Format: Url   CSS Inheritance: yes
Sets the default icon for opened folders
FlpTree
  
openedIcon
Type: String   Format: Url   CSS Inheritance: yes
Sets the default open icon for the open / close button
FlpTree
  
rollOverColor
Type: uint   Format: Color   CSS Inheritance: yes
Sets the backgroundColor of an item on hover
FlpTree
  
selectionColor
Type: uint   Format: Color   CSS Inheritance: yes
Sets the backgroundColor of an item on selection
FlpTree
  
textRollOverColor
Type: uint   Format: Color   CSS Inheritance: yes
Sets the textColor of an item on selection
FlpTree
  
textSelectedColor
Type: uint   Format: Color   CSS Inheritance: yes
Sets the textColor of an item on selection
FlpTree
  
verticalGap
Type: Number   Format: Length   CSS Inheritance: no
Sets the gap between nodes
FlpTree
Property detail
allowDropOnAllNodesproperty
allowDropOnAllNodes:Boolean  [read-write]

Gets or sets the allowDropOnAllNodes property, when true, you can drop a node on any node, when false, you can only drop on folders (nodes having a 'children' property)

Implementation
    public function get allowDropOnAllNodes():Boolean
    public function set allowDropOnAllNodes(value:Boolean):void
childrenFieldproperty 
childrenField:String  [read-write]

Gets or sets the name of the children field of the dataProvider

Implementation
    public function get childrenField():String
    public function set childrenField(value:String):void
closedfoldericonproperty 
closedfoldericon:*  [read-write]

The default icon for a closed folder

Implementation
    public function get closedfoldericon():*
    public function set closedfoldericon(value:*):void
closediconproperty 
closedicon:*  [read-write]

The default icon of the open / close button for a opened folder

Implementation
    public function get closedicon():*
    public function set closedicon(value:*):void
dataproperty 
data:Object  [read-only]Implementation
    public function get data():Object
dataProviderproperty 
dataProvider:ArrayCollection  [read-write]

The dataprovider

Implementation
    public function get dataProvider():ArrayCollection
    public function set dataProvider(value:ArrayCollection):void
dragEnabledproperty 
dragEnabled:Boolean  [read-write]

Gets or sets the dragEnabled property, when enabled, you can drag items to rearrange them will also set dropenabled to true

Implementation
    public function get dragEnabled():Boolean
    public function set dragEnabled(value:Boolean):void
dropEnabledproperty 
dropEnabled:Boolean  [read-write]

Gets or sets the dropEnabled property, when enabled, you can drop items in the tree, but not rearrange items

Implementation
    public function get dropEnabled():Boolean
    public function set dropEnabled(value:Boolean):void
dropIndicatorproperty 
dropIndicator:IFactory  [read-write]

Sets the renderer for the drop thinghy

Implementation
    public function get dropIndicator():IFactory
    public function set dropIndicator(value:IFactory):void
hoverDelayValueproperty 
hoverDelayValue:uint  [read-only]Implementation
    public function get hoverDelayValue():uint
iconproperty 
icon:Class  [read-write]

The default icon for a node If it's a string, it sets the icon, if it's an array, it sets the icon and the folder icons if it's an object, it sets the icon and the folder icons, you can use the following names: icon - the icon foldericon - the icon for folders (opened and closed) openedfoldericon - the icon for opened folder closedfoldericon - the icon for closed folders Note: these are the default icons, the tree will look for icons in de dataprovider first. Note2: the get function allways returns the icon only, not the foldericons.

Implementation
    public function get icon():Class
    public function set icon(value:Class):void
iconFieldproperty 
iconField:String  [read-write]

Gets or sets the field of the dataprovider which holds the icons

Implementation
    public function get iconField():String
    public function set iconField(value:String):void
iconFunctionproperty 
iconFunction:Function  [read-write]

Gets or sets the function to call for the icons

Implementation
    public function get iconFunction():Function
    public function set iconFunction(value:Function):void
indentationproperty 
indentation:int  [read-write]

Gets or sets the indentation of child nodes

Implementation
    public function get indentation():int
    public function set indentation(value:int):void
itemRendererproperty 
itemRenderer:IFactory  [read-write]

The renderer for a node

Implementation
    public function get itemRenderer():IFactory
    public function set itemRenderer(value:IFactory):void
labelFieldproperty 
labelField:String  [read-write]

Gets or sets the field of the dataprovider which acts as labelfield

Implementation
    public function get labelField():String
    public function set labelField(value:String):void
labelFunctionproperty 
labelFunction:Function  [read-write]

Gets or sets the function to call for the labels

Implementation
    public function get labelFunction():Function
    public function set labelFunction(value:Function):void
multiselectproperty 
multiselect:Boolean  [read-write]

Gets or sets the multiple selection allowance

Implementation
    public function get multiselect():Boolean
    public function set multiselect(value:Boolean):void
openedfoldericonproperty 
openedfoldericon:*  [read-write]

The default icon for a opened folder

Implementation
    public function get openedfoldericon():*
    public function set openedfoldericon(value:*):void
openediconproperty 
openedicon:*  [read-write]

The default icon of the open / close button for a opened folder

Implementation
    public function get openedicon():*
    public function set openedicon(value:*):void
openNodeOnHoverproperty 
openNodeOnHover:Boolean  [read-write]

Gets or sets the openNodeOnHover property, when true, a node will open when you drag a node over it (nodes having a 'children' property)

Implementation
    public function get openNodeOnHover():Boolean
    public function set openNodeOnHover(value:Boolean):void
rollOverColorValueproperty 
rollOverColorValue:uint  [read-only]Implementation
    public function get rollOverColorValue():uint
selectedNodeproperty 
selectedNode:Node  [read-write]

Gets or sets the selected node

Implementation
    public function get selectedNode():Node
    public function set selectedNode(value:Node):void
selectedNodesproperty 
selectedNodes:Array  [read-write]

Gets the selected nodes

Implementation
    public function get selectedNodes():Array
    public function set selectedNodes(value:Array):void
selectionColorValueproperty 
selectionColorValue:uint  [read-only]Implementation
    public function get selectionColorValue():uint
textRollOverColorValueproperty 
textRollOverColorValue:uint  [read-only]Implementation
    public function get textRollOverColorValue():uint
textSelectedColorValueproperty 
textSelectedColorValue:uint  [read-only]Implementation
    public function get textSelectedColorValue():uint
verticalGapValueproperty 
verticalGapValue:int  [read-only]

Gets the gap between nodes

The default value is = 2;.

Implementation
    public function get verticalGapValue():int
Constructor detail
FlpTree()constructor
public function FlpTree()
Method detail
__dispatchTreeEvent()method
public function __dispatchTreeEvent(eventType:String, data:Object):voidParameters
eventType:String
 
data:Object
commitProperties()method 
protected override function commitProperties():void
findNodes()method 
public function findNodes(property:String, value:Node, startingNode:* = null):Array

Finds nodes with the given property and it's value. You can use nested properties (for instance data.label)

Parameters
property:String — The property
 
value:Node — The value to match with
 
startingNode:* (default = null) — The root node to start the search from

Returns
Array — array The found nodes
Event detail
closeevent 
Event object type: nl.flexperiments.events.FlpTreeEvent
FlpTreeEvent.type property = nl.flexperiments.events.FlpTreeEvent.CLOSE

Dispatched when the user closes a node The TreeEvent contains a data property with additional information

The close Event is called each time the user closes a node. The user receives the event with the data of the node that's being closed as data property

itemDoubleClickevent  
Event object type: nl.flexperiments.events.FlpTreeEvent
FlpTreeEvent.type property = nl.flexperiments.events.FlpTreeEvent.ITEM_DOUBLE_CLICK

Dispatched when the user doubleclicks on an item

Dispatched when a user double clicks on an item

nodeDragDropevent  
Event object type: nl.flexperiments.events.FlpTreeEvent

Dispatched when the user drops an item on the tree which is accepted by the tree The TreeEvent contains a data property with additional information

openevent  
Event object type: nl.flexperiments.events.FlpTreeEvent
FlpTreeEvent.type property = nl.flexperiments.events.FlpTreeEvent.OPEN

Dispatched when the user opens a node The TreeEvent contains a data property with additional information

The open Event is called each time the user selects a node. The user receives the event with the data of the node that's being selected as data property

selectedNodeChangeevent  
Event object type: nl.flexperiments.events.FlpTreeEvent
FlpTreeEvent.type property = nl.flexperiments.events.FlpTreeEvent.SELECTEDNODECHANGE

Dispatched when the selected node is changed The TreeEvent contains a data property with additional information