|
|||||||||
| 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 | |
|---|---|
protected java.lang.String |
emptyStyle
|
protected static com.google.gwt.user.client.ui.impl.TextBoxImpl |
impl
|
protected El |
input
|
protected Validator |
validator
|
| Fields inherited from class com.extjs.gxt.ui.client.widget.form.Field |
|---|
autoValidate, emptyText, errorIcon, fieldStyle, focusStyle, focusValue, forceInvalidText, hasFocus, images, invalidStyle, messages, name, originalValue, preventMark, propertyEditor, readOnly, readOnlyFieldStyle, validationDelay, validationTask, value |
| Fields inherited from class com.extjs.gxt.ui.client.widget.BoxComponent |
|---|
adjustSize, cacheSizes, ensureVisibilityOnSizing, height, lastSize, layer, shim, width |
| Fields inherited from class com.extjs.gxt.ui.client.widget.Component |
|---|
afterRender, attachables, baseStyle, disabled, disabledStyle, disableTextSelection, dummy, focusable, hidden, mask, maskMessage, maskMessageStyleName, monitorWindowResize, rendered, resizeHandler, setElementRender, stateId, swallowEvents, toolTip, windowResizeDelay, windowResizeTask |
| Fields inherited from class com.google.gwt.user.client.ui.UIObject |
|---|
DEBUG_ID_PREFIX |
| Constructor Summary | |
|---|---|
TextField()
Creates a new text field. |
|
| Method Summary | |
|---|---|
protected Size |
adjustInputSize()
|
protected void |
applyEmptyText()
|
boolean |
getAllowBlank()
Returns the field's allow blank state. |
int |
getCursorPos()
Returns the cursor position. |
protected El |
getFocusEl()
|
protected El |
getInputEl()
Provides support for wrapping the actual input element. |
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. |
protected El |
getStyleEl()
|
Validator |
getValidator()
Returns the field's validator instance. |
boolean |
isPassword()
Returns true if the field is a password field. |
protected void |
onBlur(ComponentEvent be)
|
void |
onComponentEvent(ComponentEvent ce)
Any events a component receives will be forwarded to this method. |
protected void |
onFocus(ComponentEvent be)
|
protected void |
onRender(com.google.gwt.user.client.Element target,
int index)
Subclasses must override and ensure setElement is called for lazy rendered components. |
protected void |
onResize(int width,
int height)
Called after the component is resized, this method is empty by default but can be implemented by any subclass that needs to perform custom logic after a resize occurs. |
protected void |
removeEmptyText()
|
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 valid when its value length = 0 (default to true). |
protected void |
setAriaState(java.lang.String stateName,
java.lang.String stateValue)
|
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. |
protected boolean |
validateValue(java.lang.String value)
Subclasses should provide the validation implementation by overriding this. |
| Methods inherited from class com.extjs.gxt.ui.client.widget.BoxComponent |
|---|
adjustPosition, adjustSize, getBounds, getHeight, getHeight, getPosition, getPositionEl, getResizeEl, getShadow, getShadowOffset, getShadowPosition, getSize, getWidth, getWidth, hideShadow, hideShim, hideUnders, isAutoHeight, isAutoWidth, isDeferHeight, isShim, onPosition, onUnload, 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 |
|---|
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, fireEvent, getHandlerCount, getLayoutData, getParent, isAttached, isOrWasAttached, setLayoutData |
| Methods inherited from class com.google.gwt.user.client.ui.UIObject |
|---|
addStyleDependentName, ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getOffsetHeight, getOffsetWidth, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, isVisible, removeStyleDependentName, resolvePotentialElement, setElement, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setVisible, sinkBitlessEvent, unsinkEvents |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected static com.google.gwt.user.client.ui.impl.TextBoxImpl impl
protected java.lang.String emptyStyle
protected El input
protected Validator validator
| 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 onComponentEvent(ComponentEvent ce)
ComponentComponent.onBrowserEvent(com.google.gwt.user.client.Event) method
should not be overridden or modified.
onComponentEvent in class Field<D>ce - the base event
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 setprotected Size adjustInputSize()
protected void applyEmptyText()
protected El getFocusEl()
getFocusEl in class Componentprotected El getInputEl()
Field
getInputEl in class Field<D>protected El getStyleEl()
getStyleEl in class Field<D>protected void onBlur(ComponentEvent be)
onBlur in class Field<D>protected void onFocus(ComponentEvent be)
onFocus in class Field<D>
protected void onRender(com.google.gwt.user.client.Element target,
int index)
Component
onRender in class Field<D>target - the target elementindex - the insert location
protected void onResize(int width,
int height)
BoxComponent
onResize in class Field<D>width - the widthheight - the heightprotected void removeEmptyText()
protected void setAriaState(java.lang.String stateName,
java.lang.String stateValue)
setAriaState in class Componentprotected boolean validateValue(java.lang.String value)
Field
validateValue in class Field<D>value - the value to validate
true for valid
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||