コード例 #1
0
 /**
  * Update the tree according to the list of loaded roots
  *
  * @param roots the list of roots to add to the tree
  * @param uncheckedCommits the map from vcs root to commit identifiers that should be
  *     uncheckedCommits
  */
 private void updateTree(List<Root> roots, Map<VirtualFile, Set<String>> uncheckedCommits) {
   myTreeRoot.removeAllChildren();
   if (roots == null) {
     roots = Collections.emptyList();
   }
   for (Root r : roots) {
     CheckedTreeNode rootNode = new CheckedTreeNode(r);
     Status status = new Status();
     status.root = r;
     rootNode.add(new DefaultMutableTreeNode(status, false));
     Set<String> unchecked =
         uncheckedCommits != null && uncheckedCommits.containsKey(r.root)
             ? uncheckedCommits.get(r.root)
             : Collections.<String>emptySet();
     for (Commit c : r.commits) {
       CheckedTreeNode child = new CheckedTreeNode(c);
       rootNode.add(child);
       child.setChecked(r.remoteName != null && !unchecked.contains(c.commitId()));
     }
     myTreeRoot.add(rootNode);
   }
 }