org.netbeans.spi.project.ui
public interface LogicalViewProvider
Project
to supply
a logical view of itself.Project.getLookup()
,
ProjectIconAnnotator
Node createLogicalView()
The node need not bother implementing badging
for the root node; any files contained in the project will
be considered as badging sources automatically. Other subnodes representing
various collections of files may still need explicit badging logic.
As of org.netbeans.modules.projectuiapi/1 1.31
CommonProjectActions.forType(java.lang.String)
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
Built on March 18 2014. | Portions Copyright 1997-2014 Sun Microsystems, Inc. All rights reserved.