com.emarson.lemonade.bluelemon.midp1
Class TextField

java.lang.Object
  extended by com.emarson.lemonade.bluelemon.midp1.TextField

public class TextField
extends Object

This class delivers the functionality of the MIDP1 TextField Java class to the Bluelemon environment.


Field Summary
static Number ANY
          The user is allowed to enter any text.
static Number ANYORPASSWORD
          The result of ANY | PASSWORD
static Number CONSTRAINT_MASK
          The mask value for determining the constraint mode.
static Number EMAILADDR
          The user is allowed to enter an e-mail address.
static Number NUMERIC
          The user is allowed to enter only an integer value.
static Number NUMERICORPASSWORD
          The result of NUMERIC | PASSWORD
static Number PASSWORD
          The text entered must be masked so that the characters typed are not visible.
static Number PHONENUMBER
          The user is allowed to enter a phone number.
static Number URL
          The user is allowed to enter a URL.
 
Constructor Summary
TextField()
          Constructs a new, empty TextField object.
 
Method Summary
 void delete(Number offset, Number length)
          Deletes characters from the TextField.
 Number getCaretPosition()
          Gets the current input position.
 Number getConstraints()
          Get the current input constraints of the TextField.
 Number getMaxSize()
          Returns the maximum size (number of characters) that can be stored in this TextField.
 Number getString()
          Gets the contents of the TextField as a string value.
 void initialize(String title, String text, Number maxSize, Number constraints)
          Initializes a TextField object with the given title
 void insert(String text, Number position)
          Inserts a String into the contents of the TextField.
 void setConstraints(Number constraints)
          Sets the input constraints of the TextField.
 Number setMaxSize(Number maxSize)
          Sets the maximum size (number of characters) that can be contained in this TextField.
 void setString(String string)
          Sets the contents of the TextField as a string value, replacing the previous contents.
 Number size()
          Gets the number of characters that are currently stored in this TextField.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ANY

public static Number ANY
The user is allowed to enter any text.

See Also:
MIDP1 TextField

ANYORPASSWORD

public static Number ANYORPASSWORD
The result of ANY | PASSWORD


CONSTRAINT_MASK

public static Number CONSTRAINT_MASK
The mask value for determining the constraint mode.

See Also:
MIDP1 TextField

EMAILADDR

public static Number EMAILADDR
The user is allowed to enter an e-mail address.

See Also:
MIDP1 TextField

NUMERIC

public static Number NUMERIC
The user is allowed to enter only an integer value.

See Also:
MIDP1 TextField

NUMERICORPASSWORD

public static Number NUMERICORPASSWORD
The result of NUMERIC | PASSWORD


PASSWORD

public static Number PASSWORD
The text entered must be masked so that the characters typed are not visible.

See Also:
MIDP1 TextField

PHONENUMBER

public static Number PHONENUMBER
The user is allowed to enter a phone number.

See Also:
MIDP1 TextField

URL

public static Number URL
The user is allowed to enter a URL.

See Also:
MIDP1 TextField
Constructor Detail

TextField

public TextField()
Constructs a new, empty TextField object.

Usage examples:
   <blue:newInstance class="com/emarson/lemonade/bluelemon/midp1/TextField"
                     toVariable="textField"/>
 
Method Detail

delete

public void delete(Number offset,
                   Number length)
Deletes characters from the TextField.

Parameters:
offset - the beginning of the region to be deleted
length - the number of characters to be deleted
Usage examples:
   <blue:call object="textField" method="delete">
     <blue:argument type="byte" value="0"/>
     <blue:argument type="variable" name="length"/>
   </blue:call>
 

getCaretPosition

public Number getCaretPosition()
Gets the current input position.

Returns:
Usage examples:
   <blue:call object="textField" method="getCaretPosition"
                     toVariable="caretPosition"/>
 

getConstraints

public Number getConstraints()
Get the current input constraints of the TextField.

Returns:
see input constraints
Usage examples:
   <blue:call object="textField" method="getConstraints"
                     toVariable="constraints"/>
 

getMaxSize

public Number getMaxSize()
Returns the maximum size (number of characters) that can be stored in this TextField.

Returns:
the maximum size in characters
Usage examples:
   <blue:call object="textField" method="getMaxSize"
                     toVariable="maxSize"/>
 

getString

public Number getString()
Gets the contents of the TextField as a string value.

Returns:
the current contents
Usage examples:
   <blue:call object="textField" method="getString"
                     toVariable="string"/>
 

initialize

public void initialize(String title,
                       String text,
                       Number maxSize,
                       Number constraints)
Initializes a TextField object with the given title

Parameters:
title - the TextField's title
text - the TextField's title
maxSize - the maximum size in characters
constraints - see input constraints
Usage examples:
   <blue:call object="textField" method="initialize">
     <blue:argument type="String" value="title"/>
     <blue:argument type="String" value="text"/>
     <blue:argument type="byte" value="8"/>
     <blue:argument type="int" value="TextField.ANY"/>
   </blue:call>
 

insert

public void insert(String text,
                   Number position)
Inserts a String into the contents of the TextField.

Parameters:
text - the String to be inserted
position - the position at which insertion is to occur
Usage examples:
   <blue:call object="textField" method="insert">
     <blue:argument type="String" value="text"/>
     <blue:argument type="byte" value="2"/>
   </blue:call>
 

setConstraints

public void setConstraints(Number constraints)
Sets the input constraints of the TextField.

Parameters:
constraints - see input constraints
Usage examples:
   <blue:call object="textField" method="setConstraints">
     <blue:argument type="int" value="TextField.NUMERIC"/>
   </blue:call>
 

setMaxSize

public Number setMaxSize(Number maxSize)
Sets the maximum size (number of characters) that can be contained in this TextField.

Parameters:
maxSize - the new maximum size
Returns:
assigned maximum capacity - may be smaller than requested.
Usage examples:
   <blue:call object="textField" method="setMaxSize">
     <blue:argument type="byte" value="12"/>
   </blue:call>
 

setString

public void setString(String string)
Sets the contents of the TextField as a string value, replacing the previous contents.

Parameters:
the - new value of the TextField, or null if the TextField is to be made empty
Usage examples:
   <blue:call object="textField" method="setString">
     <blue:argument type="String" value="text"/>
   </blue:call>
 

size

public Number size()
Gets the number of characters that are currently stored in this TextField.

Returns:
the number of characters
Usage examples:
   <blue:call object="textField" method="size"
              toVariable="textFieldSize"/>
 


Copyright © 2007 E-MARSON. All Rights Reserved.