Package org.openide.explorer.view

Examples of org.openide.explorer.view.TreeView


                    // Reset the forward and back lists because we're resetting the root context
                    resetHistory();

                    Children childNodes = em.getRootContext().getChildren();
                    TreeView tree = getTree();

                    Node results = childNodes.findChild(ResultsNode.NAME);
                    tree.expandNode(results);

                    Children resultsChilds = results.getChildren();
                    tree.expandNode(resultsChilds.findChild(KeywordHits.NAME));
                    tree.expandNode(resultsChilds.findChild(ExtractedContent.NAME));


                    Node views = childNodes.findChild(ViewsNode.NAME);
                    Children viewsChilds = views.getChildren();
                    for (Node n : viewsChilds.getNodes()) {
                        tree.expandNode(n);
                    }

                    tree.collapseNode(views);

                    // if the dataResult is not opened
                    if (!dataResult.isOpened()) {
                        dataResult.open(); // open the data result top component as well when the directory tree is opened
                    }
View Full Code Here


                Node generated = new DirectoryTreeFilterNode(new AbstractNode(new RootContentChildren(hierarchy)), true);
                Children genChilds = generated.getChildren();

                final DirectoryTreeTopComponent dirTree = DirectoryTreeTopComponent.findInstance();
                TreeView dirTreeView = dirTree.getTree();
                ExplorerManager dirTreeExplorerManager = dirTree.getExplorerManager();
                Node dirTreeRootNode = dirTreeExplorerManager.getRootContext();
                Children dirChilds = dirTreeRootNode.getChildren();
                Children currentChildren = dirChilds.findChild(DataSourcesNode.NAME).getChildren();

                Node dirExplored = null;

                // Find the parent node of the content in the directory tree
                for (int i = 0; i < genChilds.getNodesCount() - 1; i++) {
                    Node currentGeneratedNode = genChilds.getNodeAt(i);
                    for (int j = 0; j < currentChildren.getNodesCount(); j++) {
                        Node currentDirectoryTreeNode = currentChildren.getNodeAt(j);
                        if (currentGeneratedNode.getDisplayName().equals(currentDirectoryTreeNode.getDisplayName())) {
                            dirExplored = currentDirectoryTreeNode;
                            dirTreeView.expandNode(dirExplored);
                            currentChildren = currentDirectoryTreeNode.getChildren();
                            break;
                        }
                    }
                }

                // Set the parent node of the content as the selection in the
                // directory tree
                try {
                    if (dirExplored != null) {
                        dirTreeView.expandNode(dirExplored);
                        dirTreeExplorerManager.setExploredContextAndSelection(dirExplored, new Node[]{dirExplored});
                    }
                } catch (PropertyVetoException ex) {
                    logger.log(Level.WARNING, "Couldn't set selected node", ex); //NON-NLS
                }
View Full Code Here

TOP

Related Classes of org.openide.explorer.view.TreeView

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.