goog.ui.TabBarRenderer
Provided By | |
---|---|
Extends |
Default renderer for goog.ui.TabBar
s, 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:
<div class="goog-tab-bar goog-tab-bar-horizontal goog-tab-bar-top">
...(tabs here)...
</div>
new TabBarRenderer()
Parameters | None. |
---|
Instance Methods
this.canDecorate( element ) → boolean
boolean
Default implementation of canDecorate
; returns true if the element
is a DIV, false otherwise.
Defined by | |||||
---|---|---|---|---|---|
Parameters |
| ||||
Returns |
|
this.createDom( container ) → (Element|null)
(Element|null)
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.
Defined by | |||||
---|---|---|---|---|---|
Parameters |
| ||||
Returns |
|
this.decorate( container, element ) → Element
Element
Default implementation of decorate
for goog.ui.Container
s.
Decorates the element with the container, and attempts to decorate its child
elements. Returns the decorated element.
Defined by | |||||||||
---|---|---|---|---|---|---|---|---|---|
Parameters |
| ||||||||
Returns |
|
this.decorateChildren( container, element, opt_firstChild ) → void
void
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.
Defined by | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Parameters |
|
this.enableTabIndex( element, enable ) → void
void
Enables or disables the tab index of the element. Only elements with a valid tab index can receive focus.
Defined by | |||||||||
---|---|---|---|---|---|---|---|---|---|
Parameters |
|
this.getAriaRole() → (string|undefined)
(string|undefined)
Returns the ARIA role to be applied to the container. See http://wiki/Main/ARIA for more info.
Defined by | |||
---|---|---|---|
Parameters | None. | ||
Returns |
|
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.
Overrides | |||||
---|---|---|---|---|---|
Parameters |
| ||||
Returns |
|
this.getContentElement( element ) → (Element|null)
(Element|null)
Returns the DOM element into which child components are to be rendered, or null if the container hasn't been rendered yet.
Defined by | |||||
---|---|---|---|---|---|
Parameters |
| ||||
Returns |
|
this.getCssClass() → string
string
Returns the CSS class name to be applied to the root element of all tab bars rendered or decorated using this renderer.
Overrides | |||
---|---|---|---|
Parameters | None. | ||
Returns |
|
this.getDecoratorForChild( element ) → (goog.ui.Control|null)
(goog.ui.Control|null)
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.
Defined by | |||||
---|---|---|---|---|---|
Parameters |
| ||||
Returns |
|
this.getDefaultOrientation() → goog.ui.Container.Orientation
goog.ui.Container.Orientation
Returns the default orientation of containers rendered or decorated by this
renderer. The base class implementation returns VERTICAL
.
Defined by | |||
---|---|---|---|
Parameters | None. | ||
Returns |
|
this.getKeyEventTarget( container ) → (Element|null)
(Element|null)
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.
Defined by | |||||
---|---|---|---|---|---|
Parameters |
| ||||
Returns |
|
this.initializeDom( container ) → void
void
Initializes the container's DOM when the container enters the document.
Called from goog.ui.Container#enterDocument
.
Defined by | |||||
---|---|---|---|---|---|
Parameters |
|
this.setStateFromClassName( tabBar, className, baseClass ) → void
void
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.
Overrides | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Parameters |
|
Static Functions
TabBarRenderer.getInstance() → goog.ui.TabBarRenderer
goog.ui.TabBarRenderer
Parameters | None. | |
---|---|---|
Returns |
|
Static Properties
TabBarRenderer.CSS_CLASS → string
string
Default CSS class to be applied to the root element of components rendered by this renderer.