Home

# Class goog.ui.MenuButtonRenderer

Renderer for {@link goog.ui.MenuButton}s. This implementation overrides {@link goog.ui.CustomButtonRenderer#createButton} to create a separate caption and dropdown element.

extends goog.ui.CustomButtonRenderer

Instance Method Summary
| `createButton(?goog.ui.ControlContent content, ?goog.dom.DomHelper dom) ⇒ ?Element` Takes a text caption or existing DOM structure, and returns the content and a dropdown arrow element wrapped in a pseudo-rounded-corner box. Creates the following DOM structure:
| `createCaption(?goog.ui.ControlContent content, ?goog.dom.DomHelper dom) ⇒ ?Element` Takes a text caption or existing DOM structure, and returns it wrapped in an appropriately-styled DIV. Creates the following DOM structure:
| `createDropdown(?goog.dom.DomHelper dom) ⇒ ?Element` Returns an appropriately-styled DIV containing a dropdown arrow element. Creates the following DOM structure:
| `decorate(?goog.ui.MenuButton button, ?Element element) ⇒ ?Element` Takes an element, decorates it with the menu button control, and returns the element. Overrides {@link goog.ui.CustomButtonRenderer#decorate} by looking for a child element that can be decorated by a menu, and if it finds one, decorates it and attaches it to the menu button.
| `getContentElement(?Element element) ⇒ ?Element` Takes the button's root element and returns the parent element of the button's contents. Overrides the superclass implementation by taking the nested DIV structure of menu buttons into account.
| `getCssClass() ⇒ string` Returns the CSS class to be applied to the root element of components rendered using this renderer.
| `setContent(?Element element, ?goog.ui.ControlContent content)` Takes the menubutton's root element, and sets its content to the given text caption or DOM structure. Because the DOM structure of this button is conditional based on whether we need to work around FF2/RTL bugs, we override the default implementation to take this into account.

Static Method Summary
| `wrapCaption(?goog.ui.ControlContent content, string cssClass, ?goog.dom.DomHelper dom) ⇒ ?Element` Takes a text caption or existing DOM structure, and returns it wrapped in an appropriately-styled DIV. Creates the following DOM structure: