On Tue, 15 Jul 2025 03:58:55 GMT, Sergey Bylokhov <s...@openjdk.org> wrote:

> It means exactly that, and it is also impossible to request the first 
> character after the caret position if it is at the start of the document. For 
> both cases getAtIndex() should work.

Ok, let's step away from the documentation and try to focus on the use case of 
this method. Method is supposed to expose navigation within the text component 
to the assistive technology devices and programs. One of such programs (not the 
only one) is a text narrator. These narrators are meant to be used on text 
components and they have special shortcuts to narrate the previous and next 
word or character compared to the current caret position. And if you say that 
at the end of the text when caret is behind the last symbol the "narrate 
previous word before cursor" should say "null" or just say nothing - well, i 
would like to know what is your logic behind it because for me it is clearly 
wrong. The documentation needs to be corrected as well as implementation - 
first of all it does not take into account bidirectional text and i think that 
might be a problem - but the fix here doing the right thing regarding physical 
meaning of this interface in the context of accessibility.

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

PR Comment: https://git.openjdk.org/jdk/pull/25941#issuecomment-3095528873

Reply via email to