Most graphical application makes use of some sort of menu. Its labels are often referred to as File, Edit, or Exit, for instance, and are usually placed on the top of an application window to display a list of choices. In SWT, the Menu
and MenuItem
classes are responsible for handling operations related to menus.
Basically, we can divide menus into three different kinds:
Main: These menus are created using the
SWT.BAR
style below the shell titleDrop down: These menus are also referred to as submenus or cascade menus and are created by using the
SWT.DROP_DOWN
stylePop up: These menus are created using the
SWT_POP_UP
style and are displayed when an user requests a menu in a control
The relationship among these three types of menus works by having the menu bars and pop-up menus as the root of the hierarchy. Both of them are usually composed of drop-down menus.
Menu acts as a container for MenuItems
, and contains methods so that MenuItems
can be added. MenuItem
is a widget that can be selected...