calendar picker chaining
jonathan.giles at oracle.com
Sat Aug 11 14:42:24 PDT 2012
> How would this be done? I am not supposed use the setSkin method, so
> does specifying that a certain control on a certain screen uses the
> multimonth skin belong in the CSS? And the configuration of the skin;
> how many months, grid layout (2x2, 3x1), also in the CSS? How would I
> access this information in the skin itself?
Unfortunately the images never arrived, so I'm not entirely clear on
what you are showing. I'm also not totally clear on your question.
However, here is an answer to a question, hopefully somewhat related to
What we do in the JavaFX UI controls team is have one control with
potentially multiple visuals represented as different style classes. You
can see this with the TabPane, it has a public static final
STYLE_CLASS_FLOATING string, which users may use to modify the styling,
TabPane tabPane = new TabPane();
We use the STYLE_CLASS prefix to clarify the purpose of the public
static string. It should be noted that probably no one knows about the
existence of this floating style, but I'm sure one day someone will make
the discovery. We don't do this too many times, from memory I think it
is also done in the new 2.2 controls Pagination and ColorPicker as well.
I know that, in the case of ColorPicker, there is code that modifies the
actual layout based on the style class. In the case of TabPane (last
time I looked) there is no difference in the skin code, just in the CSS.
So, it all comes down to the complexity of the skin, and of course the
preference is to push it out as far to the boundaries as possible (that
is, CSS should take precedence over skin layout code whenever possible).
It would definitely pay to check out OpenJFX and look at the code for
TabPane, ColorPicker and Pagination.
If you want to expose new CSS properties you'll have to use private API
currently. Look at TreeCellSkin - it exposes -fx-indent as a CSS
property to let users configure how much indentation there is per level
in the TreeView. Of course, standard disclaimers apply - we can't stop
you using private API, but please don't complain to us when we break
your code - and I promise we will.
Hope that helps,
More information about the openjfx-dev