StyledTextArea is a Node and as such takes care of rendering the visual representation of a document. In other words, StyledTextArea is the view. A big part of the model is represented by EditableStyledDocument, which is independent of the view. However, some parts of the model currently leak into StyledTextArea; namely undo/redo, caret position and selection. As a result, for example, to test undo/redo, one needs to instantiate the view, even though undo/redo itself doesn't depend on the view.
I propose to introduce a class (StyledTextAreaModel) to encapsulate the model.
StyledTextAreais aNodeand as such takes care of rendering the visual representation of a document. In other words,StyledTextAreais the view. A big part of the model is represented byEditableStyledDocument, which is independent of the view. However, some parts of the model currently leak intoStyledTextArea; namely undo/redo, caret position and selection. As a result, for example, to test undo/redo, one needs to instantiate the view, even though undo/redo itself doesn't depend on the view.I propose to introduce a class (
StyledTextAreaModel) to encapsulate the model.