public final class RecentMenu
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static interface |
RecentMenu.Listener
Listener for events generated by RecentMenu.
|
Modifier and Type | Field and Description |
---|---|
static int |
MAX_ITEMS
The maximum number of items.
|
Constructor and Description |
---|
RecentMenu(java.lang.String text,
java.lang.String path,
RecentMenu.Listener listener)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
add(java.lang.String label,
java.lang.String value)
Add a new item at the top.
|
int |
getCount() |
GuiMenu |
getMenu()
Don't modify the items in this menu!
|
java.lang.String |
getValue(int i) |
void |
remove(int i) |
void |
setLabel(int i,
java.lang.String label) |
void |
updateEnabled()
Set menu enabled if not empty, disabled otherwise.
|
public static final int MAX_ITEMS
public RecentMenu(java.lang.String text, java.lang.String path, RecentMenu.Listener listener)
text
- The label of the menu. Supports marking the mnemonics in
the label with a preceeding '&' (like in Qt).path
- The absolute path name of the node in
java.util.prefs.Preferences that is used to store the menu items.listener
- The callback to be called if a menu item is
selected.public void add(java.lang.String label, java.lang.String value)
public int getCount()
public GuiMenu getMenu()
public java.lang.String getValue(int i)
public void remove(int i)
public void setLabel(int i, java.lang.String label)
public void updateEnabled()