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 voidstatic voidaddKeyStrokesFrom(KeyStrokeMappingProvider provider) Adds the collection ofs from the givenKeyStrokeMappingto this map.KeyStrokeMappingProviderstatic charGiven a, returns the equivalent character.KeyStrokeprivate static CharactercharWithoutModifiersButShift(KeyStroke keyStroke) static voidRemoves all the character-mappings.KeyStrokestatic booleanIndicates whetherhas mappings or not.KeyStrokeMapstatic KeyStrokekeyStrokeFor(char character) Returns thecorresponding to the given character, as best we can guess it, orKeyStrokenullif we don't know how to generate it.static voidDeprecated.static voidReloads 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.useinstead.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 ofs from the givenKeyStrokeMappingto 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 whetherhas mappings or not.KeyStrokeMap- Returns:
trueif it has mappings,falseotherwise.
-
keyStrokeFor
Returns thecorresponding to the given character, as best we can guess it, orKeyStrokenullif we don't know how to generate it.- Parameters:
character- the given character.- Returns:
- the key code-based
KeyStrokecorresponding to the given character, ornullif 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()