|
|||||||||
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.gwtext.client.widgets.Component
com.gwtext.client.widgets.BoxComponent
com.gwtext.client.widgets.form.Field
com.gwtext.client.widgets.form.TextField
public class TextField
Basic text field.
Nested Class Summary |
---|
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.gwtext.client.widgets.Component |
---|
config, id |
Fields inherited from class com.google.gwt.user.client.ui.UIObject |
---|
DEBUG_ID_PREFIX |
Constructor Summary | |
---|---|
TextField()
Create a new TextField. |
|
TextField(com.google.gwt.core.client.JavaScriptObject jsObj)
|
|
TextField(java.lang.String fieldLabel)
Create a new TextField. |
|
TextField(java.lang.String fieldLabel,
java.lang.String name)
Create a new TextField. |
|
TextField(java.lang.String fieldLabel,
java.lang.String name,
int width)
Create a new TextField. |
|
TextField(java.lang.String fieldLabel,
java.lang.String name,
int width,
java.lang.String value)
Create a new TextField. |
Method Summary | |
---|---|
void |
addKeyListener(int[] keyCodes,
KeyListener listener)
Add a key listener. |
void |
addKeyListener(int keyCode,
KeyListener listener)
Add a key listener. |
void |
addKeyListener(java.lang.String keys,
KeyListener listener)
Add a key listener. |
void |
addKeyPressListener(EventCallback listener)
Add a key press listener |
void |
addKeyPressListener(EventCallback listener,
ListenerConfig listenerConfig)
Add a key press listener |
void |
addListener(TextFieldListener listener)
Add a TextField listener. |
void |
autoSize()
Automatically grows the field to accomodate the width of the text up to the maximum field width allowed. |
protected com.google.gwt.core.client.JavaScriptObject |
create(com.google.gwt.core.client.JavaScriptObject jsObj)
|
int[] |
getCaretPosition()
This method return the position of the caret as a int array. |
protected com.google.gwt.core.client.JavaScriptObject |
getConfigPrototype()
|
java.lang.String |
getText()
Returns the value of the text field. |
Validator |
getValidator()
Get the validator set for this field (if any). |
java.lang.String |
getXType()
Gets the xtype for this component as registered with ComponentMgr. |
void |
insertAtCaret(java.lang.String text)
|
void |
selectText()
Selects text in this field. |
void |
selectText(int start,
int end)
Selects text in this field. |
void |
setAllowBlank(boolean allowBlank)
False to validate that the value length > 0 (defaults to true). |
void |
setBlankText(java.lang.String blankText)
Error text to display if the allow blank validation fails (defaults to "This field is required"). |
void |
setCaretPosition(int caretStart,
int numToSelect)
This method sets the caret position |
void |
setDisableKeyFilter(boolean disableKeyFilter)
True to disable input keystroke filtering (defaults to false). |
void |
setEmptyClass(java.lang.String emptyClass)
The CSS class to apply to an empty field to style the emptyText (defaults to 'x-form-empty-field'). |
void |
setEmptyText(java.lang.String emptyText)
The default text to display in an empty field (defaults to null). |
void |
setGrow(boolean grow)
True if this field should automatically grow and shrink to its content. |
void |
setGrowMax(int growMax)
The maximum width to allow when grow = true (defaults to 800). |
void |
setGrowMin(int growMin)
The minimum width to allow when grow = true (defaults to 30). |
void |
setMaskRe(java.lang.String maskRe)
An input mask regular expression that will be used to filter keystrokes that don't match (defaults to null). |
void |
setMaxLength(int maxLength)
|
void |
setMaxLengthText(java.lang.String maxLengthText)
Error text to display if the maximum length validation fails. |
void |
setMinLength(int minLength)
Minimum input field length required (defaults to 0). |
void |
setMinLengthText(java.lang.String minLengthText)
Error text to display if the minimum length validation fails. |
void |
setPassword(boolean password)
Set true if field is a password field. |
void |
setRegex(java.lang.String regex)
A Regular Expressionto be tested against the field value during validation (defaults to null). |
void |
setRegexText(java.lang.String regexText)
The error text to display if regex is used and the test fails during validation (defaults to ""). |
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)
Set a custom Validator for the Field. |
void |
setVtype(VType vtype)
A validation type name as defined in VType (defaults to null). |
void |
setVtypeText(java.lang.String vtypeText)
The validation type text if the validation specified by setVtype(VType) fails. |
boolean |
validateValue(java.lang.String value)
Validates a value according to the field's validation rules and marks the field as invalid if the validation fails. |
Methods inherited from class com.gwtext.client.widgets.form.Field |
---|
addListener, applyTo, applyTo, clearInvalid, getClearCls, getCls, getFieldLabel, getFocusClass, getInputType, getInvalidClass, getInvalidText, getLabelSeparator, getLabelStyle, getName, getRawValue, getTabindex, getValidationDelay, getValueAsString, hide, isAutoCreate, isDirty, isHideLabel, isReadOnly, isValid, isValid, isValidateOnBlur, markInvalid, reset, setAutoCreate, setAutoCreate, setClearCls, setCls, setDisabled, setFieldClass, setFieldLabel, setFieldMsgTarget, setFocusClass, setHideLabel, setInputType, setInvalidClass, setInvalidText, setLabel, setLabelSeparator, setLabelStyle, setMsgFx, setMsgTarget, setName, setRawValue, setReadOnly, setTabIndex, setValidateOnBlur, setValidationDelay, setValidationEvent, setValidationEvent, setValue, show, validate |
Methods inherited from class com.gwtext.client.widgets.BoxComponent |
---|
addListener, doOnRender, doOnRender, getAutoHeight, getAutoWidth, getBox, getBox, getHeight, getPosition, getPosition, getSize, getWidth, setAutoHeight, setAutoWidth, setHeight, setHeight, setPagePosition, setPosition, setSize, setSize, setWidth, setWidth, syncSize, updateBox |
Methods inherited from class com.google.gwt.user.client.ui.Widget |
---|
doAttachChildren, doDetachChildren, getParent, isAttached, onAttach, onBrowserEvent, onDetach, onLoad, onUnload, removeFromParent |
Methods inherited from class com.google.gwt.user.client.ui.UIObject |
---|
ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, isVisible, onEnsureDebugId, setElement, setPixelSize, setStyleName, setStyleName, setStylePrimaryName, setVisible, sinkEvents, unsinkEvents |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public TextField()
public TextField(java.lang.String fieldLabel)
fieldLabel
- the field labelpublic TextField(java.lang.String fieldLabel, java.lang.String name)
fieldLabel
- the field labelname
- the field namepublic TextField(java.lang.String fieldLabel, java.lang.String name, int width)
fieldLabel
- the field labelname
- the field namewidth
- the field widthpublic TextField(java.lang.String fieldLabel, java.lang.String name, int width, java.lang.String value)
fieldLabel
- the field labelname
- the field namewidth
- the field widthvalue
- the field valuepublic TextField(com.google.gwt.core.client.JavaScriptObject jsObj)
Method Detail |
---|
protected com.google.gwt.core.client.JavaScriptObject getConfigPrototype()
getConfigPrototype
in class BoxComponent
public java.lang.String getXType()
Component
TextField field = new TextField();
field.getXType() returns "textfield"
getXType
in class Field
protected com.google.gwt.core.client.JavaScriptObject create(com.google.gwt.core.client.JavaScriptObject jsObj)
create
in class Field
public void addKeyListener(int keyCode, KeyListener listener)
keyCode
- the numeric key codelistener
- the key listenerpublic void addKeyListener(int[] keyCodes, KeyListener listener)
keyCodes
- array of key codeslistener
- the key listenerpublic void addKeyListener(java.lang.String keys, KeyListener listener)
keys
- a string with the keys to listen forlistener
- the key listenerpublic void addKeyPressListener(EventCallback listener)
listener
- the key press listenerpublic void addKeyPressListener(EventCallback listener, ListenerConfig listenerConfig)
listener
- the key press listenerlistenerConfig
- the listener configpublic void addListener(TextFieldListener listener)
listener
- the listenerpublic void autoSize()
public void selectText()
public void selectText(int start, int end)
start
- the index where the selection should startend
- the index where the selection should endpublic boolean validateValue(java.lang.String value)
value
- the value to valdiate
public java.lang.String getText()
public void setAllowBlank(boolean allowBlank)
allowBlank
- false to disallow blankpublic void setBlankText(java.lang.String blankText)
blankText
- error message for blank fieldpublic void setDisableKeyFilter(boolean disableKeyFilter) throws java.lang.IllegalStateException
disableKeyFilter
- true to disable
java.lang.IllegalStateException
- this property cannot be changed after the Component has been renderedpublic void setEmptyClass(java.lang.String emptyClass) throws java.lang.IllegalStateException
emptyClass
- the empty field CSS class
java.lang.IllegalStateException
- this property cannot be changed after the Component has been renderedpublic void setEmptyText(java.lang.String emptyText)
emptyText
- the empty field textpublic void setGrow(boolean grow) throws java.lang.IllegalStateException
grow
- true to allow grow
java.lang.IllegalStateException
- this property cannot be changed after the Component has been renderedpublic void setGrowMax(int growMax) throws java.lang.IllegalStateException
growMax
- the max width
java.lang.IllegalStateException
- this property cannot be changed after the Component has been renderedpublic void setGrowMin(int growMin) throws java.lang.IllegalStateException
growMin
- the minimum width
java.lang.IllegalStateException
- this property cannot be changed after the Component has been renderedpublic void setMaskRe(java.lang.String maskRe)
maskRe
- the mask regular expressionpublic void setMaxLength(int maxLength)
public void setMaxLengthText(java.lang.String maxLengthText)
maxLengthText
- the max lenght error textpublic void setMinLength(int minLength)
minLength
- the min lengthpublic void setMinLengthText(java.lang.String minLengthText)
minLengthText
- the min length error textpublic void setPassword(boolean password) throws java.lang.IllegalStateException
password
- true if passowrd field
java.lang.IllegalStateException
- this property cannot be changed after the Component has been renderedpublic void setRegex(java.lang.String regex)
regex
- the regular expressionpublic void setRegexText(java.lang.String regexText)
regexText
- the regexp textpublic void setSelectOnFocus(boolean selectOnFocus) throws java.lang.IllegalStateException
selectOnFocus
- true to select text on focus
java.lang.IllegalStateException
- this property cannot be changed after the Component has been renderedpublic void setValidator(Validator validator)
validator
- the field validatorpublic Validator getValidator()
public void setVtype(VType vtype)
VType
(defaults to null).
vtype
- the validation typepublic void setVtypeText(java.lang.String vtypeText)
setVtype(VType)
fails.
vtypeText
- the vtypepublic int[] getCaretPosition()
public void setCaretPosition(int caretStart, int numToSelect)
caretPos
- the caret positionpublic void insertAtCaret(java.lang.String text)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |