Packagenl.flexperiments.tree
Classpublic class FlpTree
InheritanceFlpTree 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)

new in version 1.3.1

new in version 1.3.0:

new in version 1.2.2:

new in version 1.2.1:

new in version 1.2.0:

new in version 1.1.0b

new in version 1.0.2b



Public Properties
 PropertyDefined by
  allowDropOnAllNodes : Boolean
FlpTree
  childrenField : String
FlpTree
  closedfoldericon : *
FlpTree
  closedicon : *
FlpTree
  dataProvider : ArrayCollection
FlpTree
  dragEnabled : Boolean
FlpTree
  dropIndicator : IFactory
FlpTree
  filterFunction : Function
FlpTree
  hoverDelay : Number
FlpTree
  icon : Class
FlpTree
  iconField : *
FlpTree
  iconFunction : Function
FlpTree
  indentation : int
FlpTree
  itemRenderer : IFactory
FlpTree
  labelField : String
FlpTree
  labelFunction : Function
FlpTree
  multiselect : Boolean
FlpTree
  openedfoldericon : *
FlpTree
  openedicon : *
FlpTree
  __openItems : ArrayCollection
FlpTree
  openNodeOnHover : Boolean
FlpTree
  selectedNode : Node
FlpTree
  selectedNodes : Array
FlpTree
  verticalGap : int
FlpTree
  width : Number
[write-only] Gets or sets the width of the tree
FlpTree
Public Methods
 MethodDefined by
  
FlpTree
  
__addNode(parentUIC:UIComponent, data:Object, index:int):void
Adds a node to the tree
FlpTree
  
__deselectNode(node:Node):void
FlpTree
  
closeAll():void
Closes all nodes
FlpTree
  
disableAll():void
Disables all nodes
FlpTree
  
enableAll():void
Enables all nodes
FlpTree
  
findNode(property:String, value:Node, startingNode:* = null):Node
Finds a node with the given property and it's value
FlpTree
  
findNodes(property:String, value:Node, startingNode:* = null):Array
FlpTree
  
openAll():void
Opens all nodes
FlpTree
  
openNode(node:Node):void
Opens a node
FlpTree
  
refreshTree():void
Since caching is now supported, we don't rebuild the tree from the ground, instead we try to reuse as much as possible.
FlpTree
  
traverseTreeWithCallback(callback:Function):void
Walks through the tree and calls the callback function for each node
FlpTree
Protected Methods
 MethodDefined by
  
FlpTree
Events
 EventSummaryDefined by
   Dispatched when the user closes a node The TreeEvent contains a data property with additional information 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 doubleclicks on an item 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
  
backgroundColor
Type: uint   Format: Color   CSS Inheritance: no
Sets the backgroundColor of the tree
FlpTree
  
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
  
color
Type: uint   Format: Color   CSS Inheritance: yes
Sets the color of the text, this applies only to the default renderer
FlpTree
  
indicatorColor
Type: uint   Format: Color   CSS Inheritance: no
Sets the default color for the indicator
FlpTree
  
indicatorThickness
Type: Number   Format: Length   CSS Inheritance: no
Sets the default thickness for the indicator
FlpTree
  
itemBackgroundColor
Type: uint   Format: Color   CSS Inheritance: no
Sets the backgroundColor of an item
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
  
selectedItemBackgroundColor
Type: uint   Format: Color   CSS Inheritance: no
Sets the backgroundColor of a selected item
FlpTree
Public Constants
 ConstantDefined by
  VERSION : String = "1.3.1"
[static]
FlpTree
Property detail
allowDropOnAllNodesproperty
allowDropOnAllNodes:Boolean  [read-write]Implementation
    public function get allowDropOnAllNodes():Boolean
    public function set allowDropOnAllNodes(value:Boolean):void
childrenFieldproperty 
childrenField:String  [read-write]Implementation
    public function get childrenField():String
    public function set childrenField(value:String):void
closedfoldericonproperty 
closedfoldericon:*  [read-write]Implementation
    public function get closedfoldericon():*
    public function set closedfoldericon(value:*):void
closediconproperty 
closedicon:*  [read-write]Implementation
    public function get closedicon():*
    public function set closedicon(value:*):void
dataProviderproperty 
dataProvider:ArrayCollection  [read-write]Implementation
    public function get dataProvider():ArrayCollection
    public function set dataProvider(value:ArrayCollection):void
dragEnabledproperty 
dragEnabled:Boolean  [read-write]Implementation
    public function get dragEnabled():Boolean
    public function set dragEnabled(value:Boolean):void
