This is a follow-up to https://bugs.openjdk.org/browse/JDK-8366201
The undo/redo code needs to
1. Possibly limit the depth of undo/redo stack. Example: a text editor application that remains open for weeks editing the same document, the undo-redo stack growing uncontrollably. Practically speaking, there is little need to keep more that 100 or 200 undo/redo entries, it is hardly a necessity to go back more than a dozen or two steps back.
2. The simple undo events need to coalesce, similarly to what TextArea does. As a reference, these are the conditions listed in TextInputControl:613
/*
* A new undo record is created, if
* 1. createNewUndoRecord is true, currently it is set to true for paste operation
* 2. Text is selected and a character is typed
* 3. This is the first operation to be added to undo record
* 4. forceNewUndoRecord is true, currently it is set to true if there is no text present
* 5. Space character is typed
* 6. 2500 milliseconds are elapsed since the undo record was created
* 7. Cursor position is changed and a character is typed
* 8. A range of text is replaced programmatically using replaceText()
* Otherwise, the last undo record is updated or discarded.
*/
The undo/redo code needs to
1. Possibly limit the depth of undo/redo stack. Example: a text editor application that remains open for weeks editing the same document, the undo-redo stack growing uncontrollably. Practically speaking, there is little need to keep more that 100 or 200 undo/redo entries, it is hardly a necessity to go back more than a dozen or two steps back.
2. The simple undo events need to coalesce, similarly to what TextArea does. As a reference, these are the conditions listed in TextInputControl:613
/*
* A new undo record is created, if
* 1. createNewUndoRecord is true, currently it is set to true for paste operation
* 2. Text is selected and a character is typed
* 3. This is the first operation to be added to undo record
* 4. forceNewUndoRecord is true, currently it is set to true if there is no text present
* 5. Space character is typed
* 6. 2500 milliseconds are elapsed since the undo record was created
* 7. Cursor position is changed and a character is typed
* 8. A range of text is replaced programmatically using replaceText()
* Otherwise, the last undo record is updated or discarded.
*/
- relates to
-
JDK-8366201 RichTextArea: remove allowUndo parameter
-
- In Progress
-
-
JDK-8351982 ☂ RichTextArea (Incubator) Feedback and Bugs in jfx24
-
- Open
-