RFR: 8370140: RichTextArea: line endings [v12]

Kevin Rushforth kcr at openjdk.org
Thu Nov 6 21:18:18 UTC 2025


On Thu, 6 Nov 2025 20:06:42 GMT, Andy Goryachev <angorya at openjdk.org> wrote:

>> Adds control of line endings (newline separators) in `StyledTextModel`, `RichTextArea`, and `CodeArea`.
>> 
>> The impacted areas are:
>> - saving to plain text
>> - copying to plain text
>> - IME
>> 
>> This feature is implemented as a regular field in the `StyledTextModel` (since it is ultimately an attribute of the model), with convenience setter and getter in the `RichTextArea`.
>> 
>> ### NOTES
>> 
>> - some dependency on #1938 , resolved.
>
> Andy Goryachev has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 16 commits:
> 
>  - Merge remote-tracking branch 'origin/master' into 8370140.line.separator
>  - review comments
>  - removed property
>  - review comments
>  - code area test
>  - Merge branch 'master' into 8370140.line.separator
>  - fixed tests
>  - non-nullable
>  - Merge branch 'master' into 8370140.line.separator
>  - get text
>  - ... and 6 more: https://git.openjdk.org/jfx/compare/5684edf7...285cf40e

Looks good. I left one minor comment, but will approve as is. Will reapprove if you decide to make changes.

modules/jfx.incubator.richtext/src/test/java/test/jfx/incubator/scene/control/richtext/support/RTUtil.java line 88:

> 86:         ByteArrayOutputStream out = new ByteArrayOutputStream();
> 87:         try {
> 88:             try {

Minor: you don't need two levels of try here. Even better, you can use try with resources instead of adding finally clause.

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

Marked as reviewed by kcr (Lead).

PR Review: https://git.openjdk.org/jfx/pull/1944#pullrequestreview-3430574192
PR Review Comment: https://git.openjdk.org/jfx/pull/1944#discussion_r2500877917


More information about the openjfx-dev mailing list