MenuItem
, or one of its subclasses. The default MenuItem
object embodies a simple labeled menu item.
This picture of a menu bar shows five menu items:
The first two items are simple menu items, labeled "Basic"
and "Simple"
. Following these two items is a separator, which is itself a menu item, created with the label "-"
. Next is an instance of CheckboxMenuItem
labeled "Check"
. The final menu item is a submenu labeled "More Examples"
, and this submenu is an instance of Menu
.
When a menu item is selected, AWT sends an action event to the menu item. Since the event is an instance of ActionEvent
, the processEvent
method examines the event and passes it along to processActionEvent
. The latter method redirects the event to any ActionListener
objects that have registered an interest in action events generated by this menu item.
Note that the subclass Menu
overrides this behavior and does not send any event to the frame until one of its subitems is selected.
@author Sami Shaio
MenuItem
s is travered looking for menu items that are valid for the current state. This is then used to build up a tree of {@link com.adito.core.AvailableMenuItem} objects that ispassed to the view for rendering. A MenuItem
is deemed valid for the current state if true
is returned from {@link #isAvailable(HttpServletRequest)}method. By default this checks the parmeters parameters passed to this object when constructing administratorOnly
, availableInSetup
and permissionId
. If any actions have any special requirements as to when they are visible, MenuItem
should be sub-classed and {@link #isAvailable(HttpServletRequest)} should be overidden.
Every menu item must have two message resources added to a bundle. The keys must be in the format menuItem.[id].name and menuItem.[id].description. The bundle name must be passed as the contructor parameter messageResourcesKey
.
@see com.adito.core.AvailableMenuItem
Menu.create({ data: [ {title: "item1", click: "alert(1)"}, {title: "item2"} ] });And in XML:
<Menu> <data> <MenuItem title="item1" click="alert(1)"/> <MenuItem title="item2"/> </data> </Menu>
MenuItem
, or one of its subclasses. The default MenuItem
object embodies a simple labeled menu item.
This picture of a menu bar shows five menu items:
The first two items are simple menu items, labeled "Basic"
and "Simple"
. Following these two items is a separator, which is itself a menu item, created with the label "-"
. Next is an instance of CheckboxMenuItem
labeled "Check"
. The final menu item is a submenu labeled "More Examples"
, and this submenu is an instance of Menu
.
When a menu item is selected, AWT sends an action event to the menu item. Since the event is an instance of ActionEvent
, the processEvent
method examines the event and passes it along to processActionEvent
. The latter method redirects the event to any ActionListener
objects that have registered an interest in action events generated by this menu item.
Note that the subclass Menu
overrides this behavior and does not send any event to the frame until one of its subitems is selected.
@version 1.94, 07/11/06
@author Sami Shaio
MenuItem
class is the base class for ALL objects in the Menu
package. Its main purpose is to provide the recursive functions necessary for managing a tree-like menu structure. If you are interested in designing a new type of menu based on this structure, then you need to (a) create a Menu
subclass and (b) create a MenuItem
subclass. Your new Menu
subclass will handle the root-level layout and logic handling, while your MenuItem
subclass should draw itself and layout any sub-items it may have. See the examples within this package, all of which were designed in this way.
@author Greg
Default {@link #getZclass}: z-menu-item. (since 3.5.0) @author tomyeh
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|