DCT Lightfoot v3 API specification

javax.microedition.lcdui
Class TextField

java.lang.Object
  |
  +--javax.microedition.lcdui.Item
        |
        +--javax.microedition.lcdui.TextField

public class TextField
extends Item

The text field implementation that allows text to be editied in a form


Nested Class Summary
protected  class TextField.Peer
          Peer class that does the drawing
 
Nested classes inherited from class javax.microedition.lcdui.Item
 
Field Summary
static int ANY
          any constraint
static int CONSTRAINT_MASK
          Constraint mask
static int EMAILADDR
          email address constraint
static int NUMERIC
          Numeric constraint
static int PASSWORD
          Password constraint
static int PHONENUMBER
          A phone number constraint
static int URL
          A URL constraint
 
Fields inherited from class javax.microedition.lcdui.Item
form, highlighted, label, peer
 
Constructor Summary
TextField(java.lang.String label, java.lang.String text, int maxSize, int constraints)
          Create a new text field given a label, initial text, max size and constraints
 
Method Summary
 void delete(int offset, int length)
          Delete characters from the field
 int getCaretPosition()
          Get the caret position
 int getChars(char[] data)
          Copy the contents into a character array
 int getConstraints()
          Get the constraints
 int getMaxSize()
          Get the maximum size
 java.lang.String getString()
          Get the string
 void insert(char[] data, int offset, int length, int position)
          Insert characters at a position
 void insert(java.lang.String str, int position)
          Insert a string at a position
 void setChars(char[] data, int offset, int length)
          Set the chars in the text field
 void setConstraints(int constraints)
          Set the constraints
 int setMaxSize(int maxSize)
          Set the maximum size
 void setString(java.lang.String str)
          Set the string
 int size()
          Get the number of characters currently there
 
Methods inherited from class javax.microedition.lcdui.Item
getLabel, setLabel
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ANY

public static final int ANY
any constraint

See Also:
Constant Field Values

CONSTRAINT_MASK

public static final int CONSTRAINT_MASK
Constraint mask

See Also:
Constant Field Values

EMAILADDR

public static final int EMAILADDR
email address constraint

See Also:
Constant Field Values

NUMERIC

public static final int NUMERIC
Numeric constraint

See Also:
Constant Field Values

PASSWORD

public static final int PASSWORD
Password constraint

See Also:
Constant Field Values

PHONENUMBER

public static final int PHONENUMBER
A phone number constraint

See Also:
Constant Field Values

URL

public static final int URL
A URL constraint

See Also:
Constant Field Values
Constructor Detail

TextField

public TextField(java.lang.String label,
                 java.lang.String text,
                 int maxSize,
                 int constraints)
Create a new text field given a label, initial text, max size and constraints

Parameters:
label - The label to use
text - The text to use
maxSize - The maximum size
constraints - The constraints to use
Method Detail

delete

public void delete(int offset,
                   int length)
Delete characters from the field

Parameters:
offset - The offset to delete from
length - The number of characters to delete

getCaretPosition

public int getCaretPosition()
Get the caret position

Returns:
the current caret position

getChars

public int getChars(char[] data)
Copy the contents into a character array

Parameters:
data - Where to copy to
Returns:
the number of characters copied

getConstraints

public int getConstraints()
Get the constraints

Returns:
the constraints

getMaxSize

public int getMaxSize()
Get the maximum size

Returns:
the maximum size

getString

public java.lang.String getString()
Get the string

Returns:
the string

insert

public void insert(char[] data,
                   int offset,
                   int length,
                   int position)
Insert characters at a position

Parameters:
data - The characters to insert
offset - The offset to insert from
length - The length to insert for
position - The position to insert at

insert

public void insert(java.lang.String str,
                   int position)
Insert a string at a position

Parameters:
str - The string to insert
position - The position to insert at

setChars

public void setChars(char[] data,
                     int offset,
                     int length)
Set the chars in the text field

Parameters:
data - The characters
offset - The offset into the array
length - The length of the array

setConstraints

public void setConstraints(int constraints)
Set the constraints

Parameters:
constraints - The constraints to use

setMaxSize

public int setMaxSize(int maxSize)
Set the maximum size

Parameters:
maxSize - The maximum size

setString

public void setString(java.lang.String str)
Set the string

Parameters:
str - The string to set

size

public int size()
Get the number of characters currently there

Returns:
the number of characters

DCT Lightfoot v3 API specification

DCT Lightfoot v3 API specification