public class MenuBar
extends java.lang.Object
MenuBar
object allows you to access and modify the application's menus. The application has one unique instance of menu bar. A menu bar
consists of menus.Modifier and Type | Method and Description |
---|---|
void |
addMenu(int index,
Menu menu)
Adds a menu by index.
|
void |
addMenu(Menu menu)
Adds a menu at the end of the menu bar.
|
int |
countMenus()
Returns the number of menus in this menu bar.
|
Menu |
findMenu(int id)
Returns a menu based on its ID.
|
MenuItem |
findMenuItem(int command)
Returns a menu item based on it's command.
|
Menu |
getMenu(int index)
Returns a menu by index.
|
Menu |
getMenu(java.lang.String name)
Returns a menu by name.
|
Menu |
getMenuByID(int id)
Returns a menu by ID.
|
java.lang.Object |
getParent()
Returns the parent object for this object.
|
void |
removeMenu(Menu menu)
Removes a menu from the menu bar.
|
void |
removeMenuAt(int index)
Removes a menu by index.
|
void |
removeMenuByID(int id)
Removes a menu by ID.
|
public java.lang.Object getParent()
Application
's instance.public int countMenus()
public Menu getMenu(int index)
index
- the index of the menu in the menu bar.public Menu getMenu(java.lang.String name) throws CumulusException
name
- the name of the menu.CumulusException
- if the specified menu is not in the menu bar.Menu.getName()
public Menu getMenuByID(int id) throws CumulusException
id
- the menu ID.CumulusException
- if the specified menu is not in the menu bar.public void addMenu(Menu menu)
menu
- the menu to add.public void addMenu(int index, Menu menu)
index
- the index where to add the menu.menu
- the menu to add.public void removeMenu(Menu menu) throws CumulusException
menu
- the menu to remove.CumulusException
- if the specified menu is not in the menu bar.public void removeMenuAt(int index)
index
- the index of the menu to remove.public void removeMenuByID(int id) throws CumulusException
id
- the ID of the menu to remove.CumulusException
- if the specified menu is not in the menu bar.public Menu findMenu(int id)
id
- the menu ID.null
if no such menu exists in the menu bar.public MenuItem findMenuItem(int command)
command
- the menu item command.null
if no such item exists in the menu bar.www.canto.com
Canto, the Canto logo, the Cumulus logo, and Cumulus are registered trademarks of Canto GmbH, registered in the U.S. and other countries.