| Create a Mnemonic instance with the mnemonic information from the
given encoded String. Unencoded text, the mnemonic keycode, and
the display index are encapsulated in the returned Mnemonic object.
Encoding consists of placing an ampersand (&) prior to the character
designated as the mnemonic.
Mnemonics may be encoded as follows:
Original Text | Visible Text | Mnemonic |
&File | File | VK_F |
Save &As... | Save As... | VK_A second instance |
Me&&&You | Me&You | VK_Y ambiguous ampersands
must be escaped |
Sugar & Spice | Sugar & Spice | None ampersand is unambiguous,
whitespace is not allowed as a mnemonic |
Swing restricts mnemonics to available KeyEvent VK_ constants, so
there must exist a mapping between text characters and said
constants. If the obvious mappings (A-Z, a-z, 0-9) don't hold, lookup
falls back to other methods. Whitespace, quotes, and ampersand are
disallowed as mnemonics.
Mappings from arbitrary characters to mnemonic keys may be defined
by providing a property
MNEMONIC_{unicode char}={KeyEvent.VK_ constant name} within a bundle
accessible by abbot.i18n.Strings . If no such
mapping is defined, a VK_ code is guessed by checking if there can be
found a keystroke mapping for the original character.
See Also: abbot.tester.KeyStrokeMap See Also: abbot.i18n.Strings |