[Review request] 8178519: Consider removing two-level focus support from UI controls
Kevin, Phil, Could you please review the webrev below, which aims to remove the unused two-level focus code that presently ships in JDK 9 and earlier releases. https://bugs.openjdk.java.net/browse/JDK-8178519 http://cr.openjdk.java.net/~jgiles/8178519/ Thanks, -- -- Jonathan
Re: Two Level Focus
Hi John, However, if you do click on it with the mouse (by selecting one of its items), focus is stuck there and cannot be moved anymore with just the 5 buttons. when you click on a two_level control with a mouse it goes straight into 'internal mode', as at this stage it's obvious that there are mouse events. If you go back to 'external mode' normal traversal should be available again. On desktops the OK function is mapped to Enter, so just pressing Enter should work. You can enable this from the command line with : -Dcom.sun.javafx.twoLevelFocus=true BTW not all controls were selected to have two level functionality, and not all style sheets have separate internal-focus styles. regards, mick
Re: Two Level Focus
Hi John, TWO_LEVEL_FOCUS is a feature developed for embedded platforms. However it can be enabled for desktop platforms by setting a system property in the way you describe. The kind of input device you have is exactly a match for two level focus. On embedded platforms the criterion for setting two level focus is that arrow and select keys are available but not a full PC keyboard. Unfortunately there are a number of bugs currently filed against two level focus and we are not going to be fixing all of them for the upcoming Java 8 release. I do encourage you to file JIRAs on specific issues you run into so that we can track them in update releases. If you can include sample code and information on what JavaFX key codes are generated by your remote, that will help. Thanks, Daniel Yes, you can enable TWO_LEVEL_FOCUS on non-embedded platforms On Nov 16, 2013, at 5:22 PM, John Hendrikx hj...@xs4all.nl wrote: Hi list, I'm wondering how well the Conditional Feature TWO_LEVEL_FOCUS works, and if it is allowed to be used on non-embedded platforms. My main JavaFX project is basically a Windows/Linux application that runs without focus and is controlled with a remote control (no mouse or keyboard, although keyboard events are synthesized). This means I often run into problems related to the Window not having focus (controls donot show it, combobox drop downs close automatically, etc.) While fixing yet another of these problems in custom controls / skins, I ran into the Conditional Feature above, which quite accurately describes what I'm doing (remote control only has left/right/up/down and an OK button... and a back button) which qualifies as two level navigation I think. So I tried turning this on on Windows using: System.setProperty(com.sun.javafx.twoLevelFocus, true); ...which I dug up out of Jira. This changes ComoBox control atleast to not respond to up and down keys when it has the focus, allowing me to move away from it. However, if you do click on it with the mouse (by selecting one of its items), focus is stuck there and cannot be moved anymore with just the 5 buttons. Anyway, this sounds like it is exactly what I need and may save me a lot of work, any more information about it is appreciated! --John
Two Level Focus
Hi list, I'm wondering how well the Conditional Feature TWO_LEVEL_FOCUS works, and if it is allowed to be used on non-embedded platforms. My main JavaFX project is basically a Windows/Linux application that runs without focus and is controlled with a remote control (no mouse or keyboard, although keyboard events are synthesized). This means I often run into problems related to the Window not having focus (controls donot show it, combobox drop downs close automatically, etc.) While fixing yet another of these problems in custom controls / skins, I ran into the Conditional Feature above, which quite accurately describes what I'm doing (remote control only has left/right/up/down and an OK button... and a back button) which qualifies as two level navigation I think. So I tried turning this on on Windows using: System.setProperty(com.sun.javafx.twoLevelFocus, true); ...which I dug up out of Jira. This changes ComoBox control atleast to not respond to up and down keys when it has the focus, allowing me to move away from it. However, if you do click on it with the mouse (by selecting one of its items), focus is stuck there and cannot be moved anymore with just the 5 buttons. Anyway, this sounds like it is exactly what I need and may save me a lot of work, any more information about it is appreciated! --John