JEP 253: UI control skins and input mapping discussion
Jonathan Giles
jonathan.giles at oracle.com
Thu Aug 6 23:07:39 UTC 2015
Hi all,
As you might be aware, JEP 253 is all about getting private JavaFX UI
control and CSS APIs out into the public. You can read all about JEP 253
at [1]. This JEP is split into three sub-projects:
1) Make UI control skins into public APIs
2) Improve support for input mapping
3) Review and make public relevant CSS APIs
Today I'm posting a first javadoc that contains a proposed set of API
for project 1) and 2). The javadoc for project 3) will come in a week or
two, once it is closer to completion. You can find the javadoc for the
first two projects at [2].
In this javadoc you'll see three packages. Here's a few brief comments:
1) javafx.scene.control: This package is unchanged. It is only here for
completeness (so you can compare control classes to skin classes).
2) javafx.scene.control.skin: This package is entirely new. It consists
of many of the classes that previously inhabited
com.sun.javafx.scene.control.skin. Look closely at the skin classes you
are interested in - almost all classes do not resemble their original
form. This is because up until now, skin classes have never been
considered public API, and as such not much was done to ensure a sane
API. With JDK 9 this changes, and so the amount of API on each class is
significantly less than what existed previously. We will take the normal
approach of growing the API as demand is shown - so if something is
missing, please comment ASAP!
3) javafx.scene.input: This package contains just the new classes as
part of this JEP. In general the classes here are the most preliminary
of the bunch - they are likely to go under the most change between now
and JDK 9 being released. Please review and comment.
The primary implementation change is that whilst Skins are mostly
unchanged, they handle behaviors differently than now. Input mappings
are now created by the skin and installed on the control. It is
conceivable that in a future release these behaviors will themselves
become public API, but for JEP 253 that is out of scope.
There are still a few things to be thought through:
1) How to document the available input mappings so they can be easily
searched for at runtime (javadoc? Java API?)
2) Controls have an empty inputMap until skin is instantiated - this
means manipulating the mappings can't happen as soon as the control is
created.
3) No plan on how this might support Action-style API in the future.
4) There is no API to access context menus in controls such as TextField
(to add / remove functionality).
I look forward to any feedback you may have. Feel free to email me on-
or off- list.
[1] http://openjdk.java.net/jeps/253
[2] http://jonathangiles.net/javafx/jdk9/public-skins/2/
Thanks,
-- Jonathan
More information about the openjfx-dev
mailing list