|
Oracle UIX API Reference Release 2.1.22.0.0 B12196-01 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--oracle.cabo.ui.path.DeltaTree
DeltaTree supports layering differences on top of a UINode tree. Because it does not modify the original tree, modifications can be made to a tree that is being reused multiple times without worrying about thread safety. It also has much lower memory requirements than duplicating an entire tree.
Clients that simply need to hide and show parts of a tree probably do not need a DeltaTree. Instead, they should look at the "rendered" attribute supported by all UIX Component (Marlin) beans; making this attribute databound provides all the advantages of DeltaTree for this simpler case, and requires even less memory and much less indirection for affected nodes.
UINodes in the DeltaTree are located by Path objects. The PathUtils class may help in creating these Paths.
// Generate the dynamic contents UINode dynamicSubtree = _getDynamicSubtree(...); // Create a DeltaTree around the root of your page DeltaTree tree = new DeltaTree(rootBean); // Get the path to the stub node (ideally, this path // gets generated once and cached) Path pathToNode = PathUtils.findPathWithNodeID(rootBean, "stubID"); // Replace that node. tree.replaceNode(pathToNode, newSubtree); // And render the DeltaTree's root instead of the root bean tree.getRoot().render(context);
Path
,
PathUtils
Constructor Summary | |
DeltaTree(UINode root)
Create a DeltaTree for the given root node. |
Method Summary | |
MutableUINode |
getMutableUINode(RenderingContext context,
MutableUINode base,
int childIndex)
Gets a mutable node for an indexed child of a parent node in the DeltaTree. |
MutableUINode |
getMutableUINode(RenderingContext context,
MutableUINode base,
java.lang.String childName)
Gets a mutable node for a named child of a parent node in the DeltaTree. |
MutableUINode |
getMutableUINode(RenderingContext context,
Path path)
Returns a MutableUINode that corresponds to following the Path from the root node. |
MutableUINode |
getMutableUINode(RenderingContext context,
Path path,
MutableUINode base)
Returns a MutableUINode that corresponds to following the Path from a node in the delta tree. |
MutableUINode |
getRoot()
Return the modified root; this does not return the original root node, but the mutated proxy. |
boolean |
replaceNode(RenderingContext context,
Path path,
UINode newChild)
Replaces a node with another UINode, following a path from the root node. |
boolean |
replaceNode(RenderingContext context,
Path path,
UINode newChild,
MutableUINode base)
Replaces the node with another UINode, following a path from an arbitrary base node. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public DeltaTree(UINode root)
Method Detail |
public MutableUINode getRoot()
return
- a MutableUINode proxying the rootpublic MutableUINode getMutableUINode(RenderingContext context, Path path)
path
- a path instancepublic MutableUINode getMutableUINode(RenderingContext context, Path path, MutableUINode base)
path
- a path instancebase
- the UINode to start the path from. The node
must have been retrieved directly from the tree.public MutableUINode getMutableUINode(RenderingContext context, MutableUINode base, java.lang.String childName)
base
- the base UINodechildName
- the name of the childreturn
- a MutableUINode proxying that child, or
null if there was no such childpublic MutableUINode getMutableUINode(RenderingContext context, MutableUINode base, int childIndex)
base
- the base UINodechildIndex
- the index of the childreturn
- a MutableUINode proxying that child, or
null if there was no such childpublic boolean replaceNode(RenderingContext context, Path path, UINode newChild)
path
- a path instancenewChild
- the new child; if null, the old node at
that location will be removedpublic boolean replaceNode(RenderingContext context, Path path, UINode newChild, MutableUINode base)
path
- a path instancenewChild
- the new child; if null, the old node at
that location will be removedbase
- the UINode to start the path from. The node
must have been retrieved directly from the DeltaTree.
|
Oracle UIX API Reference Release 2.1.22.0.0 B12196-01 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |