Fields Summary |
---|
private static char[] | upperKeyMapset of chars for alpha upper-case input |
private static char[] | lowerKeyMapset of chars for alpha low-case input |
private static char[] | longPressKeyMapset of chars for long key press |
protected static final int[] | CAPS_MODESarray of sub-inputModes supported by this inputMode |
private static final String[] | CAPS_MODES_LABELSarray of sub-inputModes labels, corresponding to CAPS_MODES array |
private static char[] | keyMapsthe possible key maps for this input mode |
protected int | capsModePointerpoints to an element of CAPS_MODES which is the current sub-inputMode |
private static final boolean[] | isMapinput subset x constraint map |
Methods Summary |
---|
protected boolean | commitPendingChar()This method is used to immediately commit the pending
character because a new character is now pending.
boolean committed = super.commitPendingChar();
if (committed) {
if (CAPS_MODES[capsModePointer] == CAPS_SENTENCE) {
nextCapsMode();
}
}
return committed;
|
protected char[] | getCharOptions(int lastKey)Gets the possible matches for the key code
char[] chars = null;
switch (lastKey) {
case Canvas.KEY_NUM0:
chars = keyMap[0];
break;
case Canvas.KEY_NUM1:
chars = keyMap[1];
break;
case Canvas.KEY_NUM2:
chars = keyMap[2];
break;
case Canvas.KEY_NUM3:
chars = keyMap[3];
break;
case Canvas.KEY_NUM4:
chars = keyMap[4];
break;
case Canvas.KEY_NUM5:
chars = keyMap[5];
break;
case Canvas.KEY_NUM6:
chars = keyMap[6];
break;
case Canvas.KEY_NUM7:
chars = keyMap[7];
break;
case Canvas.KEY_NUM8:
chars = keyMap[8];
break;
case Canvas.KEY_NUM9:
chars = keyMap[9];
break;
case Canvas.KEY_POUND:
chars = keyMap[10];
break;
case Canvas.KEY_STAR:
nextCapsMode();
break;
default:
// This can actually happen if the Timer went off without
// a pending key, which can sometimes happen.
break;
}
return chars;
|
public java.lang.String | getCommandName()Returns the command name which will represent this InputMode in
the input menu
return getName();
|
public boolean[][] | getIsConstraintsMap()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 |
return isMap;
|
public java.lang.String | getName()Returns the display name which will represent this InputMode to
the user, such as in a selection list or the softbutton bar.
return CAPS_MODES_LABELS[capsModePointer];
|
protected void | nextCapsMode()Set the next capital mode for this input method
if (Logging.REPORT_LEVEL <= Logging.INFORMATION) {
Logging.report(Logging.INFORMATION, LogChannels.LC_HIGHUI,
"[A.nextCapsMode]");
}
capsModePointer++;
if (capsModePointer == CAPS_MODES.length) {
capsModePointer = 0;
}
if (CAPS_MODES[capsModePointer] == CAPS_OFF) {
keyMap = lowerKeyMap;
} else {
keyMap = upperKeyMap;
}
mediator.subInputModeChanged();
|
protected void | setInputSubset(java.lang.String inputSubset)Notify about current input subset
int mode = -1;
if ("MIDP_UPPERCASE_LATIN".equals(inputSubset)) {
mode = CAPS_ON;
} else if ("MIDP_LOWERCASE_LATIN".equals(inputSubset)) {
mode = CAPS_OFF;
}
for (int i = CAPS_MODES.length - 1; i >= 0; i--) {
if (CAPS_MODES[i] == mode) {
capsModePointer = i;
break;
}
}
|
protected boolean | setKeyMap(int constraints, boolean longPress)Set the corresponding key map.
char[][] oldKeyMap = keyMap;
keyMap = longPress ?
longPressKeyMap:
keyMaps[capsModePointer];
return oldKeyMap != keyMap;
|
public boolean | supportsConstraints(int constraints)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.
switch (constraints & TextField.CONSTRAINT_MASK) {
case TextField.NUMERIC:
case TextField.DECIMAL:
case TextField.PHONENUMBER:
return false;
default:
return true;
}
|