public class KeyStrokeMappingsParser extends Object
KeyStrokeMappings by parsing a text file.
Mappings for the following characters:
will be automatically added and should not be included to the file to parse.
The following is an example of a mapping file:
a, A, NO_MASK A, A, SHIFT_MASK COMMA, COMMA, NO_MASK
Each line represents a character-keystroke mapping where each value is separated by a comma.
The first value represents the character to map. For example 'a' or 'A'. Since each field is separated by a comma, to map the ',' character we need to specify the text "COMMA."
The second value represents the key code, which should be the name of a key code from
KeyEvent without the
prefix "VK_". For example, if the key code is
KeyEvent.VK_COMMA we just need to specify "COMMA".
The third value represents any modifiers to use, which should be the name of a modifier from a
For example, if the modifier to use is
InputEvent.SHIFT_MASK we need to specify "SHIFT_MASK". If no modifiers
are necessary, we just specify "NO_MASK".
|Constructor and Description|
|Modifier and Type||Method and Description|
@Nonnull public KeyStrokeMappingProvider parse(@Nonnull String fileName)
KeyStrokeMappingProvider containing all the character-keystroke mappings specified in the file
with the given name.
Note: This attempts to read the file using
@Nonnull public KeyStrokeMappingProvider parse(@Nonnull File file)
KeyStrokeMappingProvidercontaining all the character-keystroke mappings specified in the given file.
Copyright © 2014–2017 AssertJ. All rights reserved.