public static class TextBinding.MnemonicKeyCombination extends KeyCombination
KeyCombination.Modifier, KeyCombination.ModifierValue
ALT_ANY, ALT_DOWN, CONTROL_ANY, CONTROL_DOWN, META_ANY, META_DOWN, NO_MATCH, SHIFT_ANY, SHIFT_DOWN, SHORTCUT_ANY, SHORTCUT_DOWN
Constructor and Description |
---|
MnemonicKeyCombination(String character)
Constructs a
MnemonicKeyCombination for the specified main key
character. |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj)
Tests whether this
MnemonicKeyCombination equals to the
specified object. |
String |
getCharacter()
Gets the key character associated with this key combination.
|
String |
getName()
Returns a string representation of this
MnemonicKeyCombination . |
int |
hashCode()
Returns a hash code value for this
MnemonicKeyCombination . |
boolean |
match(KeyEvent event)
Tests whether this key combination matches the key combination in the
given
KeyEvent . |
getAlt, getControl, getDisplayText, getMeta, getShift, getShortcut, keyCombination, toString, valueOf
public MnemonicKeyCombination(String character)
MnemonicKeyCombination
for the specified main key
character.character
- the main key characterpublic final String getCharacter()
public boolean match(KeyEvent event)
KeyEvent
.match
in class KeyCombination
event
- the key eventtrue
if the key combinations match, false
otherwisepublic String getName()
MnemonicKeyCombination
.
The string representation consists of sections separated by plus characters. Each section specifies either a modifier key or the main key.
A modifier key section contains the KeyCode
name of a modifier
key. It can be prefixed with the Ignored
keyword. A non-prefixed
modifier key implies its PRESSED
value while the prefixed version
implies the IGNORED
value. If some modifier key is not specified
in the string at all, it means it has the default RELEASED
value.
The main key section contains the main key character enclosed in single quotes and is the last section in the returned string.
getName
in class KeyCombination
MnemonicKeyCombination
public boolean equals(Object obj)
MnemonicKeyCombination
equals to the
specified object.equals
in class KeyCombination
obj
- the object to compare totrue
if the objects are equal, false
otherwisepublic int hashCode()
MnemonicKeyCombination
.hashCode
in class KeyCombination
Copyright © 2020. All rights reserved.