public final class MenuItem
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static interface |
MenuItem.Callback |
Modifier and Type | Field and Description |
---|---|
private MenuItem.Callback |
callback |
private boolean |
checked |
private MenuItemDelegate |
delegate |
private boolean |
enabled |
static MenuItem |
Separator |
private int |
shortcutKey |
private int |
shortcutModifiers |
private java.lang.String |
title |
Modifier | Constructor and Description |
---|---|
protected |
MenuItem(java.lang.String title) |
protected |
MenuItem(java.lang.String title,
MenuItem.Callback callback) |
protected |
MenuItem(java.lang.String title,
MenuItem.Callback callback,
int shortcutKey,
int shortcutModifiers) |
protected |
MenuItem(java.lang.String title,
MenuItem.Callback callback,
int shortcutKey,
int shortcutModifiers,
Pixels pixels) |
Modifier and Type | Method and Description |
---|---|
MenuItem.Callback |
getCallback() |
(package private) MenuItemDelegate |
getDelegate() |
int |
getShortcutKey()
returns KeyEvent.VK_UNDEFINED if the shortcut is not assigned
|
int |
getShortcutModifiers()
returns KeyEvent.MODIFIER_NONE if the shortcut is not assigned
|
java.lang.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(java.lang.String title) |
public static final MenuItem Separator
private final MenuItemDelegate delegate
private java.lang.String title
private MenuItem.Callback callback
private boolean enabled
private boolean checked
private int shortcutKey
private int shortcutModifiers
protected MenuItem(java.lang.String title)
protected MenuItem(java.lang.String title, MenuItem.Callback callback)
protected MenuItem(java.lang.String title, MenuItem.Callback callback, int shortcutKey, int shortcutModifiers)
protected MenuItem(java.lang.String title, MenuItem.Callback callback, int shortcutKey, int shortcutModifiers, Pixels pixels)
public java.lang.String getTitle()
public void setTitle(java.lang.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)
MenuItemDelegate getDelegate()