element.
.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.FlatButtonRenderer
.
Returns true if this renderer can decorate the element. Overrides
{@link goog.ui.ButtonRenderer#canDecorate} by returning true if the
element is a DIV, false otherwise.
element
{Element
}
Element to decorate.
returns {boolean
}
Whether the renderer can decorate the element.
.createCaption(content , dom )
Takes a text caption or existing DOM structure, and returns it wrapped in
an appropriately-styled DIV. Creates the following DOM structure:
content
{goog.ui.ControlContent
}
Text caption or DOM structure to wrap
in a box.
dom
{goog.dom.DomHelper
}
DOM helper, used for document interaction.
returns {Element
}
Caption element.
.createDom(control )
Returns the button's contents wrapped in the following DOM structure:
Overrides {@link goog.ui.FlatButtonRenderer#createDom}.
control
{goog.ui.Control
}
Button to render.
returns {Element
}
Root element for the button.
.createDropdown(dom )
Returns an appropriately-styled DIV containing a dropdown arrow element.
Creates the following DOM structure:
dom
{goog.dom.DomHelper
}
DOM helper, used for document interaction.
returns {Element
}
Dropdown element.
.decorate(button , element )
Takes an element, decorates it with the menu button control, and returns
the element. Overrides {@link goog.ui.CustomButtonRenderer#decorate} by
looking for a child element that can be decorated by a menu, and if it
finds one, decorates it and attaches it to the menu button.
button
{goog.ui.Control
}
Menu button to decorate the element.
element
{Element
}
Element to decorate.
returns {Element
}
Decorated element.
@suppress
{visibility} setContentInternal and setStateInternal
.enableClassName(control , className , enable )
Inherited from goog.ui.ControlRenderer
.
Updates the control's DOM by adding or removing the specified class name
to/from its root element. May add additional combined classes as needed in
IE6 and lower. Because of this, subclasses should use this method when
modifying class names on the control's root element.
control
{goog.ui.Control
|Element
}
Control instance (or root element)
to be updated.
className
{string
}
CSS class name to add or remove.
enable
{boolean
}
Whether to add or remove the class name.
Inherited from goog.ui.ControlRenderer
.
Updates the control's DOM by adding or removing the specified extra class
name to/from its element.
control
{goog.ui.Control
}
Control to be updated.
className
{string
}
CSS class name to add or remove.
enable
{boolean
}
Whether to add or remove the class name.
.getAriaRole()
Inherited from goog.ui.FlatButtonRenderer
.
Returns the ARIA role to be applied to flat buttons.
returns {goog.dom.a11y.Role
|undefined
}
ARIA role.
.getClassForState(state )
[protected]
Inherited from goog.ui.ControlRenderer
.
Takes a single {@link goog.ui.Component.State}, and returns the
corresponding CSS class name (null if none).
state
{goog.ui.Component.State
}
Component state.
returns {string
|undefined
}
CSS class representing the given state (undefined
if none).
.getClassNames(control )
[protected]
Inherited from goog.ui.ControlRenderer
.
Returns all CSS class names applicable to the given control, based on its
state. The return value is an array of strings containing
the renderer-specific CSS class returned by {@link #getCssClass},
followed by
the structural CSS class returned by {@link getStructuralCssClass} (if
different from the renderer-specific CSS class), followed by
any state-specific classes returned by {@link #getClassNamesForState},
followed by
any extra classes returned by the control's {@code getExtraClassNames}
method and
for IE6 and lower, additional combined classes from
{@link getAppliedCombinedClassNames_}.
Since all controls have at least one renderer-specific CSS class name, this
method is guaranteed to return an array of at least one element.
control
{goog.ui.Control
}
Control whose CSS classes are to be
returned.
returns {Array
.<string
>}
Array of CSS class names applicable to the control.
.getClassNamesForState(state )
[protected]
Inherited from goog.ui.ControlRenderer
.
Takes a bit mask of {@link goog.ui.Component.State}s, and returns an array
of the appropriate class names representing the given state, suitable to be
applied to the root element of a component rendered using this renderer, or
null if no state-specific classes need to be applied. This default
implementation uses the renderer's {@link getClassForState} method to
generate each state-specific class.
state
{number
}
Bit mask of component states.
returns {!Array
.<string
>}
Array of CSS class names representing the given
state.
.getContentElement(element )
Takes the button's root element and returns the parent element of the
button's contents.
element
{Element
}
Root element of the button whose content
element is to be returned.
returns {Element
}
The button's content element (if any).
.getCssClass()
Returns the CSS class to be applied to the root element of components
rendered using this renderer.
returns {string
}
Renderer-specific CSS class.
.getIe6ClassCombinations()
Inherited from goog.ui.ControlRenderer
.
Returns an array of combinations of classes to apply combined class names for
in IE6 and below. See {@link IE6_CLASS_COMBINATIONS} for more detail. This
method doesn't reference {@link IE6_CLASS_COMBINATIONS} so that it can be
compiled out, but subclasses should return their IE6_CLASS_COMBINATIONS
static constant instead.
returns {Array
.<Array
.<string
>>}
Array of class name combinations.
.getKeyEventTarget(control )
Inherited from goog.ui.ControlRenderer
.
Returns the element within the component's DOM that should receive keyboard
focus (null if none). The default implementation returns the control's root
element.
control
{goog.ui.Control
}
Control whose key event target is to be
returned.
returns {Element
}
The key event target.
.getStateFromClass(className )
[protected]
Inherited from goog.ui.ControlRenderer
.
Takes a single CSS class name which may represent a component state, and
returns the corresponding component state (0x00 if none).
className
{string
}
CSS class name, possibly representing a component
state.
returns {goog.ui.Component.State
}
state Component state corresponding
to the given CSS class (0x00 if none).
.getStructuralCssClass()
Inherited from goog.ui.ControlRenderer
.
Returns the name of a DOM structure-specific CSS class to be applied to the
root element of all components rendered or decorated using this renderer.
Unlike the class name returned by {@link #getCssClass}, the structural class
name may be shared among different renderers that generate similar DOM
structures. The structural class name also serves as the basis of derived
class names used to identify and style structural elements of the control's
DOM, as well as the basis for state-specific class names. The default
implementation returns the same class name as {@link #getCssClass}, but
subclasses are expected to override this method as needed.
returns {string
}
DOM structure-specific CSS class name (same as the renderer-
specific CSS class name by default).
Inherited from goog.ui.ButtonRenderer
.
Takes a button's root element, and returns its tooltip text.
element
{Element
}
The button's root element.
returns {string
|undefined
}
The tooltip text.
.getValue(element )
Inherited from goog.ui.FlatButtonRenderer
.
Flat buttons can't use the value attribute since they are div elements.
Overrides {@link goog.ui.ButtonRenderer#getValue} to prevent trying to
access the element's value.
element
{Element
}
The button control's root element.
returns {string
}
Value not valid for flat buttons.
.initializeDom(control )
Inherited from goog.ui.ControlRenderer
.
Initializes the control's DOM by configuring properties that can only be set
after the DOM has entered the document. This implementation sets up BiDi
and keyboard focus. Called from {@link goog.ui.Control#enterDocument}.
control
{goog.ui.Control
}
Control whose DOM is to be initialized
as it enters the document.
.isFocusable(control )
Inherited from goog.ui.ControlRenderer
.
Returns true if the control's key event target supports keyboard focus
(based on its {@code tabIndex} attribute), false otherwise.
control
{goog.ui.Control
}
Control whose key event target is to be
checked.
returns {boolean
}
Whether the control's key event target is focusable.
.setAllowTextSelection(element , allow )
Inherited from goog.ui.ControlRenderer
.
Allows or disallows text selection within the control's DOM.
element
{Element
}
The control's root element.
allow
{boolean
}
Whether the element should allow text selection.
.setAriaRole(element , opt_preferredRole )
Inherited from goog.ui.ControlRenderer
.
Sets the element's ARIA role.
element
{Element
}
Element to update.
opt_preferredRole
{?goog.dom.a11y.Role
=}
The preferred ARIA role.
.setAriaStates(control , element )
Inherited from goog.ui.ControlRenderer
.
Sets the element's ARIA states. An element does not need an ARIA role in
order to have an ARIA state. Only states which are initialized to be true
will be set.
control
{!goog.ui.Control
}
Control whose ARIA state will be updated.
element
{!Element
}
Element whose ARIA state is to be updated.
.setCollapsed(button , sides )
[protected]
Inherited from goog.ui.ButtonRenderer
.
Collapses the border on one or both sides of the button, allowing it to be
combined with the adjacent button(s), forming a single UI componenet with
multiple targets.
button
{goog.ui.Button
}
Button to update.
sides
{number
}
Bitmap of one or more {@link goog.ui.ButtonSide}s for
which borders should be collapsed.
.setContent(element , content )
Inherited from goog.ui.ControlRenderer
.
Takes a control's root element, and sets its content to the given text
caption or DOM structure. The default implementation replaces the children
of the given element. Renderers that create more complex DOM structures
must override this method accordingly.
element
{Element
}
The control's root element.
content
{goog.ui.ControlContent
}
Text caption or DOM structure to be
set as the control's content. The DOM nodes will not be cloned, they
will only moved under the content element of the control.
.setFocusable(control , focusable )
Inherited from goog.ui.ControlRenderer
.
Updates the control's key event target to make it focusable or non-focusable
via its {@code tabIndex} attribute. Does nothing if the control doesn't
support the {@code FOCUSED} state, or if it has no key event target.
control
{goog.ui.Control
}
Control whose key event target is to be
updated.
focusable
{boolean
}
Whether to enable keyboard focus support on the
control's key event target.
.setRightToLeft(element , rightToLeft )
Inherited from goog.ui.ControlRenderer
.
Applies special styling to/from the control's element if it is rendered
right-to-left, and removes it if it is rendered left-to-right.
element
{Element
}
The control's root element.
rightToLeft
{boolean
}
Whether the component is rendered
right-to-left.
.setState(control , state , enable )
Inherited from goog.ui.ControlRenderer
.
Updates the appearance of the control in response to a state change.
control
{goog.ui.Control
}
Control instance to update.
state
{goog.ui.Component.State
}
State to enable or disable.
enable
{boolean
}
Whether the control is entering or exiting the state.
Inherited from goog.ui.ButtonRenderer
.
Takes a button's root element and a tooltip string, and updates the element
with the new tooltip.
element
{Element
}
The button's root element.
tooltip
{string
}
New tooltip text.
.setValue
Inherited from goog.ui.ButtonRenderer
.
Takes a button's root element and a value, and updates the element to reflect
the new value. No-op in the base class.
element
{Element
}
The button's root element.
value
{string
}
New value.
.setVisible(element , visible )
Inherited from goog.ui.ControlRenderer
.
Shows or hides the element.
element
{Element
}
Element to update.
visible
{boolean
}
Whether to show the element.
.updateAriaState(element , state , enable )
[protected]
Inherited from goog.ui.ButtonRenderer
.
Updates the button's ARIA (accessibility) state if the button is being
treated as a checkbox.
element
{Element
}
Element whose ARIA state is to be updated.
state
{goog.ui.Component.State
}
Component state being enabled or
disabled.
enable
{boolean
}
Whether the state is being enabled or disabled.