|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.google.gwt.user.client.ui.UIObject
com.google.gwt.user.client.ui.Widget
com.extjs.gxt.ui.client.widget.Component
com.extjs.gxt.ui.client.widget.BoxComponent
com.extjs.gxt.ui.client.widget.form.Field<D>
com.extjs.gxt.ui.client.widget.form.TextField<D>
D - the data typepublic class TextField<D>
Basic text field. Code snippet:
TextField<String> text = new TextField<String>();
text.setFieldLabel("Name");
text.setEmptyText("Enter your full name");
text.setAllowBlank(false);
text.setMinLength(4);
NumberField| Nested Class Summary | |
|---|---|
class |
TextField.TextFieldMessages
TextField Messages. |
| Nested classes/interfaces inherited from class com.extjs.gxt.ui.client.widget.form.Field |
|---|
Field.FieldImages, Field.FieldMessages |
| Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.UIObject |
|---|
com.google.gwt.user.client.ui.UIObject.DebugIdImpl, com.google.gwt.user.client.ui.UIObject.DebugIdImplEnabled |
| Field Summary |
|---|
| Fields inherited from class com.google.gwt.user.client.ui.UIObject |
|---|
DEBUG_ID_PREFIX |
| Constructor Summary | |
|---|---|
TextField()
Creates a new text field. |
|
| Method Summary | |
|---|---|
boolean |
getAllowBlank()
Returns the field's allow blank state. |
int |
getCursorPos()
Returns the cursor position. |
int |
getMaxLength()
Returns the field's max length. |
TextField.TextFieldMessages |
getMessages()
Returns the field's messages. |
int |
getMinLength()
Returns the minimum length. |
java.lang.String |
getRegex()
Returns the field's regex value. |
java.lang.String |
getSelectedText()
Returns the selected text. |
int |
getSelectionLength()
Returns the length of the current selection. |
boolean |
getSelectOnFocus()
Returns the select of focus state. |
Validator |
getValidator()
Returns the field's validator instance. |
boolean |
isPassword()
Returns true if the field is a password field. |
void |
select(int start,
int length)
Selects text in the field. |
void |
selectAll()
Selects all the text. |
void |
setAllowBlank(boolean allowBlank)
Sets whether a field is value when its value length = 0 (default to true). |
void |
setCursorPos(int pos)
Sets the cursor position. |
void |
setEmptyText(java.lang.String emptyText)
Sets the default text to display in an empty field. |
void |
setMaxLength(int maxLength)
Sets the maximum input field length. |
void |
setMinLength(int minLength)
Minimum input field length required (defaults to 0). |
void |
setPassword(boolean password)
True to create the text field as a password input (defaults to false, pre-render). |
void |
setRegex(java.lang.String regex)
Sets regular expression to be tested against the field value during validation. |
void |
setSelectionRange(int pos,
int length)
Selects the range. |
void |
setSelectOnFocus(boolean selectOnFocus)
True to automatically select any existing field text when the field receives input focus (defaults to false). |
void |
setValidator(Validator validator)
Sets the validator instance to be called during field validation. |
void |
setValue(D value)
Sets a data value into the field and validates it. |
| Methods inherited from class com.extjs.gxt.ui.client.widget.BoxComponent |
|---|
getBounds, getHeight, getHeight, getPosition, getShadow, getShadowOffset, getShadowPosition, getSize, getWidth, getWidth, isAutoHeight, isAutoWidth, isDeferHeight, isShim, setAutoHeight, setAutoWidth, setBounds, setBounds, setDeferHeight, setHeight, setHeight, setPagePosition, setPagePosition, setPixelSize, setPosition, setShadow, setShadowOffset, setShadowPosition, setShim, setSize, setSize, setWidth, setWidth, sync, syncSize |
| Methods inherited from class com.google.gwt.user.client.ui.Widget |
|---|
fireEvent, getParent, isAttached |
| Methods inherited from class com.google.gwt.user.client.ui.UIObject |
|---|
addStyleDependentName, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getOffsetHeight, getOffsetWidth, getStyleName, getStylePrimaryName, getTitle, isVisible, removeStyleDependentName, setStylePrimaryName, setVisible, unsinkEvents |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public TextField()
| Method Detail |
|---|
public boolean getAllowBlank()
public int getCursorPos()
public int getMaxLength()
public TextField.TextFieldMessages getMessages()
Field
getMessages in class Field<D>public int getMinLength()
public java.lang.String getRegex()
public java.lang.String getSelectedText()
public int getSelectionLength()
public boolean getSelectOnFocus()
public Validator getValidator()
public boolean isPassword()
public void select(int start,
int length)
start - the index where the selection should start.length - the number of characters to be selectedpublic void selectAll()
public void setAllowBlank(boolean allowBlank)
allowBlank - true to allow blanks, false otherwisepublic void setCursorPos(int pos)
pos - the positionpublic void setEmptyText(java.lang.String emptyText)
Field
setEmptyText in class Field<D>emptyText - the empty textpublic void setMaxLength(int maxLength)
maxLength - the max lengthpublic void setMinLength(int minLength)
minLength - the minimum lengthpublic void setPassword(boolean password)
password - the password statepublic void setRegex(java.lang.String regex)
regex - the regex expression
public void setSelectionRange(int pos,
int length)
pos - the positionlength - the range lengthpublic void setSelectOnFocus(boolean selectOnFocus)
selectOnFocus - true to focuspublic void setValidator(Validator validator)
null if
the value is valid or a string error message if invalid. Default value is
null.
validator - the validatorpublic void setValue(D value)
FieldField.setRawValue(java.lang.String).
setValue in class Field<D>value - the value to set
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||