Packagecom.yworks.support
Classpublic class CallbackLookup
InheritanceCallbackLookup Inheritance Object
Implements ILookup

Utility class that implements the ILookup interface by delegating to a callback function.

To serve as a lookup callback, the function has to take a subject and type parameter, and return an Object (or null):

	 function lookupCallback( subject:Object, type:Class ):Object {
	 
	   // ..
	 
	 }
	 



Public Properties
 PropertyDefined By
  handler : Function
Gets or sets the actual callback implementation.
CallbackLookup
  subject : Object
Gets or sets the subject to use for calls to the lookup callback.
CallbackLookup
Public Methods
 MethodDefined By
  
CallbackLookup(callback:Function, subject:Object = null)
Creates this instance using the specified callback and subject.
CallbackLookup
  
lookup(type:Class):Object
Performs the actual lookup operation.
CallbackLookup
Property Detail
handlerproperty
handler:Function

Gets or sets the actual callback implementation.


Implementation
    public function get handler():Function
    public function set handler(value:Function):void
subjectproperty 
subject:Object

Gets or sets the subject to use for calls to the lookup callback.


Implementation
    public function get subject():Object
    public function set subject(value:Object):void
Constructor Detail
CallbackLookup()Constructor
public function CallbackLookup(callback:Function, subject:Object = null)

Creates this instance using the specified callback and subject.

Parameters
callback:Function — The callback to use for lookup calls.
 
subject:Object (default = null) — The subject to use for calls to the lookup callback. May be null.
Method Detail
lookup()method
public function lookup(type:Class):Object

Performs the actual lookup operation.

If a handler is specified, that handler is used to perform the query.

Parameters

type:Class — The type to query

Returns
Object — The result of the query or null if the handler is null.