On Fri, 15 May 2026 18:53:10 GMT, Andy Goryachev <[email protected]> wrote:

> Why not make it a public API? `Event.dispatchTo(Node)` or something like that?

Dispatching to a single node is a very specialized case and I don't think it's 
worth adding a public routine. We would get more mileage out of adding a public 
API to create an EventDispatchChain. Then clients could write their own version 
of this short routine or build more complicated chains that dispatch across 
multiple nodes.

> Or, at a minimum, replace these two with a utility method added to 
> `EventUtil` ?

This routine is only used in two places and I'm hoping it stays that way. The 
right location for this routine is a common superclass of ComboBox and Spinner 
(something like ForwardingControl) but that doesn't exist and I don't know how 
to add it after the fact. As it stands Spinner doesn't handle input method 
events or requests correctly and to fix that we'll have to copy code verbatim 
from ComboBox. New controls that need to do this sort of forwarding should 
start with a common superclass and it should probably pursue a different design.

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

PR Review Comment: https://git.openjdk.org/jfx/pull/2166#discussion_r3250959788

Reply via email to