RFR: 8301121: RichTextArea Control (Incubator) [v3]

Andy Goryachev angorya at openjdk.org
Mon Aug 19 16:33:03 UTC 2024


On Mon, 19 Aug 2024 05:01:13 GMT, Robert Lichtenberger <rlichten at openjdk.org> wrote:

>> You are right, but this is just a default implementation.  you can still implement your own `BasicTextModel.Content` and pass it to the constructor.
>> 
>> Do you want to see an in-memory implementation optimized for large number of paragraphs or should it better be left up to the app developers?
>
> Yes, we should definitely provide a very efficient implementation, because most app developers will not want to change it. We should definitely avoid another "TextArea situation", where the application breaks apart, if the text grows too big.

I am strongly against `LinkedList` here: not only it adds 2 pointers to each element, but mostly because it provides no random access.

ArrayList should be sufficient for simple cases, and the developers are free to implement a better Content _for their use case_.  Maybe it's a skip list, or BPlusTree, or something else.

I would also like to mention that the performance issue with TextArea is not the storage (at least it is not the first order issue), but the fact that it renders all the text (in a single Text node).  RTA renders only the sliding window, which should be much faster.  Of course, RTA will have issues with very long paragraphs, but that's a different story (and is mentioned in the Non-Goals section)

https://github.com/andy-goryachev-oracle/Test/blob/main/doc/RichTextArea/RichTextArea.md#non-goals

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

PR Review Comment: https://git.openjdk.org/jfx/pull/1524#discussion_r1722060389


More information about the openjfx-dev mailing list