java.lang.Object
is.codion.swing.common.ui.TransferFocusOnEnter
A utility class for adding focus traversal events based on the Enter key.
-
Method Summary
Modifier and TypeMethodDescriptionstatic Action
Instantiates an Action for transferring keyboard focus backward.static <T extends JComponent>
Tdisable
(T component) Disables the transfer focus action added viaenable(JComponent)
static <T extends JComponent>
Tenable
(T component) Adds a key event to the component which transfers focus on enter, and backwards if SHIFT is down.static Action
Instantiates an Action for transferring keyboard focus forward.
-
Method Details
-
enable
Adds a key event to the component which transfers focus on enter, and backwards if SHIFT is down. Note that for JTextArea CTRL is added to move focus forward.- Type Parameters:
T
- the component type- Parameters:
component
- the component- Returns:
- the component
- See Also:
-
disable
Disables the transfer focus action added viaenable(JComponent)
- Type Parameters:
T
- the component type- Parameters:
component
- the component- Returns:
- the component
-
forwardAction
Instantiates an Action for transferring keyboard focus forward.- Returns:
- an Action for transferring focus
-
backwardAction
Instantiates an Action for transferring keyboard focus backward.- Returns:
- an Action for transferring focus
-