DCT Lightfoot v3 API specification

javax.microedition.lcdui
Class TextBox

java.lang.Object
  |
  +--javax.microedition.lcdui.Displayable
        |
        +--javax.microedition.lcdui.Screen
              |
              +--javax.microedition.lcdui.TextBox

public class TextBox
extends Screen

This provides the implementation for text fields and text boxes


Nested Class Summary
protected  class TextBox.Peer
          Peer class that does the drawing
 
Field Summary
 
Fields inherited from class javax.microedition.lcdui.Screen
height, offset
 
Fields inherited from class javax.microedition.lcdui.Displayable
display
 
Constructor Summary
TextBox(java.lang.String title, java.lang.String text, int maxSize, int constraints)
          Create a new text box given initial sizes, text and contraints
 
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.Screen
getTicker, getTitle, scrollDown, scrollUp, setTicker, setTitle
 
Methods inherited from class javax.microedition.lcdui.Displayable
addCommand, isShown, removeCommand, setCommandListener
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TextBox

public TextBox(java.lang.String title,
               java.lang.String text,
               int maxSize,
               int constraints)
Create a new text box given initial sizes, text and contraints

Parameters:
title - The title 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