apwidgets
Class PEditText

java.lang.Object
  extended by apwidgets.PWidget
      extended by apwidgets.PTextView
          extended by apwidgets.PEditText
All Implemented Interfaces:
android.text.NoCopySpan, android.text.TextWatcher, android.view.View.OnClickListener, android.widget.TextView.OnEditorActionListener

public class PEditText
extends PTextView
implements android.widget.TextView.OnEditorActionListener

An editable text field. Add instances to PWidgetContainer.

Author:
Rikard Lundstedt

Nested Class Summary
 
Nested classes/interfaces inherited from interface android.text.NoCopySpan
android.text.NoCopySpan.Concrete
 
Constructor Summary
PEditText(int x, int y, int width, int height)
          Creates a new editable text field.
 
Method Summary
 boolean getHorizontallyScrolling()
           
 void init(processing.core.PApplet pApplet)
          Initializes the text field.
 boolean onEditorAction(android.widget.TextView textView, int actionId, android.view.KeyEvent keyEvent)
           
 void setCloseImeOnDone(boolean closeImeOnDone)
          If you have called setImeOptions(EditorInfo.IME_ACTION_DONE), and you have set closeImeOnDone to true, the IME will close when you press done.
 void setHorizontallyScrolling(boolean horizontallyScrolling)
           
 void setImeOptions(int editorInfo)
          You can set IMEOptions for this EditText using this method.
 void setInputType(int inputType)
          You can set InputType here.
 void setNextEditText(PEditText nextEditText)
          If you have called setImeOptions(EditorInfo.IME_ACTION_NEXT), you can use this method to specify which EditText will be focused when you press next.
 
Methods inherited from class apwidgets.PTextView
afterTextChanged, beforeTextChanged, getText, getTextColor, getTextSize, onTextChanged, setText, setTextColor, setTextSize
 
Methods inherited from class apwidgets.PWidget
addOnClickWidgetListener, getHeight, getPApplet, getWidth, getView, getX, getY, onClick, setPosition, setSize
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PEditText

public PEditText(int x,
                 int y,
                 int width,
                 int height)
Creates a new editable text field.

Parameters:
x - The text field's x position.
y - The text field's y position.
width - The text field's width.
height - The text field's height.
Method Detail

getHorizontallyScrolling

public boolean getHorizontallyScrolling()

setCloseImeOnDone

public void setCloseImeOnDone(boolean closeImeOnDone)
If you have called setImeOptions(EditorInfo.IME_ACTION_DONE), and you have set closeImeOnDone to true, the IME will close when you press done.

Parameters:
closeImeOnDone -

setNextEditText

public void setNextEditText(PEditText nextEditText)
If you have called setImeOptions(EditorInfo.IME_ACTION_NEXT), you can use this method to specify which EditText will be focused when you press next.

Parameters:
nextEditText -

init

public void init(processing.core.PApplet pApplet)
Initializes the text field. Is called by PWidgetContainer as it is added to it.

Overrides:
init in class PTextView

onEditorAction

public boolean onEditorAction(android.widget.TextView textView,
                              int actionId,
                              android.view.KeyEvent keyEvent)
Specified by:
onEditorAction in interface android.widget.TextView.OnEditorActionListener

setImeOptions

public void setImeOptions(int editorInfo)
You can set IMEOptions for this EditText using this method. See list of IMEOptions here: http://developer.android.com/reference/android/view/inputmethod/EditorInfo.html

Parameters:
editorInfo -

setInputType

public void setInputType(int inputType)
You can set InputType here. See list of different InputTypes here: http://developer.android.com/reference/android/text/InputType.html

Parameters:
inputType -

setHorizontallyScrolling

public void setHorizontallyScrolling(boolean horizontallyScrolling)