goog.ui.ac.RichInputHandler
Provided By | |
---|---|
Extends | |
All Implemented Interfaces |
Class for managing the interaction between an autocomplete object and a text-input or textarea.
new RichInputHandler( opt_separators, opt_literals, opt_multi, opt_throttleTime )
Parameters |
|
---|
Instance Methods
this.addOnDisposeCallback<T>( callback, opt_scope ) → void
void
Invokes a callback function when this object is disposed. Callbacks are invoked in the order in which they were added. If a callback is added to an already disposed Disposable, it will be called immediately.
Defined by | |||||||||
---|---|---|---|---|---|---|---|---|---|
Parameters |
|
this.attachAutoComplete( ac ) → void
void
Attach an instance of an AutoComplete
Defined by | |||||
---|---|---|---|---|---|
Parameters |
|
this.attachInput( target ) → void
void
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.
Defined by | |||||
---|---|---|---|---|---|
Parameters |
|
this.attachInputs( ...var_args ) → void
void
Attaches the input handler to multiple elements.
Defined by | |||||
---|---|---|---|---|---|
Parameters |
|
this.detachInput( target ) → void
void
Detaches the input handler from the provided element.
Defined by | |||||
---|---|---|---|---|---|
Parameters |
|
this.detachInputs( ...var_args ) → void
void
Detaches the input handler from multuple elements.
Defined by | |||||
---|---|---|---|---|---|
Parameters |
|
this.dispose() → ?
?
Disposes of the object and its resources.
Overrides | ||
---|---|---|
Specified by | ||
Parameters | None. | |
Returns |
|
this.disposeInternal() → void
void
Performs appropriate cleanup. See description of goog.disposable.IDisposable
for examples. 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() { mypackage.MyClass.base(this, 'constructor'); // 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. mypackage.MyClass.base(this, 'disposeInternal'); };
Defined by | |
---|---|
Overrides | |
Parameters | None. |
this.getActiveElement() → (Element|null)
(Element|null)
Returns the current active element.
Defined by | |||
---|---|---|---|
Parameters | None. | ||
Returns |
|
this.getAutoComplete() → (goog.ui.ac.AutoComplete|null)
(goog.ui.ac.AutoComplete|null)
Returns the associated autocomplete instance.
Defined by | |||
---|---|---|---|
Parameters | None. | ||
Returns |
|
this.getCursorPosition() → number
number
Returns the current cursor position.
Defined by | |||
---|---|---|---|
Parameters | None. | ||
Returns |
|
this.getDisposed() → boolean
boolean
warning Deprecated | Use |
---|
Defined by | |||
---|---|---|---|
Parameters | None. | ||
Returns |
|
this.getThrottleTime() → number
number
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.
Defined by | |||
---|---|---|---|
Parameters | None. | ||
Returns |
|
this.getUpdateDuringTyping() → boolean
boolean
Gets whether the result list is updated during typing.
Defined by | |||
---|---|---|---|
Parameters | None. | ||
Returns |
|
this.getValue() → string
string
Returns the value of the current active element.
Defined by | |||
---|---|---|---|
Parameters | None. | ||
Returns |
|
this.handleBlur( opt_e ) → void
void
Handles an element blurring.
Defined by | |||||
---|---|---|---|---|---|
Parameters |
|
this.handleFocus( e ) → void
void
Handles an element getting focus.
Defined by | |||||
---|---|---|---|---|---|
Parameters |
|
this.handleKeyEvent( e ) → boolean
boolean
Handles a key event.
Defined by | |||||
---|---|---|---|---|---|
Parameters |
| ||||
Returns |
|
this.handleKeyUp( e ) → boolean
boolean
Handles the key up event. Registered only if needKeyUpListener returns true.
Defined by | |||||
---|---|---|---|---|---|
Parameters |
| ||||
Returns |
|
this.handleMouseDown( e ) → void
void
For subclasses to override to handle the mouse-down event.
Defined by | |||||
---|---|---|---|---|---|
Parameters |
|
this.isDisposed() → boolean
boolean
Overrides | |||
---|---|---|---|
Specified by | |||
Parameters | None. | ||
Returns |
|
this.needKeyUpListener() → boolean
boolean
Defined by | |||
---|---|---|---|
Parameters | None. | ||
Returns |
|
this.parseToken() → string
string
Parses a text area or input box for the currently highlighted token.
Defined by | |||
---|---|---|---|
Parameters | None. | ||
Returns |
|
this.processBlur() → void
void
Helper function that does the logic to handle an element blurring.
this.processFocus( target ) → void
void
Registers handlers for the active element when it receives focus.
Defined by | |||||
---|---|---|---|---|---|
Parameters |
|
this.registerDisposable( disposable ) → void
void
Associates a disposable object with this object so that they will be disposed together.
Defined by | |||||
---|---|---|---|---|---|
Parameters |
|
this.selectRow( row ) → boolean
boolean
this.setCursorPosition( pos ) → void
void
Sets the cursor at the given position.
Defined by | |||||
---|---|---|---|---|---|
Parameters |
|
this.setEndsWithSeparatorRegExp( separatorCheck ) → void
void
Sets the regular expression used to check whether the replacement (used to update the text area after a row is selected) ends with a separator. This can be set to null if the input handler should never automatically append a separator to the replacement string.
Defined by | |||||
---|---|---|---|---|---|
Parameters |
|
this.setGenerateNewTokenOnLiteral( newValue ) → void
void
Sets whether new tokens should be generated from literals. That is, should hello'world be two tokens, assuming ' is a literal?
Defined by | |||||
---|---|---|---|---|---|
Parameters |
|
this.setPreventDefaultOnTab( newValue ) → void
void
Sets whether we will prevent the default input behavior (moving focus to the next focusable element) on TAB.
Defined by | |||||
---|---|---|---|---|---|
Parameters |
|
this.setPreventSelectionOnTab( newValue ) → void
void
Sets whether we will prevent highlighted item selection on TAB.
Defined by | |||||
---|---|---|---|---|---|
Parameters |
|
this.setRowJustSelected( justSelected ) → void
void
Sets whether a row has just been selected.
Defined by | |||||
---|---|---|---|---|---|
Parameters |
|
this.setSeparatorCompletes( newValue ) → void
void
Sets whether separators perform autocomplete.
Defined by | |||||
---|---|---|---|---|---|
Parameters |
|
this.setSeparatorSelects( newValue ) → void
void
Sets whether separators perform autocomplete.
Defined by | |||||
---|---|---|---|---|---|
Parameters |
|
this.setSeparators( separators, opt_defaultSeparators ) → void
void
this.setThrottleTime( time ) → void
void
Sets the time to wait before updating the results.
Defined by | |||||
---|---|---|---|---|---|
Parameters |
|
this.setTokenText( tokenText, opt_multi ) → void
void
this.setTrimmingRegExp( trimmer ) → void
void
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.
Defined by | |||||
---|---|---|---|---|---|
Parameters |
|
this.setUpdateDuringTyping( value ) → void
void
Sets whether the result list should be updated during typing.
Defined by | |||||
---|---|---|---|---|---|
Parameters |
|
this.setUpsideDown( upsideDown ) → void
void
Sets whether to flip the orientation of up & down for hiliting next and previous autocomplete entries.
Defined by | |||||
---|---|---|---|---|---|
Parameters |
|
this.setValue( value ) → void
void
Sets the value of the current active element.
Defined by | |||||
---|---|---|---|---|---|
Parameters |
|
this.setWhitespaceWrapEntries( newValue ) → void
void
Sets whether auto-completed tokens should be wrapped with whitespace.
Defined by | |||||
---|---|---|---|---|---|
Parameters |
|
this.update( opt_force ) → void
void
Checks if an update has occurred and notified the autocomplete of the new token.
Defined by | |||||
---|---|---|---|---|---|
Parameters |
|
Instance Properties
this.ac_ → (goog.ui.ac.AutoComplete|null)
(goog.ui.ac.AutoComplete|null)
The AutoComplete instance this inputhandler is associated with.
this.creationStack → (string|undefined)
(string|undefined)
If monitoring the goog.Disposable instances is enabled, stores the creation stack trace of the Disposable instance.