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.

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().

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 (in a 
follow-up ticket).

-------------

Commit messages:
 - cleanup
 - cleanup
 - removed allow undo parameter
 - nl
 - test
 - append insert text
 - tests
 - allow undo

Changes: https://git.openjdk.org/jfx/pull/1941/files
  Webrev: https://webrevs.openjdk.org/?repo=jfx&pr=1941&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8366201
  Stats: 218 lines in 16 files changed: 139 ins; 6 del; 73 mod
  Patch: https://git.openjdk.org/jfx/pull/1941.diff
  Fetch: git fetch https://git.openjdk.org/jfx.git pull/1941/head:pull/1941

PR: https://git.openjdk.org/jfx/pull/1941

Reply via email to