The goog.ui.registry Namespace

.getDecorator(element)

Returns an instance of {@link goog.ui.Component} or a subclass suitable to decorate the given element, based on its CSS class.

element {Element}
Element to decorate.
returns {goog.ui.Component?}
Component to decorate the element (null if none).

.getDecoratorByClassName(className)

Returns the {@link goog.ui.Component} instance created by the decorator factory function registered for the given CSS class name, or null if no decorator factory function was found.

className {string}
CSS class name.
returns {goog.ui.Component?}
Component instance.

.getDefaultRenderer(componentCtor)

Given a {@link goog.ui.Component} constructor, returns an instance of its default renderer. If the default renderer is a singleton, returns the singleton instance; otherwise returns a new instance of the renderer class.

componentCtor {Function}
Component constructor function (for example {@code goog.ui.Button}).
returns {goog.ui.ControlRenderer?}
Renderer instance (for example the singleton instance of {@code goog.ui.ButtonRenderer}), or null if no default renderer was found.

.reset()

Resets the global renderer and decorator registry.

.setDecoratorByClassName(className, decoratorFn)

Maps a CSS class name to a function that returns a new instance of {@link goog.ui.Component} or a subclass, suitable to decorate an element that has the specified CSS class.

className {string}
CSS class name.
decoratorFn {Function}
No-argument function that returns a new instance of a {@link goog.ui.Component} to decorate an element.
@throws
{Error} If the class name or the decorator function is invalid.

.setDefaultRenderer(componentCtor, rendererCtor)

Sets the default renderer for the given {@link goog.ui.Component} constructor.

componentCtor {Function}
Component constructor function (for example {@code goog.ui.Button}).
rendererCtor {Function}
Renderer constructor function (for example {@code goog.ui.ButtonRenderer}).
@throws
{Error} If the arguments aren't functions.