On Mon, 18 May 2026 20:35:01 GMT, Martin Fox <[email protected]> wrote:

>> modules/javafx.base/src/main/java/com/sun/javafx/event/EventUtil.java line 
>> 78:
>> 
>>> 76:     }
>>> 77: 
>>> 78:     public static Event dispatch(Event event, EventDispatcher 
>>> dispatcher) {
>> 
>> would it make sense to pass the `Node` instead of the dispatcher, and return 
>> a `boolean`?
>
> EventUtil is in the javafx.base module and doesn't have access to Node.
> 
> Dispatching an event returns an event (possibly null) and all other routines 
> in EventUtil return that event. It strikes me as artificial to only check 
> whether the event was consumed or not.

This is a utility method to dispatch an `Event` to a `Node`, right?  So 
returning a boolean which is then passed on makes sense.  The 
`Node.getEventDispatcher()` is a public API.

Perhaps I don't quite understand your objection?

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

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

Reply via email to