public class AcceleratorKey
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
SystemMenuKeyModifier
The integer key code that represents the standard modifier key for menu shortcuts.
|
Constructor and Description |
---|
AcceleratorKey() |
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
getAltKeyName() |
static java.lang.String |
getAltKeyName(boolean abbreviated) |
static javax.swing.KeyStroke |
getKey(char key) |
static javax.swing.KeyStroke |
getKey(java.lang.String key) |
static java.lang.String |
getMetaKeyName() |
static java.lang.String |
getMetaKeyName(boolean abbreviated) |
static java.lang.String |
getModifierKeyName(int modifierKeyCodeOrMask) |
static java.lang.String |
getModifierKeyName(int modifierKeyCodeOrMask,
boolean abbreviated) |
static java.lang.String |
getShortcutModifierKeyName() |
static java.lang.String |
getShortcutModifierKeyName(boolean abbreviated) |
static void |
removeAllTabTraversalKeys(java.awt.Component... components)
Disable the default behavior of TAB, Shift+TAB, Ctrl+TAB, Ctrl+Shift+TAB etc,
which is to move to the next/previous component respectively.
|
static void |
removeTabTraversalKeys(java.awt.Component component,
java.awt.AWTKeyStroke... removeKeys)
Disable the default behavior of TAB, Shift+TAB, Ctrl+TAB, Ctrl+Shift+TAB etc,
which is to move to the next/previous component respectively.
|
static void |
resetTabTraversalKeys(java.awt.Component... components)
Some Components (e.g.
|
static java.lang.String |
toString(javax.swing.KeyStroke key)
Return a nice string representation of the given keystroke
(the toString method of KeyStroke isn't nice.)
|
public static int SystemMenuKeyModifier
Event.CTRL_MASK
), while on
Mac, this is the Command Key (Event.META_MASK
).public static java.lang.String getAltKeyName()
public static java.lang.String getAltKeyName(boolean abbreviated)
public static javax.swing.KeyStroke getKey(char key)
public static javax.swing.KeyStroke getKey(java.lang.String key)
public static java.lang.String getMetaKeyName()
public static java.lang.String getMetaKeyName(boolean abbreviated)
public static java.lang.String getModifierKeyName(int modifierKeyCodeOrMask)
public static java.lang.String getModifierKeyName(int modifierKeyCodeOrMask, boolean abbreviated)
public static java.lang.String getShortcutModifierKeyName()
public static java.lang.String getShortcutModifierKeyName(boolean abbreviated)
public static void removeAllTabTraversalKeys(java.awt.Component... components)
components
- A list of components (e.g. JTextArea etc) to modify.public static void removeTabTraversalKeys(java.awt.Component component, java.awt.AWTKeyStroke... removeKeys)
component
- A component (e.g. JTextArea etc) to modify.public static void resetTabTraversalKeys(java.awt.Component... components)
components
- A list of components (e.g. JTextArea etc) to fix.public static java.lang.String toString(javax.swing.KeyStroke key)