|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectjcontrol.ui.wombat.Component
jcontrol.ui.wombat.AbstractFocusComponent
jcontrol.ui.wombat.menu.Menu
public abstract class Menu
The abstract class Menu is the superclass for graphical menus.
(c) Copyright 2005 DOMOLOGIC GmbH
| Field Summary |
|---|
| Fields inherited from interface jcontrol.ui.wombat.IFocusable |
|---|
TRANSFER_FOCUS_BACKWARD, TRANSFER_FOCUS_FORWARD |
| Fields inherited from interface jcontrol.ui.wombat.event.TouchListener |
|---|
RESULT_ACCEPTED, RESULT_EXECUTED, RESULT_NONE |
| Constructor Summary | |
|---|---|
Menu(java.lang.String[] items,
int x,
int y,
int width,
int height)
|
|
| Method Summary | |
|---|---|
abstract int |
addMenuItem(java.lang.String item)
Adds a menu item to this menu. |
int |
getIndex(java.lang.String item)
Returns the index of the specified item or -1 if there is no such item
in this menu. |
java.lang.String |
getItem(int index)
Returns the item at the specified index or null if the index is
out of range. |
int |
getItemCount()
Returns the number of menu items. |
int |
getSelectedIndex()
Returns the index of the selected menu item or -1 if none is selected. |
abstract int |
insertMenuItem(java.lang.String item,
int index)
Inserts a menu item at the specified position. |
abstract boolean |
removeMenuItem(int index)
Removes a menu at the specified index item from this menu. |
void |
setEnabled(int index,
boolean enabled)
Enables or disables the menu item at the specified index. |
boolean |
setSelection(int index)
Selects the item at the given zero-relative index in the receiver's list. |
| Methods inherited from class jcontrol.ui.wombat.AbstractFocusComponent |
|---|
getActionListener, onKeyEvent, onTouchEvent, requestFocus, setActionListener, setEnabled, setVisible |
| Methods inherited from class jcontrol.ui.wombat.Component |
|---|
getFrame, isEnabled, isVisible, paint, repaint, repaintAll, safeExec, setBackgroundColor, setBounds, setDirty, setFont, setForegroundColor, setRedraw, setTransparentColor, unsafeExec, update |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, notifyAll, toString, wait |
| Constructor Detail |
|---|
public Menu(java.lang.String[] items,
int x,
int y,
int width,
int height)
| Method Detail |
|---|
public abstract int addMenuItem(java.lang.String item)
item - the name of the menu item, can even specify an image name
insertMenuItem(String, int)public int getIndex(java.lang.String item)
-1 if there is no such item
in this menu.
item - the item to search for
public java.lang.String getItem(int index)
null if the index is
out of range.
index - the index
public int getItemCount()
public int getSelectedIndex()
public abstract int insertMenuItem(java.lang.String item,
int index)
item - the name of the menu item, can even specify an image nameindex - the position
addMenuItem(String)public abstract boolean removeMenuItem(int index)
setEnabled(int, boolean) method instead.
index - the index to remove
true if the item has been removed successfully,
false otherwisesetEnabled(int, boolean)
public void setEnabled(int index,
boolean enabled)
index - the index to enable or disableenabled - the new enabled statepublic boolean setSelection(int index)
index - the index of the item to select
true if the item has been selected successfully,
false otherwise
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||