Package org.fest.swing.keystroke
Class KeyStrokeMap
java.lang.Object
org.fest.swing.keystroke.KeyStrokeMap
Understands a collection of
KeyStrokeMapping
.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static void
static void
addKeyStrokesFrom
(KeyStrokeMappingProvider provider) Adds the collection of
s from the givenKeyStrokeMapping
to this map.KeyStrokeMappingProvider
static char
Given a
, returns the equivalent character.KeyStroke
private static Character
charWithoutModifiersButShift
(KeyStroke keyStroke) static void
Removes all the character-
mappings.KeyStroke
static boolean
Indicates whether
has mappings or not.KeyStrokeMap
static KeyStroke
keyStrokeFor
(char character) Returns the
corresponding to the given character, as best we can guess it, orKeyStroke
null
if we don't know how to generate it.static void
Deprecated.static void
Reloads the key stroke mappings for the language using the current system settings.(package private) static void
-
Field Details
-
maps
-
-
Constructor Details
-
KeyStrokeMap
private KeyStrokeMap()
-
-
Method Details
-
reloadFromLocale
Deprecated.use
instead.reloadFromSystemSettings()
Reloads the key stroke mappings for the language from the default locale. -
reloadFromSystemSettings
public static void reloadFromSystemSettings()Reloads the key stroke mappings for the language using the current system settings.- Since:
- 1.2
-
updateKeyStrokeMapCollection
-
addKeyStrokesFrom
Adds the collection of
s from the givenKeyStrokeMapping
to this map.KeyStrokeMappingProvider
- Parameters:
provider
- the givenKeyStrokeMappingProvider
.
-
add
-
clearKeyStrokes
public static void clearKeyStrokes()Removes all the character-
mappings.KeyStroke
-
hasKeyStrokes
public static boolean hasKeyStrokes()Indicates whether
has mappings or not.KeyStrokeMap
- Returns:
true
if it has mappings,false
otherwise.
-
keyStrokeFor
Returns the
corresponding to the given character, as best we can guess it, orKeyStroke
null
if we don't know how to generate it.- Parameters:
character
- the given character.- Returns:
- the key code-based
KeyStroke
corresponding to the given character, ornull
if we cannot generate it.
-
charFor
Given a
, returns the equivalent character. Key strokes are defined properly for US keyboards only. To contribute your own, please add them using the methodKeyStroke
.addKeyStrokesFrom(KeyStrokeMappingProvider)
- Parameters:
keyStroke
- the givenKeyStroke
.- Returns:
- KeyEvent.VK_UNDEFINED if the result is unknown.
-
charWithoutModifiersButShift
-
instead.reloadFromSystemSettings()