Package | impression.utilities |
Class | public class TreeNode |
Inheritance | TreeNode ![]() |
Property | Defined By | ||
---|---|---|---|
attributeName : String [read-only]
The name of the attribute in the XML object that contains the text to display for the node. | TreeNode | ||
expanded : Boolean [read-only]
Indicates the expanded state of the node. | TreeNode | ||
hasChildren : Boolean [read-only]
Indicates whether the node has children. | TreeNode | ||
owner : TreeView [read-only]
The TreeView object that owns this TreeNode. | TreeNode | ||
selected : Boolean [read-only]
Indicates the selection state of the node. | TreeNode | ||
source : XML [read-only]
The XML object containing the data for this TreeNode. | TreeNode | ||
styleName : String
The named style associated with the node. | TreeNode |
Method | Defined By | ||
---|---|---|---|
clearStyle(style:String):void
Deletes a style property from the node. | TreeNode | ||
getStyle(style:String):Object
Retrieves a style property for the node. | TreeNode | ||
getStyleDefinition():Object [static]
Retrieves the default style map for the node. | TreeNode | ||
redraw():void
Redraws the node. | TreeNode | ||
setStyle(style:String, value:Object):void
Sets a style property for the node. | TreeNode | ||
toString():String [override]
Returns the string representation of the specified object. | TreeNode |
Event | Summary | Defined By | ||
---|---|---|---|---|
Dispatched after the .redraw() method is invoked. | TreeNode | |||
Dispatched when the node is resized. | TreeNode |
attributeName | property |
attributeName:String
[read-only] The name of the attribute in the XML object that contains the text to display for the node.
public function get attributeName():String
expanded | property |
expanded:Boolean
[read-only] Indicates the expanded state of the node.
The default value is false
.
public function get expanded():Boolean
hasChildren | property |
hasChildren:Boolean
[read-only] Indicates whether the node has children.
public function get hasChildren():Boolean
owner | property |
owner:TreeView
[read-only] The TreeView object that owns this TreeNode.
public function get owner():TreeView
selected | property |
selected:Boolean
[read-only] Indicates the selection state of the node.
The default value is false
.
public function get selected():Boolean
source | property |
source:XML
[read-only] The XML object containing the data for this TreeNode.
public function get source():XML
styleName | property |
styleName:String
The named style associated with the node.
This value should be a string that was previously added to the owning TreeView using the setNodeStyle
.
public function get styleName():String
public function set styleName(value:String):void
See also
clearStyle | () | method |
public function clearStyle(style:String):void
Deletes a style property from the node.
Parameters
style:String — The name of the style property.
|
See also
getStyle | () | method |
public function getStyle(style:String):Object
Retrieves a style property for the node.
Note that this method will only return style values that have been explicitly set using setStyle()
.
Parameters
style:String — The name of the style property.
|
Object — Style value.
|
See also
getStyleDefinition | () | method |
public static function getStyleDefinition():Object
Retrieves the default style map for the node.
Note that values from the default style map are used only if no specific value for a style was
set using the setStyle()
method and no specific value for a style was set in the owning
TreeView by a call to setNodeStyle()
using the style name specified by the styleName
property.
Object — Default styles object.
|
See also
redraw | () | method |
public function redraw():void
Redraws the node.
When looking up a style to use for drawing, the TreeNode determines the style value to use according to the following rules:
setStyle()
method, it is used.setNodeStyle()
method with styleName
, it is used.setNodeStyle()
method without a style name (the styleName
parameter was null
or the empty string (""), it is used.If the node is selected, and an explicit value is not available either from the node or the owning TreeView, then the TreeNode attempts to retrieve the alternate, non-selected style value before the default style value is used.
When all drawing is complete, the TreeNodeDrawEvent.AFTER_REDRAW event is dispatched. If the node's size has changed during drawing (or in code handling the AFTER_REDRAW event) the RESIZE event is dispatched.
See also
setStyle | () | method |
public function setStyle(style:String, value:Object):void
Sets a style property for the node.
Any style value set using this method will override the named style value from the owning TreeView, if one is set.
Parameters
style:String — The name of the style property.
| |
value:Object — The value of the style.
|
See also
toString | () | method |
override public function toString():String
Returns the string representation of the specified object.
ReturnsString — The string representation of the specified object.
|
afterRedraw | Event |
impression.events.TreeNodeDrawEvent
TreeNodeDrawEvent.AFTER_REDRAW
Dispatched after the .redraw() method is invoked.
See also
resize | Event |
flash.events.Event
flash.events.Event.RESIZE
Dispatched when the node is resized.