RFR: 8258777: SkinBase: add api to un-/register invalidation-/listChange listeners [v4]

Nir Lisker nlisker at openjdk.java.net
Mon Mar 29 17:30:28 UTC 2021


On Mon, 29 Mar 2021 15:53:55 GMT, Jeanette Winzenburg <fastegal at openjdk.org> wrote:

>> Changes in Lambda..Handler:
>> - added api and implemenation to support invalidation and listChange listeners in the same way as changeListeners
>> - added java doc 
>> - added tests
>> 
>> Changes in SkinBase
>> - added api (and implementation delegating to the handler)
>> - copied java doc from the change listener un/register methods 
>> - added tests to verify that the new (and old) api is indeed delegating to the handler
>> 
>> Note that the null handling is slightly extended: all methods now can handle both null consumers (as before) and null observables (new) - this allows simplified code on rewiring "path" properties (see reference example in the issue)
>
> Jeanette Winzenburg has updated the pull request incrementally with one additional commit since the last revision:
> 
>   fixed trailing whitespace

modules/javafx.controls/src/main/java/javafx/scene/control/SkinBase.java line 246:

> 244:     /**
> 245:      * Registers an operation to perform when the given {@code Observable} sends an invalidation event.
> 246:      * Does nothing if observable or operation is {@code null}.

I would write "Does nothing if either {@code observable} or {@code operation} are {@code null}"

modules/javafx.controls/src/main/java/javafx/scene/control/SkinBase.java line 265:

> 263:      * Unregisters all operations that have been registered using
> 264:      * {@link #registerInvalidationListener(Observable, Consumer)}
> 265:      * for the given observable.

If the parameter can be `null`, mention what happens like in `registerInvalidationListener`.

modules/javafx.controls/src/main/java/javafx/scene/control/SkinBase.java line 270:

> 268:      *  may be {@code null}
> 269:      * @return a composed consumer that performs all removed operations or
> 270:      *  {@code null} if none has been registered or the observable is {@null}

* Comma before the first "or"
* "none *have* been"

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

PR: https://git.openjdk.java.net/jfx/pull/409


More information about the openjfx-dev mailing list