An interface for instances that can be used to chain lookup operations.
Remarks
Type Details
- yfiles module
- view-component
- yfiles-umd modules
- All view modules
- Legacy UMD name
- yfiles.graph.IContextLookupChainLink
See Also
Methods
Tries to create or retrieve an implementation of the given type for a given item.
Parameters
A map of options to pass to the method.
Returns
- ↪Object
- an implementation or
null
See Also
Defined in
This method is called by the framework to register the fallback lookup implementation that should be used during a call to contextLookup.
Remarks
Parameters
A map of options to pass to the method.
- next - IContextLookup
- The context to use as a fallback.
Static Methods
Factory method for a lookup chain element that simply adds an entry to a lookup chain.
Parameters
A map of options to pass to the method.
- type - Class
- The type to add to the lookup.
- instance - Object
- The instance to return if the
type
is being looked up.
Returns
- ↪IContextLookupChainLink
- An instance that can be used in a lookup chain.
See Also
Factory method for a lookup chain element that adds an dynamic instance to a lookup chain.
Remarks
instance
is of the queried type and will then return the instance.Parameters
A map of options to pass to the method.
- instance - Object
- The instance to query the type from dynamically.
Returns
- ↪IContextLookupChainLink
- An instance that can be used in a lookup chain.
See Also
Factory method for a lookup chain element that adds an ILookup layer to a lookup chain.
Remarks
null
, the call will be propagated to the chain.Parameters
A map of options to pass to the method.
- lookup - ILookup
- The lookup to use.
Returns
- ↪IContextLookupChainLink
- An instance that can be used in a lookup chain.
See Also
Creates a lookup chain link that is backed by the given callback
.
Remarks
callback
returns null
the request is passed to the chain.Parameters
A map of options to pass to the method.
- callback - function(Object, Class):Object
- The callback to invoke.
Signature Details
function(subject: any, type: Class) : Object
Callback delegate that can be used to query results of a virtual lookup call on objects that don't necessarily implementILookup
.Parameters
- subject - any
- the subject for which a lookup shall be made
- type - Class
- the type to look up
Returns
- Object
- an instance that can be assigned to type or
null
Returns
- ↪IContextLookupChainLink
- The implementation of the link that uses the
callback
.
See Also
factoryLookupChainLink
<TContext,TResult>(contextType: Class, resultType: Class, factory: function(TContext):TResult) : IContextLookupChainLinkFactory method for a lookup chain element that uses a function of type function(
TContext
)
to yield a TResult
for a specific TContext
.
Remarks
TResult
and the context is of type TContext
, the factory
method will be queried and the result will be returned. Otherwise the next chain link will be delegated the request to.Type Parameters
- TContext
- TResult
Parameters
A map of options to pass to the method.
- contextType - Class
- resultType - Class
- factory - function(TContext):TResult
- The factory delegate to use that yields the result for a given context.
Signature Details
function(item: TContext) : TResult
A function which provides a custom into a custom implementation ofTInterface
for the givenitem
.Parameters
- item - TContext
- The item to return the implementation for.
Returns
- TResult
- The new implementation.
Returns
- ↪IContextLookupChainLink
- An instance that can be used in a lookup chain.
See Also
Factory method for a lookup chain element that removes the entry from the lookup chain for a given type.
Parameters
A map of options to pass to the method.
- type - Class
- The type to hide from the lookup.
Returns
- ↪IContextLookupChainLink
- An instance that can be used in a lookup chain.