On Thu, 8 Aug 2024 16:23:43 GMT, Andy Goryachev <ango...@openjdk.org> wrote:

> b) I am not convinced that returning null from a dispatcher is a good 
> solution. We already have an API for that: `Event.isConsumed()`. Adding a 
> new, parallel paradigm, in my opinion is unnecessary.

We would not be adding anything. Consuming an event is how a developer 
communicates to one EventDispatcher that the event was dealt with. But this 
information is propagated through the dispatch chain by returning null from 
dispatchEvent. That's all in place already.

There's a variant of `EventUtil.fireEvent` that returns the result of 
dispatchEvent so a client can check for null to see if the event was consumed. 
And there are already places in the code where this happens. 
[JDK-8303209](https://bugs.openjdk.org/browse/JDK-8303209) calls for this to be 
cleaned up and made public.

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

PR Comment: https://git.openjdk.org/jfx/pull/1523#issuecomment-2276277201

Reply via email to