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

RichTextArea: remove allowUndo parameter

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Unresolved
    • Icon: P4 P4
    • tbd
    • jfx24
    • javafx
    • None
    • Fix Understood

      User feedback (see https://mail.openjdk.org/pipermail/openjfx-discuss/2025-August/000267.html ):
      The methods applyStyle and setStyle in RichTextArea should have a boolean undo parameter like replaceText.

      Upon further analysis, the 'allowUndo' parameter was a mistake: allowing the application code to disable creating undo/redo entries messes up the internal undo/redo stack.
      There is an internal need (UndoableChange), but it should not be exposed via public API.

      Whenever the application needs to disable undo/redo functionality (while, for example, building a document from multiple segments), this can be accomplished by calling clearUndoRedo().

      One possible issue is the maximum size of the undo/redo stack - currently it is unlimited - but in practice we should probably limit the depth to maybe 100-200 entries (see JDK-8370447 )

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

              Created:
              Updated: