Should there be getter methods in LabeledSkinBase?

Jonathan Giles jonathan.giles at oracle.com
Tue May 2 21:32:40 UTC 2017


Thorsten,

Your reference to JDK-8077916 is correct here. Our first goal was to 
simply get the skins into the public API in a minimal form. In some 
cases there was then follow-up feedback from the community regarding 
missing API, and there were improvements made. Your feedback here is the 
same, and should be turned into a jira issue for follow-up discussion 
(did you want to do this - if not, I can do it).

For JDK 9 the ship has (essentially) sailed and we can't improve the API 
for LabeledSkinBase like you would like. One alternate approach is to 
consider composing your skin with a Label, rather than having it extend 
LabeledSkinBase.

In the fullness of time, I would love to see these skin classes in more 
public use, but I can appreciate we need to do a push in the JDK 10 
timeframe to fill out these gaps. Any feedback here from the community 
is much appreciated - file Jira issues and the API will be discussed and 
considered with a high priority.

-- Jonathan

On 3/05/17 6:51 AM, Thorsten_Fischer at gmx.de wrote:
> Hi there,
>
> I’m currently working on creating a new JavaFX control with jdk 9 (latest ea release). Now I have a question regarding the ‚LabeledSkinBase‘ class. (I’d like implement something similar to a TitledPane and the corresponding Skin class extends from LabeledSkinBase).
>
> I’d really like to rely on some parts of LabeledSkinBase (like the JDK’s TitledPaneSkin class does in its update() method), but I cannot access the package protected declared fields, like „LabeledText text". Why are there no getters implemented for them? This means, that your own shipped controls may rely on the LabeledSkinBase class and I sadly cannot. On a field like "Node graphic" I can work around myself with getSkinnable().getGraphic() but imho this als would be cleaner with specific getters supplied. This applies also to utility methods of LabeledSkinBase, like isIgnoreGraphic().
>
> I know that even with JDK-8077916 (making UI controls Skins public API) your goal was to make only the minimal necessary API public, but in this case I cannot reuse this class at all.. Or do I miss something? Are there public alternatives? Should I even use this class? Would be nice if someone can give his/her opinion on this one.
>
> Thank you in advance,
> Thorsten
>



More information about the openjfx-dev mailing list