Package org.openstreetmap.josm.tools
Class InputMapUtils
- java.lang.Object
-
- org.openstreetmap.josm.tools.InputMapUtils
-
public final class InputMapUtils extends java.lang.Object
Tools to work with Swing InputMap.- Since:
- 5200
-
-
Constructor Summary
Constructors Modifier Constructor Description privateInputMapUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidaddCtrlEnterAction(javax.swing.JComponent c, javax.swing.Action a)Add an action activated with Ctrl+Enter key on a component.static voidaddEnterAction(javax.swing.JComponent c, javax.swing.Action a)Add an action activated with Enter key on a component.private static voidaddEnterAction(javax.swing.JComponent c, javax.swing.Action a, int condition)static voidaddEnterActionWhenAncestor(javax.swing.JComponent c, javax.swing.Action a)Add an action activated with Enter key on a component or its children.static voidaddEscapeAction(javax.swing.JComponent c, javax.swing.Action a)Add an action activated with ESCAPE key on a component or its children.static voidaddSpacebarAction(javax.swing.JComponent c, javax.swing.Action a)Add an action activated with Spacebar key on a component.static voidenableEnter(javax.swing.JButton b)Enable activating button on Enter (which is replaced with spacebar for certain Look-And-Feels).static voidunassignCtrlShiftUpDown(javax.swing.JComponent cmp, int condition)Unassign Ctrl-Shift/Alt-Shift Up/Down from the given component to allow global JOSM shortcuts to work in this component.static voidunassignPageUpDown(javax.swing.JComponent cmp, int condition)Unassign PageUp/PageDown from the given component to allow global JOSM shortcuts to work in this component.
-
-
-
Constructor Detail
-
InputMapUtils
private InputMapUtils()
-
-
Method Detail
-
unassignCtrlShiftUpDown
public static void unassignCtrlShiftUpDown(javax.swing.JComponent cmp, int condition)
Unassign Ctrl-Shift/Alt-Shift Up/Down from the given component to allow global JOSM shortcuts to work in this component.- Parameters:
cmp- The Swing componentcondition- one of the following values:- JComponent.FOCUS_INPUTMAP_CREATED
- JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT
- JComponent.WHEN_IN_FOCUSED_WINDOW
-
unassignPageUpDown
public static void unassignPageUpDown(javax.swing.JComponent cmp, int condition)
Unassign PageUp/PageDown from the given component to allow global JOSM shortcuts to work in this component.- Parameters:
cmp- The Swing componentcondition- one of the following values:- JComponent.FOCUS_INPUTMAP_CREATED
- JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT
- JComponent.WHEN_IN_FOCUSED_WINDOW
- Since:
- 6557
-
enableEnter
public static void enableEnter(javax.swing.JButton b)
Enable activating button on Enter (which is replaced with spacebar for certain Look-And-Feels).- Parameters:
b- Button
-
addEnterAction
public static void addEnterAction(javax.swing.JComponent c, javax.swing.Action a)
Add an action activated with Enter key on a component.- Parameters:
c- The Swing componenta- action activated with Enter key- See Also:
JComponent.WHEN_FOCUSED
-
addEnterActionWhenAncestor
public static void addEnterActionWhenAncestor(javax.swing.JComponent c, javax.swing.Action a)
Add an action activated with Enter key on a component or its children.- Parameters:
c- The Swing componenta- action activated with Enter key- Since:
- 10790
- See Also:
JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT
-
addEnterAction
private static void addEnterAction(javax.swing.JComponent c, javax.swing.Action a, int condition)
-
addSpacebarAction
public static void addSpacebarAction(javax.swing.JComponent c, javax.swing.Action a)
Add an action activated with Spacebar key on a component.- Parameters:
c- The Swing componenta- action activated with Spacebar key
-
addEscapeAction
public static void addEscapeAction(javax.swing.JComponent c, javax.swing.Action a)
Add an action activated with ESCAPE key on a component or its children.- Parameters:
c- The Swing componenta- action activated with ESCAPE key- Since:
- 10791
- See Also:
JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT
-
addCtrlEnterAction
public static void addCtrlEnterAction(javax.swing.JComponent c, javax.swing.Action a)
Add an action activated with Ctrl+Enter key on a component.- Parameters:
c- The Swing componenta- action activated with Ctrl+Enter key- See Also:
JComponent.WHEN_IN_FOCUSED_WINDOW
-
-