Package org.openide.nodes

Examples of org.openide.nodes.Children


        final String windowTitle = NbBundle.getMessage(this.getClass(), "KeywordSearchQueryManager.execute.exeWinTitle", ++resultWindowCount, queryStrShort);
        DataResultTopComponent searchResultWin = DataResultTopComponent.createInstance(windowTitle);
       
        Node rootNode;
        if (queryRequests.size() > 0) {
            Children childNodes =
                    Children.create(new KeywordSearchResultFactory(queryRequests, searchResultWin), true);

            rootNode = new AbstractNode(childNodes);
        } else {
            rootNode = Node.EMPTY;
View Full Code Here


     * @param parent Node with at least one child to get properties from
     * @param rows max number of rows to retrieve properties for (can be used
     * for memory optimization)
     */
    private void getAllChildPropertyHeadersRec(Node parent, int rows) {
        Children children = parent.getChildren();
        int childCount = 0;
        for (Node child : children.getNodes()) {
            if (++childCount > rows) {
                break;
            }
            for (PropertySet ps : child.getPropertySets()) {
                final Property<?>[] props = ps.getProperties();
View Full Code Here

                    ((BeanTreeView) this.jScrollPane1).setRootVisible(false); // hide the root

                    // 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);
View Full Code Here

     */
    private void refreshDataSourceTree() {
        Node selectedNode = getSelectedNode();
        final String[] selectedPath = NodeOp.createPath(selectedNode, em.getRootContext());

        Children rootChildren = em.getRootContext().getChildren();
        Node dataSourcesFilterNode = rootChildren.findChild(DataSourcesNode.NAME);
        if (dataSourcesFilterNode == null) {
            logger.log(Level.SEVERE, "Cannot find data sources filter node, won't refresh the content tree"); //NON-NLS
            return;
        }
        DirectoryTreeFilterNode.OriginalNode imagesNodeOrig = dataSourcesFilterNode.getLookup().lookup(DirectoryTreeFilterNode.OriginalNode.class);
View Full Code Here

    }

    @Override
    public void viewArtifact(final BlackboardArtifact art) {
        BlackboardArtifact.ARTIFACT_TYPE type = BlackboardArtifact.ARTIFACT_TYPE.fromID(art.getArtifactTypeID());
        Children rootChilds = em.getRootContext().getChildren();
        Node treeNode = null;
        Node resultsNode = rootChilds.findChild(ResultsNode.NAME);
        Children resultsChilds = resultsNode.getChildren();
        if (type.equals(BlackboardArtifact.ARTIFACT_TYPE.TSK_HASHSET_HIT)) {
            Node hashsetRootNode = resultsChilds.findChild(type.getLabel());
            Children hashsetRootChilds = hashsetRootNode.getChildren();
            try {
                String setName = null;
                List<BlackboardAttribute> attributes = art.getAttributes();
                for (BlackboardAttribute att : attributes) {
                    int typeId = att.getAttributeTypeID();
                    if (typeId == BlackboardAttribute.ATTRIBUTE_TYPE.TSK_SET_NAME.getTypeID()) {
                        setName = att.getValueString();
                    }
                }
                treeNode = hashsetRootChilds.findChild(setName);
            } catch (TskException ex) {
                logger.log(Level.WARNING, "Error retrieving attributes", ex); //NON-NLS
            }
        } else if (type.equals(BlackboardArtifact.ARTIFACT_TYPE.TSK_KEYWORD_HIT)) {
            Node keywordRootNode = resultsChilds.findChild(type.getLabel());
            Children keywordRootChilds = keywordRootNode.getChildren();
            try {
                String listName = null;
                String keywordName = null;
                List<BlackboardAttribute> attributes = art.getAttributes();
                for (BlackboardAttribute att : attributes) {
                    int typeId = att.getAttributeTypeID();
                    if (typeId == BlackboardAttribute.ATTRIBUTE_TYPE.TSK_SET_NAME.getTypeID()) {
                        listName = att.getValueString();
                    } else if (typeId == BlackboardAttribute.ATTRIBUTE_TYPE.TSK_KEYWORD.getTypeID()) {
                        keywordName = att.getValueString();
                    }
                }
                Node listNode = keywordRootChilds.findChild(listName);
                Children listChildren = listNode.getChildren();
                treeNode = listChildren.findChild(keywordName);
            } catch (TskException ex) {
                logger.log(Level.WARNING, "Error retrieving attributes", ex); //NON-NLS
            }
        } else if (type.equals(BlackboardArtifact.ARTIFACT_TYPE.TSK_INTERESTING_FILE_HIT)
                || type.equals(BlackboardArtifact.ARTIFACT_TYPE.TSK_INTERESTING_ARTIFACT_HIT)) {
            Node interestingItemsRootNode = resultsChilds.findChild(type.getLabel());
            Children interestingItemsRootChildren = interestingItemsRootNode.getChildren();
            try {
                String setName = null;
                List<BlackboardAttribute> attributes = art.getAttributes();
                for (BlackboardAttribute att : attributes) {
                    int typeId = att.getAttributeTypeID();
                    if (typeId == BlackboardAttribute.ATTRIBUTE_TYPE.TSK_SET_NAME.getTypeID()) {
                        setName = att.getValueString();
                    }
                }
                treeNode = interestingItemsRootChildren.findChild(setName);
            } catch (TskException ex) {
                logger.log(Level.WARNING, "Error retrieving attributes", ex); //NON-NLS
            }
        } else {
            Node extractedContent = resultsChilds.findChild(ExtractedContent.NAME);
            Children extractedChilds = extractedContent.getChildren();
            treeNode = extractedChilds.findChild(type.getLabel());
        }
        try {
            em.setExploredContextAndSelection(treeNode, new Node[]{treeNode});
        } catch (PropertyVetoException ex) {
            logger.log(Level.WARNING, "Property Veto: ", ex); //NON-NLS
        }

        // Another thread is needed because we have to wait for dataResult to populate
        EventQueue.invokeLater(new Runnable() {
            @Override
            public void run() {
                Children resultChilds = dataResult.getRootNode().getChildren();
                Node select = resultChilds.findChild(Long.toString(art.getArtifactID()));
                if (select != null) {
                    dataResult.requestActive();
                    dataResult.setSelectedNodes(new Node[]{select});
                    fireViewerComplete();
                }
View Full Code Here

                ReverseHierarchyVisitor vtor = new ReverseHierarchyVisitor();
                List<Content> hierarchy = content.accept(vtor);
                Collections.reverse(hierarchy);

                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;
View Full Code Here

     * @param tree          the given tree
     * @param currentNode   the current selectedNode
     */
    private void collapseAll(BeanTreeView tree, Node currentNode) {

        Children c = currentNode.getChildren();

        for (Node next : c.getNodes()) {
            if (tree.isExpanded(next)) {
                this.collapseAll(tree, next);
            }
        }

View Full Code Here

TOP

Related Classes of org.openide.nodes.Children

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.