|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Ability for a Project
to supply
a logical view of itself.
Project.getLookup()
Method Summary | |
Node |
createLogicalView()
Create a logical view node. |
Node |
findPath(Node root,
Object target)
Try to find a given node in the logical view. |
Method Detail |
public Node createLogicalView()
public Node findPath(Node root, Object target)
private static boolean isAncestor(Node root, Node n) { if (n == null) return false; if (n == root) return true; return isAncestor(root, n.getParentNode()); } // ... Node root = ...; Object target = ...; LogicalViewProvider lvp = ...; Node n = lvp.findPath(root, target); if (n != null) { assert isAncestor(root, n); Lookup.Template tmpl = new Lookup.Template(null, null, target); Collection res = n.getLookup().lookup(tmpl).allInstances(); assert Collections.singleton(target).equals(new HashSet(res)); }
root
- a root node. E.g. a node from createLogicalView()
or some wapper
(FilterNode) around the node. The provider of the functionality is
responsible for finding the appropriate node in the wrapper's children.target
- a target cookie, such as a DataObject
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |