This section covers the operation of the CNF in detail.
Selecting the content provider is done by finding one or more
NCEs associated with an object. The CNF is registered as a content
provider a viewer and thus gets called at the content provider APIs in
response to actions by the user on the viewer. In general, if the user
is navigating by expanding in the viewer, the getElements()
or getChildren()
methods are called. However if the user
has selected some object (like in an editor) and wishes to show it in
the viewer, the getParent()
method is used because the
viewer needs to be able to figure out the part of the tree between the
object and the content currently visible in the viewer.
When selecting an NCE in reaction to the getElements()
or getChildren()
call on the viewer, the triggerPoints
(or enablement if specified) expression is evaluated against the
object. The content provider associated with that NCE is invoked. If
there are multiple content providers enabled by their triggerPoints
(or enablement) expressions, they are all invoked in order
according to priority and their results are concatenated.
When selecting an NCE in reaction to the getParent()
call on the viewer, the possibleChildren (or enablement if
specified) expression is evaluated against the object. The content
provider associated with that NCE is invoked. If there are multiple
content providers enabled by their possibleChildren (or enablement)
expressions, the content providers are invoked in priority order. The
first non-null parent returned by the content provider is used.
The overrides element allows an NCE to be overridden by another. In this case the content provider associated with the suppressed NCE will not be invoked to contribute.
During the initialization of the viewer, the it gets the initial
input by invocation of the CommonNavigator.getInitialInput()
.
The default implementation of this method is to return the input of the
current page. Thus, the initial input becomes the first object that is
evaluated for the selection of NCEs.