Methods Summary |
---|
public abstract boolean | clearInputMethodClient(InputMethodClient imc)Clears the current input handler if it matches the specified one.
Any pending keys are first sent to the client.
|
public abstract void | endComposition(boolean discard)End the on-going composition. Any keys that are pending are
conditionally sent to the client.
|
public abstract void | flush()Removes any pending key presses
|
public static com.sun.midp.lcdui.InputMethodHandler | getInputMethodHandler()get the input method handler.
if (thisIM != null) {
return thisIM;
}
thisIM = getInputMethodHandlerImpl();
return thisIM;
|
private static com.sun.midp.lcdui.InputMethodHandler | getInputMethodHandlerImpl()get the input handler class.
try {
String n =
Configuration.getProperty(
"com.sun.midp.lcdui.inputMethodHandler");
if (n != null) {
Class c = Class.forName(n);
return (InputMethodHandler) c.newInstance();
}
String loc = Configuration.getProperty("microedition.locale");
if (loc != null) {
/*
* This only check for the first '-' in the locale, and
* convert to '_' for Class.forName() to work.
*/
int hyphen;
if ((hyphen = loc.indexOf('-")) != -1) {
StringBuffer tmploc = new StringBuffer(loc);
tmploc.setCharAt(hyphen, '_");
loc = tmploc.toString();
}
String cls
= "com.sun.midp.lcdui.i18n.DefaultInputMethodHandler_";
while (true) {
try {
Class c = Class.forName(cls + loc);
return (InputMethodHandler) c.newInstance();
} catch (Throwable t) {}
int pos = loc.lastIndexOf('_");
if (pos == -1) {
break;
} else {
loc = loc.substring(0, pos);
}
}
}
Class c =
Class.forName("com.sun.midp.lcdui.DefaultInputMethodHandler");
return (InputMethodHandler) c.newInstance();
} catch (Throwable t) {
System.out.println(t);
throw new Error("Textbox input method was not initialized.");
}
|
public boolean | isSymbol(char c)Determine whether the character is considered a symbol
return false;
|
public abstract int | keyPressed(int keyCode)Called when a key is pressed.
|
public abstract int | keyReleased(int keyCode)Called when a key is released.
|
public abstract int | keyRepeated(int keyCode)Called when a key is repeated.
|
public abstract int | keyTyped(char c)Called when a key is repeated.
|
public abstract boolean | setConstraints(int constraints)set the constraints, modifiers, and other data structures that
depend on them.
|
public abstract void | setInputMethodClient(InputMethodClient imc)Set the InputMethodClient object to the InputMethod.
|
public abstract java.lang.String[] | supportedInputModes()Return the supported input modes.
|