|
org.netbeans.modules.projectuiapi/1 1.13.32 5 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface LogicalViewProvider
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 |
---|
Node createLogicalView()
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
|
org.netbeans.modules.projectuiapi/1 1.13.32 5 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |