You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jun 24, 2021. It is now read-only.
With Java 8, we used a custom TextFieldSkin to add a few custom options to the context menu of a text field. In more recent Java versions, the relevant code now moved to TextInputControlBehavior.
Thus, it would be simple to derive from this behavior class and add additional items to the context menu. However, I don't see a way to replace the original behavior by the customized one, because the behavior is initialized here:
As explained in #5254 (comment) it is no longer possible to customize the context menu items, because the classes related to the text field behavior are not accessible. Thus, instead I simply copied the relevant code from openjdk. Pretty ugly workaround... Fixes#5254 and refs javafxports/openjdk-jfx#583.
Moreover, I removed the custom tab handling because it is now working as expected (i.e. #2902 is fixed in Java 9+).
As explained in #5254 (comment) it is no longer possible to customize the context menu items, because the classes related to the text field behavior are not accessible. Thus, instead I simply copied the relevant code from openjdk. Pretty ugly workaround... Fixes#5254 and refs javafxports/openjdk-jfx#583.
Moreover, I removed the custom tab handling because it is now working as expected (i.e. #2902 is fixed in Java 9+).
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
With Java 8, we used a custom TextFieldSkin to add a few custom options to the context menu of a text field. In more recent Java versions, the relevant code now moved to
TextInputControlBehavior
.openjdk-jfx/modules/javafx.controls/src/main/java/com/sun/javafx/scene/control/behavior/TextInputControlBehavior.java
Line 661 in 662281e
Thus, it would be simple to derive from this behavior class and add additional items to the context menu. However, I don't see a way to replace the original behavior by the customized one, because the behavior is initialized here:
openjdk-jfx/modules/javafx.controls/src/main/java/javafx/scene/control/skin/TextFieldSkin.java
Lines 151 to 154 in 4f0addf
and
behavior
inTextFieldSkin
is private. Thus, there seems to be no easy way to register a custom behavior class. Did I overlooked something obvious?The text was updated successfully, but these errors were encountered: