public interface StringMenu<T extends Comparable<T> & Serializable>
| Modifier and Type | Method and Description |
|---|---|
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.
|
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()
Copyright © 2012. All Rights Reserved.