dropIndicatorproperty 
dropIndicator:IFactory  [read-write]Implementation
    public function get dropIndicator():IFactory
    public function set dropIndicator(value:IFactory):void
filterFunctionproperty 
filterFunction:Function  [read-write]Implementation
    public function get filterFunction():Function
    public function set filterFunction(value:Function):void
hoverDelayproperty 
hoverDelay:Number  [read-write]Implementation
    public function get hoverDelay():Number
    public function set hoverDelay(value:Number):void
iconproperty 
icon:Class  [read-write]Implementation
    public function get icon():Class
    public function set icon(value:Class):void
iconFieldproperty 
iconField:*  [read-write]Implementation
    public function get iconField():*
    public function set iconField(value:*):void
iconFunctionproperty 
iconFunction:Function  [read-write]Implementation
    public function get iconFunction():Function
    public function set iconFunction(value:Function):void
indentationproperty 
indentation:int  [read-write]Implementation
    public function get indentation():int
    public function set indentation(value:int):void
itemRendererproperty 
itemRenderer:IFactory  [read-write]Implementation
    public function get itemRenderer():IFactory
    public function set itemRenderer(value:IFactory):void
labelFieldproperty 
labelField:String  [read-write]Implementation
    public function get labelField():String
    public function set labelField(value:String):void
labelFunctionproperty 
labelFunction:Function  [read-write]Implementation
    public function get labelFunction():Function
    public function set labelFunction(value:Function):void
multiselectproperty 
multiselect:Boolean  [read-write]Implementation
    public function get multiselect():Boolean
    public function set multiselect(value:Boolean):void
openedfoldericonproperty 
openedfoldericon:*  [read-write]Implementation
    public function get openedfoldericon():*
    public function set openedfoldericon(value:*):void
openediconproperty 
openedicon:*  [read-write]Implementation
    public function get openedicon():*
    public function set openedicon(value:*):void
__openItemsproperty 
public var __openItems:ArrayCollection
openNodeOnHoverproperty 
openNodeOnHover:Boolean  [read-write]Implementation
    public function get openNodeOnHover():Boolean
    public function set openNodeOnHover(value:Boolean):void
selectedNodeproperty 
selectedNode:Node  [read-write]Implementation
    public function get selectedNode():Node
    public function set selectedNode(value:Node):void
selectedNodesproperty 
selectedNodes:Array  [read-write]Implementation
    public function get selectedNodes():Array
    public function set selectedNodes(value:Array):void
verticalGapproperty 
verticalGap:int  [read-write]Implementation
    public function get verticalGap():int
    public function set verticalGap(value:int):void
widthproperty 
width:Number  [write-only]

Gets or sets the width of the tree

This property can be used as the source for data binding.

Implementation
    public function set width(value:Number):void
Constructor detail
FlpTree()constructor
public function FlpTree()
Method detail
__addNode()method
public function __addNode(parentUIC:UIComponent, data:Object, index:int):void

Adds a node to the tree

Parameters
parentUIC:UIComponent — The parent UIComponent (parentNode), the node to add the new node to
 
data:Object — The data from the dataprovider
 
index:int — The index of the node
__deselectNode()method 
public function __deselectNode(node:Node):voidParameters
node:Node
closeAll()method 
public function closeAll():void

Closes all nodes

createChildren()method 
protected override function createChildren():void
disableAll()method 
public function disableAll():void

Disables all nodes

enableAll()method 
public function enableAll():void

Enables all nodes

findNode()method 
public function findNode(property:String, value:Node, startingNode:* = null):Node

Finds a node with the given property and it's value

Parameters
property:String
 
value:Node
 
startingNode:* (default = null)

Returns
Node
findNodes()method 
public function findNodes(property:String, value:Node, startingNode:* = null):ArrayParameters
property:String
 
value:Node
 
startingNode:* (default = null)

Returns
Array
openAll()method 
public function openAll():void

Opens all nodes

openNode()method 
public function openNode(node:Node):void

Opens a node

Parameters
node:Node
refreshTree()method 
public function refreshTree():void

Since caching is now supported, we don't rebuild the tree from the ground, instead we try to reuse as much as possible.

traverseTreeWithCallback()method 
public function traverseTreeWithCallback(callback:Function):void

Walks through the tree and calls the callback function for each node

Parameters
callback:Function — The function to call
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

dragDropevent  
Event object type: nl.flexperiments.events.FlpTreeEvent
FlpTreeEvent.type property = nl.flexperiments.events.FlpTreeEvent.DRAGDROP

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

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

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

Constant detail
VERSIONconstant
public static const VERSION:String = "1.3.1"