TreeNode

TreeNode

Represents a tree node

Constructor

new TreeNode(config)

Source:
Create a new TreeNode with the given configuration
Parameters:
Name Type Description
config TreeNode~config The configuration for this TreeNode

Members

alwaysOpen

Source:

childNodes :Array.<TreeNode>

Source:
The children of this TreeNode
Type:

context

Source:

html :Element

Source:
The DOM Element of this TreeNode
Type:
  • Element

metaIcons :Array.<Element>

Source:
Meta icons of this TreeNode
Type:
  • Array.<Element>

parentNode :TreeNode

Source:
The parent node of this TreeNode
Type:

type

Source:

Methods

addMetaIcon(icon)

Source:
Add a meta icon to this TreeNode
Parameters:
Name Type Description
icon *

addNode(index, node)

Source:
Add a child node to this node at a given index
Parameters:
Name Type Description
index Number
node TreeNode

clearNodes()

Source:
Removes all child nodes from this TreeNode

fold()

Source:
Fold this TreeNode

getProperty(propertyName, defaultValueopt) → {*}

Source:
Retrieve the value of the given property
Parameters:
Name Type Attributes Default Description
propertyName String
defaultValue * <optional>
null The default value if the property does not exist
Returns:
Type
*

getTreeBrowser() → {null|TreeBrowser}

Source:
Return the TreeBrowser at the top of the tree this TreeNode is in, if any
Returns:
Type
null | TreeBrowser

isFolded() → {boolean}

Source:
Check wether this TreeNode is folded or unfolded
Returns:
- True of this TreeNode is folded, false if unfolded
Type
boolean

isLeaf() → {boolean}

Source:
Checks if this TreeNode has any children
Returns:
True/False depending on if this TreeNode has any children
Type
boolean

onDecorated()

Source:
Called when this TreeNode has been decorated

onRemoved()

Source:
Called when we are removed from the tree

removeMetaIcon(icon)

Source:
Remove a meta icon from this TreeNode
Parameters:
Name Type Description
icon *

removeNode(node)

Source:
Remove a child node from this node
Parameters:
Name Type Description
node TreeNode

reveal()

Source:
Make this TreeNode and all parent TreeNode's unfold,

select()

Source:
Make this TreeNode the selected node in the tree

setProperty(propertyName, value)

Source:
Sets the value of the given property
Parameters:
Name Type Description
propertyName String
value *

toggleFold()

Source:
Toggle fold state of this TreeNode

triggerAction()

Source:
Trigger the action listeners of this TreeNode

unfold()

Source:
Unfold this TreeNode

Type Definitions

config

Source:
Properties:
Name Type Attributes Default Description
type string The type of this TreeNode, ex. "DomTreeNode", "AssetNode", "AssetRootNode"
context * The context of this TreeNode
alwaysOpen boolean <optional>
false If this TreeNode should stay unfolded
lookupKey * <optional>
context The lookupkey to use when TreeGenerator saves this TreeNode for later lookup
startOpen boolean <optional>
false If this TreeNode should start unfolded
hideSelf boolean <optional>
false If this TreeNode should be hidden.
Type:
  • Object

Events

EventSystem:"TreeBrowser.TreeNode.Action"

Source:
Properties:
Name Type Description
node TreeNode The node which had its action triggered
Called when a TreeNode's action is triggered. (Ie. double click it)
Type:
  • CustomEvent