title: Minimal implementation of JavaFX TextInputArea
body: <p>I'm investigating the best way to write a rich text editor in JavaFX - don't mention the HTMLEditor to me: we've spent literally months hacking at it and I could write reams about why it isn't suitable for our purposes!  Choice at the moment is to extend AnchorPane and do all of the layout, navigation etc. from scratch or to extend TextInputArea, which looks as though it would help.  Anyone have their own implementation of that or would like to propose a minimal implementation?</p>
  
  <p>FWIW here's a scrap from me:</p>
  
  <p>public class TryPain3 extends TextInputControl {
      private AnchorPane rootNode = new AnchorPane();</p>
  
  <pre><code>public TryPain3() {
      super(new Content() {
          private String text = "";
  
          @Override
          public String get(int i, int i1) {
              return text.substring(i, i1);
          }
  
          @Override
          public void insert(int i, String string, boolean bln) {
          }
  
          @Override
          public void delete(int i, int i1, boolean bln) {
          }
  
          @Override
          public int length() {
              return text.length();
          }
  
          @Override
          public String get() {
              return text;
          }
  
          @Override
          public void addListener(ChangeListener&lt;? super String&gt; cl) {
  
          }
  
          @Override
          public void removeListener(ChangeListener&lt;? super String&gt; cl) {
              throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
          }
  
          @Override
          public String getValue() {
              return text;
          }
  
          @Override
          public void addListener(InvalidationListener il) {
  
          }
  
          @Override
          public void removeListener(InvalidationListener il) {
              throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
          }
      });
  
      setEditable(true);
  
      Text text1 = new Text("fred was here");
      text1.setFont(Font.font("Tahoma", FontWeight.NORMAL, 18));
      text1.setTextAlignment(TextAlignment.LEFT);
  
      text1.setFontSmoothingType(FontSmoothingType.LCD);
  
      rootNode.getChildren().add(text1);
  
  
      setSkin(new TP3Skin(this, rootNode));
  
  }
  
  
  class TP3Skin implements Skin&lt;TryPain3&gt; {
      TryPain3 tp;
      Node root;
  
      public TP3Skin(TryPain3 tp, Node root) {
          this.tp = tp;
          this.root = root;
      }
  
  
      @Override
      public TryPain3 getSkinnable() {
          return tp;
      }
  
      @Override
      public Node getNode() {
          return root;
      }
  
      @Override
      public void dispose() {
          tp = null;
          rootNode = null;
      }
  
  }
  </code></pre>
  
  <p>}</p>
  
  <p>It looks as though the skin is not optional.</p>
  
  <p>Questions I'd like to find out are things like:</p>
  
  <ul>
  <li>how is the UI supposed to be drawn - I'm quite happy to code it from scratch but how to get benefit of calls to forward() as an example</li>
  <li>should the UI creation be done in the Skin?</li>
  <li>whether the base class deals with things like where to put the cursor if you click on a bit of text</li>
  </ul>
  
  <p>I'm sure other questions will arise from this.</p>