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

Jeanette Winzenburg fastegal at openjdk.org
Wed Aug 24 16:02:43 UTC 2022


On Fri, 12 Aug 2022 18:15:37 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 incrementally with one additional commit since the last revision:
> 
>   8290844: review comments

trying again: the current state of a (arbitrarily complex property)

     // constructor setting a property unconditionally
     control.setYY(myYY);

     // dispose
     if (getSkinnable().getYY() == myYY) getSkinnable().setYY(myYY); 

We agree that setting the property unconditionally is suboptimal, a better (yet to be implemented, RFE required :) way would be to only do so if the control doesn't have one set

      // constructor setting a property as default, only if the control doesn't have its own
      // not possible - can't differentiate control-set from skin-set
      if (control.getYY() == null) control.setYY(myYY);

      // dispose is the same
      if (getSkinnable().getYY() == myYY) getSkinnable().setYY(null);

Implementating that pattern - in a future RFE - requires new API, f.i. separating instantiation from install

      // constructor does nothing related to YY

      // install
      // the constraint getSkinnable().getSkin() == null guarantees that no skin installed property is left
      if (control.getYY() == null) control.setYY(myYY);

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

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


More information about the openjfx-dev mailing list