Packageweavejs.util
Classpublic class WeaveMenuItem
InheritanceWeaveMenuItem Inheritance WeaveTreeItem Inheritance Object

Dynamic menu item for use with Flex Menus. Flex's DefaultDataDescriptor checks the following properties: label, children, enabled, toggled, type, groupName



Public Properties
 PropertyDefined By
 InheritedcacheSettings : Object
Maps a property name to a Boolean which enables or disables caching for that property.
WeaveTreeItem
  children : *
[override] Gets a filtered copy of the child menu items.
WeaveMenuItem
  click : * = null
This can be either a Function or an ILinkableVariable to be treated as a boolean setting.
WeaveMenuItem
 Inheriteddata : Object = null
This can be any data associated with this tree item.
WeaveTreeItem
 Inheriteddependency : ILinkableObject
A pointer to the ILinkableObject that created this node.
WeaveTreeItem
  enabled : *
This can be set to either a Boolean, a Function, or an ILinkableVariable.
WeaveMenuItem
  groupName : String = null
This property is checked by Flex's default data descriptor.
WeaveMenuItem
  label : *
[override]
WeaveMenuItem
  shown : *
Specifies whether or not this item should be shown.
WeaveMenuItem
  toggled : *
This property is checked by Flex's default data descriptor.
WeaveMenuItem
  type : String = null
This property is checked by Flex's default data descriptor.
WeaveMenuItem
Protected Properties
 PropertyDefined By
 Inherited_cache : Object
Cached values that get invalidated when the source triggers callbacks.
WeaveTreeItem
 InheritedchildItemClass : Class
Set this to change the constructor used for initializing child items.
WeaveTreeItem
 Inherited_children : * = null
WeaveTreeItem
 Inherited_counter : Object
Cached values of getCallbackCollection(source).triggerCounter.
WeaveTreeItem
 Inherited_dependency : ILinkableObject = null
WeaveTreeItem
 Inherited_label : *
WeaveTreeItem
 Inherited_recursion : Object
WeaveTreeItem
Public Methods
 MethodDefined By
  
WeaveMenuItem(params:Object)
Constructs a new WeaveMenuItem.
WeaveMenuItem
 Inherited
createItems(WeaveTreeItem_implementation:Class, items:Array):Array
[static] Initializes an Array of WeaveTreeItems using an Array of objects to pass to the constructor.
WeaveTreeItem
  
createMenuItems(items:Array):Array
[static] Initializes an Array of WeaveMenuItems using an Array of objects to pass to the constructor.
WeaveMenuItem
  
If the click property is set to a Function, it will be called like click.call(this) or click.call(this, this) if the former produces an ArgumentError.
WeaveMenuItem
Protected Methods
 MethodDefined By
 Inherited
_mapItem(WeaveTreeItem_implementation:Class, item:Object):Object
[static] Used for mapping an Array of params objects to an Array of WeaveTreeItem objects.
WeaveTreeItem
 Inherited
cache(id:String, newValue:*):*
Retrieves or updates a cached value for a property.
WeaveTreeItem
 Inherited
evalFunction(func:Function):*
First tries calling a function with no parameters.
WeaveTreeItem
 Inherited
getBoolean(param:*, recursionName:String):*
Computes a Boolean value from various structures
WeaveTreeItem
 Inherited
getObject(param:*, recursionName:String):*
Evaluates a function to get an Object or just returns the non-Function Object passed in.
WeaveTreeItem
 Inherited
getString(param:*, recursionName:String):*
Gets a String value from a String or Function.
WeaveTreeItem
 Inherited
isCached(id:String):Boolean
Checks if cached value is valid.
WeaveTreeItem
 Inherited
isSimpleObject(object:*, singlePropertyName:String):Boolean
Checks if an object has a single specified property.
WeaveTreeItem
Public Constants
 ConstantDefined By
  TYPE_CHECK : String = check
[static]
WeaveMenuItem
  TYPE_RADIO : String = radio
[static]
WeaveMenuItem
  TYPE_SEPARATOR : String = separator
[static]
WeaveMenuItem
Property Detail
childrenproperty
children:*[override]

Gets a filtered copy of the child menu items. When this property is accessed, refresh() will be called except if refresh() is already being called. This property is checked by Flex's default data descriptor.


Implementation
    public function get children():*
    public function set children(value:any):void
clickproperty 
public var click:* = null

This can be either a Function or an ILinkableVariable to be treated as a boolean setting. The Function signature can be like function():void or function(item:WeaveMenuItem):void. Instead of reading this property directly, call runClickFunction().

See also

enabledproperty 
enabled:*

This can be set to either a Boolean, a Function, or an ILinkableVariable. This property is checked by Flex's default data descriptor.


Implementation
    public function get enabled():*
    public function set enabled(value:any):void
groupNameproperty 
public var groupName:String = null

This property is checked by Flex's default data descriptor.

labelproperty 
label:*[override]


Implementation
    public function get label():*
    public function set label(value:any):void
shownproperty 
shown:*

Specifies whether or not this item should be shown. This can be set to either a Boolean, a Function, an ILinkableVariable, or an Array of ILinkableVariables.


Implementation
    public function get shown():*
    public function set shown(value:any):void
toggledproperty 
toggled:*

This property is checked by Flex's default data descriptor.


Implementation
    public function get toggled():*
    public function set toggled(value:any):void
typeproperty 
public var type:String = null

This property is checked by Flex's default data descriptor.

Constructor Detail
WeaveMenuItem()Constructor
public function WeaveMenuItem(params:Object)

Constructs a new WeaveMenuItem.

Parameters
params:Object — An Object containing property values to set on the WeaveMenuItem. If this is a String equal to "separator" (TYPE_SEPARATOR), a new separator will be created.
Method Detail
createMenuItems()method
public static function createMenuItems(items:Array):Array

Initializes an Array of WeaveMenuItems using an Array of objects to pass to the constructor. Any Arrays passed in will be flattened and surrounded by separators.

Parameters

items:Array — An Array of item descriptors.

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

If the click property is set to a Function, it will be called like click.call(this) or click.call(this, this) if the former produces an ArgumentError. If the click property is set to an ILinkableVariable, it will be toggled as a boolean.

Constant Detail
TYPE_CHECKConstant
public static const TYPE_CHECK:String = check

TYPE_RADIOConstant 
public static const TYPE_RADIO:String = radio

TYPE_SEPARATORConstant 
public static const TYPE_SEPARATOR:String = separator