Esempio n. 1
0
  /**
   * Selects the specified account
   *
   * @param account account to select
   */
  public void setSelectedAccount(final Account account) {
    if (account != null) {
      TreeNode node = model.findAccountNode(account);

      if (node != null) {
        TreePath path = new TreePath(model.getPathToRoot(node));

        tree.setSelectionPath(path); // select the path
        tree.scrollPathToVisible(path); // ensure selected path is visible
      }
    }
  }