if(id < NATIVE_INPUT_MODE_START) {
InputMode im;
switch(id) {
case KEYBOARD_INPUT_MODE: im = new KeyboardInputMode(); break;
case NUMERIC_INPUT_MODE: im = new NumericInputMode(); break;
case ALPHANUMERIC_INPUT_MODE: im = new AlphaNumericInputMode(); break;
case PREDICTIVE_TEXT_INPUT_MODE: im = new PredictiveTextInputMode(); break;
case SYMBOL_INPUT_MODE: im = new SymbolInputMode(); break;
default: throw new IllegalArgumentException("bad java input mode id: "+id);
}
return im;
} else {
NativeInputMode nim = new NativeInputMode();
if (0 != nim.initialize(id)) {
throw new IllegalArgumentException("bad native input mode id: "+id);
}
return nim;
}