RFR: 8290844: Add Skin.install() method [v3]
Jeanette Winzenburg
fastegal at openjdk.org
Fri Aug 12 17:03:44 UTC 2022
On Thu, 11 Aug 2022 22:19:39 GMT, Andy Goryachev <angorya at openjdk.org> wrote:
>> - added Skin.install()
>> - javadoc changes for Skinnable.setSkin(Skin)
>>
>> no code changes for Skinnable.setSkin(Skin) yet.
>
> 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 13 additional commits since the last revision:
>
> - 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
> - 8289397: added space
> - 8290844: skin.install
> - 8290844: whitespace
> - 8290844: validate input
> - 8290844: illegal argument exception
> - 8290844: illegal argument exception
> - ... and 3 more: https://git.openjdk.org/jfx/compare/7839c8cd...647ecd6c
did a bit of experimenting, trying to eat and keep the cake at the same time :) Or in terms of the new skin api: have a nice new life-cycle without breaking existing skins
The idea:
- let skin have another new method `supportsInstall` with a default to false
- let our concrete skins implement that to test against their exact class
- let constructors of concrete skins call install if supportsInstall returns false
- custom skins will see the completely installed super if not refactored, or have moved their own installation code into install and overridden supportsInstall to return true
A quick PoC is in [my fork off Andy's PR](https://github.com/kleopatra/jfx/tree/exp-skin-install-supportsInstall) - obviously very raw :) - for TextFieldSkin, tested in SkinCleanupTest: note the uncommented ignores for [JDK-8268877](https://bugs.openjdk.org/browse/JDK-8268877) which pass due to Andy's work on install. Directly below those is a test against a custom text skin which expects super to be fully installed at the end of the constructor.
Have a nice weekend, everybody, whenever it begins in your timezone!
-------------
PR: https://git.openjdk.org/jfx/pull/845
More information about the openjfx-dev
mailing list