RFR: 8294809: ListenerHelper for managing and disconnecting listeners [v6]
Andy Goryachev
angorya at openjdk.org
Thu Nov 3 21:43:33 UTC 2022
On Fri, 28 Oct 2022 20:02:40 GMT, Andy Goryachev <angorya at openjdk.org> wrote:
>> modules/javafx.controls/src/main/java/javafx/scene/control/SkinBase.java line 222:
>>
>>> 220: * @since 20
>>> 221: */
>>> 222: protected ListenerHelper listenerHelper() {
>>
>> This would make it part of the public API, so you will need to find some other way to do this without adding anything to the public API surface.
>
> I *do* want this as public API.
>
> I can change the code to use an accessor, but it gets really ugly:
>
>
> ListenerHelper.get(PaginationSkin.this).addListChangeListener(getSkinnable().getStyleClass(), (ch) -> {
>
>
> Besides, what's the harm of adding a [better] public API? I do want ListenerHelper to be public anyway.
changed the code to remove listenerHelper() to avoid changing the public API.
For now, will be using accessor, and using a local variable in skins where we have many calls to LH (in constructors, for example).
-------------
PR: https://git.openjdk.org/jfx/pull/908
More information about the openjfx-dev
mailing list