RichTextArea: remove allowUndo parameter

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Fixed
    • Priority: P4
    • jfx26
    • Affects Version/s: jfx24
    • Component/s: javafx
    • b16

      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 )

            Assignee:
            Andy Goryachev
            Reporter:
            Andy Goryachev
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: