FileDocCategorySizeDatePackage
InputModeFactory.javaAPI DocphoneME MR2 API (J2ME)2840Wed May 02 18:00:20 BST 2007com.sun.midp.chameleon.input

InputModeFactory

public class InputModeFactory extends Object

Fields Summary
public static final int
KEYBOARD_INPUT_MODE
public static final int
NUMERIC_INPUT_MODE
public static final int
ALPHANUMERIC_INPUT_MODE
public static final int
PREDICTIVE_TEXT_INPUT_MODE
public static final int
SYMBOL_INPUT_MODE
public static final int
NATIVE_INPUT_MODE_START
protected static int[]
inputModeIds
Constructors Summary
Methods Summary
public static InputModecreateInputMode(int id)


         
        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;
        }
    
public static InputMode[]createInputModes()

        final int nModes = inputModeIds.length;
        InputMode[] ims = new InputMode[nModes];
        for (int i=0; i<nModes; i++) {
                ims[i] = createInputMode(inputModeIds[i]);
        }
        return ims;
     
public static native int[]getInputModeIds()