Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8102029

Expose undo/redo functionality on TextInputControl

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 7u6
    • javafx

      Hi,

      I needed to call the undo/redo functionality on a TextInputControl.

      What I ended up was doing this:
      ((TextInputControlBehavior)((TextInputControlSkin)textArea.getSkin()).getBehavior()).callAction("Undo");

      This uses internal classes.

      I suggest to add those methods to the control, so that I can use:
      textArea.undo();

      However, I don't know, if this contradicts the Control/Skin/Behavior concept.

      Maybe another solution is to put the Behaviors in the public package and add an undo/redo method to it, so that you don't have to callAction with a String value.

      Other functions like copy/paste could be useful as well.

      See this thread:
      https://forums.oracle.com/forums/thread.jspa?threadID=2438759&tstart=0

            rbair Richard Bair (Inactive)
            cschudtjfx Christian Schudt (Inactive)
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: