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

Variable Index

 o MENU_EVENT

Constructor Index

 o AppMenuBar()
Create an empty menu bar.
 o AppMenuBar(Properties, String)
Create a menu bar from a resource
 o AppMenuBar(String)
Create a menu bar from a resource

Method Index

 o add(Properties, String)
Add a menu to the menubar from a property.
 o add(Properties, String, String)
Add a menu to the menubar.
 o add(String)
Add a menu to the menubar from a property.
 o add(String, String)
Add a menu to the menubar given a description.
 o enable(String, boolean)
Enable the named menu or menu item.
 o formatLabel(String)
Format the given menu label; currently it just removes '&' characters when the platform is not the pc.
 o get(String)
Get a menu or menu item by name.
 o menuEvent(Event)
Pre-process an event.
 o setLabel(String, String)
Set the label of a menu item.
 o setLabel(String, String, String)
Set the label and key-shortcut of a menu item.
 o setState(String, boolean)
Set the state of a named CheckboxMenuItem.

Variables

 o MENU_EVENT
  public final static int MENU_EVENT

Constructors

 o AppMenuBar
  public AppMenuBar()
Create an empty menu bar.
 o AppMenuBar
  public AppMenuBar(String name)
Create a menu bar from a resource
 o AppMenuBar
  public AppMenuBar(Properties props,
                    String name)
Create a menu bar from a resource

Methods

 o add
  public void add(String name)
Add a menu to the menubar from a property.
 o add
  public void add(Properties props,
                  String name)
Add a menu to the menubar from a property.
 o add
  public void add(String name,
                  String description)
Add a menu to the menubar given a description.
 o 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?");
 o get
  public MenuItem get(String nm)
Get a menu or menu item by name.
 o enable
  public void enable(String nm,
                     boolean on)
Enable the named menu or menu item.
 o setState
  public void setState(String nm,
                       boolean on)
Set the state of a named CheckboxMenuItem.
 o setLabel
  public void setLabel(String nm,
                       String label)
Set the label of a menu item.
 o setLabel
  public void setLabel(String nm,
                       String label,
                       String key)
Set the label and key-shortcut of a menu item.
 o formatLabel
  public static String formatLabel(String label)
Format the given menu label; currently it just removes '&' characters when the platform is not the pc.
 o 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