title: TreeView in a table cell Java FX 8
body: <p>I have a TableView in my UI, it displays an user list from the database. One of the column of this table is editable, when editing is enabled the cell of this particular column becomes a treeview, listing various options which can be chosen.</p>
  
  <p>Just to clarify, I am trying to implement a Datepicker or a colorpicker like functionality on a table cell, but with my own list of items as a tree.</p>
  
  <p>The table is defined like this</p>
  
  <pre><code>private TableView&lt;User&gt; userTable;
  </code></pre>
  
  <p>The particular column which displays a tree view is defined like this</p>
  
  <pre><code>private TableColumn&lt;User, TreeView&gt; col4;
  </code></pre>
  
  <p>I set a setcellFactory method like this to display the tree</p>
  
  <pre><code>col4.setCellFactory(new Callback&lt;TableColumn&lt;User,TreeView&gt;, TableCell&lt;User,TreeView&gt;&gt;() {
  
              @Override
              public TableCell&lt;User, TreeView&gt; call(
                      TableColumn&lt;User, TreeView&gt; param)
              {
                  returns a comboboxtablecell which is filled with a tree
              }
      });
  </code></pre>
  
  <p>In the table, in the corresponding column, when I click the cell, the cell shows a combo box and the combobox on opening up shows the tree value.</p>
  
  <p>However when the cell is in non-editable state, I am not sure how I should set the setcellValuefactory with a string value</p>
  
  <pre><code>col4.setCellValueFactory(new Callback&lt;TableColumn.CellDataFeatures&lt;User,TreeView&gt;, ObservableValue&lt;TreeView&gt;&gt;() {
  
          @Override
          public ObservableValue&lt;TreeView&gt; call(
                  CellDataFeatures&lt; User,TreeView&gt; param)
          {
                       }
    }
  </code></pre>
  
  <p>I want to display a value which is inside the treeview as a string when the cell is in a non editable state. I am at a loss as to how to return an observablevalue of type treeview as per the method signature  and still display a string.</p>