search

goog.ui.Control

Provided By
Extends
All Implemented Interfaces
All Known Direct Subclasses

Base class for UI controls. Extends goog.ui.Component by adding the following:

  • a goog.events.KeyHandler, to simplify keyboard handling,
  • a pluggable renderer framework, to simplify the creation of simple controls without the need to subclass this class,
  • the notion of component content, like a text caption or DOM structure displayed in the component (e.g. a button label),
  • getter and setter for component content, as well as a getter and setter specifically for caption text (for convenience),
  • support for hiding/showing the component,
  • fine-grained control over supported states and state transition events, and
  • default mouse and keyboard event handling.
This class has sufficient built-in functionality for most simple UI controls. All controls dispatch SHOW, HIDE, ENTER, LEAVE, and ACTION events on show, hide, mouseover, mouseout, and user action, respectively. Additional states are also supported. See closure/demos/control.html for example usage.

new Control( opt_content, opt_renderer, opt_domHelper )

Parameters
opt_content(string|Node|Array<Node>|NodeList<Node>|null)=

Text caption or DOM structure to display as the content of the control (if any).

opt_renderer(goog.ui.ControlRenderer|null)=

Renderer used to render or decorate the component; defaults to goog.ui.ControlRenderer.

opt_domHelper(goog.dom.DomHelper|null)=

Optional DOM helper, used for document interaction.

Instance Methods

Instance Properties

Static Functions

Classes