| java.lang.Object com.sun.midp.chameleon.input.BasicInputMode
All known Subclasses: com.sun.midp.chameleon.input.NumericInputMode, com.sun.midp.chameleon.input.AlphaNumericInputMode,
BasicInputMode | abstract class BasicInputMode implements InputMode,Runnable(Code) | | An InputMode instance which processes the numeric 0-9 keys
as their literal numeric values.
|
Method Summary | |
public void | beginInput(InputModeMediator mediator, String inputSubset, int constraints) This method will be called before any input keys are passed
to this InputMode to allow the InputMode to perform any needed
initialization. | protected boolean | commitPendingChar() This method is used to immediately commit the pending
character because a new character is now pending. | protected void | completeInputMode(boolean commit) | public void | endInput() Mark the end of this InputMode's processing. | abstract protected char[] | getCharOptions(int lastKey) Gets the possible matches for the key code
Parameters: lastKey - the key code returns the set of options. | abstract public String | getCommandName() | public Displayable | getDisplayable() By default the regular input method has no specific displayable
representation so it returns null. | abstract public boolean[][] | getIsConstraintsMap() Returns the map specifying this input mode is proper one for the
particular pair of input subset and constraint. | protected char[][] | getMapByLine(String line) Converts the string to key map. | public String[] | getMatchList() | abstract public String | getName() Returns the display name which will represent this InputMode to
the user, such as in a selection list or the softbutton bar. | protected int | getNextChar() | public String | getNextMatch() Return the next possible match for the key input processed thus
far by this InputMode. | public char | getPendingChar() return the pending char
used to bypass the asynchronous commit mechanism
e.g. | public int | getPendingCharInternal() | public boolean | hasDisplayable() Returns true if input mode is using its own displayable, false ifinput
mode does not require the speial displayable for its representation. | public boolean | hasMoreMatches() True, if after processing a key, there is more than one possible
match to the input. | protected void | nextCapsMode() | public int | processKey(int keyCode, boolean longPress) Process the given key code as input. | public void | run() Implementation of a timer routine which will attempt to commit
a pending character after a certain timeout (depending on the
state of the commitChar boolean). | protected void | setInputSubset(String inputSubset) | abstract protected boolean | setKeyMap(int constraints, boolean longPress) Set the corresponding key map.
Parameters: constraints - text input constraints. | abstract public boolean | supportsConstraints(int constraints) This method is called to determine if this InputMode supports
the given text input constraints. | protected void | validateState(boolean activeOperation) This method will validate the state of this InputMode. |
KEY_COMMIT_TIMEOUT | final protected static int KEY_COMMIT_TIMEOUT(Code) | | A timeout, in ms, after which a pending key will be committed
to the text component. By default this is set to 250ms.
|
clickCount | protected int clickCount(Code) | | The number of times the user pressed the last key code. This value
acts as an index into the array of possible characters of any one
key. For example, a lastKey == to Canvas.KEY_NUM2 and a clickCount
of 3 would yield a 'c'.
|
commitChar | protected boolean commitChar(Code) | | A boolean flag used by the timer in this input mode to
determine if a character should be committed to the text
component or not
|
constraints | protected int constraints(Code) | | Text input constraints for this input mode. The semantics of the
constraints value are defined in the TextField API.
|
hasMoreMatches | protected boolean hasMoreMatches(Code) | | Flag indicating if more matches exist
|
keyMap | static char[][] keyMap(Code) | | the possible key maps for this input mode
|
lastKey | protected int lastKey(Code) | | A holder for the keyCode which was last processed
|
modifiers | protected int modifiers(Code) | | Text input modifiers for this input mode. The semantics of the
modifiers value are defined in the TextField API.
|
pendingChar | protected int pendingChar(Code) | | The single, pending character based on the key presses thus far
|
sessionIsLive | protected boolean sessionIsLive(Code) | | A boolean flag used by the timer in this input mode to
know when to completely shut down the timer thread. That is,
when the input session is no longer active, the timer thread
in this input mode will quit entirely, freeing up system
resources.
|
beginInput | public void beginInput(InputModeMediator mediator, String inputSubset, int constraints)(Code) | | This method will be called before any input keys are passed
to this InputMode to allow the InputMode to perform any needed
initialization. A reference to the InputModeMediator which is
currently managing the relationship between this InputMode and
the input session is passed in. This reference can be used
by this InputMode to commit text input as well as end the input
session with this InputMode. The reference is only valid until
this InputMode's endInput() method is called.
Parameters: constraints - text input constraints. The semantics of the constraints value are defined in the TextField API. Parameters: mediator - the InputModeMediator which is negotiating therelationship between this InputMode and the input session Parameters: inputSubset - current input subset |
commitPendingChar | protected boolean commitPendingChar()(Code) | | This method is used to immediately commit the pending
character because a new character is now pending.
true if char has been committed otherwise false |
completeInputMode | protected void completeInputMode(boolean commit)(Code) | | This method is used to immediately commit the given
string and then call the TextInputMediator's inputModeCompleted()
method
Parameters: commit - true if the char is accepted, false if the char is rejected |
endInput | public void endInput()(Code) | | Mark the end of this InputMode's processing. The only possible call
to this InputMode after a call to endInput() is a call to beginInput()
to begin a new input session.
|
getCharOptions | abstract protected char[] getCharOptions(int lastKey)(Code) | | Gets the possible matches for the key code
Parameters: lastKey - the key code returns the set of options. Return null if matches are not found. |
getCommandName | abstract public String getCommandName()(Code) | | Returns the command name which will represent this InputMode in
the input menu
the locale-appropriate name to represent this InputModeto the user |
getDisplayable | public Displayable getDisplayable()(Code) | | By default the regular input method has no specific displayable
representation so it returns null.
null by default |
getIsConstraintsMap | abstract public boolean[][] getIsConstraintsMap()(Code) | | Returns the map specifying this input mode is proper one for the
particular pair of input subset and constraint. The form of the map is
|ANY|EMAILADDR|NUMERIC|PHONENUMBER|URL|DECIMAL|
---------------------------------------------------------------------
IS_FULLWIDTH_DIGITS |t|f| t|f | t|f | t|f |t|f| t|f |
IS_FULLWIDTH_LATIN |t|f| t|f | t|f | t|f |t|f| t|f |
IS_HALFWIDTH_KATAKANA |t|f| t|f | t|f | t|f |t|f| t|f |
IS_HANJA |t|f| t|f | t|f | t|f |t|f| t|f |
IS_KANJI |t|f| t|f | t|f | t|f |t|f| t|f |
IS_LATIN |t|f| t|f | t|f | t|f |t|f| t|f |
IS_LATIN_DIGITS |t|f| t|f | t|f | t|f |t|f| t|f |
IS_SIMPLIFIED_HANZI |t|f| t|f | t|f | t|f |t|f| t|f |
IS_TRADITIONAL_HANZI |t|f| t|f | t|f | t|f |t|f| t|f |
MIDP_UPPERCASE_LATIN |t|f| t|f | t|f | t|f |t|f| t|f |
MIDP_LOWERCASE_LATIN |t|f| t|f | t|f | t|f |t|f| t|f |
NULL |t|f| t|f | t|f | t|f |t|f| t|f |
input subset x constraint map |
getMapByLine | protected char[][] getMapByLine(String line)(Code) | | Converts the string to key map. The rows are separated each from other
by '$'. The characters inside of one row follow each to other without
any separator.
Parameters: line - string combines all keys map of the keys in char[][] format |
getMatchList | public String[] getMatchList()(Code) | | Gets the possible string matches
returns the set of options. |
getName | abstract public String getName()(Code) | | Returns the display name which will represent this InputMode to
the user, such as in a selection list or the softbutton bar.
the locale-appropriate name to represent this InputModeto the user |
getNextChar | protected int getNextChar()(Code) | | Get next possble char
next key code |
getNextMatch | public String getNextMatch()(Code) | | Return the next possible match for the key input processed thus
far by this InputMode. A call to this method should be preceeded
by a check of hasMoreMatches(). If the InputMode has more available
matches for the given input, this method will return them one by one.
a String representing the next available match to the key input thus far, or 'null' if no pending input is available |
getPendingChar | public char getPendingChar()(Code) | | return the pending char
used to bypass the asynchronous commit mechanism
e.g. to immediately commit a char before moving the cursor
return the pending char |
getPendingCharInternal | public int getPendingCharInternal()(Code) | | return the pending char for internal use
return the pending char |
hasDisplayable | public boolean hasDisplayable()(Code) | | Returns true if input mode is using its own displayable, false ifinput
mode does not require the speial displayable for its representation.
By default - false
true if input mode is using its own displayable, otherwise false |
hasMoreMatches | public boolean hasMoreMatches()(Code) | | True, if after processing a key, there is more than one possible
match to the input. If this method returns true, the getNextMatch()
method can be called to return the value.
true if after processing a key, there is more than the onepossible match to the given input |
nextCapsMode | protected void nextCapsMode()(Code) | | Set the next capital mode for this input method
|
processKey | public int processKey(int keyCode, boolean longPress)(Code) | | Process the given key code as input.
This method will return true if the key was processed successfully,
false otherwise.
Parameters: keyCode - the keycode of the key which was input Parameters: longPress - return true if it's long key press otherwise false the key code if the key has been committed for the input, orKEYCODE_NONE if the key has not been habdled by the input mode, orKEYCODE_INVISIBLE if the key has been handled by the input mode butthis key has not been displayed |
run | public void run()(Code) | | Implementation of a timer routine which will attempt to commit
a pending character after a certain timeout (depending on the
state of the commitChar boolean).
|
setInputSubset | protected void setInputSubset(String inputSubset)(Code) | | Notify about current input subset
Parameters: inputSubset - current input subset |
setKeyMap | abstract protected boolean setKeyMap(int constraints, boolean longPress)(Code) | | Set the corresponding key map.
Parameters: constraints - text input constraints. The semantics of the constraints value are defined in the TextField API. Parameters: longPress - return true if it's long key press otherwise false true if the key map has been changed otherwise false |
supportsConstraints | abstract public boolean supportsConstraints(int constraints)(Code) | | This method is called to determine if this InputMode supports
the given text input constraints. The semantics of the constraints
value are defined in the javax.microedition.lcdui.TextField API.
If this InputMode returns false, this InputMode must not be used
to process key input for the selected text component.
Parameters: constraints - text input constraints. The semantics of the constraints value are defined in the TextField API. true if this InputMode supports the given text componentconstraints, as defined in the MIDP TextField API |
validateState | protected void validateState(boolean activeOperation)(Code) | | This method will validate the state of this InputMode. If this
is a check for an "active" operation, the TextInputMediator must
be non-null or else this method will throw an IllegalStateException.
If this is a check for an "inactive" operation, then the
TextInputMediator should be null.
Parameters: activeOperation - true if any operation is active otherwise false. |
|
|