Proposal: Focus Traversal API

Michael Strauß michaelstrau2 at gmail.com
Wed Oct 23 17:57:53 UTC 2024


How about „predictFocus“, which will return a Node without changing focus?

This would give applications even more flexibility, because they can then
decide if they want to go ahead and actually change focus by calling
predictFocus()?.requestFocus()


Andy Goryachev <andy.goryachev at oracle.com> schrieb am Mi. 23. Okt. 2024 um
19:16:

> Thank you for suggestion!
>
>
>
> My only problem with a more assertive “moveFocus” is that it implies a
> success, while this API may or may not succeed (similarly to requestFocus).
>
>
>
> The word "shift" in "shiftFocus" might clash with the "shift" key, don't
> really like that.
>
>
>
> Maybe "requestTraversal" although it will expand auto-completion list that
> has 2 items already.  Welcome any alternative, as long as it's not creat().
>
>
>
> -andy
>
>
>
>
>
> *From: *openjfx-dev <openjfx-dev-retn at openjdk.org> on behalf of Michael
> Strauß <michaelstrau2 at gmail.com>
> *Date: *Wednesday, October 23, 2024 at 10:05
> *To: *
> *Cc: *openjfx-dev at openjdk.org <openjfx-dev at openjdk.org>
> *Subject: *Re: Proposal: Focus Traversal API
>
> Maybe we can polish the naming a bit:
>
> When used as a transitive verb, "traverse" means (according to
> Merriam-Webster): to go or travel across or over, to move or pass
> along or through.
>
> MW gives the example: "light rays traversing a crystal". So one thing
> is moving (light rays), while the other thing is static (a crystal).
> Cambridge gives the example "Stanley traversed the continent from west
> to east." Again, "Stanley" is moving, "the continent" is static.
>
> Since "traverseFocus" is a transitive verb followed by a direct noun,
> it sounds to me like "focus" is the thing that can be traversed over
> or across.
> As an analogy, let's call the method "traverseContinent" for a moment.
> It becomes obvious that "continent" is the space which is traveled
> across, and not the thing travelling.
>
> In our case, "focus" is the moving thing, not the thing that it is
> moved across. I would use something like "moveFocus", "shiftFocus", or
> something along those lines.
>
> As for "TraversalDirection", I think it is acceptable, but I'll note
> that to me, "direction" implies one of the four directional modes, not
> the two logical modes (previous and next).
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/openjfx-dev/attachments/20241023/fb5ab303/attachment.htm>


More information about the openjfx-dev mailing list