|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnu.zoom.swing.desktop.component.stringmenu.StringMenuItem<T>
T - The value type. Must be comparable since it is used when comparing
the menu items and serializable since it is stored in the
Preferences to persist menus.public class StringMenuItem<T extends Comparable<T> & Serializable>
Holds information about a menu item. A menu item is a presentation name, which is shown on the menu, and a value. When a menu is selected the value is used in callbacks to indicate which menu was selected.
| Constructor Summary | |
|---|---|
StringMenuItem(T value,
String presentationName)
Create a new menu item. |
|
| Method Summary | |
|---|---|
int |
compareTo(T o)
Compares this menu item to another by delegating to this items value for comparison. |
boolean |
equals(Object obj)
Two menu items are considered the same if their values are equal. |
String |
getPresentationName()
|
T |
getValue()
|
int |
hashCode()
|
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public StringMenuItem(T value,
String presentationName)
value - The value of the menu, may not be null.presentationName - The string that is shown on the menu. If null the default is
to take toString on the value and truncating if too long.| Method Detail |
|---|
public String getPresentationName()
public T getValue()
public boolean equals(Object obj)
equals in class ObjectObject.equals(java.lang.Object)public int hashCode()
hashCode in class Objectpublic String toString()
toString in class Objectpublic int compareTo(T o)
compareTo in interface Comparable<T extends Comparable<T> & Serializable>Comparable.compareTo(java.lang.Object)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||