-
Notifications
You must be signed in to change notification settings - Fork 236
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Move UndoManager creation code outside StyledTextArea #333
Comments
By including an Thus, RTFX should provide a factory method that can install a basic plain or rich UndoFX UndoManager into an area for convenience. |
Closed by #528. |
Relates to #233. In order to have non-linear undo/redo capability,
StyledTextArea
and its model class will need to take anUndoManager
argument and push the creation code outside of the area itself.There's a few things to keep in mind:
QuadFunction
that accepts the arguments now found inStyledTextAreaModel#createRich/PlainUndoManager
. However, this might restrict the developer due to the first point made.Since anEditableStyledDocument
exists outside of the area before being inserted into one then that document could, at least technically, be modified by a non-StyledTextArea
class. If that occurs, the code should be robust enough to update all the areas displaying its content to account for that change (e.g. a valid undo might no longer be valid). This implies that the ``UndoManagerFactoryshould somehow be tied to the
EditableStyledDocument` for the lifetime of that document.UndoManagerFactory
know which items to ignore (an area changed the document) and which to accept (the document was modified directly)?UndoManager
's next undo/redo could be invalidated if a developer edited that document directly instead of through the area. Rather than accounting for that possibility (why would that happen in the first place?), it just shouldn't be done.UndoManager
's next undo/redo is only the one that the area did and not some other clone's change. UndoFX already uses something like this to ignore changes to the content that it performs:The text was updated successfully, but these errors were encountered: