public final class MenuItem extends Object
Modifier and Type | Class and Description |
---|---|
static interface |
MenuItem.Callback |
Modifier | Constructor and Description |
---|---|
protected |
MenuItem(String title) |
protected |
MenuItem(String title,
MenuItem.Callback callback) |
protected |
MenuItem(String title,
MenuItem.Callback callback,
int shortcutKey,
int shortcutModifiers) |
protected |
MenuItem(String title,
MenuItem.Callback callback,
int shortcutKey,
int shortcutModifiers,
Pixels pixels) |
Modifier and Type | Method and Description |
---|---|
MenuItem.Callback |
getCallback() |
int |
getShortcutKey()
returns KeyEvent.VK_UNDEFINED if the shortcut is not assigned
|
int |
getShortcutModifiers()
returns KeyEvent.MODIFIER_NONE if the shortcut is not assigned
|
String |
getTitle() |
boolean |
isChecked() |
boolean |
isEnabled() |
void |
setCallback(MenuItem.Callback callback) |
void |
setChecked(boolean checked) |
void |
setEnabled(boolean enabled) |
boolean |
setPixels(Pixels pixels) |
void |
setShortcut(int shortcutKey,
int shortcutModifiers) |
void |
setTitle(String title) |
public static final MenuItem Separator
protected MenuItem(String title)
protected MenuItem(String title, MenuItem.Callback callback)
protected MenuItem(String title, MenuItem.Callback callback, int shortcutKey, int shortcutModifiers)
protected MenuItem(String title, MenuItem.Callback callback, int shortcutKey, int shortcutModifiers, Pixels pixels)
public String getTitle()
public void setTitle(String title)
public MenuItem.Callback getCallback()
public void setCallback(MenuItem.Callback callback)
public boolean isEnabled()
public void setEnabled(boolean enabled)
public boolean isChecked()
public void setChecked(boolean checked)
public int getShortcutKey()
public int getShortcutModifiers()
public void setShortcut(int shortcutKey, int shortcutModifiers)
public boolean setPixels(Pixels pixels)
Copyright © 2020. All rights reserved.