final String repoName = pRepo.getRootURI().toString();
//
//create new tree and model for the repo
//
final RepoTree repoTree = createRepoTree(pRepo);
//
//store the tree in the tree-cache, and add it to the layout
//
final JScrollPane scrollPane = ScrollPaneFactory.createScrollPane(repoTree);
treesPanel.add(scrollPane, repoName);
repos.put(pRepo, repoTree);
treesCardLayout.show(treesPanel, repoName);
//
//later on, start fetching the root node
//
final TreeModel model = repoTree.getModel();
if (model instanceof RepoTreeModel) {
final RepoTreeModel repoModel = (RepoTreeModel) model;
repoTree.fetchNode(repoModel.getRoot());
}
return repoTree;
}