title: How do i set the grapic for a TextFieldTreeCell
body: <p>I made a treeview with normal treecells and a cellfactory to display my custom objects. </p>
  
  <p>I wanned to be able to edit the object names in the treeview.</p>
  
  <p>So i switched from a normal TreeCell to a TextFieldTreeCell so that i can edit the name of my objects in the tree.</p>
  
  <p>But now the setGrapic methods in updateitem is not working. what am i doing wrong?</p>
  
  <p>Also im not sure how to acces the custom object from the fromString methode for editing the object.</p>
  
  <pre><code>    treeView.setCellFactory(new Callback&lt;TreeView&lt;MenuItem&gt;, TreeCell&lt;MenuItem&gt;&gt;() {
          @Override
          public TreeCell&lt;MenuItem&gt; call(TreeView&lt;MenuItem&gt; menuItemTreeView) {
            //     MenuItemTreeCell menuItemTreeCell = new MenuItemTreeCell();
              TextFieldTreeCell&lt;MenuItem&gt; cell = new TextFieldTreeCell&lt;MenuItem&gt;(new StringConverter&lt;MenuItem&gt;() {
                  @Override
                  public String toString(MenuItem menuItem) {
                      if(menuItem==null){
                          return "";
                      }
                      return menuItem.getName();
                  }
                  @Override
                  public MenuItem fromString(String s) {
                      // todo add code for changing name
                      return null;
                  }
              })
              {
                  @Override
                  public void updateItem(MenuItem item, boolean empty) { // empty was b
                      super.updateItem(item, empty);
  
                 //     setText((empty || item == null) ? "" : item.getName());
                 //     checking if not null , and then what class to determ icon
                      if (item != null) {
                          switch (item.getClass().getSimpleName()) {
                              case "Group":
                                  setGraphic(new ImageView(caseicon));
                                  break;
                              case "Item":
                                  setGraphic(new ImageView(basicicon));
                                  break;
                              case "ClassItem":
                                  setGraphic(new ImageView(classicon));
                                  break;
                              case "MechanicItem":
                                  setGraphic(new ImageView(mechanicicon));
                                  break;
                          }
                      } else {
                          // no icon
                          setGraphic(null);
                      }
  
                      super.updateItem(item, empty);
  
  
                  }
              };
  </code></pre>