void (@Nullable RepositoryNode repositoryNode, boolean shouldScrollTo) { TreePath selectionPath = repositoryNode != null ? TreeUtil.getPathFromRoot(repositoryNode) : TreeUtil.getFirstNodePath(myTree); myTree.setSelectionPath(selectionPath); if (shouldScrollTo) { myTree.scrollPathToVisible(selectionPath); } }