danger.ui
Class InputMethod

java.lang.Object
  extended by danger.ui.InputMethod


public class InputMethod
extends Object

Provides a way of inputting text into a text edit field (Editor). This base class implementation simply passes characters directly into the edit field as input. Subclasses may want to chord input, instead. For example, HexInputMethod chords 4-character hex input and passes the corresponding unicode character to the edit field.


Field Summary
protected  EditText mEditText
           
 
Constructor Summary
InputMethod()
           
 
Method Summary
 void cancel()
          Disconnect from editText
 InputMethod createInstance(EditText et)
          Called whenever input method mode begins to obtain a new instance.
 void done()
          Called before this instance is discarded.
 boolean eventKeyDown(char c, Event e)
          Called in place of EditText.eventKeyDown()
 boolean eventWidgetDown(int widget, Event e)
          Called in place of EditText.eventWidgetDown()
 boolean eventWidgetUp(int widget, Event e)
          Called in place of EditText.eventWidgetUp()
 void handleKey(char c, Event event)
          Pass a character in to the standard EditText key processing code
 void install()
          Set this input method as the system default one.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mEditText

protected EditText mEditText
Constructor Detail

InputMethod

public InputMethod()
Method Detail

createInstance

public InputMethod createInstance(EditText et)
Called whenever input method mode begins to obtain a new instance. The EditText parameter should be stored in mEditText in the new instance for it to work correctly.


eventKeyDown

public boolean eventKeyDown(char c,
                            Event e)
Called in place of EditText.eventKeyDown()


eventWidgetDown

public boolean eventWidgetDown(int widget,
                               Event e)
Called in place of EditText.eventWidgetDown()


eventWidgetUp

public boolean eventWidgetUp(int widget,
                             Event e)
Called in place of EditText.eventWidgetUp()


done

public void done()
Called before this instance is discarded.


cancel

public final void cancel()
Disconnect from editText


install

public final void install()
Set this input method as the system default one.


handleKey

public final void handleKey(char c,
                            Event event)
Pass a character in to the standard EditText key processing code