|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface StringMenu<T extends Comparable<T> & Serializable>
A managed menu of items. The menu saves the items (but not the listeners) to the desktop preferences when the workbench quits. The menu restores itself when the getJMenu is first called. When a menu item is selected by the user all registered listeners will be called.
| Method Summary | |
|---|---|
void |
addItem(StringMenuItem<T> menuItem)
Add an item to the beginning of the menu. |
void |
addListener(StringMenuListener<T> listener)
Add a listener for selection events. |
void |
clear()
Remove all items. |
JMenu |
getJMenu(String menuName,
Icon icon,
String clearName,
String clearTooltip)
Get a menu of the items. |
int |
getNumberOfItems()
Get the number of items on the menu. |
void |
removeItem(StringMenuItem<T> menuItem)
Remove a named item. |
void |
removeListener(StringMenuListener<T> listener)
Remove a listener. |
| Method Detail |
|---|
void addListener(StringMenuListener<T> listener)
listener - void removeListener(StringMenuListener<T> listener)
listener - void addItem(StringMenuItem<T> menuItem)
menuItem - void removeItem(StringMenuItem<T> menuItem)
menuItem -
JMenu getJMenu(String menuName,
Icon icon,
String clearName,
String clearTooltip)
menuName - The name of the menu.icon - The icon to set for the menu, if null no icon will be used.clearName - The name of the "clear all"-action at the top of the menu. If
null the clear action will not be created.clearTooltip - The tooltip to set for the clear action, if null no tooltip
will be set.
int getNumberOfItems()
void clear()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||