Methods Summary |
---|
public void | beginSession(TextInputComponent component)Start a text input session for the given TextInputComponent.
The TextInputComponent can be used to determine the initial
input mode, constraints, etc.
|
public void | endSession()End the current text input session and do not commit any pending
input to the buffer.
|
public InputMode[] | getAvailableModes()List the appropriate InputModes available for the current input
session. This method may be used by UI components in order to make
certain input mode choices available to the user for selection.
If this handler is not currently in an active text input session,
this method returns null.
|
public InputMode | getCurrentInputMode()Retrieve the InputMode which is the current "active" mode
for this TextInputSession. This does not necessarily mean there is
any pending input with the InputMode itself, it means that if this
TextInputSession receives key input, the returned InputMode will be
the mode which processes that input.
|
public java.lang.String[] | getMatchList()Gets the possible string matches
|
public java.lang.String | getNextMatch()An iterative method to return the next available match given
the key processing thus far. If the return value of hasMoreMatches()
is true, this method will return a non-null String and will iterate
through the entire set of available matches until the set is exhausted.
Each subsequent call to processKey() will reset the iterator over
the set of available matches regardless if the key resulted in a change
to the set.
The two methods, hasMoreMatches() and getNextMatch(), can be used by
the User Interface system to retrieve the current set of pending inputs
and possibly present a chooser option to the user.
|
public char | getPendingChar()return the pending char
used to bypass the asynchronous commit mechanism
e.g. to immediately commit a char before moving the cursor
|
public boolean | hasMoreMatches()If the InputMode supports multiple matches and more matches are
available this method will return true, false otherwise.
|
public boolean | isSymbol(char c)Check if the given char is symbol
|
public int | processKey(int keyCode, boolean longPress)This method abstracts key processing to a single call (from
the assorted key press, release, repeat events). This method
should be called from the TextInputComponent to pass along
key input from the user. The TextInputComponent is responsible
for determining what key events should be processed (ie,
key events trigger processing on press or on release).
|
public void | setCurrentInputMode(InputMode mode)Set this TextInputSession's current "active" InputMode to the
given mode. The given mode must be one of the InputModes listed
in the array of InputModes returned from the getAvailableModes()
method of this TextInputSession. Calling this method will terminate
any existing input session with the current InputMode and will
result in any subsequent key input being processed by the given
InputMode. If the given mode is already the current "active"
InputMode, this method has no effect. If this TextInputSession
is not currently in an input session (ie, there is no active
TextInputComponent), this method has no effect.
|