Class Index | File Index

Classes


Class wm.Component


Extends wm.Object.

Defined in: Component.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
Base class for all palette objects.
Property Summary
Property Attributes Property Name and Description
Note: to support bindings it is recommend that you use the getValue/setValue API to access or modify properties.
 
Name of this object.
 
Name of this object.
Method Summary
Method Attributes Method Name and Description
 
constructor(inProperties)
Component constructor optionally takes a set of properties to initialize on the new instance.
 
createComponent(inName, inType, inProps, inEvents, inChildren, inOwner)
Create a component as a child of this component.
 
Remove this component from the system and clean up all resources.
 
getId(inName)
Return a string that can identify a name as a child of this component in the namespace of the root object.
 
getRuntimeId(inName)
Return a string that can globally identify a name as a child of this component.
Methods borrowed from class wm.Object:
extendSchema, getPropertyType, getPropFlags, getValue, listDataProperties, listProperties, setValue, toString

Class Detail
wm.Component()
Base class for all palette objects.

Component:
  • can own components, and can itself be owned.
  • ensures all owned components have distinct names.
  • can be identified by a globally unique string id.
  • sends notification messages (via id) when it's values change
  • can read or write it's properties to a stream
Report errata or suggestions for Component.
Property Detail
Note: to support bindings it is recommend that you use the getValue/setValue API to access or modify properties.
{String} name
Name of this object. Must be unique to it's owner.
Example:
this.label1.setValue("name", "titleLabel");
Report errata or suggestions for name.

{String} owner
Name of this object. Must be unique to it's owner.
Example:
newButton.setValue("owner", this);
Report errata or suggestions for owner.
Method Detail
constructor(inProperties)
Component constructor optionally takes a set of properties to initialize on the new instance.
Parameters:
{Object} inProperties
Properties to initialize on the new instance. May be ommitted.
Example:
		var foo = new wm.Component({name: "foo"});
Report errata or suggestions for constructor.

createComponent(inName, inType, inProps, inEvents, inChildren, inOwner)
Create a component as a child of this component.
Parameters:
inName
{String} Name of the new component (may be altered to ensure uniqueness).
inType
{String} Type of component to create (note, a string, not a constructor).
inProps
{Object} Hash of properties to pass to the new components constructor.
inEvents
{Object} Name/value pairs that match events in the new component to functions in the owner.
inChildren
{Object} Name/value pairs that describe child components to create on this object.
inOwner
{Object} Optional. Override automatic value for "owner".
Example:
this.panel1.createComponent("custom", "wm.Panel", { 
	// properties
	height: "3em",
}, {
	// events
	onclick: "click" // connect onclick event to owner's "click" function
}, {
	// children
	// name: [ "[type]", { [properties] }, { [events] }, { [children] } ]
	spacer1: [ "wm.Spacer", { width: "300px" } ],
	content: [ "wm.Label", { width: "1flex" } ],
	spacer2: [ "wm.Spacer", { width: "300px" } ]
});
Report errata or suggestions for createComponent.

destroy()
Remove this component from the system and clean up all resources.
Report errata or suggestions for destroy.

{String} getId(inName)
Return a string that can identify a name as a child of this component in the namespace of the root object.
Parameters:
{String} inName
The name to qualify.
Returns:
{String} The qualified id string.
See:
getRoot
Report errata or suggestions for getId.

{String} getRuntimeId(inName)
Return a string that can globally identify a name as a child of this component.
Parameters:
{String} inName
The name to qualify.
Returns:
{String} The qualified id string.
Report errata or suggestions for getRuntimeId.

Documentation generated by JsDoc Toolkit 2.0.1 on Wed Jun 03 2009 13:28:38 GMT-0700 (PDT)