| goog.Disposable | |
| goog.events.EventTarget | goog.Disposable |
| goog.ui.Component | goog.events.EventTarget |
| goog.ui.Control | goog.ui.Component |
| goog.ui.Textarea | goog.ui.Control |
|
content
:
Text to set as the textarea's value.
|
|
opt_renderer
:
Renderer used to render or decorate the textarea. Defaults to goog.ui.TextareaRenderer.
|
|
opt_domHelper
:
Optional DOM helper, used for document interaction.
|
discoverTextareaCharacteristics_()
In order to assess the correct height for a textarea, we need to know
whether the scrollHeight (the full height of the text) property includes
the values for padding and borders. We can also test whether the
box-sizing: border-box setting is working and then tweak accordingly.
Instead of hardcoding a list of currently known behaviors and testing
for quirksmode, we do a runtime check out of the flow. The performance
impact should be very small.
|
code » | ||
enterDocument()
No description.
|
code » | ||
|
Gets the textarea's content height + padding height + border height.
This is done by getting the scrollHeight and adjusting from there.
In the end this result is what we want the new offsetHeight to equal.
Returns:
The height of the textarea.
|
code » | ||
|
Gets the the height of (possibly present) horizontal scrollbar.
Returns:
The height of the horizontal scrollbar.
|
code » | ||
|
No description.
Returns:
The maxHeight value.
|
code » | ||
|
No description.
Returns:
The maxHeight value with a potential padding fix.
|
code » | ||
|
No description.
Returns:
The minHeight value.
|
code » | ||
|
No description.
Returns:
The minHeight value with a potential padding fix.
|
code » | ||
|
No description.
Returns:
The padding plus the border box height.
|
code » | ||
|
Gets the textarea's value.
Returns:
value The value of the textarea.
|
code » | ||
grow_(opt_e)
Resizes the textarea to grow/shrink to match its contents.
Arguments:
|
code » | ||
mouseUpListener_(e)
We use this listener to check if the textarea has been natively resized
and if so we reset minHeight so that we don't ever shrink smaller than
the user's manually set height. Note that we cannot check size on mousedown
and then just compare here because we cannot capture mousedown on
the textarea resizer, while mouseup fires reliably.
Arguments:
|
code » | ||
resize()
Resizes the textarea vertically.
|
code » | ||
setContent(content)
No description.
Arguments:
|
code » | ||
setEnabled(enable)
No description.
Arguments:
|
code » | ||
setHeightToEstimate_()
Sets the textarea's rows attribute to be the number of newlines + 1.
This is necessary when the textarea is hidden, in which case scrollHeight
is not available.
|
code » | ||
setHeight_(height)
Sets the textarea's height.
Arguments:
|
code » | ||
setMaxHeight(height)
Sets a maximum height for the textarea, and calls resize if rendered.
Arguments:
|
code » | ||
setMinHeight(height)
Sets a minimum height for the textarea, and calls resize if rendered.
Arguments:
|
code » | ||
setValue(value)
Sets the textarea's value.
Arguments:
|
code » | ||
shrink_()
Resizes the textarea to shrink to fit its contents. The way this works is
by increasing the padding of the textarea by 1px (it's important here that
we're in box-sizing: border-box mode). If the size of the textarea grows,
then the box is filled up to the padding box with text.
If it doesn't change, then we can shrink.
|
code » |
addClassName(className)
Adds the given class name to the list of classes to be applied to the
component's root element.
Arguments:
|
code » | ||
|
Returns true if the given element can be decorated by this component.
Overrides goog.ui.Component#canDecorate.
|
code » | ||
createDom()
Creates the control's DOM. Overrides goog.ui.Component#createDom by
delegating DOM manipulation to the control's renderer.
|
code » | ||
decorateInternal(element)
Decorates the given element with this component. Overrides goog.ui.Component#decorateInternal by delegating DOM manipulation
to the control's renderer.
Arguments:
|
code » | ||
disposeInternal()
No description.
|
code » | ||
enableClassName(className, enable)
Adds or removes the given class name to/from the list of classes to be
applied to the component's root element.
|
code » | ||
enableMouseEventHandling_(enable)
Enables or disables mouse event handling on the control.
Arguments:
|
code » | ||
enterDocument()
Configures the component after its DOM has been rendered, and sets up event
handling. Overrides goog.ui.Component#enterDocument.
|
code » | ||
exitDocument()
Cleans up the component before its DOM is removed from the document, and
removes event handlers. Overrides goog.ui.Component#exitDocument
by making sure that components that are removed from the document aren't
focusable (i.e. have no tab index).
|
code » | ||
|
No description.
Returns:
Text caption of the control or empty string if none.
|
code » | ||
|
Returns the text caption or DOM structure displayed in the component.
|
code » | ||
|
Returns the DOM element into which child components are to be rendered,
or null if the control itself hasn't been rendered yet. Overrides
goog.ui.Component#getContentElement by delegating to the renderer.
Returns:
Element to contain child elements (null if none).
|
code » | ||
|
Returns any additional class name(s) to be applied to the component's
root element, or null if no extra class names are needed.
|
code » | ||
|
Returns the DOM element on which the control is listening for keyboard
events (null if none).
Returns:
Element on which the control is listening for key events.
|
code » | ||
|
Returns the keyboard event handler for this component, lazily created the
first time this method is called. Considered protected; should only be
used within this package and by subclasses.
Returns:
Keyboard event handler for this component.
|
code » | ||
|
Returns the control's preferred ARIA role. This can be used by a control to
override the role that would be assigned by the renderer. This is useful in
cases where a different ARIA role is appropriate for a control because of the
context in which it's used. E.g., a goog.ui.MenuButton added to a
goog.ui.Select should have an ARIA role of LISTBOX and not MENUITEM.
Returns:
This control's preferred ARIA role or null if no preferred ARIA role is set.
|
code » | ||
|
Returns the renderer used by this component to render itself or to decorate
an existing element.
Returns:
Renderer used by the component (undefined if none).
|
code » | ||
|
Returns the component's state as a bit mask of goog.ui.Component.States.
Returns:
Bit mask representing component state.
|
code » | ||
handleBlur(e)
Handles blur events on the component's key event target element. Always
deactivates the component. In addition, if the component is focusable,
updates its state and styling to indicate that it no longer has keyboard
focus. Considered protected; should only be used within this package and
by subclasses. Warning: IE dispatches focus and blur events
asynchronously!
Arguments:
|
code » | ||
handleContextMenu(e)
Handles contextmenu events.
Arguments:
|
code » | ||
handleDblClick(e)
Handles dblclick events. Should only be registered if the user agent is
IE. If the component is enabled, performs its associated action by calling
performActionInternal. This is used to allow more performant
buttons in IE. In IE, no mousedown event is fired when that mousedown will
trigger a dblclick event. Because of this, a user clicking quickly will
only cause ACTION events to fire on every other click. This is a workaround
to generate ACTION events for every click. Unfortunately, this workaround
won't ever trigger the ACTIVE state. This is roughly the same behaviour as
if this were a 'button' element with a listener on mouseup. Considered
protected; should only be used within this package and by subclasses.
Arguments:
|
code » | ||
handleFocus(e)
Handles focus events on the component's key event target element. If the
component is focusable, updates its state and styling to indicate that it
now has keyboard focus. Considered protected; should only be used within
this package and by subclasses. Warning: IE dispatches focus and
blur events asynchronously!
Arguments:
|
code » | ||
|
Attempts to handle a keyboard event, if the component is enabled and visible,
by calling handleKeyEventInternal. Considered protected; should only
be used within this package and by subclasses.
Arguments:
Returns:
Whether the key event was handled.
|
code » | ||
|
Attempts to handle a keyboard event; returns true if the event was handled,
false otherwise. Considered protected; should only be used within this
package and by subclasses.
Arguments:
Returns:
Whether the key event was handled.
|
code » | ||
handleMouseDown(e)
Handles mousedown events. If the component is enabled, highlights and
activates it. If the component isn't configured for keyboard access,
prevents it from receiving keyboard focus. Considered protected; should
only be used within this package andy by subclasses.
Arguments:
|
code » | ||
handleMouseOut(e)
Handles mouseout events. Dispatches a LEAVE event; if the event isn't
canceled, and the component supports auto-highlighting, deactivates and
un-highlights the component. Considered protected; should only be used
within this package and by subclasses.
Arguments:
|
code » | ||
handleMouseOver(e)
Handles mouseover events. Dispatches an ENTER event; if the event isn't
canceled, the component is enabled, and it supports auto-highlighting,
highlights the component. Considered protected; should only be used
within this package and by subclasses.
Arguments:
|
code » | ||
handleMouseUp(e)
Handles mouseup events. If the component is enabled, highlights it. If
the component has previously been activated, performs its associated action
by calling performActionInternal, then deactivates it. Considered
protected; should only be used within this package and by subclasses.
Arguments:
|
code » | ||
|
Returns true if the component is in the specified state, false otherwise.
|
code » | ||
|
Returns true if the component is active (pressed), false otherwise.
Returns:
Whether the component is active.
|
code » | ||
|
Returns true if the control allows text selection within its DOM, false
otherwise. Controls that disallow text selection have the appropriate
unselectable styling applied to their elements. Note that controls hosted
in containers will report that they allow text selection even if their
container disallows text selection.
Returns:
Whether the control allows text selection.
|
code » | ||
|
Returns true if the component provides default event handling for the state,
false otherwise.
|
code » | ||
|
Returns true if the component is checked, false otherwise.
Returns:
Whether the component is checked.
|
code » | ||
|
Returns true if the component is set to dispatch transition events for the
given state, false otherwise.
|
code » | ||
|
Returns true if the component is enabled, false otherwise.
Returns:
Whether the component is enabled.
|
code » | ||
|
Returns true if the component is styled to indicate that it has keyboard
focus, false otherwise. Note that
isFocused() returning true
doesn't guarantee that the component's key event target has keyborad focus,
only that it is styled as such.
Returns:
Whether the component is styled to indicate as having keyboard focus.
|
code » | ||
|
Returns true if the control is configured to handle its own mouse events,
false otherwise. Controls not hosted in goog.ui.Containers have
to handle their own mouse events, but controls hosted in containers may
allow their parent to handle mouse events on their behalf. Considered
protected; should only be used within this package and by subclasses.
Returns:
Whether the control handles its own mouse events.
|
code » | ||
|
Returns true if the component is currently highlighted, false otherwise.
Returns:
Whether the component is highlighted.
|
code » | ||
|
Returns true if the component is open (expanded), false otherwise.
Returns:
Whether the component is open.
|
code » | ||
|
Returns true if the control has a parent that is itself disabled, false
otherwise.
Returns:
Whether the component is hosted in a disabled container.
|
code » | ||
|
Returns true if the component is selected, false otherwise.
Returns:
Whether the component is selected.
|
code » | ||
|
Returns true if the component supports the specified state, false otherwise.
|
code » | ||
|
Returns true if the transition into or out of the given state is allowed to
proceed, false otherwise. A state transition is allowed under the following
conditions:
|
code » | ||
|
Returns true if the component's visibility is set to visible, false if
it is set to hidden. A component that is set to hidden is guaranteed
to be hidden from the user, but the reverse isn't necessarily true.
A component may be set to visible but can otherwise be obscured by another
element, rendered off-screen, or hidden using direct CSS manipulation.
Returns:
Whether the component is visible.
|
code » | ||
|
Performs the appropriate action when the control is activated by the user.
The default implementation first updates the checked and selected state of
controls that support them, then dispatches an ACTION event. Considered
protected; should only be used within this package and by subclasses.
Arguments:
Returns:
Whether the action is allowed to proceed.
|
code » | ||
removeClassName(className)
Removes the given class name from the list of classes to be applied to
the component's root element.
Arguments:
|
code » | ||
setActive(active)
Activates or deactivates the component. Does nothing if this state
transition is disallowed.
Arguments:
|
code » | ||
setAllowTextSelection(allow)
Allows or disallows text selection within the control's DOM.
Arguments:
|
code » | ||
setAutoStates(states, enable)
Enables or disables automatic event handling for the given state(s).
|
code » | ||
setCaption(caption)
Sets the text caption of the component.
Arguments:
|
code » | ||
setChecked(check)
Checks or unchecks the component. Does nothing if this state transition
is disallowed.
Arguments:
|
code » | ||
setContent(content)
Sets the component's content to the given text caption, element, or array of
nodes. (If the argument is an array of nodes, it must be an actual array,
not an array-like object.)
|
code » | ||
setContentInternal(content)
Sets the component's content to the given text caption, element, or array
of nodes. Unlike #setContent, doesn't modify the component's DOM.
Called by renderers during element decoration. Considered protected; should
only be used within this package and by subclasses.
|
code » | ||
setDispatchTransitionEvents(states, enable)
Enables or disables transition events for the given state(s). Controls
handle state transitions internally by default, and only dispatch state
transition events if explicitly requested to do so by calling this method.
|
code » | ||
setEnabled(enable)
Enables or disables the component. Does nothing if this state transition
is disallowed. If the component is both visible and focusable, updates its
focused state and tab index as needed. If the component is being disabled,
ensures that it is also deactivated and un-highlighted first. Note that the
component's enabled/disabled state is "locked" as long as it is hosted in a
goog.ui.Container that is itself disabled; this is to prevent clients
from accidentally re-enabling a control that is in a disabled container.
Arguments:
|
code » | ||
setFocused(focused)
Applies or removes styling indicating that the component has keyboard focus.
Note that unlike the other "set" methods, this method is called as a result
of the component's element having received or lost keyboard focus, not the
other way around, so calling
setFocused(true) doesn't guarantee that
the component's key event target has keyboard focus, only that it is styled
as such.
Arguments:
|
code » | ||
setHandleMouseEvents(enable)
Enables or disables mouse event handling for the control. Containers may
use this method to disable mouse event handling in their child controls.
Considered protected; should only be used within this package and by
subclasses.
Arguments:
|
code » | ||
setHighlighted(highlight)
Highlights or unhighlights the component. Does nothing if this state
transition is disallowed.
Arguments:
|
code » | ||
setOpen(open)
Opens (expands) or closes (collapses) the component. Does nothing if this
state transition is disallowed.
Arguments:
|
code » | ||
setPreferredAriaRole(role)
Sets the control's preferred ARIA role. This can be used to override the role
that would be assigned by the renderer. This is useful in cases where a
different ARIA role is appropriate for a control because of the
context in which it's used. E.g., a goog.ui.MenuButton added to a
goog.ui.Select should have an ARIA role of LISTBOX and not MENUITEM.
Arguments:
|
code » | ||
setRenderer(renderer)
Registers the given renderer with the component. Changing renderers after
the component has entered the document is an error.
Arguments:
|
code » | ||
setRightToLeft(rightToLeft)
No description.
Arguments:
|
code » | ||
setSelected(select)
Selects or unselects the component. Does nothing if this state transition
is disallowed.
Arguments:
|
code » | ||
setState(state, enable)
Sets or clears the given state on the component, and updates its styling
accordingly. Does nothing if the component is already in the correct state
or if it doesn't support the specified state. Doesn't dispatch any state
transition events; use advisedly.
|
code » | ||
setStateInternal(state)
Sets the component's state to the state represented by a bit mask of
goog.ui.Component.States. Unlike #setState, doesn't
update the component's styling, and doesn't reject unsupported states.
Called by renderers during element decoration. Considered protected;
should only be used within this package and by subclasses.
Arguments:
|
code » | ||
setSupportedState(state, support)
Enables or disables support for the given state. Disabling support
for a state while the component is in that state is an error.
|
code » | ||
|
Shows or hides the component. Does nothing if the component already has
the requested visibility. Otherwise, dispatches a SHOW or HIDE event as
appropriate, giving listeners a chance to prevent the visibility change.
When showing a component that is both enabled and focusable, ensures that
its key target has a tab index. When hiding a component that is enabled
and focusable, blurs its key target and removes its tab index.
|
code » |
addChild(child, opt_render)
Adds the specified component as the last child of this component. See
goog.ui.Component#addChildAt for detailed semantics.
Arguments:
|
code » | ||||
addChildAt(child, index, opt_render)
⇒ undefined
Adds the specified component as a child of this component at the given
0-based index.
Both
addChild and addChildAt assume the following contract
between parent and child components:
parent.addChild(child) will throw an error if the
child component is already in the document, but the parent isn't.
Clients of this API may call addChild and addChildAt with
opt_render set to true. If opt_render is true, calling these
methods will automatically render the child component's element into the
parent component's element. However, parent.addChild(child, true)
will throw an error if:
opt_render is true and the parent component is not already
in the document, enterDocument will not be called on this component
at this point.
Finally, this method also throws an error if the new child already has a
different parent, or the given index is out of bounds.
Arguments:
Returns:
undefined
Nada.
|
code » | ||||
|
Determines if a given element can be decorated by this type of component.
This method should be overridden by inheriting objects.
|
code » | ||||
createDom()
Creates the initial DOM representation for the component. The default
implementation is to set this.element_ = div.
|
code » | ||||
decorate(element)
Decorates the element for the UI component.
Arguments:
|
code » | ||||
decorateInternal(element)
Actually decorates the element. Should be overridden by inheriting objects.
This method can assume there are checks to ensure the component has not
already been rendered have occurred and that enter document will be called
afterwards. This method is considered protected.
Arguments:
|
code » | ||||
disposeInternal()
Disposes of the component. Calls
exitDocument, which is expected to
remove event handlers and clean up the component. Propagates the call to
the component's children, if any. Removes the component's DOM from the
document unless it was decorated.
|
code » | ||||
enterDocument()
Called when the component's element is known to be in the document. Anything
using document.getElementById etc. should be done at this stage.
If the component contains child components, this call is propagated to its
children.
|
code » | ||||
exitDocument()
Called by dispose to clean up the elements and listeners created by a
component, or by a parent component/application who has removed the
component from the document but wants to reuse it later.
If the component contains child components, this call is propagated to its
children.
It should be possible for the component to be rendered again once this method
has been called.
|
code » | ||||
forEachChild(f, opt_obj)
Calls the given function on each of this component's children in order. If
opt_obj is provided, it will be used as the 'this' object in the
function when called. The function should take two arguments: the child
component and its 0-based index. The return value is ignored.
Arguments:
|
code » | ||||
|
Returns the child with the given ID, or null if no such child exists.
Arguments:
Returns:
The child with the given ID; null if none.
|
code » | ||||
|
Returns the child at the given index, or null if the index is out of bounds.
Arguments:
Returns:
The child at the given index; null if none.
|
code » | ||||
|
Returns the number of children of this component.
Returns:
The number of children.
|
code » | ||||
|
Returns an array containing the IDs of the children of this component, or an
empty array if the component has no children.
|
code » | ||||
|
Returns the DOM element into which child components are to be rendered,
or null if the component itself hasn't been rendered yet. This default
implementation returns the component's root element. Subclasses with
complex DOM structures must override this method.
Returns:
Element to contain child elements (null if none).
|
code » | ||||
|
Returns the dom helper that is being used on this component.
Returns:
The dom helper used on this component.
|
code » | ||||
|
Gets the component's element.
Returns:
The element for the component.
|
code » | ||||
|
Returns the first element in this component's DOM with the provided
className.
|
code » | ||||
|
Helper function for returning an element in the document with a unique id
generated using makeId().
|
code » | ||||
getElementsByClass(className)
⇒ {length: number}
Returns an array of all the elements in this component's DOM with the
provided className.
Arguments:
Returns:
{length: number}
The items found with the class name provided.
|
code » | ||||
|
Helper function for returning the fragment portion of an id generated using
makeId().
|
code » | ||||
|
Returns the event handler for this component, lazily created the first time
this method is called.
Returns:
Event handler for this component.
|
code » | ||||
|
Gets the unique ID for the instance of this component. If the instance
doesn't already have an ID, generates one on the fly.
Returns:
Unique component ID.
|
code » | ||||
getModel()
⇒ *
Returns the model associated with the UI component.
Returns:
*
The model.
|
code » | ||||
|
Returns the component's parent, if any.
Returns:
The parent component.
|
code » | ||||
|
Returns true if the component has children.
Returns:
True if the component has children.
|
code » | ||||
|
Returns the 0-based index of the given child component, or -1 if no such
child is found.
Arguments:
Returns:
0-based index of the child component; -1 if not found.
|
code » | ||||
|
Determines whether the component has been added to the document.
Returns:
TRUE if rendered. Otherwise, FALSE.
|
code » | ||||
|
Returns true if the component is rendered right-to-left, false otherwise.
The first time this function is invoked, the right-to-left rendering property
is set if it has not been already.
Returns:
Whether the control is rendered right-to-left.
|
code » | ||||
|
Helper function for subclasses that gets a unique id for a given fragment,
this can be used by components to generate unique string ids for DOM
elements.
|
code » | ||||
|
Makes a collection of ids. This is a convenience method for makeId. The
object's values are the id fragments and the new values are the generated
ids. The key will remain the same.
|
code » | ||||
|
Removes the given child from this component, and returns it. Throws an error
if the argument is invalid or if the specified child isn't found in the
parent component. The argument can either be a string (interpreted as the
ID of the child component to remove) or the child component itself.
If
opt_unrender is true, calls goog.ui.component#exitDocument
on the removed child, and subsequently detaches the child's DOM from the
document. Otherwise it is the caller's responsibility to clean up the child
component's DOM.
Arguments:
Returns:
The removed component, if any.
|
code » | ||||
|
Removes the child at the given index from this component, and returns it.
Throws an error if the argument is out of bounds, or if the specified child
isn't found in the parent. See goog.ui.Component#removeChild for
detailed semantics.
Arguments:
Returns:
The removed component, if any.
|
code » | ||||
|
Removes every child component attached to this one and returns them.
Arguments:
Returns:
The removed components if any.
|
code » | ||||
render(opt_parentElement)
Renders the component. If a parent element is supplied, the component's
element will be appended to it. If there is no optional parent element and
the element doesn't have a parentNode then it will be appended to the
document body.
If this component has a parent component, and the parent component is
not in the document already, then this will not call
enterDocument
on this component.
Throws an Error if the component is already rendered.
Arguments:
|
code » | ||||
renderBefore(sibling)
Renders the component before another element. The other element should be in
the document already.
Throws an Error if the component is already rendered.
Arguments:
|
code » | ||||
render_(opt_parentElement, opt_beforeNode)
Renders the component. If a parent element is supplied, the component's
element will be appended to it. If there is no optional parent element and
the element doesn't have a parentNode then it will be appended to the
document body.
If this component has a parent component, and the parent component is
not in the document already, then this will not call
enterDocument
on this component.
Throws an Error if the component is already rendered.
|
code » | ||||
setElementInternal(element)
Sets the component's root element to the given element. Considered
protected and final.
This should generally only be called during createDom. Setting the element
does not actually change which element is rendered, only the element that is
associated with this UI component.
Arguments:
|
code » | ||||
setId(id)
Assigns an ID to this component instance. It is the caller's responsibility
to guarantee that the ID is unique. If the component is a child of a parent
component, then the parent component's child index is updated to reflect the
new ID; this may throw an error if the parent already has a child with an ID
that conflicts with the new ID.
Arguments:
|
code » | ||||
setModel(obj)
Sets the model associated with the UI component.
Arguments:
|
code » | ||||
setParent(parent)
Sets the parent of this component to use for event bubbling. Throws an error
if the component already has a parent or if an attempt is made to add a
component to itself as a child. Callers must use
removeChild
or removeChildAt to remove components from their containers before
calling this method.
Arguments:
|
code » | ||||
setParentEventTarget(parent)
Overrides goog.events.EventTarget#setParentEventTarget to throw an
error if the parent component is set, and the argument is not the parent.
Arguments:
|
code » | ||||
setRightToLeft(rightToLeft)
Set is right-to-left. This function should be used if the component needs
to know the rendering direction during dom creation (i.e. before
#enterDocument is called and is right-to-left is set).
Arguments:
|
code » | ||||
|
No description.
Returns:
Whether the component was decorated.
|
code » |
addEventListener(type, handler, opt_capture, opt_handlerScope)
Adds an event listener to the event target. The same handler can only be
added once per the type. Even if you add the same handler multiple times
using the same type then it will only be called once when the event is
dispatched.
Supported for legacy but use goog.events.listen(src, type, handler) instead.
Arguments:
|
code » | |||||
|
Dispatches an event (or event like object) and calls all listeners
listening for events of this type. The type of the event is decided by the
type property on the event object.
If any of the listeners returns false OR calls preventDefault then this
function will return false. If one of the capture listeners calls
stopPropagation, then the bubble listeners won't fire.
|
code » | |||||
disposeInternal()
Unattach listeners from this object. Classes that extend EventTarget may
need to override this method in order to remove references to DOM Elements
and additional listeners, it should be something like this:
MyClass.prototype.disposeInternal = function() {
MyClass.superClass_.disposeInternal.call(this);
// Dispose logic for MyClass
};
|
code » | |||||
|
Returns the parent of this event target to use for bubbling.
Returns:
The parent EventTarget or null if there is no parent.
|
code » | |||||
removeEventListener(type, handler, opt_capture, opt_handlerScope)
Removes an event listener from the event target. The handler must be the
same object as the one added. If the handler has not been added then
nothing is done.
Arguments:
|
code » | |||||
setParentEventTarget(parent)
Sets the parent of this event target to use for bubbling.
Arguments:
|
code » |
addOnDisposeCallback(callback, opt_scope)
Invokes a callback function when this object is disposed. Callbacks are
invoked in the order in which they were added.
Arguments:
|
code » | |||
dispose()
⇒ undefined
Disposes of the object. If the object hasn't already been disposed of, calls
#disposeInternal. Classes that extend
goog.Disposable should
override #disposeInternal in order to delete references to COM
objects, DOM nodes, and other disposable objects. Reentrant.
Returns:
undefined
Nothing.
|
code » | |||
disposeInternal()
Deletes or nulls out any references to COM objects, DOM nodes, or other
disposable objects. Classes that extend
goog.Disposable should
override this method.
Not reentrant. To avoid calling it twice, it must only be called from the
subclass' disposeInternal method. Everywhere else the public
dispose method must be used.
For example:
mypackage.MyClass = function() {
goog.base(this);
// Constructor logic specific to MyClass.
...
};
goog.inherits(mypackage.MyClass, goog.Disposable);
mypackage.MyClass.prototype.disposeInternal = function() {
// Dispose logic specific to MyClass.
...
// Call superclass's disposeInternal at the end of the subclass's, like
// in C++, to avoid hard-to-catch issues.
goog.base(this, 'disposeInternal');
};
|
code » | |||
|
Use #isDisposed instead.
No description.
Returns:
Whether the object has been disposed of.
|
code » | |||
|
No description.
Returns:
Whether the object has been disposed of.
|
code » | |||
registerDisposable(disposable)
Associates a disposable object with this object so that they will be disposed
together.
Arguments:
|
code » |
|
For storing the border box size during enterDocument, to prevent possible
measurement differences that can happen after text zooming.
Note: runtime border width changes will cause problems with this.
|
Code » | |
|
Whether or not textarea rendering characteristics have been discovered.
Specifically we determine, at runtime:
If the padding and border box is included in offsetHeight.
|
Code » | |
|
The height of the textarea as last measured.
|
Code » | |
|
True if the resizing function is executing, false otherwise.
|
Code » | |
|
A maximum height for the textarea. When set to 0, the default, there is no
enforcement of this value during resize.
|
Code » | |
|
A minimum height for the textarea. When set to 0, the default, there is no
enforcement of this value during resize.
|
Code » | |
|
If a user agent doesn't correctly support the box-sizing:border-box CSS
value then we'll need to adjust our height calculations.
|
Code » | |
|
For storing the padding box size during enterDocument, to prevent possible
measurement differences that can happen after text zooming.
Note: runtime padding changes will cause problems with this.
|
Code » | |
|
Whether or not scrollHeight of a textarea includes the border box.
|
Code » | |
|
Whether or not scrollHeight of a textarea includes the padding box.
|
Code » |
|
Whether the control allows text selection within its DOM. Defaults to false.
|
Code » | |
|
A bit mask of goog.ui.Component.States for which this component
provides default event handling. For example, a component that handles
the HOVER state automatically will highlight itself on mouseover, whereas
a component that doesn't handle HOVER automatically will only dispatch
ENTER and LEAVE events but not call setHighlighted on itself.
By default, components provide default event handling for all states.
Controls hosted in containers (e.g. menu items in a menu, or buttons in a
toolbar) will typically want to have their container manage their highlight
state. Selectable controls managed by a selection model will also typically
want their selection state to be managed by the model.
|
Code » | |
|
Text caption or DOM structure displayed in the component.
|
Code » | |
|
Additional class name(s) to apply to the control's root element, if any.
|
Code » | |
|
Whether the control should listen for and handle mouse events; defaults to
true.
|
Code » | |
|
Keyboard event handler.
|
Code » | |
|
The control's preferred ARIA role.
|
Code » | |
|
Renderer associated with the component.
|
Code » | |
|
Current component state; a bit mask of goog.ui.Component.States.
|
Code » | |
|
A bit mask of goog.ui.Component.States for which this component
dispatches state transition events. Because events are expensive, the
default behavior is to not dispatch any state transition events at all.
Use the #setDispatchTransitionEvents API to request transition
events as needed. Subclasses may enable transition events by default.
Controls hosted in containers or managed by a selection model will typically
want to dispatch transition events.
|
Code » | |
|
A bit mask of goog.ui.Component.States this component supports.
|
Code » | |
|
Component visibility.
|
Code » |
|
Map of child component IDs to child components. Used for constant-time
random access to child components by ID. Lazily initialized on first use.
Must be kept in sync with
children_. This property is strictly
private and must not be accessed directly outside of this class!
We use a plain Object, not a goog.structs.Map, for simplicity.
This means components can't have children with IDs such as 'constructor' or
'valueOf', but this shouldn't really be an issue in practice, and if it is,
we can always fix it later without changing the API.
|
Code » | |
|
Array of child components. Lazily initialized on first use. Must be kept in
sync with
childIndex_. This property is strictly private and must
not be accessed directly outside of this class!
|
Code » | |
|
DomHelper used to interact with the document, allowing components to be
created in a different window.
|
Code » | |
|
The DOM element for the component.
|
Code » | |
|
Event handler.
TODO(user): rename it to handler_ after all component subclasses in
inside Google have been cleaned up.
Code search: http://go/component_code_search
|
Code » | |
|
Generator for unique IDs.
|
Code » | |
|
Unique ID of the component, lazily initialized in goog.ui.Component#getId if needed. This property is strictly private and
must not be accessed directly outside of this class!
|
Code » | |
|
Whether the component is in the document.
|
Code » | |
model_
: *
Arbitrary data object associated with the component. Such as meta-data.
|
Code » | |
|
Parent component to which events will be propagated. This property is
strictly private and must not be accessed directly outside of this class!
|
Code » | |
|
Whether the component is rendered right-to-left. Right-to-left is set
lazily when #isRightToLeft is called the first time, unless it has
been set by calling #setRightToLeft explicitly.
|
Code » | |
|
Flag used to keep track of whether a component decorated an already existing
element or whether it created the DOM itself.
If an element is decorated, dispose will leave the node in the document.
It is up to the app to remove the node.
If an element was rendered, dispose will remove the node automatically.
|
Code » |
|
If monitoring the goog.Disposable instances is enabled, stores the creation
stack trace of the Disposable instance.
|
Code » | |
|
Disposables that should be disposed when this object is disposed.
|
Code » | |
|
Whether the object has been disposed of.
|
Code » | |
|
Callbacks to invoke when this object is disposed.
|
Code » |
|
Some UAs will shrink the textarea automatically, some won't.
|
Code » |
goog.ui.Textarea.EventType
:
Constants for event names.
Constants:
|
Code » |