| java.lang.Object com.sun.midp.chameleon.input.NativeInputMode
Method Summary | |
public void | beginInput(InputModeMediator theMediator, 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. | native public void | beginInput0(InputModeMediator theMediator, String inputSubset, int constraints) | public void | endInput() Mark the end of this InputMode's processing. | native public void | endInput0() | protected void | executeMediatorCommand(int[] stateArgs, String stringArg) Execute a mediator command whose id and integer arguments are stored
in the stateArgs array, and the string argument, if required, is
passed as stringArg; the returned value, if any, is stored
as stateArgs[STATE_CALLBACK_RES].
This function implements the functionality of processKey, but
when it needs to call some mediator function, it stores the current
state into stateArgs and returns; processKey calls the necessary
interface function and calls processKey0 again.
stateArgs[STATE_CALLBACK_RES] -- mediator function result. | native public String | getCommandName() | public Displayable | getDisplayable() Gets displayable for particular input method. | public boolean[][] | getIsConstraintsMap() Returns the map specifying this input mode is proper one for the
particular pair of input subset and constraint. | native public String[] | getMatchList() | native 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. | native public String | getNextMatch() Return the next possible match for the key input processed thus
far by this InputMode. | native public char | getPendingChar() return the pending char
used to bypass the asynchronous commit mechanism
e.g. | public boolean | hasDisplayable() | native public boolean | hasMoreMatches() True, if after processing a key, there is more than one possible
match to the input. | native public int | initialize(int theId) Initialize the instance. | public int | processKey(int keyCode, boolean longPress) Process the given key code as input. | native protected String | processKey0(int keyCode, boolean longPress, int isClearKey, int[] stateArgs) This function is repeatedly called
by procesKey(int keyCode, boolean longPress)
to process the given key code as input.
This function implements the functionality of processKey, but
when it needs to call some mediator function, it stores the current
state into stateArgs and returns; processKey calls the necessary
interface function and calls processKey0 again.
Since the function processKey is a callback invoked when a key
is pressed, it is recommended to finish key processing as soon
as possible. | native public boolean | supportsConstraints(int constraints) This method is called to determine if this InputMode supports
the given text input constraints. | public String | toString() |
id | public int id(Code) | | Input method identifier. For a given platform, this class may
support multiple input methods, and id determines which one is
supported by this particular instance.
|
instanceData | protected int instanceData(Code) | | reserved for instance data
|
NativeInputMode | public NativeInputMode()(Code) | | constructor; the real initialization is done
in the initialize(int) function
|
beginInput | public void beginInput(InputModeMediator theMediator, String inputSubset, int constraints) throws IllegalStateException(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: theMediator - the InputModeMediator which is negotiating therelationship between this InputMode and the input session Parameters: inputSubset - current input subset |
endInput | public void endInput() throws IllegalStateException(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.
|
executeMediatorCommand | protected void executeMediatorCommand(int[] stateArgs, String stringArg)(Code) | | Execute a mediator command whose id and integer arguments are stored
in the stateArgs array, and the string argument, if required, is
passed as stringArg; the returned value, if any, is stored
as stateArgs[STATE_CALLBACK_RES].
This function implements the functionality of processKey, but
when it needs to call some mediator function, it stores the current
state into stateArgs and returns; processKey calls the necessary
interface function and calls processKey0 again.
stateArgs[STATE_CALLBACK_RES] -- mediator function result.
stateArgs[STATE_FUNC_TOKEN] -- the mediator function id.
stateArgs[STATE_NEXT_STATE] -- not used by executeMediatorCommand,
a native function uses this value to store the integer state id,
the Java function that calls the native function repeats calls
until this value becomes zero.
stateArgs[STATE_INT_ARG] -- int argument for the mediator function,
if required.
stateArgs[STATE_FINAL_RES] -- not used by executeMediatorCommand,
the native function store there a result to be returned
by the Java function.
stateArgs[STATE_INTERNAL] -- for use by native functions.
stateArgs[STATE_INTERNAL_EXT] -- for use by native functions.
Parameters: stateArgs - the function state data array Parameters: stringArg - the string argument, this value is used only if thefunction specified as stateArgs[STATE_FUNC_TOKEN] requiresa string argument. |
getCommandName | native 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) | | Gets displayable for particular input method. If the input method has no
specific displayable representation returns null.
displayable |
getIsConstraintsMap | 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 |
getMatchList | native public String[] getMatchList()(Code) | | Gets the possible string matches
returns the set of options. |
getName | native 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 |
getNextMatch | native 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 | native 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 |
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
true if input mode is using its own displayable, otherwise false |
hasMoreMatches | native 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 |
initialize | native public int initialize(int theId)(Code) | | Initialize the instance.
Parameters: theId - the value to be stored as id error code, 0 if ok |
processKey | public int processKey(int keyCode, boolean longPress) throws IllegalStateException(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 true if the key was processed by this InputMode, falseotherwise. |
processKey0 | native protected String processKey0(int keyCode, boolean longPress, int isClearKey, int[] stateArgs) throws IllegalStateException(Code) | | This function is repeatedly called
by procesKey(int keyCode, boolean longPress)
to process the given key code as input.
This function implements the functionality of processKey, but
when it needs to call some mediator function, it stores the current
state into stateArgs and returns; processKey calls the necessary
interface function and calls processKey0 again.
Since the function processKey is a callback invoked when a key
is pressed, it is recommended to finish key processing as soon
as possible. The number of times the function processKey0() may
be called before the function processKey() returns is limited
by the constant MAX_STATE_MACHINE_ITERATIONS, but it does not
mean that it is ok to use so many iterations.
stateArgs[STATE_CALLBACK_RES] -- mediator function result.
stateArgs[STATE_FUNC_TOKEN] -- the mediator function id.
stateArgs[STATE_NEXT_STATE] -- the integer id of the next state,
the processKey repeats calling processKey0
until this value becomes zero.
stateArgs[STATE_INT_ARG] -- int argument for the mediator function,
if required.
stateArgs[STATE_FINAL_RES] -- the result to be returned
by processKey.
stateArgs[STATE_INTERNAL] -- may be used by native code implementing
processKey0.
stateArgs[STATE_INTERNAL_EXT] -- may be used by native code
implementing processKey0.
Parameters: keyCode - the keycode of the key which was input Parameters: longPress - return true if it's long key press otherwise false Parameters: isClearKey - 1 if it's a claer key, 0 if it's not, and -1 ifit cannot be determined because the mediator is null Parameters: stateArgs - contains state information that survives acrossrepeated reinvocations of this function, and datato be passed to/from the mediator functions. the string argument to be passed to the mediator function,or null. |
supportsConstraints | native 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 |
|
|