The class MacaoMenuItem is used to create menu items for menus. See MacaoMenu.addMenuItem().
The following structure shows the HTML elements, which are used to display a menu item. In the structure MyMenuMenuItemXXX stands for one of MyMenuMenuItem, MyMenuMenuItemActive or MyMenuMenuItemMouseOver, where MyMenu is the name of the menu object.
<div class="MyMenu" title="Title of the menu"> <table class="MyMenu"> <tr class="MyMenu"> <td class="MyMenu"> <div class="MyMenuItemXXX" title="Title of the item"> <img class="MyMenuItemXXX" src="Image source"> <span class="MyMenuItemXXX">Text of the item</span> </div> </td> </tr> </table> </div>
The next structure shows the HTML elements for a menu item, which contains a placeholder %input% or %password%. The text is split into two parts. Each part is enclosed in a span element. Between this parts is a text or password input field.
<div class="MyMenu" title="Title of the menu"> <table class="MyMenu"> <tr class="MyMenu"> <td class="MyMenu"> <div class="MyMenuMenuItemXXX" title="Title of the item"> <img class="MyMenuItemXXX" src="Image source"> <span class="MyMenuItemXXX">Begin of text</span> <input type="text|password"> <span class="MyMenuItemXXX">End of text</span> </div> </td> </tr> </table> </div>
Constructor Summary |
---|
MacaoMenuItem(String name, String title, String imageDefaultSource, String imageMouseOverSource, String imageActiveSource, String eventType, Array eventParams, optional String recipientName)
Use this constructor, to create a new menu item for a menu. |
Method Summary | |
---|---|
void | execute()
Call this method to execute the menu item like the user had clicked it. |
Element | getDiv()
Call this method to get the DOM element, which encloses elements of the menu item. |
Array | getEventParams()
Call this method to get the parameters, which are defined for the menu items event. |
String | getEventType()
Call this method to get the menu items event. |
String | getInputValue()
Call this method to get the value of the input field. |
MacaoMenu | getMenu()
Call this method to get the menu object, to which the menu item belongs. |
String | getName()
Call this method to get the name of the menu item. |
String | getRecipientName()
Call this method to set the name of the object, to which the menu items event is sent. |
String | getTitle()
Call this method, to get the title of the menu item. |
boolean | getVisibility()
Call this method to get the visibility of the menu item. |
boolean | isActivation()
Call this method to find out, if this menu item is a toggle menu item. |
boolean | isActive()
Call this method to find out, if this radio or toggle menu item is activated or deactivated. |
boolean | isRadio()
Call this method to find out, if this menu item is a radio menu item. |
void | setAbsolutePosition(integer left, integer top)
Call this method to move the menu item to an absolute position on the page. |
void | setActivation(boolean isActivation, boolean isRadio)
Call this method to set the menu item as toggle menu item or radio menu item. |
void | setActive(boolean active)
Call this method to set the toggle or radio menu item as active or inactive. |
void | setEventParams(Array eventParams)
Call this method to define the parameters for the menu items event. |
void | setEventType(String eventType)
Call this method to set the event type of the menu item. |
void | setImageSource(String imageSource, boolean isDefaultImage, boolean isMouseOverImage, boolean isActiveImage)
Call this method to change an image, which is used to display the menu item. |
void | setInputValue(String value)
Call this method to set the value of the input field. |
void | setRecipientName(String recipientName)
Call this method to define the recipient of the menu items event. |
void | setText(String html)
Call this method to set or clear the HTML, which is used to display the text beside the image in a span element. |
void | setTitle(String title)
Call this method to change the tool tip of the menu item. |
void | setVisibility(boolean visibility)
Call this method to show or hide the menu item. |
Constructor Details |
---|
Use this constructor, to create a new menu item for a menu.
The URLs of the images, which can be provided as parameters, need to be relative to the base path. See MacaoPage.getBasePath().
Method Details |
---|
Call this method to execute the menu item like the user had clicked it.
Calling this method will execute the menu items event.
Call this method to get the DOM element, which encloses elements of the menu item.
Call this method to get the parameters, which are defined for the menu items event.
Call this method to get the menu items event.
Call this method to get the value of the input field.
The menu item has an input field, if the title of the item contains one of the placeholders %input% or %password%.
Call this method to get the menu object, to which the menu item belongs.
Call this method to get the name of the menu item.
Call this method to set the name of the object, to which the menu items event is sent.
Call this method, to get the title of the menu item.
Call this method to get the visibility of the menu item.
Call this method to find out, if this menu item is a toggle menu item.
Call this method to find out, if this radio or toggle menu item is activated or deactivated.
Call this method to find out, if this menu item is a radio menu item.
Call this method to move the menu item to an absolute position on the page.
Call this method to set the menu item as toggle menu item or radio menu item.
Call this method to set the toggle or radio menu item as active or inactive.
Calling this method will execute the menu items event with a Boolean parameter. The parameter is true, when the item is activated and false, when the item is deactivated.
Call this method to define the parameters for the menu items event.
When sending activation events, these parameters are ignored. Instead a Boolean parameter is send, which represents the active state of the menu item.
Call this method to set the event type of the menu item.
Call this method to change an image, which is used to display the menu item.
Call this method to set the value of the input field.
The menu item has an input field, if the title of the item contains one of the placeholders %input% or %password%.
Call this method to define the recipient of the menu items event.
Call this method to set or clear the HTML, which is used to display the text beside the image in a span element.
Call this method to change the tool tip of the menu item.
Call this method to show or hide the menu item.