Home

# Class goog.ui.MenuItem

Class representing an item in a menu.

extends goog.ui.Control

Instance Method Summary
| `getCaption() ⇒ string` Returns the text caption of the component while ignoring accelerators.
| `getMnemonic() ⇒ ?goog.events.KeyCodes` Gets the mnemonic key code. The mnemonic is the key associated with this action.
| `getValue() ⇒ <Any Type>` Returns the value associated with the menu item. The default implementation returns the model object associated with the item (if any), or its caption.
| `handleKeyEventInternal(?goog.events.KeyEvent e) ⇒ boolean` Attempts to handle a keyboard event; returns true if the event was handled, false otherwise. Considered protected; should only be used within this package and by subclasses.
| `handleMouseUp(?goog.events.Event e)` Handles mouseup events. If the component is enabled, highlights it. If the component has previously been activated, performs its associated action by calling {@link performActionInternal}, then deactivates it. Considered protected; should only be used within this package and by subclasses.
| `setCheckable(boolean checkable)` Sets the menu item to be checkable or not. Set to true for menu items that represent checkable options.
| `setMnemonic(?goog.events.KeyCodes key)` Sets the mnemonic key code. The mnemonic is the key associated with this action.
| `setSelectable(boolean selectable)` Sets the menu item to be selectable or not. Set to true for menu items that represent selectable options.
| `setValue(<Any Type> value)` Sets the value associated with the menu item. The default implementation stores the value as the model of the menu item.