Index: project/src/org/netbeans/modules/apisupport/project/LogicalView.java =================================================================== RCS file: /cvs/apisupport/project/src/org/netbeans/modules/apisupport/project/LogicalView.java,v retrieving revision 1.15 diff -C5 -r1.15 LogicalView.java *** project/src/org/netbeans/modules/apisupport/project/LogicalView.java 24 Jun 2004 20:12:15 -0000 1.15 --- project/src/org/netbeans/modules/apisupport/project/LogicalView.java 8 Jul 2004 21:48:03 -0000 *************** *** 23,34 **** --- 23,36 ---- import org.netbeans.spi.java.project.support.ui.PackageView; import org.netbeans.api.project.ProjectInformation; import org.netbeans.api.project.SourceGroup; import org.netbeans.api.project.Sources; import org.netbeans.spi.project.ui.LogicalViewProvider; + import org.openide.filesystems.FileObject; import org.openide.filesystems.FileUtil; import org.openide.loaders.DataObject; + import org.openide.loaders.DataFolder; import org.openide.loaders.DataObjectNotFoundException; import org.openide.nodes.AbstractNode; import org.openide.nodes.Children; import org.openide.nodes.FilterNode; import org.openide.nodes.Node; *************** *** 49,59 **** public Node createLogicalView() { return new RootNode(project); } public Node findPath( Node root, Object target ) { ! // XXX return null; } private static final class RootNode extends AbstractNode { --- 51,96 ---- public Node createLogicalView() { return new RootNode(project); } public Node findPath( Node root, Object target ) { ! //Check whether root was created for this project: ! if (root.getLookup().lookup(NbModuleProject.class) != project) ! return null; ! ! Node[] rootChildren = root.getChildren().getNodes(true); ! DataObject file = null; ! ! if (target instanceof FileObject) { ! try { ! file = DataObject.find((FileObject) target); ! } catch (DataObjectNotFoundException e) { ! throw new AssertionError(e); ! } ! } else { ! if (target instanceof DataObject) { ! file = (DataObject) target; ! } ! } ! ! for (int cntr = 0; cntr < rootChildren.length; cntr++) { ! //XXX Currently, each PackageRootNode has a DataFolder in its lookup: ! //XXX is there any other (better) way to assure that the PackageView.findPath ! //XXX method will work correctly? ! if (rootChildren[cntr].getLookup().lookup(DataFolder.class) != null) { ! Node found = PackageView.findPath(rootChildren[cntr], target); ! ! if (found != null) ! return found; ! } ! ! //For the special files, like manifest and arch description. ! if (file != null && rootChildren[cntr].getCookie(DataObject.class) == file) ! return rootChildren[cntr]; ! } ! ! //It seems that no PackageRootNode contained required node: return null; } private static final class RootNode extends AbstractNode {