[External] : Re: Proposal: Add Skin.install() method
Andy Goryachev
andy.goryachev at oracle.com
Thu Jul 21 21:55:30 UTC 2022
Thank you, Michael.
Perhaps the Skin life cycle should be clarified explicitly in Skin interface, or Control.setSkin(Skin) javadoc.
Also, the javadoc for Skin interface might need correcting, as it refers to Skin as "base class".
Created RFE https://bugs.openjdk.org/browse/JDK-8290844
Cheers,
-andy
From: Michael Strauß <michaelstrau2 at gmail.com>
Date: Thursday, 2022/07/21 at 12:03
To: Andy Goryachev <andy.goryachev at oracle.com>
Cc: openjfx-dev at openjdk.org <openjfx-dev at openjdk.org>
Subject: [External] : Re: Proposal: Add Skin.install() method
I agree with the assessment that skin initialization should not happen
in the constructor of a skin, but only when the skin is actually
installed on a control. You already laid out several reasons, but
here's another: some skin classes call methods in their constructor as
part of skin initialization that are overridden in derived skin
classes. This makes it harder to reason about the state of a skin
under initialization, since methods in derived classes will be called
on a partially constructed object. Adding an install() method and
having a clearly defined life-cycle fixes that also.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/openjfx-dev/attachments/20220721/218eb770/attachment-0001.htm>
More information about the openjfx-dev
mailing list