|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--com.yospace.yae.yogi.YogiComponent
|
+--com.yospace.yae.yogi.YogiTextField
This is a MIDP compatible TextField. It allows the same method of text entry that MIDP uses to be used inside Yogi. Consequently YogiTextFields work in an identical way to MIDP TextFields.
| Field Summary | |
static int |
CONSTRAINT_MASK
Constant that defines the constraint mask for the text field. |
static int |
CONSTRAINTS_ANY
Constant used to set a text field to allow any kind of input. |
static int |
CONSTRAINTS_EMAILADDR
Constant used to set a text field to allow input of an email address only. |
static int |
CONSTRAINTS_NUMERIC
Constant used to set a text field to allow numeric input only. |
static int |
CONSTRAINTS_PHONENUMBER
Constant used to set a text field to allow input of a phone number only. |
static int |
CONSTRAINTS_URL
Constant used to set a text field to allow input of a URL only. |
static int |
PASSWORD_MODIFIER
Constant used to set a text field to use password mode where input is obscured. |
static int |
PROPERTY_CONSTRAINTS
Constant for the constraints property |
static int |
PROPERTY_LABEL
Constant for the label property |
static int |
PROPERTY_MAXSIZE
Constant for the maxsize property |
static int |
PROPERTY_PASSWORD
Constant for the password property |
static int |
PROPERTY_STRING
Constant for the string property |
| Constructor Summary | |
YogiTextField()
Default constructor creates a text field with no label, no initial value, of length 1 and no constraints. |
|
YogiTextField(java.lang.String label,
java.lang.String text,
int maxSize,
int constraints)
Constructs a new YogiTextField with the given label, initial text, maximum size and contraints. |
|
| Method Summary | |
void |
delete(int offset,
int length)
Deletes a region of characters from the text field. |
int |
getCaretPosition()
Returns the current cursor position. |
YogiComponent |
getCellRendererComponent(AbstractTable table,
java.lang.Object value,
boolean isSelected,
boolean cellHasFocus)
Provided to implement the RendererFactory interface. |
int |
getChars(char[] data)
Copies the contents of the text field into the character array data starting at position 0. |
int |
getConstraints()
Gets the current constraints for the text field. |
java.lang.String |
getLabel()
Gets the current label of the text field. |
int |
getMaxSize()
Gets the maximum number of characters that the text field is allowed to contain. |
java.lang.String |
getString()
Gets the contents of the text field and returns them as a String. |
java.lang.String |
getText()
A convenience method that standardizes using getText within YoGI whilst keeping the getString of MIDP. |
javax.microedition.lcdui.TextField |
getTextField()
An accessor method that allows access to the MIDP text field itself. |
void |
insert(char[] data,
int offset,
int length,
int position)
Inserts a range of characters from data into the text field. |
void |
insert(java.lang.String src,
int position)
Inserts the String src into the text field beginning at position pos. |
boolean |
isPassword()
Gets whether the current string is a password or not. |
void |
setChars(char[] data,
int offset,
int length)
Sets the text of the text field to be a range of characters in a character array. |
void |
setConstraints(int constraints)
Sets the constraints for the text field. |
void |
setLabel(java.lang.String newLabel)
Sets the label of the text field. |
int |
setMaxSize(int maxSize)
Sets the maximum number of characters that the text field can contain. |
void |
setPassword(boolean password)
Sets whether the string is a password. |
void |
setString(java.lang.String newText)
Sets the current text inside the text field to be text. |
void |
setText(java.lang.String newText)
A convenience method that standardizes using setText within YoGI whilst keeping the setString of MIDP. |
int |
size()
Gets the current number of characters stored in the text field. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final int PROPERTY_STRING
public static final int PROPERTY_LABEL
public static final int PROPERTY_MAXSIZE
public static final int PROPERTY_CONSTRAINTS
public static final int PROPERTY_PASSWORD
public static int CONSTRAINTS_ANY
public static int CONSTRAINTS_EMAILADDR
public static int CONSTRAINTS_NUMERIC
public static int CONSTRAINTS_PHONENUMBER
public static int CONSTRAINTS_URL
public static int CONSTRAINT_MASK
public static int PASSWORD_MODIFIER
| Constructor Detail |
public YogiTextField()
public YogiTextField(java.lang.String label,
java.lang.String text,
int maxSize,
int constraints)
label - the label for the text field, may not be displayed depending on the MIDP implmentation.text - the initial text that the text field will contain.maxSize - the maximum number of characters that the text field can contain.constraints - see the MIDP constraints in TextField.| Method Detail |
public javax.microedition.lcdui.TextField getTextField()
public void delete(int offset,
int length)
offset - the position of the start of the region to delete.length - the length of the region to delete.public int getCaretPosition()
public int getChars(char[] data)
data starting at position 0.data - the character array into which the text field value will be copied.public int getConstraints()
public int getMaxSize()
public java.lang.String getString()
public java.lang.String getText()
getString()
public void insert(char[] data,
int offset,
int length,
int position)
data into the text field. The range is defined by the offset from
the start of the character array and the length from that start position. This range is then inserted into the
text field starting at position position.data - the source character array.offset - the offset from the start of the array that the range begins.length - the length of the range to be inserted.position - the start position in the text array that the range of characters will be inserted into.
public void insert(java.lang.String src,
int position)
src into the text field beginning at position pos.src - the String to be inserted.position - the starting position that the String will be inserted to.
public void setChars(char[] data,
int offset,
int length)
data is null then
the text field will be set to being blank.
The component is repainted and a PROPERTY_STRING change event
is fired.
data - the source character array.offset - the start position of the range inside the character array.length - the length of the range inside the character array.public void setConstraints(int constraints)
The component is repainted and a PROPERTY_CONSTRAINTS change event
is fired.
constraints - the new constraints for the text field.public int setMaxSize(int maxSize)
If the value changes, the component is repainted and a PROPERTY_MAXSIZE change event
is fired.
maxSize - the new maximum size.public void setString(java.lang.String newText)
text. If the text is too long to fit into
the text field then the maximum size is increased to fit the new value. (this is different from the MIDP
specification).
If the value changes, the component is repainted and a PROPERTY_STRING change event
is fired.
the - new text value in the text field.public void setText(java.lang.String newText)
newText - the new text value in the text field.setString(String)public void setLabel(java.lang.String newLabel)
If the value changes, the component is repainted and a PROPERTY_LABEL change event
is fired.
newLabel - the new label for the text field.public java.lang.String getLabel()
public void setPassword(boolean password)
If the value changes, the component is repainted and a PROPERTY_PASSWORD change event
is fired.
password - a boolean representing whether the string is a password.public boolean isPassword()
public int size()
public YogiComponent getCellRendererComponent(AbstractTable table,
java.lang.Object value,
boolean isSelected,
boolean cellHasFocus)
RendererFactoryRendererFactory interface.
Returns a YogiComponent customised to the arguments passed from the
AbstractTable subclass.getCellRendererComponent in interface RendererFactorycom.yospace.yae.yogi.RendererFactorytable - the table for which the check box is rendering.value - the object to be custom rendered.isSelected - the selected state of the object to be custom rendered.cellHasFocus - the focus state of the object to be custom rendered.
|
Copyright 2002 Yospace Holdings Ltd. All Rights Reserved. | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||