|
JIU 0.14.3 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sourceforge.jiu.apps.MenuWrapper
net.sourceforge.jiu.gui.awt.AwtMenuWrapper
public class AwtMenuWrapper
A wrapper around an AWT MenuBar object.
Constructor Summary | |
---|---|
AwtMenuWrapper(Strings strings,
ActionListener actionListener)
Internally creates a MenuBar object and provides methods to update that menu bar. |
Method Summary | |
---|---|
int |
findIndex(Object o)
Attempts to find one of the menu items in the internal list. |
MenuBar |
getMenuBar()
Returns the encapsulated MenuBar object. |
void |
setEnabled(int index,
boolean enabled)
Changes the enabled status of one of the MenuItem objects, given by its index. |
void |
setLabel(int index,
String text)
Changes the label text of one of the MenuItem objects, given by its index. |
void |
updateEnabled(OperationProcessor op)
Changes the enabled status of all MenuItem objects using the argument OperationProcessor object (more precisely, its isAvailable(int) method). |
void |
updateLabels(Strings strings)
Sets the label text of all MenuItem objects to new values using the argument Strings information. |
Methods inherited from class net.sourceforge.jiu.apps.MenuWrapper |
---|
getStringIndex |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AwtMenuWrapper(Strings strings, ActionListener actionListener)
strings
- String resource used to initialize menu itemsactionListener
- a listener which will be registered with all menu itemsMethod Detail |
---|
public int findIndex(Object o)
findIndex
in class MenuWrapper
o
- some object representing part of the menu
MenuIndexConstants
on success
or -1 on failurepublic MenuBar getMenuBar()
public void setEnabled(int index, boolean enabled)
setEnabled
in class MenuWrapper
index
- menu index of the component whose status is to be resetenabled
- boolean with the new valuepublic void setLabel(int index, String text)
setLabel
in class MenuWrapper
index
- integer index of the menu elementtext
- new text value to be used for this elementpublic void updateEnabled(OperationProcessor op)
public void updateLabels(Strings strings)
|
JIU 0.14.3 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |