Package | twaver |
Interface | public interface IData extends flash.events.IEventDispatcher, IClient |
Implementors | Data |
This data class defines simple properties for all data used
int TWaver Flex. Data ID, name, icon, tooltip, parent/children,
and more. Data can be XML serialized or unserialized. Data extends
from IEventDispatcher
so it able to dispatch events
when property changed.
Property | Defined By | ||
---|---|---|---|
children : ICollection [read-only]
Get all children data as a collection. | IData | ||
childrenCount : int [read-only]
Get total children count. | IData | ||
![]() | clientProperties : ICollection [read-only]
Get a ICollection that contians all client proerty name. | IClient | |
hasChildren : Boolean [read-only]
Check whether this data has children data. | IData | ||
icon : String
The small icon of this data. | IData | ||
id : Object [read-only]
The ID of this data. | IData | ||
name : String
Get the name of this data. | IData | ||
parent : IData
Get parent data. | IData | ||
toolTip : String
Get tooltip of this data. | IData |
Method | Defined By | ||
---|---|---|---|
Add the specified data as a child of current data at the specified
children index location. | IData | ||
addPropertyChangeListener(listener:Function, priority:int = 0, useWeakReference:Boolean = false):void
Add a property change listener on this data so it can be
notified on any property changed. | IData | ||
clearChildren():Boolean
Clear all children objects from this data. | IData | ||
deserializeXML(serializer:XMLSerializer, dataXML:XML):void
Deserialize data from specified XML data. | IData | ||
dispatchPropertyChangeEvent(property:String, oldValue:Object, newValue:Object):Boolean
Dispatch property change event. | IData | ||
getChildAt(index:int):IData
Get child data from specified children location. | IData | ||
![]() | getClient(clientProp:String):*
Get the specified client property. | IClient | |
getPropertyValue(property:String):Object
Get an user defined property on this data. | IData | ||
hasOwnProperty(name:String):Boolean
Whether current data has created specified property. | IData | ||
isDescendantOf(data:IData):Boolean
Check whether this data is a descendant of the specified data. | IData | ||
isParentOf(data:IData):Boolean
Check whether this data is the parent of specified data. | IData | ||
isRelatedTo(data:IData):Boolean
Check whether this data and the specified data has any relationship
of descendant. | IData | ||
removeChild(child:IData):Boolean
Remove the specified child data from children of current data. | IData | ||
removePropertyChangeListener(listener:Function):void
Remove the specified property change listener from this data. | IData | ||
Serialize this data into XML. | IData | ||
![]() |
Set a client property by specified property name and property value. | IClient | |
setPropertyValue(property:String, value:Object):void
Set an user defined property on this data. | IData | ||
toChildren(matchFunction:Function = null):ICollection
Return all children as a collection filtered by the specified function. | IData | ||
toString():String | IData |
children | property |
children:ICollection
[read-only] Get all children data as a collection.
public function get children():ICollection
childrenCount | property |
childrenCount:int
[read-only] Get total children count.
public function get childrenCount():int
hasChildren | property |
hasChildren:Boolean
[read-only] Check whether this data has children data.
public function get hasChildren():Boolean
icon | property |
icon:String
The small icon of this data. It will be displayed on tree, table or other views. Data like node, group, subnetwork will displays image on network view, not icon.
public function get icon():String
public function set icon(value:String):void
id | property |
id:Object
[read-only] The ID of this data. This is an unique ID value can not duplicatable for one data box.
public function get id():Object
name | property |
name:String
Get the name of this data. Name is just a simple string value represents the name of this data. It can by any value, can be duplicatable, can be changed anytime. Name will be displayed on network by a label.
public function get name():String
public function set name(value:String):void
parent | property |
parent:IData
Get parent data.
public function get parent():IData
public function set parent(value:IData):void
toolTip | property |
toolTip:String
Get tooltip of this data. Tooltip text is the text message displayed on all views when mouse cursor move over the data and stop for a short time.
public function get toolTip():String
public function set toolTip(value:String):void
addChild | () | method |
public function addChild(child:IData, index:int = 0):Boolean
Add the specified data as a child of current data at the specified children index location.
Parameters
child:IData — the child data to be added.
| |
index:int (default = 0 ) — the children index location of this new child data to
be added.
|
Boolean — true if added successfully, false otherwise.
|
addPropertyChangeListener | () | method |
public function addPropertyChangeListener(listener:Function, priority:int = 0, useWeakReference:Boolean = false):void
Add a property change listener on this data so it can be notified on any property changed.
Parameters
listener:Function — the property change listener to be added
| |
priority:int (default = 0 ) — listening priority
| |
useWeakReference:Boolean (default = false ) — whether use weak reference
|
clearChildren | () | method |
public function clearChildren():Boolean
Clear all children objects from this data. All children data will be removed from current data children collection, but will not removed from the data box/element box.
ReturnsBoolean — true if cleared successfully, false otherwise.
|
deserializeXML | () | method |
public function deserializeXML(serializer:XMLSerializer, dataXML:XML):void
Deserialize data from specified XML data.
Parameters
serializer:XMLSerializer — the XML serializer
| |
dataXML:XML — the XML data contains TWaver data.
|
dispatchPropertyChangeEvent | () | method |
public function dispatchPropertyChangeEvent(property:String, oldValue:Object, newValue:Object):Boolean
Dispatch property change event.
Parameters
property:String — property name has changed.
| |
oldValue:Object — old value before the change.
| |
newValue:Object — new value after the change.
|
Boolean — true if dispatch successfully, false otherwise.
|
getChildAt | () | method |
public function getChildAt(index:int):IData
Get child data from specified children location.
Parameters
index:int — the location that child located.
|
IData — the child data at the specified location.
|
getPropertyValue | () | method |
public function getPropertyValue(property:String):Object
Get an user defined property on this data.
Parameters
property:String — the property name need to get.
|
Object — property value of specified property.
|
hasOwnProperty | () | method |
public function hasOwnProperty(name:String):Boolean
Whether current data has created specified property.
Parameters
name:String — the property name to be checked.
|
Boolean — true if this property has been created on this data,
false otherwise.
|
isDescendantOf | () | method |
public function isDescendantOf(data:IData):Boolean
Check whether this data is a descendant of the specified data.
Parameters
data:IData — the data to be checked.
|
Boolean — true if this data is a descendant of the specified data,
false otherwise.
|
isParentOf | () | method |
public function isParentOf(data:IData):Boolean
Check whether this data is the parent of specified data.
Parameters
data:IData — the data to be checked.
|
Boolean — true if this data is parent of the specified data,
false otherwise.
|
isRelatedTo | () | method |
public function isRelatedTo(data:IData):Boolean
Check whether this data and the specified data has any relationship of descendant.
Parameters
data:IData — the data to be checked.
|
Boolean — true if has relationship of descendant, false otherwise.
|
removeChild | () | method |
public function removeChild(child:IData):Boolean
Remove the specified child data from children of current data.
Parameters
child:IData — the child data to be removed.
|
Boolean — true if removed successfully, false otherwise.
|
removePropertyChangeListener | () | method |
public function removePropertyChangeListener(listener:Function):void
Remove the specified property change listener from this data.
Parameters
listener:Function — the listener to be removed.
|
serializeXML | () | method |
public function serializeXML(serializer:XMLSerializer, newInstance:IData):void
Serialize this data into XML.
Parameters
serializer:XMLSerializer — the XML serializer.
| |
newInstance:IData — a new instance that will be used for property value comparision
during the XML serialization.
|
setPropertyValue | () | method |
public function setPropertyValue(property:String, value:Object):void
Set an user defined property on this data. If property not exist, then create; otherwise, replace it.
Parameters
property:String — the property name to be set.
| |
value:Object — the value of this property.
|
toChildren | () | method |
public function toChildren(matchFunction:Function = null):ICollection
Return all children as a collection filtered by the specified function.
Parameters
matchFunction:Function (default = null ) — the filter function decides which child
should be in the returned collection.
|
ICollection — the collection contains all children data that matchs the filter.
|
toString | () | method |
public function toString():String
Returns
String |