ui.TabBarRenderer Extends goog.ui.ContainerRenderer
Default renderer for goog.ui.TabBars, based on the 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)...

Inheritance

Constructor

goog.ui.TabBarRenderer()

Instance Methods

Public Protected Private
createClassByLocationMap_()
Creates the location-to-class lookup table.
code »
createLocationByClassMap_()
Creates the class-to-location lookup table, used during decoration.
code »
getClassNames(tabBar) !Array.<string>
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.
Arguments:
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.
code »
getCssClass() string
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.
code »
setStateFromClassName(tabBarclassNamebaseClass)
Sets the tab bar's state based on the given CSS class name, encountered during decoration. Overrides the superclass implementation by recognizing class names representing tab bar orientation and location.
Arguments:
tabBar : goog.ui.Container
Tab bar to configure.
className : string
CSS class name.
baseClass : string
Base class name used as the root of state-specific class names (typically the renderer's own class name).
code »
canDecorate(element) boolean
Default implementation of canDecorate; returns true if the element is a DIV, false otherwise.
Arguments:
element : Element
Element to decorate.
Returns: boolean  Whether the renderer can decorate the element.
code »
createDom(container) Element
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.
Arguments:
container : goog.ui.Container
Container to render.
Returns: Element  Root element for the container.
code »
decorate(containerelement) !Element
Default implementation of decorate for goog.ui.Containers. Decorates the element with the container, and attempts to decorate its child elements. Returns the decorated element.
Arguments:
container : goog.ui.Container
Container to decorate the element.
element : Element
Element to decorate.
Returns: !Element  Decorated element.
code »
decorateChildren(containerelementopt_firstChild)
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.
Arguments:
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.
code »
enableTabIndex(elementenable)
Enables or disables the tab index of the element. Only elements with a valid tab index can receive focus.
Arguments:
element : Element
Element whose tab index is to be changed.
enable : boolean
Whether to add or remove the element's tab index.
code »
getAriaRole() undefined | string
Returns the ARIA role to be applied to the container. See http://wiki/Main/ARIA for more info.
Returns: undefined | string  ARIA role.
code »
getClassNames(container) !Array.<string>
Returns all CSS class names applicable to the given container, based on its state. The array of class names returned includes the renderer's own CSS class, followed by a CSS class indicating the container's orientation, followed by any state-specific CSS classes.
Arguments:
container : goog.ui.Container
Container whose CSS classes are to be returned.
Returns: !Array.<string>  Array of CSS class names applicable to the container.
code »
getContentElement(element) Element
Returns the DOM element into which child components are to be rendered, or null if the container hasn't been rendered yet.
Arguments:
element : Element
Root element of the container whose content element is to be returned.
Returns: Element  Element to contain child elements (null if none).
code »
getCssClass() string
Returns the CSS class to be applied to the root element of containers rendered using this renderer.
Returns: string  Renderer-specific CSS class.
code »
getDecoratorForChild(element) ?goog.ui.Control
Inspects the element, and creates an instance of 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.
Arguments:
element : Element
Element to decorate.
Returns: ?goog.ui.Control  A new control suitable to decorate the element (null if none).
code »
getDefaultOrientation() goog.ui.Container.Orientation
Returns the default orientation of containers rendered or decorated by this renderer. The base class implementation returns VERTICAL.
Returns: goog.ui.Container.Orientation  Default orientation for containers created or decorated by this renderer.
code »
getKeyEventTarget(container) Element
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.
Arguments:
container : goog.ui.Container
Container whose key event target is to be returned.
Returns: Element  Key event target (null if none).
code »
initializeDom(container)
Initializes the container's DOM when the container enters the document. Called from goog.ui.Container#enterDocument.
Arguments:
container : goog.ui.Container
Container whose DOM is to be initialized as it enters the document.
code »
setStateFromClassName(containerclassNamebaseClass)
Sets the container's state based on the given CSS class name, encountered during decoration. CSS class names that don't represent container states are ignored. Considered protected; subclasses should override this method to support more states and CSS class names.
Arguments:
container : goog.ui.Container
Container to update.
className : string
CSS class name.
baseClass : string
Base class name used as the root of state-specific class names (typically the renderer's own class name).
code »

Instance Properties

classByLocation_ :
Map of locations to location-specific structural class names, precomputed and cached on first use to minimize object allocations and string concatenation.
Code »
constructor :
No description.
Code »
locationByClass_ :
Map of location-specific structural class names to locations, used during element decoration. Precomputed and cached on first use to minimize object allocations and string concatenation.
Code »
ariaRole_ :
No description.
Code »

Static Methods

goog.ui.TabBarRenderer.getInstance()
No description.
code »

Static Properties

goog.ui.TabBarRenderer.CSS_CLASS :
Default CSS class to be applied to the root element of components rendered by this renderer.
Code »
goog.ui.TabBarRenderer.instance_ :
No description.
Code »
goog.ui.TabBarRenderer.superClass_ :
No description.
Code »

Package ui

Package Reference