com.ibm.mashups.enabler
Interface Locator
public Locator
This interface defines search methods that allow locating resources in a model. A resource is identified by its ID (mandatory). This interface is the base for all locators; other locators allow a more specific search in the context they are offered in, e.g. a search for a node with certain properties in a model.
A Locator
is usually obtained using the getLocator()
method .
var treeModel model = ...; var locator = model.getLocator(); var node = locator.find(...);
This locator returns anObject
which is part of some model. What exact kind of object is returned depends on the locator. Please refer to individual JavaScriptDoc for the locator used. The result object can be expected to be an element of the model the locator is used on unless specified otherwise.
find
Deferred find(Identifiable id)
-
Returns an element of a model with the given ID.
- Parameters:
id
-
identifiable or string id of the object to find; must not be null
.
- Returns:
-
a deferred object used to start this operation. The return value when executed through the deferred object is the element with the given ID or
null
if the element cannot be found.
Copyright IBM Corp. 2010 All Rights Reserved.