RichTextArea Feedback
Jurgen Doll
jurgen at ivoryemr.co.za
Mon Nov 3 09:53:00 UTC 2025
Hi Andy
Thanks for posting a summary to the dev list.
With regards to this point:
>> As expected though paste and undo/redo don't work due to
> StyledTextModel's final replace method not handling INLINE_NODE's
>
> This is correct, and I think it might be better to leave up to the
> (custom) model. The reason for it is it should be up to the
> application/custom model to decide how to deal with the embedded
> nodes, especially interactive ones.
I understand your rational, however having tried it myself (with two
different models) I can claim with a high degree of confidence that it's
currently impossible. Unless I've missed something, a developer
extending any form of StyledTextModel cannot accomplish this.
The fix if I'm not mistaken is straightforward. What is required is
the addition of something like the following method to StyledTextModel:
protected abstract int insertNodeSegment(int index, int offset,
Supplier<Node> sup, StyleAttributeMap? attrs?);
and that the method:
public final TextPos replace(..., StyledInput input)
then handles INLINE_NODE and appropriately invokes this added
insertNodeSegment method.
All your current sub-classes of StyledTextModel can then just implement
No-Op implementations of insertNodeSegment. Of course it would be
awesome if RichTextModel could handle inline nodes out of the box.
I hope this meets with your approval and if I've missed something please
let me know.
Thanks, regards
Jurgen
More information about the openjfx-dev
mailing list