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

2022-11-24 Thread Ajit Ghaisas
On Wed, 23 Nov 2022 17:18:47 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 [v13]

2022-11-23 Thread Andy Goryachev
On Wed, 23 Nov 2022 17:18:47 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 [v13]

2022-11-23 Thread Kevin Rushforth
On Wed, 23 Nov 2022 17:18:47 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 [v12]

2022-11-23 Thread Andy Goryachev
On Wed, 23 Nov 2022 16:03:44 GMT, Andy Goryachev wrote: >> Agreed. > > any suggestions? Disconnectable? HasDisconnect? will decide later - PR: https://git.openjdk.org/jfx/pull/908

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

2022-11-23 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 >

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

2022-11-23 Thread Andy Goryachev
On Tue, 22 Nov 2022 23:58:14 GMT, Kevin Rushforth 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 28 additional >>

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

2022-11-23 Thread Andy Goryachev
On Tue, 22 Nov 2022 23:43:24 GMT, Kevin Rushforth 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 28 additional >>

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

2022-11-23 Thread Andy Goryachev
On Wed, 23 Nov 2022 13:35:01 GMT, Marius Hanl wrote: >> I made a [similar >> comment](https://github.com/openjdk/jfx/pull/908#pullrequestreview-1168974400) >> about not using the `I` prefix earlier. Before this can be considered for >> public API (which won't be soon), this interface will

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

2022-11-23 Thread Marius Hanl
On Wed, 23 Nov 2022 13:28:33 GMT, Kevin Rushforth wrote: >> modules/javafx.controls/src/main/java/com/sun/javafx/scene/control/IDisconnectable.java >> line 34: >> >>> 32: */ >>> 33: @FunctionalInterface >>> 34: public interface IDisconnectable { >> >> I'm still in favor of remove the `I` in

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

2022-11-23 Thread Kevin Rushforth
On Wed, 23 Nov 2022 13:03:00 GMT, Marius Hanl 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 28 additional >> commits

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

2022-11-23 Thread Marius Hanl
On Tue, 22 Nov 2022 20:22:06 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 [v12]

2022-11-23 Thread Ajit Ghaisas
On Tue, 22 Nov 2022 20:22:06 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 [v12]

2022-11-22 Thread Kevin Rushforth
On Tue, 22 Nov 2022 20:22:06 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 [v12]

2022-11-22 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 >

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

2022-11-22 Thread Andy Goryachev
On Fri, 4 Nov 2022 19:04:03 GMT, Kevin Rushforth wrote: > we would need more descriptive names for `ChLi`, `MaChLi`, and so forth > (presuming they need to be exposed). they don't need to be exposed, will convert them to `private`. - PR: https://git.openjdk.org/jfx/pull/908

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

2022-11-21 Thread Andy Goryachev
On Tue, 15 Nov 2022 18:30:33 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 [v11]

2022-11-21 Thread Kevin Rushforth
On Tue, 15 Nov 2022 18:30:33 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-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 [v11]

2022-11-16 Thread Ajit Ghaisas
On Tue, 15 Nov 2022 18:30:33 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 [v11]

2022-11-15 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 >

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 [v10]

2022-11-14 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 >

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 >

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

2022-11-04 Thread Andy Goryachev
On Mon, 31 Oct 2022 16:45:51 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 [v8]

2022-11-04 Thread Andy Goryachev
On Fri, 4 Nov 2022 17:58:16 GMT, Kevin Rushforth wrote: >> Andy Goryachev has updated the pull request incrementally with one >> additional commit since the last revision: >> >> 8294809: whitespace > > modules/javafx.controls/src/main/java/com/sun/javafx/scene/control/IDisconnectable.java >

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

2022-11-04 Thread Kevin Rushforth
On Mon, 31 Oct 2022 16:45:51 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 [v8]

2022-11-04 Thread Kevin Rushforth
On Mon, 31 Oct 2022 16:45:51 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 [v6]

2022-11-03 Thread Andy Goryachev
On Fri, 28 Oct 2022 20:02:40 GMT, Andy Goryachev 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

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

2022-10-31 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 >

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

2022-10-28 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 >

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

2022-10-28 Thread Andy Goryachev
On Thu, 27 Oct 2022 17:15:55 GMT, Kevin Rushforth 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 >>

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

2022-10-27 Thread Kevin Rushforth
On Fri, 21 Oct 2022 20:24:07 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 [v6]

2022-10-21 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 >

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

2022-10-19 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 >

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

2022-10-19 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 >

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

2022-10-19 Thread Andy Goryachev
On Fri, 14 Oct 2022 19:11:08 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 [v3]

2022-10-19 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 >

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

2022-10-14 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 >

Re: RFR: 8294809: ListenerHelper for managing and disconnecting listeners

2022-10-14 Thread Andy Goryachev
On Thu, 13 Oct 2022 10:56:54 GMT, Nir Lisker wrote: > Reading your proposal I see you might be looking to support weak listeners as well. Personally, I believe these are better replaced You have a *very* good point here, considering the purpose of this class. Let me see if support for weak

Re: RFR: 8294809: ListenerHelper for managing and disconnecting listeners

2022-10-13 Thread Andy Goryachev
On Fri, 7 Oct 2022 20:50:55 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 installed

Re: RFR: 8294809: ListenerHelper for managing and disconnecting listeners

2022-10-13 Thread Nir Lisker
Hi, I agree with John. The work on managing listeners has been in the works for a long while now and it provides a lot more flexibility for less technical debt. I have already reviewed his 'when' proposal (sans its implementation on Node) and I think that it's the way to go. Fluent bindings

Re: RFR: 8294809: ListenerHelper for managing and disconnecting listeners

2022-10-13 Thread John Hendrikx
Hi Andy, There is another PR that will help with this: https://github.com/openjdk/jfx/pull/830 It adds a `when` method on `ObservableValue`:   default ObservableValue when(ObservableValue condition) This method can be used for all kinds of things, and one of them is that it could be

RFR: 8294809: ListenerHelper for managing and disconnecting listeners

2022-10-12 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