class NodeBase view source

Memory implementation of an AUI Node. Reflects the state of the AUI node in the DVM.

Constructor

new NodeBase(parent : NodeBase, tag : string|nodeInfo, id : number|VMApplication, attributes : Object, app : VMApplication)

Parameters

parent NodeBase parent node
tag string|nodeInfo tag name (WINDOW, GROUP, MENU, etc...) or an object containing type, id, attributes
id number|VMApplication id
attributes Object attributes list
app VMApplication application
Instance members

attribute(attributeName : string) : (any)

get attribute value

Parameters

attributeName string attribute name

Returns

(any) attribute value

emit(type : string, arguments… : any)
[inherits from EventListener]

Emit an event

Parameters

type string event type to emit
arguments any arguments (excluding type) will be set in event.data

getApplication() : (VMApplication)

get owning application

Returns

(VMApplication) owning application

getChildren(tag : string) : (Array)

get children (direct only)

Parameters

tag string if provided, returns only child nodes of the given type.

Returns

(Array) list of matching children

getParentNode() : (NodeBase)

get parent node

Returns

(NodeBase) the parent node

getWidget() : (WidgetBase)

Gets the node's widget

Returns

(WidgetBase) the node's widget

isDestroyed() : (boolean)
[inherits from EventListener]

Returns if the node is destroyed

Returns

(boolean) true if node is destroyed

onAttributeChanged(attributeName : string, handler : function) : (HandleRegistration)

attach hook when attribute changes

Parameters

attributeName string attribute name
handler function the hook

Returns

(HandleRegistration) the handler to release the hook

when(type : string, handler : Hook, once : boolean) : (HandleRegistration)
[inherits from EventListener]

Registers a handler for this event type

Parameters

type string event type (e.g. "attribute changed")
handler Hook handler to trigger when the event type is emitted
once boolean if true, will only fire once

Returns

(HandleRegistration) a registration handle (for unbind purpose)