On Mon, 20 Oct 2025 23:04:17 GMT, Andy Goryachev <[email protected]> wrote:
> Original user feedback (see > https://mail.openjdk.org/pipermail/openjfx-discuss/2025-August/000267.html ) > called for adding an `allowUndo` parameter to `applyStyle()` and `setStyle()` > methods similarly to `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. > > This PR also adds `isUndoRedoEnabled()` and `setUndoRedoEnabled()` to the > `StyledTextModel`, as well as its forwarding aliases to `RichTextArea` to > allow for the application to disable undo/redo temporarily, for example, when > building a document from multiple segments. > > WARNING this is an incompatible change, permitted because of the incubator. > > There remains a possible issue with currently unlimited size of the undo/redo > stack - perhaps we should limit its depth to maybe 100-200 entries, see > https://bugs.openjdk.org/browse/JDK-8370447 . This pull request has now been integrated. Changeset: f8bef157 Author: Andy Goryachev <[email protected]> URL: https://git.openjdk.org/jfx/commit/f8bef1575781ae8b38fba9dddd5aaa34e11e597d Stats: 314 lines in 17 files changed: 238 ins; 7 del; 69 mod 8366201: RichTextArea: remove allowUndo parameter Reviewed-by: kcr, jdv ------------- PR: https://git.openjdk.org/jfx/pull/1941
