Objectgoog.Disposable
goog.events.EventTarget
goog.ui.Component
goog.ui.ComboBox
opt_domHelper
:
Optional DOM helper.
|
![]()
Adds a new menu item at the end of the menu.
Arguments:
|
code » | |||
![]()
Adds a new menu item at a specific index in the menu.
Arguments:
|
code » | |||
Combo box currently can't decorate elements.
Returns:
The value false.
|
code » | |||
![]()
Clears the dismiss timer if it's active.
|
code » | |||
![]()
Create the DOM objects needed for the combo box. A span and text input.
|
code » | |||
No description.
Returns:
A created and set up menu.
|
code » | |||
![]()
No description.
|
code » | |||
![]()
No description.
|
code » | |||
![]()
No description.
|
code » | |||
![]()
No description.
|
code » | |||
No description.
Returns:
text The default text for the combox box.
|
code » | |||
No description.
Returns:
The field name for the combo box.
|
code » | |||
Returns a reference to the menu item at a given index.
Arguments:
Returns:
Reference to the menu item.
|
code » | |||
Returns the number of items in the list, including non-visible items,
such as separators.
Returns:
Number of items in the menu for this combobox.
|
code » | |||
No description.
Returns:
The match function for the combox box.
|
code » | |||
No description.
Returns:
The menu that pops up.
|
code » | |||
No description.
Returns:
The number of visible items in the menu.
|
code » | |||
No description.
Returns:
The token for the current cursor position in the input box, when multi-input is disabled it will be the full input value.
|
code » | |||
No description.
Returns:
The current value of the combo box.
|
code » | |||
Handles keyboard events from the input box. Returns true if the combo box
was able to handle the event, false otherwise.
Arguments:
Returns:
Whether the event was handled by the combo box.
|
code » | |||
![]()
Hide the menu and remove the active class from the combo box's element.
|
code » | |||
Returns true if the item has an isSticky method and the method returns true.
Arguments:
Returns:
Whether the item has an isSticky method and the method returns true.
|
code » | |||
![]()
The match function. The first argument for the match function will be
a MenuItem's caption and the second will be the token to evaluate.
|
code » | |||
![]()
Shows the menu if it isn't already showing. Also positions the menu
correctly, resets the menu item visibilities and highlights the relevent
item.
|
code » | |||
![]()
Event handler for when the combo box area has been clicked.
Arguments:
|
code » | |||
![]()
Event handler for when the document is clicked.
Arguments:
|
code » | |||
![]()
Event handler for when the input box looses focus -- hide the menu
Arguments:
|
code » | |||
![]()
Handles the content of the input box changing.
Arguments:
|
code » | |||
![]()
Handle the menu's select event.
Arguments:
|
code » | |||
![]()
No description.
|
code » | |||
![]()
Removes an item from the menu and disposes it.
Arguments:
|
code » | |||
![]()
Removes a menu item at a given index in the menu.
Arguments:
|
code » | |||
![]()
Sets the default text for the combo box.
Arguments:
|
code » | |||
![]()
Sets the field name for the combo box.
Arguments:
|
code » | |||
![]()
Highlights the first token that matches the given token.
Arguments:
|
code » | |||
![]()
Loops through all menu items setting their visibility according to a token.
Arguments:
|
code » | |||
![]()
Sets the match function to be used when filtering the combo box menu.
Arguments:
|
code » | |||
![]()
Set to true if a unicode inverted triangle should be displayed in the
dropdown button.
This option defaults to false for backwards compatibility.
Arguments:
|
code » | |||
![]()
Sets the current value of the combo box.
Arguments:
|
code » | |||
![]()
Show the menu and add an active class to the combo box's element.
|
code » |
![]()
Adds the specified component as the last child of this component. See
{@link goog.ui.Component#addChildAt} for detailed semantics.
Arguments:
|
code » | ||||
![]()
Adds the specified component as a child of this component at the given
0-based index.
Both {@code addChild} and {@code addChildAt} assume the following contract
between parent and child components:
Arguments:
|
code » | ||||
Determines if a given element can be decorated by this type of component.
This method should be overridden by inheriting objects.
|
code » | ||||
![]()
No description.
|
code » | ||||
![]()
Decorates the element for the UI component.
Arguments:
|
code » | ||||
![]()
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 » | ||||
![]()
Disposes of the component. Calls {@code 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 » | ||||
![]()
No description.
|
code » | ||||
![]()
No description.
|
code » | ||||
![]()
Calls the given function on each of this component's children in order. If
{@code 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.
|
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 » | ||||
Helper function for returning an element in the document with a unique id
generated using makeId().
|
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 » | ||||
![]() *
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 » | ||||
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 {@code opt_unrender} is true, calls {@link 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 {@link goog.ui.Component#removeChild} for
detailed semantics.
Arguments:
Returns:
The removed component, if any.
|
code » | ||||
![]()
Removes every child component attached to this one.
Arguments:
|
code » | ||||
![]()
Renders the component. If a parent element is supplied, it should already be
in the document and then 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.
Throws an Error if the component is already rendered.
Arguments:
|
code » | ||||
![]()
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 » | ||||
![]()
Renders the component. If a parent element is supplied, it should already be
in the document and then 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.
Throws an Error if the component is already rendered.
|
code » | ||||
![]()
Sets the component's root element to the given element. Considered
protected and final.
Arguments:
|
code » | ||||
![]()
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 » | ||||
![]()
Sets the model associated with the UI component.
Arguments:
|
code » | ||||
![]()
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 {@code removeChild}
or {@code removeChildAt} to remove components from their containers before
calling this method.
Arguments:
|
code » | ||||
![]()
Overrides {@link goog.events.EventTarget#setParentEventTarget} to throw an
error if the parent component is set, and the argument is not the parent.
Arguments:
|
code » | ||||
![]()
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
{@link #enterDocument} is called and is right-to-left is set).
Arguments:
|
code » | ||||
No description.
Returns:
Whether the component was decorated.
|
code » |
![]()
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.
Arguments:
Returns:
If anyone called preventDefault on the event object (or if any of the handlers returns false this will also return false.
|
code » | |||||
![]()
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 » | |||||
![]()
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 » | |||||
![]()
Sets the parent of this event target to use for bubbling.
Arguments:
|
code » |
![]()
No description.
|
code » | |
![]()
Deletes or nulls out any references to COM objects, DOM nodes, or other
disposable objects. Classes that extend {@code goog.Disposable} should
override this method. For example:
mypackage.MyClass = function() { goog.Disposable.call(this); // Constructor logic specific to MyClass. ... }; goog.inherits(mypackage.MyClass, goog.Disposable); mypackage.MyClass.prototype.disposeInternal = function() { mypackage.MyClass.superClass_.disposeInternal.call(this); // Dispose logic specific to MyClass. ... }; |
code » | |
No description.
Returns:
Whether the object has been disposed of.
|
code » | |
No description.
Returns:
Whether the object has been disposed of.
|
code » |
Element used as the combo boxes button.
|
Code » | |
Default text content for the input box when it is unchanged and unfocussed.
|
Code » | |
Timer identifier for delaying the dismissal of the combo menu.
|
Code » | |
Name for the input box created
|
Code » | |
Input handler to take care of firing events when the user inputs text in
the input.
|
Code » | |
The input element.
|
Code » | |
A LabelInput control that manages the focus/blur state of the input box.
|
Code » | |
The last input token.
|
Code » | |
A logger to help debugging of combo box behavior.
|
Code » | |
Drop down menu for the combo box. Will be created at construction time.
|
Code » | |
True if the unicode inverted triangle should be displayed in the dropdown
button. Defaults to false.
|
Code » | |
The cached visible count.
|
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 {@code children_}. This property is strictly
private and must not be accessed directly outside of this class!
We use a plain Object, not a {@link 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 {@code 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 » | |
Generator for unique IDs.
|
Code » | |
Unique ID of the component, lazily initialized in {@link
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 » | |
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 {@link #isRightToLeft} is called the first time, unless it has
been set by calling {@link #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 was decorated
dispose will remove the node from the document, it is left up to the app.
|
Code » |