JDK-8370909 : RichTextArea: remove allowUndo parameter
  • Type: CSR
  • Component: javafx
  • Sub-Component: controls
  • Priority: P4
  • Status: Closed
  • Resolution: Approved
  • Fix Versions: jfx26
  • Submitted: 2025-10-29
  • Updated: 2025-11-03
  • Resolved: 2025-11-03
Related Reports
CSR :  
Description
Summary
-------

Removes `allowUndo` parameter from `RichTextArea::replaceText`.
Adds a boolean `undoRedoEnabled` attribute to the `StyledTextModel`.

Note that this is NOT a backward-compatible change, as a part of the incubator iteration.

Problem
-------

Early user feedback asked for addition of `allowUndo` parameter to `applyStyle()` and `setStyle()` methods in the  `StyledTextModel`, to mirror the parameter in `replaceText()`.

However, selectively enabling or disabling the undo functionality corrupts the internal state.  Instead, to address use cases that require disabled undo, such as programmatically building the document content, a single boolean flag is added to the model.  Disabling undo also clears the undo/redo stack.

Solution
--------

The solution is to remove the offending parameter and add a flag.

Additionally, similar methods are added to the `RichTextArea` class that forward the calls to the model (or do nothing if the model is null).

Specification
-------------

See the attached diffs.


Comments
Thank you Joe, Kevin, for the review!
03-11-2025

Moving to Approved a change to an incubating feature.
03-11-2025

Thank you Kevin!
31-10-2025

Updated diff matches approved PR, so this is ready to Finalize.
31-10-2025

Looks good, although I left some wording suggestions in the PR regarding the API docs. I'll formally review this once they are settled and you update the spec (the attached diffs). The other sections are fine.
30-10-2025