The goog.ui.TabBarRenderer Class

goog.ui.TabBarRenderer
> goog.ui.ContainerRenderer

goog.ui.TabBarRenderer()

Default renderer for {@link goog.ui.TabBar}s, based on the {@code TabPane} code. The tab bar's DOM structure is determined by its orientation and location relative to tab contents. For example, a horizontal tab bar located above tab contents looks like this:

  
...(tabs here)...

.CSS_CLASS {string}

Default CSS class to be applied to the root element of components rendered by this renderer.

.canDecorate(element)

Inherited from goog.ui.ContainerRenderer .

Default implementation of {@code canDecorate}; returns true if the element is a DIV, false otherwise.

element {Element}
Element to decorate.
returns {boolean}
Whether the renderer can decorate the element.

.createDom(container)

Inherited from goog.ui.ContainerRenderer .

Creates and returns the container's root element. The default simply creates a DIV and applies the renderer's own CSS class name to it. To be overridden in subclasses.

container {goog.ui.Container}
Container to render.
returns {Element}
Root element for the container.

.decorate(container, element)

Inherited from goog.ui.ContainerRenderer .

Default implementation of {@code decorate} for {@link goog.ui.Container}s. Decorates the element with the container, and attempts to decorate its child elements. Returns the decorated element.

container {goog.ui.Container}
Container to decorate the element.
element {Element}
Element to decorate.
returns {Element}
Decorated element.

.decorateChildren(container, element, opt_firstChild)

Inherited from goog.ui.ContainerRenderer .

Takes a container and an element that may contain child elements, decorates the child elements, and adds the corresponding components to the container as child components. Any non-element child nodes (e.g. empty text nodes introduced by line breaks in the HTML source) are removed from the element.

container {goog.ui.Container}
Container whose children are to be discovered.
element {Element}
Element whose children are to be decorated.
opt_firstChild {Element=}
the first child to be decorated.
@suppress
{visibility} setElementInternal

.enableTabIndex(element, enable)

Inherited from goog.ui.ContainerRenderer .

Enables or disables the tab index of the element. Only elements with a valid tab index can receive focus.

element {Element}
Element whose tab index is to be changed.
enable {boolean}
Whether to add or remove the element's tab index.

.getAriaRole()

Returns the ARIA role to be applied to the tab bar element. See http://wiki/Main/ARIA for more info.

returns {goog.dom.a11y.Role}
ARIA role.

.getClassNames(tabBar)

Returns all CSS class names applicable to the tab bar, based on its state. Overrides the superclass implementation by appending the location-specific class name to the list.

tabBar {goog.ui.Container}
Tab bar whose CSS classes are to be returned.
returns {Array.<string>}
Array of CSS class names applicable to the tab bar.

.getContentElement(element)

Inherited from goog.ui.ContainerRenderer .

Returns the DOM element into which child components are to be rendered, or null if the container hasn't been rendered yet.

element {Element}
Root element of the container whose content element is to be returned.
returns {Element}
Element to contain child elements (null if none).

.getCssClass()

Returns the CSS class name to be applied to the root element of all tab bars rendered or decorated using this renderer.

returns {string}
Renderer-specific CSS class name.

.getDecoratorForChild(element)

Inherited from goog.ui.ContainerRenderer .

Inspects the element, and creates an instance of {@link goog.ui.Control} or an appropriate subclass best suited to decorate it. Returns the control (or null if no suitable class was found). This default implementation uses the element's CSS class to find the appropriate control class to instantiate. May be overridden in subclasses.

element {Element}
Element to decorate.
returns {goog.ui.Control?}
A new control suitable to decorate the element (null if none).

.getDefaultOrientation()

Inherited from goog.ui.ContainerRenderer .

Returns the default orientation of containers rendered or decorated by this renderer. The base class implementation returns {@code VERTICAL}.

returns {goog.ui.Container.Orientation}
Default orientation for containers created or decorated by this renderer.

.getKeyEventTarget(container)

Inherited from goog.ui.ContainerRenderer .

Returns the element within the container's DOM that should receive keyboard focus (null if none). The default implementation returns the container's root element.

container {goog.ui.Container}
Container whose key event target is to be returned.
returns {Element}
Key event target (null if none).

.initializeDom(container)

Inherited from goog.ui.ContainerRenderer .

Initializes the container's DOM when the container enters the document. Called from {@link goog.ui.Container#enterDocument}.

container {goog.ui.Container}
Container whose DOM is to be initialized as it enters the document.