-
Enhancement
-
Resolution: Duplicate
-
P3
-
None
The scenegraph lacks the concept of an "inactive" focus owner. Consider the case of a TextBox. Suppose I have some text in the TextBox and I select that text. If I transfer focus to a different application, the selection should still be valid and the selection should usually be rendered in a different color (most skins use grey). If however focus is transfered to a different control in the same application, then the selection should be cleared.
Thus, there is a difference between having the focus (which requires the Stage to also be focused), and being the focus owner within the Stage.
One solution is to have a focusOwner variable in addition to focused. Focused would indicate that the Node is both the focus owner and its Stage contains focus. Being the focusOwner simply indicates that this Node has the focus within the stage. If the stage loses focus, the Node would have "false" for focused but would still have "true" for focusOwner. If focus is transfered away programatically while the stage no longer has focus, the new Node would have focusOwner set to true but focused would be false.
Thus, there is a difference between having the focus (which requires the Stage to also be focused), and being the focus owner within the Stage.
One solution is to have a focusOwner variable in addition to focused. Focused would indicate that the Node is both the focus owner and its Stage contains focus. Being the focusOwner simply indicates that this Node has the focus within the stage. If the stage loses focus, the Node would have "false" for focused but would still have "true" for focusOwner. If focus is transfered away programatically while the stage no longer has focus, the new Node would have focusOwner set to true but focused would be false.
- duplicates
-
JDK-8102095 Need a way to know currently focused component
- Closed
- relates to
-
JDK-8099689 RFE: There should be a way to find out the current focused node on a Scene
- Closed
-
JDK-8090588 Need way to determine if the focused Node is a child of a Parent
- Closed