| Package | weavejs.util |
| Class | public class WeaveTreeItem |
| Inheritance | WeaveTreeItem Object |
| Subclasses | WeaveMenuItem |
| Property | Defined By | ||
|---|---|---|---|
| cacheSettings : Object
Maps a property name to a Boolean which enables or disables caching for that property. | WeaveTreeItem | ||
| children : *
Gets the Array of child menu items and modifies it in place if necessary to create nodes from descriptors or remove null items. | WeaveTreeItem | ||
| data : Object = null
This can be any data associated with this tree item. | WeaveTreeItem | ||
| dependency : ILinkableObject
A pointer to the ILinkableObject that created this node. | WeaveTreeItem | ||
| label : *
This can be set to either a String or a Function. | WeaveTreeItem | ||
| Property | Defined By | ||
|---|---|---|---|
| _cache : Object
Cached values that get invalidated when the source triggers callbacks. | WeaveTreeItem | ||
| childItemClass : Class
Set this to change the constructor used for initializing child items. | WeaveTreeItem | ||
| _children : * = null | WeaveTreeItem | ||
| _counter : Object
Cached values of getCallbackCollection(source).triggerCounter. | WeaveTreeItem | ||
| _dependency : ILinkableObject = null | WeaveTreeItem | ||
| _label : * | WeaveTreeItem | ||
| _recursion : Object | WeaveTreeItem | ||
| Method | Defined By | ||
|---|---|---|---|
WeaveTreeItem(params:Object = null)
Constructs a new WeaveTreeItem. | WeaveTreeItem | ||
createItems(WeaveTreeItem_implementation:Class, items:Array):Array [static]
Initializes an Array of WeaveTreeItems using an Array of objects to pass to the constructor. | WeaveTreeItem | ||
| Method | Defined By | ||
|---|---|---|---|
_mapItem(WeaveTreeItem_implementation:Class, item:Object):Object [static]
Used for mapping an Array of params objects to an Array of WeaveTreeItem objects. | WeaveTreeItem | ||
cache(id:String, newValue:*):*
Retrieves or updates a cached value for a property. | WeaveTreeItem | ||
evalFunction(func:Function):*
First tries calling a function with no parameters. | WeaveTreeItem | ||
getBoolean(param:*, recursionName:String):*
Computes a Boolean value from various structures
| WeaveTreeItem | ||
getObject(param:*, recursionName:String):*
Evaluates a function to get an Object or just returns the non-Function Object passed in. | WeaveTreeItem | ||
getString(param:*, recursionName:String):*
Gets a String value from a String or Function. | WeaveTreeItem | ||
isCached(id:String):Boolean
Checks if cached value is valid. | WeaveTreeItem | ||
isSimpleObject(object:*, singlePropertyName:String):Boolean
Checks if an object has a single specified property. | WeaveTreeItem | ||
| _cache | property |
protected var _cache:ObjectCached values that get invalidated when the source triggers callbacks.
| _children | property |
protected var _children:* = null| _counter | property |
protected var _counter:ObjectCached values of getCallbackCollection(source).triggerCounter.
| _dependency | property |
protected var _dependency:ILinkableObject = null| _label | property |
protected var _label:*| _recursion | property |
protected var _recursion:Object| cacheSettings | property |
public var cacheSettings:ObjectMaps a property name to a Boolean which enables or disables caching for that property.
| childItemClass | property |
protected var childItemClass:ClassSet this to change the constructor used for initializing child items. This variable is intentionally uninitialized to avoid overwriting the value set by an extending class in its constructor.
| children | property |
children:*Gets the Array of child menu items and modifies it in place if necessary to create nodes from descriptors or remove null items. If this tree item specifies a dependency, the Array can be filled asynchronously. This property is checked by Flex's default data descriptor.
public function get children():* public function set children(value:any):void| data | property |
public var data:Object = nullThis can be any data associated with this tree item. For example, it can be used to store state information if the tree is populated asynchronously.
| dependency | property |
dependency:ILinkableObjectA pointer to the ILinkableObject that created this node. This is used to determine when to invalidate cached values.
public function get dependency():ILinkableObject public function set dependency(value:ILinkableObject):void| label | property |
label:*
This can be set to either a String or a Function.
This property is checked by Flex's default data descriptor.
If this property is not set, the data property will be used as the label.
public function get label():* public function set label(value:any):void| WeaveTreeItem | () | Constructor |
public function WeaveTreeItem(params:Object = null)Constructs a new WeaveTreeItem.
Parametersparams:Object (default = null) — An Object containing property values to set on the WeaveTreeItem.
If params is a String, both label and data will be set to that String.
|
| _mapItem | () | method |
protected static function _mapItem(WeaveTreeItem_implementation:Class, item:Object):ObjectUsed for mapping an Array of params objects to an Array of WeaveTreeItem objects.
Parameters
WeaveTreeItem_implementation:Class — The implementation of WeaveTreeItem to use.
| |
item:Object — Item descriptors.
|
Object |
| cache | () | method |
protected function cache(id:String, newValue:*):*Retrieves or updates a cached value for a property. Does not cache the value if the source property is not set.
Parameters
id:String — A string identifying a property.
| |
newValue:* (default = NaN) — Optional new value to cache for the property.
|
* — The new or existing value for the property.
|
| createItems | () | method |
public static function createItems(WeaveTreeItem_implementation:Class, items:Array):ArrayInitializes an Array of WeaveTreeItems using an Array of objects to pass to the constructor. Any Arrays passed in will be flattened.
Parameters
WeaveTreeItem_implementation:Class — The implementation of WeaveTreeItem to use.
| |
items:Array — Item descriptors.
|
Array |
| evalFunction | () | method |
protected function evalFunction(func:Function):*First tries calling a function with no parameters. If an ArgumentError is thrown, the function will called again, passing this WeaveTreeItem as the first parameter.
Parameters
func:Function |
* |
| getBoolean | () | method |
protected function getBoolean(param:*, recursionName:String):*Computes a Boolean value from various structures
Parameters
param:* — Either a Boolean, and Object like {not: param}, a Function, an ILinkableVariable, or an Array of those objects.
| |
recursionName:String — A name used to keep track of recursion.
|
* — A Boolean value derived from the param, or the param itself if called recursively.
|
| getObject | () | method |
protected function getObject(param:*, recursionName:String):*Evaluates a function to get an Object or just returns the non-Function Object passed in.
Parameters
param:* — Either an Object or a Function.
| |
recursionName:String — A name used to keep track of recursion.
|
* — An Object derived from the param, or the param itself if called recursively.
|
| getString | () | method |
protected function getString(param:*, recursionName:String):*Gets a String value from a String or Function.
Parameters
param:* — Either a String or a Function.
| |
recursionName:String — A name used to keep track of recursion.
|
* — A String value derived from the param, or the param itself if called recursively.
|
| isCached | () | method |
protected function isCached(id:String):BooleanChecks if cached value is valid. Always returns false if the source property is not set.
Parameters
id:String — A string identifying a property.
|
Boolean — true if the property value has been cached.
|
| isSimpleObject | () | method |
protected function isSimpleObject(object:*, singlePropertyName:String):BooleanChecks if an object has a single specified property.
Parameters
object:* | |
singlePropertyName:String |
Boolean |