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ß <[email protected]>
Date: Thursday, 2022/07/21 at 12:03
To: Andy Goryachev <[email protected]>
Cc: [email protected] <[email protected]>
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.

Reply via email to