The goog.ui.ac.RichInputHandler Class

goog.ui.ac.RichInputHandler
> goog.ui.ac.InputHandler
> goog.Disposable

goog.ui.ac.RichInputHandler(opt_separators, opt_literals, opt_multi, opt_throttleTime)

Class for managing the interaction between an autocomplete object and a text-input or textarea.

opt_separators {?string=}
Seperators to split multiple entries.
opt_literals {?string=}
Characters used to delimit text literals.
opt_multi {?boolean=}
Whether to allow multiple entries (Default: true).
opt_throttleTime {?number=}
Number of milliseconds to throttle keyevents with (Default: 150).

.ac_ {goog.ui.ac.AutoComplete}

Inherited from goog.ui.ac.InputHandler .

The AutoComplete instance this inputhandler is associated with.

.addOnDisposeCallback(callback, opt_scope)

Inherited from goog.Disposable .

Invokes a callback function when this object is disposed. Callbacks are invoked in the order in which they were added.

callback {!Function}
The callback function.
opt_scope {Object=}
An optional scope to call the callback in.

.attachAutoComplete(ac)

Inherited from goog.ui.ac.InputHandler .

Attach an instance of an AutoComplete

ac {goog.ui.ac.AutoComplete}
Autocomplete object.

.attachInput(target)

Inherited from goog.ui.ac.InputHandler .

Attaches the input handler to a target element. The target element should be a textarea, input box, or other focusable element with the same interface.

target {Element|goog.events.EventTarget}
An element to attach the input handler too.

.attachInputs(var_args)

Inherited from goog.ui.ac.InputHandler .

Attaches the input handler to multiple elements.

var_args {...Element}
Elements to attach the input handler too.

.creationStack {string}

Inherited from goog.Disposable .

If monitoring the goog.Disposable instances is enabled, stores the creation stack trace of the Disposable instance.

.detachInput(target)

Inherited from goog.ui.ac.InputHandler .

Detaches the input handler from the provided element.

target {Element|goog.events.EventTarget}
An element to detach the input handler from.

.detachInputs(var_args)

Inherited from goog.ui.ac.InputHandler .

Detaches the input handler from multuple elements.

var_args {...Element}
Variable arguments for elements to unbind from.

.dispose()

Inherited from goog.Disposable .

Disposes of the object. If the object hasn't already been disposed of, calls {@link #disposeInternal}. Classes that extend {@code goog.Disposable} should override {@link #disposeInternal} in order to delete references to COM objects, DOM nodes, and other disposable objects. Reentrant.

returns {void}
Nothing.

.getActiveElement()

Inherited from goog.ui.ac.InputHandler .

Returns the current active element.

returns {Element}
The currently active element.

.getAutoComplete()

Inherited from goog.ui.ac.InputHandler .

Returns the associated autocomplete instance.

returns {goog.ui.ac.AutoComplete}
The associated autocomplete instance.

.getCursorPosition()

Inherited from goog.ui.ac.InputHandler .

Returns the current cursor position.

returns {number}
The index of the cursor position.

.getThrottleTime()

Inherited from goog.ui.ac.InputHandler .

Gets the time to wait before updating the results. If the update during typing flag is switched on, this delay counts from the last update, otherwise from the last keypress.

returns {number}
Throttle time in milliseconds.

.getUpdateDuringTyping()

Inherited from goog.ui.ac.InputHandler .

Gets whether the result list is updated during typing.

returns {boolean}
Value of the flag.

.getValue()

Inherited from goog.ui.ac.InputHandler .

Returns the value of the current active element.

returns {string}
The value of the current active element.

.isDisposed()

Inherited from goog.Disposable .

returns {boolean}
Whether the object has been disposed of.

.registerDisposable(disposable)

Inherited from goog.Disposable .

Associates a disposable object with this object so that they will be disposed together.

disposable {goog.disposable.IDisposable}
that will be disposed when this object is disposed.

.selectRow(row)

Selects the given rich row. The row's select(target) method is called.

row {Object}
The row to select.
returns {boolean}
Whether to suppress the update event.

.setCursorPosition(pos)

Inherited from goog.ui.ac.InputHandler .

Sets the cursor at the given position.

pos {number}
The index of the cursor position.

.setGenerateNewTokenOnLiteral(newValue)

Inherited from goog.ui.ac.InputHandler .

Sets whether new tokens should be generated from literals. That is, should hello'world be two tokens, assuming ' is a literal?

newValue {boolean}
boolean value indicating whether or not new tokens should be generated from literals.

.setPreventDefaultOnTab(newValue)

Inherited from goog.ui.ac.InputHandler .

Sets whether we will prevent the default input behavior (moving focus to the next focusable element) on TAB.

newValue {boolean}
Whether to preventDefault on TAB.

.setRowJustSelected(justSelected)

Inherited from goog.ui.ac.InputHandler .

Sets whether a row has just been selected.

justSelected {boolean}
Whether or not the row has just been selected.

.setSeparatorCompletes(newValue)

Inherited from goog.ui.ac.InputHandler .

Sets whether separators perform autocomplete.

newValue {boolean}
Whether to autocomplete on separators.

.setSeparatorSelects(newValue)

Inherited from goog.ui.ac.InputHandler .

Sets whether separators perform autocomplete.

newValue {boolean}
Whether to autocomplete on separators.

.setSeparators(separators)

Inherited from goog.ui.ac.InputHandler .

Sets the entry separator characters.

separators {string}
The separator characters to set.

.setThrottleTime(time)

Inherited from goog.ui.ac.InputHandler .

Sets the time to wait before updating the results.

time {number}
New throttle time in milliseconds.

.setTrimmingRegExp(trimmer)

Inherited from goog.ui.ac.InputHandler .

Sets the regular expression used to trim the tokens before passing them to the matcher: every substring that matches the given regular expression will be removed. This can also be set to null to disable trimming.

trimmer {RegExp}
Regexp to use for trimming or null to disable it.

.setUpdateDuringTyping(value)

Inherited from goog.ui.ac.InputHandler .

Sets whether the result list should be updated during typing.

value {boolean}
New value of the flag.

.setUpsideDown(upsideDown)

Inherited from goog.ui.ac.InputHandler .

Sets whether to flip the orientation of up & down for hiliting next and previous autocomplete entries.

upsideDown {boolean}
Whether the orientation is upside down.

.setValue(value)

Inherited from goog.ui.ac.InputHandler .

Sets the value of the current active element.

value {string}
The new value.

.setWhitespaceWrapEntries(newValue)

Inherited from goog.ui.ac.InputHandler .

Sets whether auto-completed tokens should be wrapped with whitespace.

newValue {boolean}
boolean value indicating whether or not auto-completed tokens should be wrapped with whitespace.

.update(opt_force)

Inherited from goog.ui.ac.InputHandler .

Checks if an update has occurred and notified the autocomplete of the new token.

opt_force {boolean=}
If true the menu will be forced to update.