private _renderTree()

in build-inspector/src/inspector/associatedItemsView.ts [169:216]


    private _renderTree(): void {
        // create the root tree nodes
        
        var historySvc = NavigationServices.getHistoryService();

        var overviewNode = new TreeView.TreeNode("Overview");
        overviewNode.link = historySvc.getFragmentActionLink("overview");
        overviewNode.id = AssociatedItemsTree.NodeItemType.overview;

        var commitNode = new TreeView.TreeNode("Commits");
        commitNode.link = historySvc.getFragmentActionLink("commit");
        commitNode.expanded = true;
        commitNode.id = AssociatedItemsTree.NodeItemType.commit;

        var workItemsNode = new TreeView.TreeNode("Workitems");
        workItemsNode.link = historySvc.getFragmentActionLink("workitem");
        workItemsNode.id = AssociatedItemsTree.NodeItemType.workItem;
        workItemsNode.expanded = true;

        // Process the build nodes to add to the appropriate root node
        this._options.associatedChanges.forEach(function (change) {
            var shortCommitId = change.id && change.id.length > 6 ? change.id.substr(0, 6) : change.id;
            var node = new TreeView.TreeNode(shortCommitId);
            node.tag = change;
            node.id = parseInt(change.id);
            node.link = historySvc.getFragmentActionLink("commit", { id: change.id });
            commitNode.add(node);            
        });

        // Process the build nodes to add to the appropriate root node
        this._options.associatedWorkItems.forEach(function (workItem) {
            var workItemId = workItem.id;
            var node = new TreeView.TreeNode(workItemId.toString());
            node.tag = workItem;
            node.link = historySvc.getFragmentActionLink("workitem", { id: workItem.id });
            workItemsNode.add(node);            
        });

        // Configure a few tree options
        var treeViewOptions = {
            width: "100%",
            height: "100%",
            nodes: [overviewNode, commitNode, workItemsNode]
        };

        // Create the tree
        this._treeView = Controls.create(AssociatedItemsTree.AssociatedItemsTree, $("#tree-container"), treeViewOptions);
    }