JIU 0.12.0 Homepage

net.sourceforge.jiu.gui.awt
Class AwtMenuWrapper

java.lang.Object
  extended bynet.sourceforge.jiu.apps.MenuWrapper
      extended bynet.sourceforge.jiu.gui.awt.AwtMenuWrapper

public class AwtMenuWrapper
extends MenuWrapper

A wrapper around an AWT MenuBar object.

Since:
0.8.0
Author:
Marco Schmidt

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()
           
 void setEnabled(int index, boolean enabled)
          Sets the enabled status of one of the menu items to either true or false.
 void setLabel(int index, String text)
          Sets the text of one of the menu elements to a new value.
 void updateEnabled(OperationProcessor op)
           
 void updateLabels(Strings strings)
           
 
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

AwtMenuWrapper

public AwtMenuWrapper(Strings strings,
                      ActionListener actionListener)
Internally creates a MenuBar object and provides methods to update that menu bar.

Parameters:
strings - String resource used to initialize menu items
actionListener - a listener which will be registered with all menu items
Method Detail

findIndex

public int findIndex(Object o)
Attempts to find one of the menu items in the internal list. Returns its index or -1 if it is not one of the items.

Specified by:
findIndex in class MenuWrapper
Parameters:
o - some object representing part of the menu
Returns:
corresponding index value from MenuIndexConstants on success or -1 on failure

getMenuBar

public MenuBar getMenuBar()

setEnabled

public void setEnabled(int index,
                       boolean enabled)
Description copied from class: MenuWrapper
Sets the enabled status of one of the menu items to either true or false.

Specified by:
setEnabled in class MenuWrapper
Parameters:
index - menu index of the component whose status is to be reset
enabled - boolean with the new value

setLabel

public void setLabel(int index,
                     String text)
Description copied from class: MenuWrapper
Sets the text of one of the menu elements to a new value. This method is usually called when the language settings have changed and new words have to be assigned.

Specified by:
setLabel in class MenuWrapper
Parameters:
index - integer index of the menu element
text - new text value to be used for this element

updateEnabled

public void updateEnabled(OperationProcessor op)

updateLabels

public void updateLabels(Strings strings)

JIU 0.12.0 Homepage

Copyright © 2000, 2001, 2002, 2003, 2004 Marco Schmidt