RFR: 8294809: ListenerHelper for managing and disconnecting listeners [v6]

Andy Goryachev angorya at openjdk.org
Fri Oct 28 20:04:47 UTC 2022


On Thu, 27 Oct 2022 17:15:55 GMT, Kevin Rushforth <kcr at openjdk.org> wrote:

>> Andy Goryachev has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains 20 additional commits since the last revision:
>> 
>>  - 8294809: map change listener
>>  - Merge remote-tracking branch 'origin/master' into 8294809.listener.helper
>>  - 8294809: generics
>>  - 8294809: is alive
>>  - Revert "8294809: removed weak listeners support"
>>    
>>    This reverts commit 2df4a85db638d76cacaf6c54ba669cdb3dd91a18.
>>  - 8294809: removed weak listeners support
>>  - 8294809: use weak reference correctly this time
>>  - 8294809: tests
>>  - 8294809: remove
>>  - 8294809: change listener with callback
>>  - ... and 10 more: https://git.openjdk.org/jfx/compare/943ef2e9...7a1fa625
>
> 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.

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

PR: https://git.openjdk.org/jfx/pull/908


More information about the openjfx-dev mailing list