control.js
Base class for UI controls such as buttons, menus, menu items, toolbar buttons, etc. The implementation is based on a generalized version of {@link goog.ui.MenuItem}. TODO: If the renderer framework works well, pull it into Component.

File Location

ui/control.js

Classes

goog.ui.Control
Base class for UI controls. Extends {@link goog.ui.Component} by adding the following:
  • a {@link 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.

Public Protected Private

Global Functions

goog.ui.Control.decorate()
Takes an element, and decorates it with a {@link goog.ui.Control} instance if a suitable decorator is found.
Returns:   New control instance that decorates the element (null if none).
code »
goog.ui.Control.getDecorator()
Takes an element and returns a new instance of {@link goog.ui.Control} or a subclass, suitable to decorate it (based on the element's CSS class).
Returns:   New control instance to decorate the element (null if none).
code »
goog.ui.Control.registerDecorator()
Maps a CSS class name to a function that returns a new instance of {@link goog.ui.Control} or a subclass thereof, suitable to decorate an element that has the specified CSS class. UI components that extend {@link goog.ui.Control} and want {@link goog.ui.Container}s to be able to discover and decorate elements using them should register a factory function via this API.
code »

Directory ui

File Reference