public final class KeyUtil
extends java.lang.Object
Constructor and Description |
---|
KeyUtil() |
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
buildToolTip(IdeAction ideAction)
Builds a tooltip for an
IdeAction in the form of cmd-name[ " (" accelerator ")" ] |
static java.lang.String |
buildTooltip(int cmdID)
Builds a tooltip for a command in the form of
cmd-name[ " (" accelerator ")" ] |
static java.lang.String |
getAcceleratorTooltip(int cmdID) |
static java.lang.String |
getAcceleratorTooltip(KeyStrokeMap keyMap,
int cmdID) |
static javax.swing.KeyStroke |
getBestAccelerator(KeyStrokeMap ksm,
int nCmdID)
Return the 'best' accelerator found in the map for the specified command ID.
|
static boolean |
isActionKey(javax.swing.KeyStroke ks)
Only the KeyEvent knows what is an action key, the KeyStroke does not.
|
static boolean |
isModifierKey(int keyCode)
Determines if the key is a modifier (Ctrl, Shift, ...)
|
static boolean |
isModifierKey(javax.swing.KeyStroke keyStroke)
Determines if the key is a modifier (Ctrl, Shift, ...)
|
static void |
removeCtrlTabFromTraversalKeys(java.awt.Component component)
Removes the Ctrl+Tab and Ctrl+Shift+Tab from the focusTraversalKeys
|
static void |
removeKeyStrokesFromInputMap(javax.swing.JComponent component,
javax.swing.KeyStroke[] keyStrokes,
int mapType) |
static void |
removeKeyStrokesFromInputMaps(javax.swing.JComponent component,
javax.swing.KeyStroke[] keyStrokes) |
static java.lang.String |
toString(javax.swing.KeyStroke ks)
Returns a user readable version of the keystroke like "Ctrl+K".
|
public static java.lang.String toString(javax.swing.KeyStroke ks)
ks
- the keystrokepublic static boolean isActionKey(javax.swing.KeyStroke ks)
public static boolean isModifierKey(int keyCode)
public static boolean isModifierKey(javax.swing.KeyStroke keyStroke)
public static void removeKeyStrokesFromInputMaps(javax.swing.JComponent component, javax.swing.KeyStroke[] keyStrokes)
SwingUtils#removeKeyStrokesFromInputMaps(JComponent,KeyStroke[])}
public static void removeKeyStrokesFromInputMap(javax.swing.JComponent component, javax.swing.KeyStroke[] keyStrokes, int mapType)
SwingUtils#removeKeyStrokesFromInputMap(JComponent,KeyStroke[],int)}
public static java.lang.String getAcceleratorTooltip(int cmdID)
cmdID
- the ID of a command present in the global keymappublic static java.lang.String getAcceleratorTooltip(KeyStrokeMap keyMap, int cmdID)
public static java.lang.String buildTooltip(int cmdID)
cmd-name[ " (" accelerator ")" ]
cmdID
- the command ID of the IdeAction
public static java.lang.String buildToolTip(IdeAction ideAction)
IdeAction
in the form of cmd-name[ " (" accelerator ")" ]
ideAction
- the action whose properties are used to generate the tip textpublic static void removeCtrlTabFromTraversalKeys(java.awt.Component component)
component
- public static javax.swing.KeyStroke getBestAccelerator(KeyStrokeMap ksm, int nCmdID)
ksm
- nCmdID
-