Extras
MenuModel
Class Hierarchy:

Representation of a menu that may contain submenus, options, and separators.

Constructor Summary
Public Extras.MenuModel()
Creates a new menu model

Instance Field Summary
Public text
The menu title text.
Public icon
The menu icon.
Public items
The child menu items, an array of ItemModels.

Instance Method Summary
Public addItem()
Adds an item to the MenuModel.
Public findItem()
Finds an item by id in the MenuModel, searching descendant MenuModels as necessary.
Public getItemModelFromPositions()
Returns the ItemModel at a specific path within this menu model.
Public indexOfItem()
Determines the index of the specified menu item.
Public toString()

Constructor Detail
Extras.MenuModel()
Creates a new menu model
Parameters:
modelId (String) - the id of the menu model
text (String) - the title text of the menu model which will appear in its parent menu when this menu is used as a submenu
icon (#ImageReference) - the icon of the menu model which will appear in its parent menu when this menu is used as a submenu
items (Array) - the child menu items, an array of ItemModels (optional)

Instance Method Detail
addItem
Adds an item to the MenuModel.
Parameters:
item (Extras.ItemModel) - the item (must be a MenuModel, OptionModel, or SeparatorModel.

findItem
Finds an item by id in the MenuModel, searching descendant MenuModels as necessary.
Parameters:
id - the id of the menu item to find
Returns:
(Extras.ItemModel) the item model, or null if it cannot be found

getItemModelFromPositions
Returns the ItemModel at a specific path within this menu model.
Parameters:
itemPositions (Array) - array of integers describing path, e.g., [0,1,2] would indicate the third item in the second item in the first item in this menu model.
Returns:
(Extras.ItemModel) the found item

indexOfItem
Determines the index of the specified menu item.
Parameters:
item (Extras.ItemModel) - the item to find
Returns:
(Number) the index of the item, or -1 if it cannot be found

toString