title: Wrapping text in a JavaFX TableView editable TextFieldTableCell
body: <p>My TableView consists of several columns and wraps the text with the following cellfactory:</p>
  
  <pre><code>private void setWrapCellFactory(TableColumn&lt;CustomObject, String&gt; table) {
      table.setCellFactory(tablecol -&gt; {
          TableCell&lt;CustomObject, String&gt; cell = new TableCell&lt;&gt;();
          Text text = new Text();
          cell.setGraphic(text);
          text.wrappingWidthProperty().bind(cell.widthProperty());
          text.textProperty().bind(cell.itemProperty());
          return cell;
      });
  }
  </code></pre>
  
  <p>This works perfectly for showing uneditable text.</p>
  
  <p>The last column has to be editable and could span across several rows (not TableView rows). To prevent the ellips I would like to wrap the new edited text.</p>
  
  <p>After hours of trying I still can't seem to get it working. I have the following code to edit my cell and a non-working attempt to wrap it.</p>
  
  <p>Non-working method to wrap my edited text:</p>
  
  <pre><code>private void setWrapCellFactoryEditable(TableColumn&lt;CustomObject, String&gt; table) {
      table.setCellFactory(tablecol -&gt; {
          TableCell&lt;CustomObject, String&gt; cell = new TextFieldTableCell&lt;&gt;(new DefaultStringConverter());
          Text text = new Text();
          text.setText(text.toString());
          text.wrappingWidthProperty().bind(cell.widthProperty());
          return cell;
      });
  }
  </code></pre>
  
  <p>The following code is the column setup:</p>
  
  <pre><code>feedbackCol.setCellValueFactory(ev -&gt; new ReadOnlyStringWrapper(ev.getValue().getLastFeedback()));
      setWrapCellFactoryEditable(feedbackCol);
      feedbackCol.setOnEditCommit((CellEditEvent&lt;CustomObject, String&gt; ev) -&gt; {
          int id = ((CustomObject) ev.getTableView().getItems().get(
                  ev.getTablePosition().getRow())).getId();
          dc.addTempFeedback(id, ev.getNewValue());
      });
  </code></pre>
  
  <p>For the regular non-editable text I'm using a <code>TableCell</code>, for editable text I'm using a <code>TextFieldTableCell</code>. I don't know why the wrapping isn't working with editable cells.</p>