Re: RFR: 8294809: ListenerHelper for managing and disconnecting listeners [v9]

2022-11-16 Thread Ajit Ghaisas
On Tue, 15 Nov 2022 18:16:20 GMT, Andy Goryachev wrote: >> The `accessor` cannot be null **only if** it is used from *Skins. >> In the current form, as we provide a no-argument public constructor, it is >> possible to create an object of `ListenerHelper` without calling >> setAccessor. Many

Re: RFR: 8294809: ListenerHelper for managing and disconnecting listeners [v9]

2022-11-15 Thread Andy Goryachev
On Tue, 15 Nov 2022 06:35:05 GMT, Ajit Ghaisas wrote: >> Exactly. In its current form, `ListenerHelper` is a utility helper class for >> Skins, and should be reviewed with that in mind. As discussed in previous >> comments, there are several things that will need to change when/if this is >>

Re: RFR: 8294809: ListenerHelper for managing and disconnecting listeners [v9]

2022-11-15 Thread Andy Goryachev
On Tue, 15 Nov 2022 06:17:21 GMT, Ajit Ghaisas wrote: >> Right, there is no way the accessor can be null, since it is initialized at >> class load time in the static initializer, We do this in many other places >> (e.g., Node.java). > > The `accessor` cannot be null **only if** it is used from

Re: RFR: 8294809: ListenerHelper for managing and disconnecting listeners [v9]

2022-11-14 Thread Ajit Ghaisas
On Mon, 14 Nov 2022 21:26:52 GMT, Kevin Rushforth wrote: >> you are correct: the original intent for this class was to make it a general >> purpose facility to help with listeners, something that might be useful at >> the application level (and it used `ListenerHelper.get(Node)`). Since that

Re: RFR: 8294809: ListenerHelper for managing and disconnecting listeners [v9]

2022-11-14 Thread Kevin Rushforth
On Mon, 14 Nov 2022 20:26:54 GMT, Andy Goryachev wrote: >> modules/javafx.controls/src/main/java/com/sun/javafx/scene/control/ListenerHelper.java >> line 70: >> >>> 68: * >>> 69: */ >>> 70: public class ListenerHelper implements IDisconnectable { >> >> This class is mixing two things- >>

Re: RFR: 8294809: ListenerHelper for managing and disconnecting listeners [v9]

2022-11-14 Thread Kevin Rushforth
On Mon, 14 Nov 2022 20:19:09 GMT, Andy Goryachev wrote: >> modules/javafx.controls/src/main/java/com/sun/javafx/scene/control/ListenerHelper.java >> line 87: >> >>> 85: >>> 86: public static ListenerHelper get(SkinBase skin) { >>> 87: return accessor.apply(skin); >> >> `accessor`

Re: RFR: 8294809: ListenerHelper for managing and disconnecting listeners [v9]

2022-11-14 Thread Andy Goryachev
On Mon, 14 Nov 2022 09:08:11 GMT, Ajit Ghaisas 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 24 additional >>

Re: RFR: 8294809: ListenerHelper for managing and disconnecting listeners [v9]

2022-11-14 Thread Andy Goryachev
On Mon, 14 Nov 2022 10:20:59 GMT, Ajit Ghaisas 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 24 additional >>

Re: RFR: 8294809: ListenerHelper for managing and disconnecting listeners [v9]

2022-11-14 Thread Ajit Ghaisas
On Fri, 4 Nov 2022 20:30:53 GMT, Andy Goryachev wrote: >> Introduction >> >> There is a number of places where various listeners (strong as well as weak) >> are added, to be later disconnected in one go. For example, Skin >> implementations use dispose() method to clean up the listeners

Re: RFR: 8294809: ListenerHelper for managing and disconnecting listeners [v9]

2022-11-10 Thread Andy Goryachev
On Fri, 4 Nov 2022 20:30:53 GMT, Andy Goryachev wrote: >> Introduction >> >> There is a number of places where various listeners (strong as well as weak) >> are added, to be later disconnected in one go. For example, Skin >> implementations use dispose() method to clean up the listeners

Re: RFR: 8294809: ListenerHelper for managing and disconnecting listeners [v9]

2022-11-04 Thread Andy Goryachev
> Introduction > > There is a number of places where various listeners (strong as well as weak) > are added, to be later disconnected in one go. For example, Skin > implementations use dispose() method to clean up the listeners installed in > the corresponding Control (sometimes using >