title: TreeTableView Dilemma
body: <p>I have a data model of :<br>
  Client - Name<br>
  Map  declared in the Client object class.</p>
  
  <p>Client<br>
  -Title - Value<br>
  -Title - Value<br>
  -Title - Value<br>
  Client<br>
  -Title - Value<br>
  -Title - Value<br>
  -Title - Value  </p>
  
  <p>As far as I'm aware the <code>TreeTableView</code> must only abide to one datatype is there a way I can make it hold both Client and a <code>Map</code> or am I forced to make <code>Map</code> part of Client?<br>
   Would the use of  javatuples come into play?</p>
  
  <pre><code>public TreeTableView createContent() {
  
      TreeItem&lt;String&gt; root = new TreeItem&lt;&gt;();
      //treeTableView.setRoot(root);
      root.setExpanded(true);
      //final TreeItem&lt;String&gt; rootItem = new TreeItem&lt;&gt;();
      ArrayList&lt;TreeItem&lt;String&gt;&gt; rootList = new ArrayList&lt;TreeItem&lt;String&gt;&gt;();
      ArrayList&lt;TreeItem&lt;String&gt;&gt; titleList = new ArrayList&lt;TreeItem&lt;String&gt;&gt;();
      ArrayList&lt;TreeItem&lt;String&gt;&gt; valueList = new ArrayList&lt;TreeItem&lt;String&gt;&gt;();
      TreeItem&lt;String&gt; rootItem = new TreeItem&lt;&gt;();
  
          for(Client client:clients){
              rootItem = new TreeItem&lt;&gt;(client.getName());//.getName());
          //rootItem.setValue(client.getName());//nameProperty().getValue());
          rootList.add(rootItem);
      }  
  
          for(Entry&lt;Title, DoubleProperty&gt; map1:map.entrySet()){
              final TreeItem&lt;Entry&lt;Title, DoubleProperty&gt;&gt; mapItem = new TreeItem&lt;&gt;(map1);//.getKey(),map1.getValue());
              final TreeItem&lt;String&gt; child2Item = new TreeItem&lt;&gt;(map1.getKey().getName());//, map1.getValue().getValue().toString());
              final TreeItem&lt;String&gt; child3Item = new TreeItem&lt;&gt;(map1.getValue().getValue().toString());
              titleList.add(child2Item); 
              valueList.add(child3Item);
          }
  
          /*for(Title title:titles){
              //final TreeItem child1Item = new TreeItem&lt;&gt;(client.getValue(title));
              final TreeItem&lt;String&gt; child2Item = new TreeItem&lt;&gt;(title.getName());//title.getName());
          titleList.add(child2Item); 
          }*/
  
          for(TreeItem&lt;String&gt; root1:rootList){
              root.getChildren().add(root1);
              for(TreeItem&lt;String&gt; title1:titleList){
              root1.getChildren().add(title1);
          }
              for(TreeItem&lt;String&gt; value:valueList){
                  root1.getChildren().add(value);
              }
          }
  
      // Name column
      final TreeTableColumn&lt;Client, String&gt; nameColumn = new TreeTableColumn&lt;&gt;("Name");
      nameColumn.setEditable(false);
      nameColumn.setMinWidth(150);
      //nameColumn.setCellValueFactory( new TreeItemPropertyValueFactory&lt;Client, String&gt;("value") );
      nameColumn.setCellValueFactory(//param -&gt; param.getValue().getValue().nameProperty());
              new Callback&lt;TreeTableColumn.CellDataFeatures&lt;Client, String&gt;, ObservableValue&lt;String&gt;&gt;() {
          @Override
          public ObservableValue&lt;String&gt; call(TreeTableColumn.CellDataFeatures&lt;Client, String&gt; p) {
              return new ReadOnlyObjectWrapper(p.getValue().getValue());
          }
      });
  
      // Data column
      TreeTableColumn&lt;Client, String&gt; dataColumn = new TreeTableColumn&lt;&gt;("Values");
      dataColumn.setEditable(true);
      dataColumn.setMinWidth(50);
     // dataColumn.setCellValueFactory( new MapValueFactory&lt;&gt;("mapvalue");
              //new TreeItemPropertyValueFactory&lt;Client, String&gt;("name") );
      //dataColumn.setCellValueFactory(new TreeItemPropertyValueFactory&lt;Client, String&gt;("name"));
      dataColumn.setCellValueFactory(
              new Callback&lt;TreeTableColumn.CellDataFeatures&lt;Client, String&gt;, ObservableValue&lt;String&gt;&gt;() {
          @Override
          public ObservableValue&lt;String&gt; call(TreeTableColumn.CellDataFeatures&lt;Client, String&gt; p) {
          return new ReadOnlyStringWrapper(p.getValue().getValue().getValues().values().toString());
  }
  });
  
      final TreeTableView&lt;Client&gt; treeTableView = new TreeTableView(root);//rootItem);
      treeTableView.setShowRoot(false);
      treeTableView.getColumns().add( nameColumn );
      treeTableView.getColumns().add( dataColumn );
      treeTableView.setEditable(true);
      treeTableView.setColumnResizePolicy( TreeTableView.CONSTRAINED_RESIZE_POLICY );
      treeTableView.getSelectionModel().setSelectionMode(SelectionMode.MULTIPLE);
      treeTableView.setPrefSize(515, 100);
      treeTableView.setLayoutX(10);
      treeTableView.setLayoutY(10);
  
      return treeTableView;
  }
  }
  </code></pre>
  
  <p>By doing this I get values directly under each title not on the second column and I feel like I'm cheating myself making it into string I would want to make it editable in the future so it changes the actual values within the map or client</p>
  
  <p>Client Object Class:</p>
  
  <pre><code>public class Client {
  private final StringProperty name = new SimpleStringProperty(this, "name");
  public final String getName() {
      return name.get();
  }
  public final void setName(String name) {
      this.name.set(name);
  }
  public StringProperty nameProperty() {
      return name ;
  }
  private final Map&lt;Title, DoubleProperty&gt; values = new HashMap&lt;&gt;();
  
  public Client(String name) {
      setName(name);
  }
  
  public DoubleProperty valueProperty(Title title) {
      // In Java 8, just do
      // return values.computeIfAbsent(title, t -&gt; new SimpleDoubleProperty());
  
      DoubleProperty value = values.get(title);
      if (value == null) {
          value = new SimpleDoubleProperty();
          values.put(title, value);
      }
      return value ;
  }
  
  public final double getValue(Title title) {
      return valueProperty(title).get();
  }
  
  public final void setValue(Title title, double value) {
      valueProperty(title).set(value);
  }
  
  public Map&lt;Title, DoubleProperty&gt; getValues() {
      return values ;
  }
  }
  </code></pre>