Objectgoog.ui.ControlRenderer
Returns true if this renderer can decorate the element, false otherwise.
The default implementation always returns true.
|
code » | ||||
![]()
Creates the lookup table of states to classes, used during state changes.
|
code » | ||||
Returns the control's contents wrapped in a DIV, with the renderer's own
CSS class and additional state-specific classes applied to it.
Arguments:
Returns:
Root element for the control.
|
code » | ||||
![]()
Creates the lookup table of classes to states, used during decoration.
|
code » | ||||
Default implementation of {@code decorate} for {@link goog.ui.Control}s.
Initializes the control's ID, content, and state based on the ID of the
element, its child nodes, and its CSS classes, respectively. Returns the
element.
Arguments:
Returns:
Decorated element.
|
code » | ||||
![]()
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.
Arguments:
|
code » | ||||
![]()
Updates the control's DOM by adding or removing the specified extra class
name to/from its element.
Arguments:
|
code » | ||||
Returns an array of all the combined class names that should be applied based
on the given list of classes. Checks the result of
{@link getIe6ClassCombinations} for any combinations that have all
members contained in classes. If a combination matches, the members are
joined with an underscore (in order), and added to the return array.
If opt_includedClass is provided, return only the combined classes that have
all members contained in classes AND include opt_includedClass as well.
opt_includedClass is added to classes as well.
|
code » | ||||
![]() goog.dom.a11y.Role | undefined
Returns the ARIA role to be applied to the control.
See http://wiki/Main/ARIA for more info.
Returns:
goog.dom.a11y.Role | undefined
ARIA role.
|
code » | ||||
Takes a single {@link goog.ui.Component.State}, and returns the
corresponding CSS class name (null if none).
Arguments:
Returns:
CSS class representing the given state (undefined if none).
|
code » | ||||
Returns all CSS class names applicable to the given control, based on its
state. The return value is an array of strings containing
Arguments:
|
code » | ||||
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.
|
code » | ||||
Takes the control's root element and returns the parent element of the
control's contents. Since by default controls are rendered as a single
DIV, the default implementation returns the element itself. Subclasses
with more complex DOM structures must override this method as needed.
|
code » | ||||
Returns the CSS class name to be applied to the root element of all
components rendered or decorated using this renderer. The class name
is expected to uniquely identify the renderer class, i.e. no two
renderer classes are expected to share the same CSS class name.
Returns:
Renderer-specific CSS class name.
|
code » | ||||
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 contasnt instead.
|
code » | ||||
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.
Arguments:
Returns:
The key event target.
|
code » | ||||
![]() goog.ui.Component.State
Takes a single CSS class name which may represent a component state, and
returns the corresponding component state (0x00 if none).
Arguments:
Returns:
goog.ui.Component.State
state Component state corresponding to the given CSS class (0x00 if none).
|
code » | ||||
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:
DOM structure-specific CSS class name (same as the renderer- specific CSS class name by default).
|
code » | ||||
![]()
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}.
Arguments:
|
code » | ||||
Returns true if the control's key event target supports keyboard focus
(based on its {@code tabIndex} attribute), false otherwise.
Arguments:
Returns:
Whether the control's key event target is focusable.
|
code » | ||||
![]()
Allows or disallows text selection within the control's DOM.
|
code » | ||||
![]()
Sets the element's ARIA role on browsers that support it.
Arguments:
|
code » | ||||
![]()
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.
Arguments:
|
code » | ||||
![]()
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.
Arguments:
|
code » | ||||
![]()
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.
|
code » | ||||
![]()
Updates the appearance of the control in response to a state change.
Arguments:
|
code » | ||||
![]()
Shows or hides the element.
|
code » | ||||
![]()
Updates the element's ARIA (accessibility) state on Gecko.
|
code » |
Constructs a new renderer and sets the CSS class that the renderer will use
as the base CSS class to apply to all elements rendered by that renderer.
An example to use this function using a color palette:
var myCustomRenderer = goog.ui.ControlRenderer.getCustomRenderer( goog.ui.PaletteRenderer, 'my-special-palette'); var newColorPalette = new goog.ui.ColorPalette( colors, myCustomRenderer, opt_domHelper);Your CSS can look like this now: .my-special-palette { } .my-special-palette-table { } .my-special-palette-cell { } etc.instead of .CSS_MY_SPECIAL_PALETTE .goog-palette { } .CSS_MY_SPECIAL_PALETTE .goog-palette-table { } .CSS_MY_SPECIAL_PALETTE .goog-palette-cell { } etc.You would want to use this functionality when you want an instance of a component to have specific styles different than the other components of the same type in your application. This avoids using descendant selectors to apply the specific styles to this component.
Arguments:
Returns:
An instance of the desired renderer with its getCssClass() method overridden to return the supplied custom CSS class name.
|
code » |
Default CSS class to be applied to the root element of components rendered
by this renderer.
|
Code » | |
Array of arrays of CSS classes that we want composite classes added and
removed for in IE6 and lower as a workaround for lack of multi-class CSS
selector support.
Subclasses that have accompanying CSS requiring this workaround should define
their own static IE6_CLASS_COMBINATIONS constant and override
getIe6ClassCombinations to return it.
For example, if your stylesheet uses the selector .button.collapse-left
(and is compiled to .button_collapse-left for the IE6 version of the
stylesheet,) you should include ['button', 'collapse-left'] in this array
and the class button_collapse-left will be applied to the root element
whenever both button and collapse-left are applied individually.
Members of each class name combination will be joined with underscores in the
order that they're defined in the array. You should alphabetize them (for
compatibility with the CSS compiler) unless you are doing something special.
|
Code » |