How to Create Contextual Information

14 Using Menus, Toolbars, and Toolboxes 14-1 14 Using Menus, Toolbars, and Toolboxes This chapter describes how to create menu bars and toolbars that contain tool buttons. For information about creating navigation menus, that is, menus that allow you to navigate through a hierarchy of pages, see Section 18.5, Using Navigation Items for a Page Hierarchy. This chapter includes the following sections: ■ Section 14.1, Introduction to Menus, Toolbars, and Toolboxes ■ Section 14.2, Using Menus in a Menu Bar ■ Section 14.3, Using Toolbars

14.1 Introduction to Menus, Toolbars, and Toolboxes

Menus and toolbars allow users to choose from a specified list of options in the case of a menu or to click buttons in the case of a toolbar to effect some change to the application. The File Explorer application contains both a menu bar and a toolbar, as shown in Figure 14–1 . Figure 14–1 Menu Bar and Toolbar in File Explorer Application When a user chooses a menu item in the menu bar, the menu component displays a list of menu items, as shown in Figure 14–2 . 14-2 Web User Interface Developers Guide for Oracle Application Development Framework Figure 14–2 Menu in the File Explorer Application Note that as shown in Figure 14–3 , menus can be nested. Figure 14–3 Nested Menu Items Buttons in a toolbar also allow a user to invoke some sort of action on an application or to open a popup menu that behaves the same as a standard menu. You can organize toolbars and menu bars using a toolbox. The toolbox gives you the ability to define relative sizes for the toolbars on the same line and to define several layers of toolbars and menu bars vertically.

14.2 Using Menus in a Menu Bar

Use the menuBar component to render a bar that contains the menu bar items such as File in the File Explorer application. Each item on a menu bar is rendered by a menu component, which holds a vertical menu. Each vertical menu consists of a list of commandMenuItem components that can invoke some operation on the application. You can nest menu components inside menu components to create submenus. The different components used to create a menu are shown in Figure 14–4 . Note: If you want to create menus and toolbars in a table, then follow the procedures in Section 10.8, Displaying Table Menus, Toolbars, and Status Bars. If you want to create a context menu for a component that is a menu that launches when a user right-clicks the component, follow the procedures in Section 13.2.3, How to Create a Context Menu.