title: expand TreeView (parent)nodes which contains selected item
body: <p>I have a TreeView existing out of User objects. The TreeView represents the hierarchy of the Users:</p>
  
  <ul>
  <li>Master1
  <ul>
  <li>Super1</li>
  <li>Super2
  <ul>
  <li>User1</li>
  <li>User2</li>
  </ul></li>
  <li>Super3
  <ul>
  <li>User3</li>
  </ul></li>
  <li>Super4</li>
  </ul></li>
  <li>Master2</li>
  <li>...</li>
  </ul>
  
  <p>Every TreeItem is Collapsed when the TreeView is initialized. However, it can be that when the FXML is loaded, a TreeItem object is passed through from another FXML file. Eg: User3 has been passed through:</p>
  
  <pre><code>selectedUserTreeItem = (TreeItem&lt;User&gt;) currentNavigation.getPassthroughObject(); //this is the User3 TreeItem
  </code></pre>
  
  <p>I try to use a recursive function to expand all the parent nodes from the <code>selecterUserTreeItem</code></p>
  
  <pre><code>if (selectedUserTreeItem != null) {
      expandTreeView(selectedUserTreeItem);
  }
  
  tvUsers.setRoot(rootItem);
  </code></pre>
  
  <p>This is what I have so far:</p>
  
  <pre><code>private void expandTreeView(TreeItem&lt;User&gt; selectedItem) {        
      if (selectedItem != null) {
          System.out.println(selectedItem);
          if (selectedItem.isLeaf() == false) {
              selectedItem.setExpanded(true);
          }
          TreeItem&lt;User&gt; parent = selectedItem.getParent();
          expandTreeView(parent);
      } else {
          System.out.println("null");
      }
  }
  </code></pre>
  
  <p>I think it has to do something with the fact that the function is a void function and it should be returning a TreeItem object I suppose but for some reason I don't succeed in doing it.</p>
  
  <p>Could someone point me in the right direction?</p>