((Apenas para componentes do Flex Data Visualization))
Pacotemx.collections
Classepublic class HierarchicalCollectionView
HerançaHierarchicalCollectionView Inheritance EventDispatcher Inheritance Object
Implementa IHierarchicalCollectionView, IXMLNotifiable

The HierarchicalCollectionView class provides a hierarchical view of a standard collection.

Sintaxe em MXMLexpandedHide MXML Syntax
The <mx.HierarchicalCollectionView> inherits all the tag attributes of its superclass, and defines the following tag attributes:

  <mx:HierarchicalCollectionView
  Properties 
    showRoot="true|false"
    source="No default"
  />
  


Propriedades Públicas
 PropriedadeDefinido por
 Inheritedconstructor : Object
A reference to the class object or constructor function for a given object instance.
Object
  hasRoot : Boolean
[read-only] A flag that, if true, indicates that the current data provider has a root node; for exemplo, a single top-level node in a hierarchical structure.
HierarchicalCollectionView
  length : int
[read-only] The length of the currently parsed collection.
HierarchicalCollectionView
  openNodes : Object
An Array of Objects containing the data provider element for all the open branch nodes of the data.
HierarchicalCollectionView
 Inheritedprototype : Object
[static] A reference to the prototype object of a class or function object.
Object
  showRoot : Boolean
A Boolean flag that specifies whether to display the data provider's root node.
HierarchicalCollectionView
  source : IHierarchicalData
The source data of the IHierarchicalCollectionView.
HierarchicalCollectionView
Métodos Públicos
 MétodoDefinido por
  
HierarchicalCollectionView(hierarchicalData:IHierarchicalData = null, argOpenNodes:Object = null)
Constructor.
HierarchicalCollectionView
  
addChild(parent:Object, newChild:Object):Boolean
Adds a child node to a node of the data.
HierarchicalCollectionView
  
addChildAt(parent:Object, newChild:Object, index:int):Boolean
Add a child node to a node at the specified index.
HierarchicalCollectionView
 Inherited
addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
Registers an event listener object with an EventDispatcher object so that the listener receives notification of an event.
EventDispatcher
  
Closes a node to hide its children.
HierarchicalCollectionView
  
Checks the collection for the data item using standard equality test.
HierarchicalCollectionView
  
Returns a new instance of a view iterator over the items in this view.
HierarchicalCollectionView
 Inherited
Dispatches an event into the event flow.
EventDispatcher
  
Returns the depth of the node in the collection.
HierarchicalCollectionView
  
Returns the parent of a node.
HierarchicalCollectionView
 Inherited
Checks whether the EventDispatcher object has any listeners registered for a specific type of event.
EventDispatcher
 Inherited
Indicates whether an object has a specified property defined.
Object
 Inherited
Indicates whether an instance of the Object class is in the prototype chain of the object specified as the parameter.
Object
  
Opens a node to display its children.
HierarchicalCollectionView
 Inherited
Indicates whether the specified property exists and is enumerable.
Object
  
removeChild(parent:Object, child:Object):Boolean
Removes the child node from the parent node.
HierarchicalCollectionView
  
removeChildAt(parent:Object, index:int):Boolean
Removes the child node from a node at the specified index.
HierarchicalCollectionView
 Inherited
removeEventListener(type:String, listener:Function, useCapture:Boolean = false):void
Removes a listener from the EventDispatcher object.
EventDispatcher
 Inherited
Sets the availability of a dynamic property for loop operations.
Object
 Inherited
Returns the string representation of the specified object.
Object
 Inherited
Returns the primitive value of the specified object.
Object
 Inherited
Checks whether an event listener is registered with this EventDispatcher object or any of its ancestors for the specified event type.
EventDispatcher
  
xmlNotification(currentTarget:Object, type:String, target:Object, value:Object, detail:Object):void
Called whenever an XML object contained in our list is updated in some way.
HierarchicalCollectionView
Eventos
 Evento Descrição Definido por
 Inherited Dispatched when Flash Player or the and AIR application gains operating system focus and becomes active.EventDispatcher
 Inherited Dispatched when Flash Player loses operating system focus and is becoming inactive.EventDispatcher
Detalhes da propriedade
hasRootpropriedade
hasRoot:Boolean  [read-only]

A flag that, if true, indicates that the current data provider has a root node; for exemplo, a single top-level node in a hierarchical structure. XML and Object are examples of data types that have a root node, while Lists and Arrays do not.


