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

RichTextArea: undo/redo improvements

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Unresolved
    • Icon: P4 P4
    • tbd
    • jfx25
    • javafx
    • None
    • Cause Known

      This is a follow-up to https://bugs.openjdk.org/browse/JDK-8366201

      The undo/redo code needs to

      1. Possibly limit the depth of undo/redo stack. Example: a text editor application that remains open for weeks editing the same document, the undo-redo stack growing uncontrollably. Practically speaking, there is little need to keep more that 100 or 200 undo/redo entries, it is hardly a necessity to go back more than a dozen or two steps back.

      2. The simple undo events need to coalesce, similarly to what TextArea does. As a reference, these are the conditions listed in TextInputControl:613

              /*
               * A new undo record is created, if
               * 1. createNewUndoRecord is true, currently it is set to true for paste operation
               * 2. Text is selected and a character is typed
               * 3. This is the first operation to be added to undo record
               * 4. forceNewUndoRecord is true, currently it is set to true if there is no text present
               * 5. Space character is typed
               * 6. 2500 milliseconds are elapsed since the undo record was created
               * 7. Cursor position is changed and a character is typed
               * 8. A range of text is replaced programmatically using replaceText()
               * Otherwise, the last undo record is updated or discarded.
               */

            angorya Andy Goryachev
            angorya Andy Goryachev
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: