|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectewe.ui.MenuItem
| Field Summary | |
String |
action
The action String for the MenuItem. |
static int |
Checked
A MenuItem modifier. |
Object |
data
Optional data to associate with the MenuItem. |
static int |
Disabled
A MenuItem modifier. |
int |
hotkey
An optional hotkey for the MenuItem. |
int |
id
An optional ID for the item. |
IImage |
image
If this is not null then this will be displayed instead of the label. |
int |
indentLevel
This is -1 by default, which means that the index level should be calculated automatically. |
String |
label
The displayed label for the MenuItem. |
int |
modifiers
Modifiers for the MenuItem. |
static int |
Selected
A MenuItem modifier. |
static int |
Separator
A MenuItem modifier. |
Menu |
subMenu
This can be set to be a sub-menu for this item. |
| Constructor Summary | |
MenuItem()
|
|
MenuItem(String text)
This creates the menu item with the action and label being equal to text. |
|
MenuItem(String text,
IImage image)
This creates the menu item with the action and label being equal to text. |
|
MenuItem(String text,
int mods,
Menu sub)
This creates the menu item with the action and label being equal to text. |
|
MenuItem(String label,
String action)
|
|
MenuItem(String text,
String imageName,
Object maskOrColor)
This creates a MenuItem using the ImageCache to load an icon for the item to be associated with the text label. |
|
| Method Summary | |
boolean |
equals(Object what)
Returns if this object is considered equal to the other object. |
MenuItem |
iconize(String text,
IImage image,
boolean leaveText)
Set the label, hotkey and image for the item. |
MenuItem |
set(String labelAndAction)
Set the action, label and hotkey of the MenuItem to be the specified parameter, allowing the parameter to have a Hot Key encoded in it. |
MenuItem |
setText(String labelAndAction)
Set the action and label of the MenuItem to be the specified parameter, assuming that the parameter is pure text only with no Hot Key encoded in it. |
String |
toString()
Return a String representation of this object. |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode |
| Field Detail |
public String label
public String action
public int modifiers
public Menu subMenu
public int id
public IImage image
public int hotkey
public Object data
public int indentLevel
public static int Disabled
public static int Separator
public static int Checked
public static int Selected
| Constructor Detail |
public MenuItem()
public MenuItem(String text,
int mods,
Menu sub)
text - The action and label for the menu item. This may have a hotkey embedded in it.mods - Optional modifiers for the item.sub - An optional sub-menu for the item.public MenuItem(String text)
text - The action and label for the menu item. This may have a hotkey embedded in it.
public MenuItem(String text,
IImage image)
text - The action and label for the menu item. This may have a hotkey embedded in it.image - An image to use as the display for the item.
public MenuItem(String text,
String imageName,
Object maskOrColor)
text - The action and label for the menu item. This may have a hotkey embedded in it.imageName - The name of an image.maskOrColor - An optional mask or transparent color for the image.
public MenuItem(String label,
String action)
| Method Detail |
public MenuItem set(String labelAndAction)
labelAndAction - The action and label for the menu item. This may have a hotkey embedded in it.
public MenuItem setText(String labelAndAction)
labelAndAction - The action and label for the menu item. This may have a hotkey embedded in it.
public MenuItem iconize(String text,
IImage image,
boolean leaveText)
text - The text for the label which may have a hotkey encoded within it.
If the action field is null when this is called it will also be set to the label.image - The image which may be a small icon to be associated with the text or
it may be the entire display line.leaveText - If this is true then it is assumed that the image is meant to be an
icon to be associated with the item.
public String toString()
Object
toString in class Objectpublic boolean equals(Object what)
Object
equals in class Objectwhat - Another object to compare to.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||