Move EventHandlerManager to public API

Johan Vos johan.vos at gluonhq.com
Sat Oct 24 09:12:21 UTC 2020


That sounds like a valid reason for opening more API's, similar to what we
did with the VirtualFlow.
I would love to hear the opinion from others -- preferably now on the
mailing list instead of later in a PR/CSR.

- Johan

On Mon, Oct 19, 2020 at 8:49 AM Abhinay Agarwal <abhinay_agarwal at live.com>
wrote:

> Hi,
>
> Classes which extends Node have access to the protected method
> `setEventHandler`[1]. It makes it exceptional easy to register a
> user-defined onXXX event handler.
>
> However, for custom EventTarget which do not extend Node, it becomes
> cumbersome as JavaFX expects us to create a whole new EventDispatcher to
> register custom event handlers/filters on these targets. JavaFX already has
> a number of implementation for EventDispatcher in the `com.sun` package.
> The most basic of which are BasicEventDispatcher and EventHandlerManager.
> The later seems to have all the necessary public methods to make it easier
> to create new EventTargets.
>
> Unless there is a good reason which I am missing, JavaFX should provide a
> basic implementation of EventDispatcher to make it easier for developers to
> create custom EventTarget.
>
> FYR, ControlsFX has 3 classes which implement EventTarget directly:
>
>   1.
>
> AutoCompletionBinding [2]
>
>
>   2.
>
> GridBase [3]
>
>   3.
>
> SpreadsheetCellBase [4]
>
> Regards,
> Abhinay
>
> [1]
> https://github.com/openjdk/jfx/blob/master/modules/javafx.graphics/src/main/java/javafx/scene/Node.java#L8776
> [2]
> https://github.com/controlsfx/controlsfx/blob/jfx-13/controlsfx/src/main/java/org/controlsfx/control/textfield/AutoCompletionBinding.java
> [3]
> https://github.com/controlsfx/controlsfx/blob/jfx-13/controlsfx/src/main/java/org/controlsfx/control/spreadsheet/GridBase.java
> [4]
> https://github.com/controlsfx/controlsfx/blob/jfx-13/controlsfx/src/main/java/org/controlsfx/control/spreadsheet/SpreadsheetCellBase.java
>


More information about the openjfx-dev mailing list