RFR: 8296266: TextArea: Navigation breaks with RTL text

Andy Goryachev angorya at openjdk.org
Mon Oct 9 22:04:05 UTC 2023


On Mon, 9 Oct 2023 20:44:24 GMT, Phil Race <prr at openjdk.org> wrote:

>> The fix uses character BreakIterator instead of the logic that relies on caretBounds/hitTest/rangeShape in TextInputControl.nextCharacterVisually().
>> 
>> I believe this is a more reliable method of navigation, as it behaves in sync with the jdk break iterator, thought it might work differently around grapheme clusters, considering a recent change JDK-8291660
>> 
>> This change also introduces TextInputControlHelper class (impl. detail) which gives access to character- and word- break iterators cached by TextInputControl (*some say* these iterators and associated editing logic should be a part of Content implementation, but that's a discussion for another day).
>
> modules/javafx.controls/src/main/java/javafx/scene/control/TextInputControl.java line 759:
> 
>> 757:     /**
>> 758:      * Returns a cached instance of character break iterator, creating it if necessary.
>> 759:      * The instance is initialized with the given text.
> 
> "updated with the current text" might be more accurate ? It obviously has to be up to date to be used.
> I'm also unsure of the performance consequences of having a BI spanning the entire text of the TextControl, which could be quite large, but that's what the code was already doing I suppose.

+1 thanks!

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

PR Review Comment: https://git.openjdk.org/jfx/pull/1220#discussion_r1350822221


More information about the openjfx-dev mailing list