goog.Disposable | |
goog.ui.ac.InputHandler | goog.Disposable |
goog.ui.ac.RichInputHandler | goog.ui.ac.InputHandler |
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).
|
![]()
Adds the necessary input event handlers.
|
code » | |||
![]()
Attach an instance of an AutoComplete
Arguments:
|
code » | |||
![]()
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.
Arguments:
|
code » | |||
![]()
Attaches the input handler to multiple elements.
Arguments:
|
code » | |||
![]()
Detaches the input handler from the provided element.
Arguments:
|
code » | |||
![]()
Detaches the input handler from multuple elements.
Arguments:
|
code » | |||
![]()
No description.
|
code » | |||
Returns the current active element.
Returns: Element
The currently active element.
|
code » | |||
Returns the associated autocomplete instance.
Returns: goog.ui.ac.AutoComplete
The associated autocomplete instance.
|
code » | |||
Returns the current cursor position.
Returns: number
The index of the cursor position.
|
code » | |||
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.
|
code » | |||
Gets the index of the currently highlighted token
|
code » | |||
Gets whether the result list is updated during typing.
Returns: boolean
Value of the flag.
|
code » | |||
Returns the value of the current active element.
Returns: string
The value of the current active element.
|
code » | |||
![]()
Handles an element blurring.
Arguments:
|
code » | |||
![]()
Handles an element getting focus.
Arguments:
|
code » | |||
Handles a key event.
Arguments:
Returns: boolean
True if the key event was handled.
|
code » | |||
Handles the key up event. Registered only if needKeyUpListener returns true.
Arguments:
Returns: boolean
Whether an action was taken or not.
|
code » | |||
![]()
For subclasses to override to handle the mouse-down event.
Arguments:
|
code » | |||
Handles a key event for a separator key.
Arguments:
Returns: boolean
True if the key event was handled.
|
code » | |||
Moves hilite down. May hilite next or previous depending on orientation.
Returns: boolean
True if successful.
|
code » | |||
Moves hilite up. May hilite next or previous depending on orientation.
Returns: boolean
True if successful.
|
code » | |||
No description.
Returns: boolean
Whether this inputhandler need to listen on key-up.
|
code » | |||
![]()
Handles the key-press event for IE, checking to see if the user typed a
separator character.
Arguments:
|
code » | |||
![]()
Handles typing in an inactive input element. Activate it.
Arguments:
|
code » | |||
![]()
Handles a KEYPRESS event generated by typing in the active input element.
Checks if IME input is ended.
Arguments:
|
code » | |||
![]()
Handles the key-up event. This is only ever used by Mac FF or when we are in
an IME entry scenario.
Arguments:
|
code » | |||
![]()
Handles typing in the active input element. Checks if the key is a special
key and does the relevent action as appropriate.
Arguments:
|
code » | |||
![]()
Handles mouse-down event.
Arguments:
|
code » | |||
![]()
Handles the timer's tick event. Calculates the current token, and reports
any update to the autocomplete.
Arguments:
|
code » | |||
Parses a text area or input box for the currently highlighted token.
Returns: string
Token to complete.
|
code » | |||
Parses a text area or input box for the currently highlighted token.
Returns: string
Token to complete.
|
code » | |||
![]()
Helper function that does the logic to handle an element blurring.
|
code » | |||
![]()
Registers handlers for the active element when it receives focus.
Arguments:
|
code » | |||
![]()
Removes the necessary input event handlers.
|
code » | |||
Selects the given row. Implements the SelectionHandler interface.
|
code » | |||
![]()
Sets the cursor at the given position.
Arguments:
|
code » | |||
![]()
Sets whether new tokens should be generated from literals. That is, should
hello'world be two tokens, assuming ' is a literal?
Arguments:
|
code » | |||
![]()
Sets whether we will prevent the default input behavior (moving focus to the
next focusable element) on TAB.
Arguments:
|
code » | |||
![]()
Sets whether a row has just been selected.
Arguments:
|
code » | |||
![]()
Sets whether separators perform autocomplete.
Arguments:
|
code » | |||
![]()
Sets whether separators perform autocomplete.
Arguments:
|
code » | |||
![]()
Sets the entry separator characters.
Arguments:
|
code » | |||
![]()
Sets the time to wait before updating the results.
Arguments:
|
code » | |||
![]()
Sets the text of the current token without updating the autocomplete
choices.
Arguments:
|
code » | |||
![]()
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.
Arguments:
|
code » | |||
![]()
Sets whether the result list should be updated during typing.
Arguments:
|
code » | |||
![]()
Sets whether to flip the orientation of up & down for hiliting next
and previous autocomplete entries.
Arguments:
|
code » | |||
![]()
Sets the value of the current active element.
Arguments:
|
code » | |||
![]()
Sets whether auto-completed tokens should be wrapped with whitespace.
Arguments:
|
code » | |||
Splits an input string of text at the occurance of a character in
goog.ui.ac.InputHandler.prototype.separators_ and creates
an array of tokens. Each token may contain additional whitespace and
formatting marks. If necessary use
goog.ui.ac.InputHandler.prototype.trim_ to clean up the
entries.
|
code » | |||
![]()
Starts waiting for IME.
|
code » | |||
![]()
Stops waiting for IME.
|
code » | |||
Trims a token of characters that we want to ignore
|
code » | |||
![]()
Checks if an update has occurred and notified the autocomplete of the new
token.
Arguments:
|
code » |
![]()
Invokes a callback function when this object is disposed. Callbacks are
invoked in the order in which they were added.
Arguments:
|
code » | |||
![]()
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: void
Nothing.
|
code » | |||
![]()
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() { 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'); }; |
code » | |||
Use
#isDisposed instead.
No description.
Returns: boolean
Whether the object has been disposed of.
|
code » | |||
No description.
Returns: boolean
Whether the object has been disposed of.
|
code » | |||
![]()
Associates a disposable object with this object so that they will be disposed
together.
Arguments:
|
code » |
![]()
No description.
|
Code » |
The AutoComplete instance this inputhandler is associated with.
|
Code » | |
Event handler to help us find an input element that already has the focus.
|
Code » | |
![]()
The element that is currently active.
|
Code » | |
![]()
The id of the currently active timeout, so it can be cleared if required.
|
Code » | |
![]()
No description.
|
Code » | |
![]()
The separator we use to reconstruct the string
|
Code » | |
Event handler used by the input handler to manage events.
|
Code » | |
![]()
Should the occurrence of a literal indicate a token boundary?
|
Code » | |
The keyhandler used for listening on most key events. This takes care of
abstracting away some of the browser differences.
|
Code » | |
![]()
The last key down key code.
|
Code » | |
![]()
The previous value of the active element.
|
Code » | |
![]()
Characters that are used to delimit literal text. Separarator characters
found within literal text are not processed as separators
|
Code » | |
![]()
Whether this input accepts multiple values
|
Code » | |
![]()
Whether to prevent the default behavior (moving focus to another element)
when tab is pressed. This occurs by default only for multi-value mode.
|
Code » | |
![]()
Flag used to indicate that the user just selected a row and we should
therefore ignore the change of the input value.
|
Code » | |
![]()
Regular expression to test whether a separator exists
|
Code » | |
![]()
If we're in 'multi' mode, does typing a separator force the current term to
autocomplete?
For example, if 'tomato' is a suggested completion and the user has typed
'to,', do we autocomplete to turn that into 'tomato,'?
|
Code » | |
![]()
If we're in 'multi' mode, does typing a separator force the updating of
suggestions?
For example, if somebody finishes typing "obama, hillary,", should the last
comma trigger updating suggestions in a guaranteed manner? Especially useful
when the suggestions depend on complete keywords. Note that "obama, hill"
(a leading sub-string of "obama, hillary" will lead to different and possibly
irrelevant suggestions.
|
Code » | |
![]()
Characters that can be used to split multiple entries in an input string
|
Code » | |
A timer object used to monitor for changes when an element is active.
TODO(user): Consider tuning the throttle time, so that it takes into
account the length of the token. When the token is short it is likely to
match lots of rows, therefore we want to check less frequently. Even
something as simple as <3-chars = 150ms, then 100ms otherwise.
|
Code » | |
![]()
Regular expression used from trimming tokens or null for no trimming.
|
Code » | |
![]()
Flag indicating whether the result list should be updated continuously
during typing or only after a short pause.
|
Code » | |
![]()
Whether to flip the orientation of up & down for hiliting next
and previous autocomplete entries.
|
Code » | |
![]()
Flag used to indicate that the IME key has been seen and we need to wait for
the up event.
|
Code » | |
![]()
Should auto-completed tokens be wrapped in whitespace? Used in selectRow.
|
Code » |
![]()
No description.
|
Code » |