JIU 0.14.3

net.sourceforge.jiu.apps
Class MenuWrapper

java.lang.Object
  extended by net.sourceforge.jiu.apps.MenuWrapper
Direct Known Subclasses:
AwtMenuWrapper

public abstract class MenuWrapper
extends Object

Abstract menu wrapper. A menu consists of a number of menu elements, each of which have a text, an enabled status and an int constant from MenuIndexConstants associated with it.

Author:
Marco Schmidt

Constructor Summary
MenuWrapper()
           
 
Method Summary
abstract  int findIndex(Object o)
          Attempts to find the index of a given object that represents a menu element.
 int getStringIndex(int menuIndex)
          For one of the values in MenuIndexConstants, returns the corresponding constant in StringIndexConstants.
abstract  void setEnabled(int index, boolean enabled)
          Sets the enabled status of one of the menu items to either true or false.
abstract  void setLabel(int index, String text)
          Sets the text of one of the menu elements to a new value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MenuWrapper

public MenuWrapper()
Method Detail

findIndex

public abstract int findIndex(Object o)
Attempts to find the index of a given object that represents a menu element.

Parameters:
o - some object representing part of the menu
Returns:
corresponding index value from MenuIndexConstants on success or -1 on failure

getStringIndex

public int getStringIndex(int menuIndex)
For one of the values in MenuIndexConstants, returns the corresponding constant in StringIndexConstants.

Parameters:
menuIndex - int value from the MenuIndexConstants interface
Returns:
int value from the StringIndexConstants interface

setEnabled

public abstract void setEnabled(int index,
                                boolean enabled)
Sets the enabled status of one of the menu items to either true or false.

Parameters:
index - menu index of the component whose status is to be reset
enabled - boolean with the new value

setLabel

public abstract void setLabel(int index,
                              String text)
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.

Parameters:
index - integer index of the menu element
text - new text value to be used for this element

JIU 0.14.3

Copyright © 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Marco Schmidt