Class marimba.desktop.AppMenuBar
All Packages Class Hierarchy This Package Previous Next Index
Class marimba.desktop.AppMenuBar
java.lang.Object
|
+----java.awt.MenuComponent
|
+----java.awt.MenuBar
|
+----marimba.desktop.AppMenuBar
- public class AppMenuBar
- extends MenuBar
A wrapper class for a application's MenuBar. This class can construct
menus from a description string, it formats the menu, and it takes care
of pre-processing events and binds key strokes to menu items.
- Version:
- 1.15, 12/19/96
- Author:
- Arthur van Hoff
-
MENU_EVENT
-
-
AppMenuBar()
- Create an empty menu bar.
-
AppMenuBar(Properties, String)
- Create a menu bar from a resource
-
AppMenuBar(String)
- Create a menu bar from a resource
-
add(Properties, String)
- Add a menu to the menubar from a property.
-
add(Properties, String, String)
- Add a menu to the menubar.
-
add(String)
- Add a menu to the menubar from a property.
-
add(String, String)
- Add a menu to the menubar given a description.
-
enable(String, boolean)
- Enable the named menu or menu item.
-
formatLabel(String)
- Format the given menu label; currently it just removes
'&' characters when the platform is not the pc.
-
get(String)
- Get a menu or menu item by name.
-
menuEvent(Event)
- Pre-process an event.
-
setLabel(String, String)
- Set the label of a menu item.
-
setLabel(String, String, String)
- Set the label and key-shortcut of a menu item.
-
setState(String, boolean)
- Set the state of a named CheckboxMenuItem.
MENU_EVENT
public final static int MENU_EVENT
AppMenuBar
public AppMenuBar()
- Create an empty menu bar.
AppMenuBar
public AppMenuBar(String name)
- Create a menu bar from a resource
AppMenuBar
public AppMenuBar(Properties props,
String name)
- Create a menu bar from a resource
add
public void add(String name)
- Add a menu to the menubar from a property.
add
public void add(Properties props,
String name)
- Add a menu to the menubar from a property.
add
public void add(String name,
String description)
- Add a menu to the menubar given a description.
add
public void add(Properties props,
String name,
String description)
- Add a menu to the menubar. Each menu item is seperated by a |.
Each item in turn is described by two or three fields seperated by a ';'.
The item fields are label;name;key, the key is optional. A menu
seperator is a single - item. You can add a checkbox by appending a ?
to the name of the item. Extra spaces are ignored. For example:
add("edit", "Edit|Cut;cut;Ctrl+X|Paste;paste;Ctrl+V|-|Grid;grid?");
get
public MenuItem get(String nm)
- Get a menu or menu item by name.
enable
public void enable(String nm,
boolean on)
- Enable the named menu or menu item.
setState
public void setState(String nm,
boolean on)
- Set the state of a named CheckboxMenuItem.
setLabel
public void setLabel(String nm,
String label)
- Set the label of a menu item.
setLabel
public void setLabel(String nm,
String label,
String key)
- Set the label and key-shortcut of a menu item.
formatLabel
public static String formatLabel(String label)
- Format the given menu label; currently it just removes
'&' characters when the platform is not the pc.
menuEvent
public void menuEvent(Event evt)
- Pre-process an event. If the event matches a menu item
it is modified to be a MENU_EVENT.
All Packages Class Hierarchy This Package Previous Next Index