RFR: 8290844: Add Skin.install() method [v15]

Andy Goryachev angorya at openjdk.org
Thu Oct 27 23:40:35 UTC 2022


On Thu, 27 Oct 2022 18:05:36 GMT, John Hendrikx <jhendrikx 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 28 additional commits since the last revision:
>> 
>>  - Merge remote-tracking branch 'origin/master' into 8290844.skin.install
>>  - 8290844: review comments
>>  - Merge remote-tracking branch 'origin/master' into 8290844.skin.install
>>  - 8290844: review comments
>>  - Merge remote-tracking branch 'origin/master' into 8290844.skin.install
>>  - 8290844: javadoc
>>  - Merge remote-tracking branch 'origin/master' into 8290844.skin.install
>>  - 8290844: javadoc
>>  - Merge branch 'openjdk:master' into 8290844.skin.install
>>  - 8290844: unit tests
>>  - ... and 18 more: https://git.openjdk.org/jfx/compare/b3cfd555...3235d433
>
> modules/javafx.controls/src/main/java/javafx/scene/control/Skin.java line 78:
> 
>> 76:      * previous skin, if any, has been uninstalled via its {@link #dispose()} method.
>> 77:      * This method allows a Skin to register listeners, add child nodes, set
>> 78:      * required properties and/or event handlers.
> 
> I don't see how it is relevant for this interface to know what happens to the previous skin.  The interface should simply describe what is expected, and not go into detail here.
> 
> Suggestion:
> 
>      * Called when the {@link Skin} is accepted for its control. The skin can now
>      * safely make changes to its associated control, like registering listeners, adding 
>      * child nodes and modifying properties and event handlers.
>      *
>      * <p>When the control calls this method, it guarantees a future call to {@link #dispose} 
>      * when the skin is removed.

I do think it's important, but I like John's wording of the second sentence.
I'd rather not add the sentence about future call - there is no such guarantee.

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

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


More information about the openjfx-dev mailing list