java.lang.Object | |
↳ | java.awt.MenuShortcut |
The MenuShortcut
class represents a keyboard accelerator
for a MenuItem.
Menu shortcuts are created using virtual keycodes, not characters. For example, a menu shortcut for Ctrl-a (assuming that Control is the accelerator key) would be created with code like the following:
MenuShortcut ms = new MenuShortcut(KeyEvent.VK_A, false);
The accelerator key is platform-dependent and may be obtained
via getMenuShortcutKeyMask()
.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Constructs a new MenuShortcut for the specified virtual keycode.
| |||||||||||
Constructs a new MenuShortcut for the specified virtual keycode.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Returns whether this MenuShortcut is the same as another:
equality is defined to mean that both MenuShortcuts use the same key
and both either use or don't use the SHIFT key.
| |||||||||||
Returns whether this MenuShortcut is the same as another:
equality is defined to mean that both MenuShortcuts use the same key
and both either use or don't use the SHIFT key.
| |||||||||||
Returns the raw keycode of this MenuShortcut.
| |||||||||||
Returns the hashcode for this MenuShortcut.
| |||||||||||
Returns an internationalized description of the MenuShortcut.
| |||||||||||
Returns whether this MenuShortcut must be invoked using the SHIFT key.
|
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Returns the parameter string representing the state of this
MenuShortcut.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
Constructs a new MenuShortcut for the specified virtual keycode.
key | the raw keycode for this MenuShortcut, as would be returned
in the keyCode field of a KeyEvent if
this key were pressed. |
---|---|
useShiftModifier | indicates whether this MenuShortcut is invoked with the SHIFT key down. |
Returns whether this MenuShortcut is the same as another: equality is defined to mean that both MenuShortcuts use the same key and both either use or don't use the SHIFT key.
obj | the Object to compare with this. |
---|
true
if this MenuShortcut is the same as another,
false
otherwise.Returns whether this MenuShortcut is the same as another: equality is defined to mean that both MenuShortcuts use the same key and both either use or don't use the SHIFT key.
s | the MenuShortcut to compare with this. |
---|
true
if this MenuShortcut is the same as another,
false
otherwise.Returns the raw keycode of this MenuShortcut.
Returns the hashcode for this MenuShortcut.
Returns an internationalized description of the MenuShortcut.
Returns whether this MenuShortcut must be invoked using the SHIFT key.
true
if this MenuShortcut must be invoked using the
SHIFT key, false
otherwise.Returns the parameter string representing the state of this MenuShortcut. This string is useful for debugging.