Package | com.yworks.graph.model |
Class | public class DefaultItemLookup |
Inheritance | DefaultItemLookup Object |
Implements | ILookup, IContextLookup, IContextLookupChainLink |
Subclasses | DefaultBendLookup, DefaultColumnLookup, DefaultEdgeLookup, DefaultLabelLookup, DefaultNodeLookup, DefaultPortLookup, DefaultRowLookup, DefaultStripeLookup |
ILookup
implementation
that also implements IContextLookupChainLink
and
IContextLookup
.
Subclass implementers should override itemLookup()
only.
Property | Defined By | ||
---|---|---|---|
item : IModelItem [read-only]
Gets the context item. | DefaultItemLookup |
Method | Defined By | ||
---|---|---|---|
DefaultItemLookup(item:IModelItem = null)
Creates an instance using the given context item. | DefaultItemLookup | ||
lookup(type:Class):Object
Returns an instance that implements the given type or null. | DefaultItemLookup | ||
lookupForItem(item:Object, type:Class):Object
Tries to create or retrieve an implementation of the given type
for a given item. | DefaultItemLookup | ||
setItem(item:IModelItem):void
Sets the context item. | DefaultItemLookup | ||
setNext(next:IContextLookup):void
This method is called by the framework to register the fallback lookup implementation
that should be used during a call to IContextLookup.lookup(). | DefaultItemLookup |
Method | Defined By | ||
---|---|---|---|
Subclasses need to override this method. | DefaultItemLookup |
item | property |
item:IModelItem
[read-only] Gets the context item.
protected function get item():IModelItem
DefaultItemLookup | () | Constructor |
public function DefaultItemLookup(item:IModelItem = null)
Creates an instance using the given context item.
Parametersitem:IModelItem (default = null )
|
itemLookup | () | method |
protected function itemLookup(item:IModelItem, type:Class, nextLookup:ILookup, lastLookup:ILookup):Object
Subclasses need to override this method.
Parameters
item:IModelItem — The context item to lookup an implementation for.
| |
type:Class — The type of the implementation to find.
| |
nextLookup:ILookup — The lookup to use for another type.
| |
lastLookup:ILookup — The lookup to use as a fallback for the type.
|
Object — An implementation of type or null .
|
lookup | () | method |
public function lookup(type:Class):Object
Returns an instance that implements the given type or null
.
This implementation delegates to itemLookup()
, unless
the context item
is null
in which case it will return null
.
Parameters
type:Class |
Object |
lookupForItem | () | method |
public function lookupForItem(item:Object, type:Class):Object
Tries to create or retrieve an implementation of the given type for a given item.
Parameters
item:Object — the item to lookup a type for
| |
type:Class — the type to look up
|
Object — an implementation or null
|
setItem | () | method |
setNext | () | method |
public function setNext(next:IContextLookup):void
This method is called by the framework to register the fallback lookup implementation
that should be used during a call to IContextLookup.lookup()
.
If the implementation cannot satisfy the query, it will use the provided context as a fallback. Note that implementations can also use the results returned by the next lookup and decorate it appropriately.
Parameters
next:IContextLookup — The context to use as a fallback.
|