|
WT Toolkit 0.3.3 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
Object | +--wtObject
wtObject is the base class of most other classes in WT Toolkit. It simulates weak references and a proxy pattern
such that memory-expensive objects (e.g. DOM nodes) can be referenced from other objects via a very cheap object. This
helps mitigate the lapsed listener problem and avoids circular referencing memory leaks in Internet Explorer 6.
Defined in wt_core.js
| Constructor Summary | |
wtObject()
Constructs a wtObject |
|
| Method Summary | |
void
|
addDependency(<wtObject> obj)
Assigns a dependency relation to this object for garbage collection purpose. |
void
|
clearLapsedListeners()
Clears all lapsed event listeners attached to this object. |
void
|
connect(<String> connId, <String> signalName, <wtObject> target, <String> slotName)
Connects a signal to a slot. |
void
|
disconnect(<String> connId, <String> signalName)
Disconnects a signal from a slot. |
void
|
emit(<String> signalName, <Object> evt)
Emits a signal with an event argument. |
void
|
endProxy()
Disconnects the weak reference and removes the memory expensive object from the weak reference table. |
Object
|
get(<String> name)
Tells the value of an attribute under the weakly referenced image. |
void
|
removeSignal(<String> signalName)
Removes a named signl |
void
|
removeSlot(<String> slotName)
Removes a named slot |
void
|
set(<String> name, <Object> value)
Sets an attribute value under the weakly referenced image. |
void
|
setSignal(<String> signalName)
Creates a named signal |
void
|
setSlot(<String> slotName, <Function> func)
Assigned an event handler function to a named slot. |
void
|
startProxy(<String> obj, <String> id)
Establishes a weak reference link to a memory expensive object. |
String
|
toString()
Tells the string ID of the weak reference. |
| Constructor Detail |
wtObject()
| Method Detail |
void addDependency(<wtObject> obj)
obj - The wtObject this object is dependent upon. If obj is garbage collected then this object would be garbage collected as wel.
void clearLapsedListeners()
void connect(<String> connId, <String> signalName, <wtObject> target, <String> slotName)
connId - The signal-slot connection ID, this ID can be used later to disconnect a signal from a slot. Each signal-slot connection ID should be unique for the same signal source and signal name.
signalName - The signal name.
target - The target to deliever the event information to.
slotName - The slot name.
void disconnect(<String> connId, <String> signalName)
connId - The signal-slot connection ID
signalName - The signal name
void emit(<String> signalName, <Object> evt)
signalName - Signal name to be emitted.
evt - Event argument object.
void endProxy()
Object get(<String> name)
name - The attribute name
void removeSignal(<String> signalName)
signalName - The signal's name
void removeSlot(<String> slotName)
slotName - The slot's name
void set(<String> name, <Object> value)
name - The attribute name
value - The attribute value
void setSignal(<String> signalName)
signalName - The signal's name
void setSlot(<String> slotName, <Function> func)
slotName - The slot's name
func - The event handler function
void startProxy(<String> obj, <String> id)
obj - The memory expensive object.
id - (Optional) The ID of the weak reference. Leave this empty if you don't know what you're doing.
String toString()
|
WT Toolkit 0.3.3 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||