Implementação
    public function get hasRoot():Boolean
lengthpropriedade 
length:int  [read-only]

The length of the currently parsed collection.


Implementação
    public function get length():int
openNodespropriedade 
openNodes:Object  [read-write]

An Array of Objects containing the data provider element for all the open branch nodes of the data.


Implementação
    public function get openNodes():Object
    public function set openNodes(value:Object):void
showRootpropriedade 
showRoot:Boolean  [read-write]

A Boolean flag that specifies whether to display the data provider's root node. If the source data has a root node, and this property is set to false, the collection will not include the root item. Only the descendants of the root item will be included in the collection.

This property has no effect on a source with no root node, such as List and Array objects.

The default value is true.

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


Implementação
    public function get showRoot():Boolean
    public function set showRoot(value:Boolean):void
sourcepropriedade 
source:IHierarchicalData  [read-write]

The source data of the IHierarchicalCollectionView.


Implementação
    public function get source():IHierarchicalData
    public function set source(value:IHierarchicalData):void
Detalhes do construtor
HierarchicalCollectionView()Construtor
public function HierarchicalCollectionView(hierarchicalData:IHierarchicalData = null, argOpenNodes:Object = null)

Constructor.

Parâmetros
hierarchicalData:IHierarchicalData (default = null) — The data structure containing the hierarchical data.
 
argOpenNodes:Object (default = null) — The Object that defines a node to appear as open.
Detalhes do método
addChild()método
public function addChild(parent:Object, newChild:Object):Boolean

Adds a child node to a node of the data.

Parâmetros

parent:Object — The Object that defines the parent node.
 
newChild:Object — The Object that defines the new node.

Retorna
Booleantrue if the node is added successfully.
addChildAt()método 
public function addChildAt(parent:Object, newChild:Object, index:int):Boolean

Add a child node to a node at the specified index. This implementation does the following:

Parâmetros

parent:Object — The Object that defines the parent node.
 
newChild:Object — The Object that defines the child node.
 
index:int — The 0-based index of where to insert the child node.

Retorna
Booleantrue if the child is added successfully.
closeNode()método 
public function closeNode(node:Object):void

Closes a node to hide its children.

Parâmetros

node:Object — The Object that defines the node.

contains()método 
public function contains(item:Object):Boolean

Checks the collection for the data item using standard equality test.

Parâmetros

item:Object — The Object that defines the node to look for.

Retorna
Booleantrue if the data item is in the collection, and false if not.
createCursor()método 
public function createCursor():IViewCursor

Returns a new instance of a view iterator over the items in this view.

Retorna
IViewCursor — IViewCursor instance.

Veja também

mx.utils.IViewCursor
getNodeDepth()método 
public function getNodeDepth(node:Object):int

Returns the depth of the node in the collection.

Parâmetros

node:Object — The Object that defines the node.

Retorna
int — The depth of the node.
getParentItem()método 
public function getParentItem(node:Object):*

Returns the parent of a node. The parent of a top-level node is null.

Parâmetros

node:Object — The Object that defines the node.

Retorna
* — The parent node containing the node, null for a top-level node, and undefined if the parent cannot be determined.
openNode()método 
public function openNode(node:Object):void

Opens a node to display its children.

Parâmetros

node:Object — The Object that defines the node.

removeChild()método 
public function removeChild(parent:Object, child:Object):Boolean

Removes the child node from the parent node.

Parâmetros

parent:Object — The Object that defines the parent node, and null for top-level nodes.
 
child:Object — The Object that defines the child node to be removed.

Retorna
Booleantrue if the node is removed successfully.
removeChildAt()método 
public function removeChildAt(parent:Object, index:int):Boolean

Removes the child node from a node at the specified index.

Parâmetros

parent:Object — The Object that defines the parent node.
 
index:int — The 0-based index of the child node to remove relative to the parent.

Retorna
Booleantrue if the child is removed successfully.
xmlNotification()método 
public function xmlNotification(currentTarget:Object, type:String, target:Object, value:Object, detail:Object):void

Called whenever an XML object contained in our list is updated in some way. The initial implementation stab is very lenient, any changeType will cause an update no matter how much further down in a hierarchy.

Parâmetros

currentTarget:Object
 
type:String
 
target:Object
 
value:Object
 
detail:Object