public abstract class ValueBaseField<T> extends Field<T> implements HasKeyPressHandlers, HasChangeHandlers, ParseErrorEvent.HasParseErrorHandlers, HasDirectionEstimator, AutoDirectionHandler.Target
UIObject.DebugIdImpl, UIObject.DebugIdImplEnabledHasDirection.DirectionEditor.Ignore, Editor.PathDEBUG_ID_PREFIX| Modifier and Type | Method and Description |
|---|---|
HandlerRegistration |
addChangeHandler(ChangeHandler handler) |
HandlerRegistration |
addKeyPressHandler(KeyPressHandler handler) |
HandlerRegistration |
addKeyUpHandler(KeyUpHandler handler) |
HandlerRegistration |
addParseErrorHandler(ParseErrorEvent.ParseErrorHandler handler)
Adds a
ParseErrorEvent.ParseErrorHandler handler for ParseErrorEvent
events. |
ValueBaseFieldCell<T> |
getCell()
Get the
Cell wrapped by this widget. |
T |
getCurrentValue()
Returns the field's current value.
|
int |
getCursorPos()
Gets the current position of the cursor (this also serves as the beginning
of the text selection).
|
HasDirection.Direction |
getDirection() |
DirectionEstimator |
getDirectionEstimator() |
String |
getEmptyText()
Returns the field's empty text.
|
PropertyEditor<T> |
getPropertyEditor()
Returns the field's property editor.
|
String |
getSelectedText()
Gets the text currently selected within this text box.
|
int |
getSelectionLength()
Gets the length of the current text selection.
|
String |
getText()
Gets this object's text.
|
T |
getValueOrThrow()
Return the parsed value, or null if the field is empty.
|
boolean |
isAllowBlank()
Returns the field's allow blank state.
|
boolean |
isCurrentValid()
Returns the valid state of the current value.
|
boolean |
isCurrentValid(boolean preventMark)
Returns the valid state of the current value.
|
boolean |
isSelectOnFocus()
Returns the select of focus state.
|
void |
redraw()
Redraw the widget.
|
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).
|
void |
setCursorPos(int pos)
Sets the cursor position.
|
void |
setDirection(HasDirection.Direction direction)
Sets the directionality for a widget.
|
void |
setDirectionEstimator(boolean enabled)
Toggles on / off direction estimation.
|
void |
setDirectionEstimator(DirectionEstimator directionEstimator)
Sets the {link DirectionEstimator} object.
|
void |
setEmptyText(String emptyText)
Sets the default text to display in an empty field (defaults to null).
|
void |
setId(String id)
Sets the component's id.
|
void |
setPropertyEditor(PropertyEditor<T> propertyEditor) |
void |
setReadOnly(boolean readOnly)
Sets the field's read only state.
|
void |
setSelectionRange(int pos,
int length)
Sets the range of text to be selected.
|
void |
setSelectOnFocus(boolean selectOnFocus)
True to automatically select any existing field text when the field
receives input focus (defaults to false).
|
void |
setText(String text)
Sets this object's text.
|
void |
setValue(T value)
Sets this object's value without firing any events.
|
addInvalidHandler, addValidator, addValidHandler, addValueChangeHandler, clear, clearInvalid, finishEditing, forceInvalid, getErrorSupport, getName, getValidateOnBlur, getValidationDelay, getValidators, isAutoValidate, isEditing, isReadOnly, isValid, isValid, markInvalid, onBrowserEvent, removeValidator, reset, setAutoValidate, setDelegate, setErrorSupport, setName, setOriginalValue, setValidateOnBlur, setValidationDelay, setValue, showErrors, validate, validategetKeyProvider, getValue, setValueaddBeforeHideHandler, addBeforeShowContextMenuHandler, addBeforeShowHandler, addBlurHandler, addDisableHandler, addEnableHandler, addFocusHandler, addHideHandler, addMoveHandler, addResizeHandler, addShowContextMenuHandler, addShowHandler, addStyleOnOver, clearSizeCache, disable, disableEvents, enable, enableEvents, fireEvent, focus, getData, getElement, getFocusSupport, getHideMode, getId, getItemId, getOffsetHeight, getOffsetWidth, getShadow, getStateId, getToolTip, hide, hideToolTip, isAllowTextSelection, isAutoHeight, isAutoWidth, isDeferHeight, isEnabled, isRendered, isStateful, isVisible, isVisible, mask, mask, removeHandler, removeToolTip, setAllowTextSelection, setBorders, setBounds, setBounds, setContextMenu, setData, setDeferHeight, setEnabled, setHeight, setHeight, setHideMode, setItemId, setPagePosition, setPixelSize, setPosition, setShadow, setSize, setStateful, setStateId, setTabIndex, setToolTip, setToolTipConfig, setVisible, setWidth, setWidth, show, sync, syncSize, unmaskaddAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, getLayoutData, getParent, isAttached, removeFromParent, setLayoutData, sinkEventsaddStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getOffsetHeight, getOffsetWidth, getStyleName, getStylePrimaryName, getTitle, isVisible, removeStyleDependentName, removeStyleName, setStyleDependentName, setStyleName, setStyleName, setStylePrimaryName, setTitle, setVisible, sinkBitlessEvent, toString, unsinkEventsequals, getClass, hashCode, notify, notifyAll, wait, wait, waitfireEventgetValuepublic HandlerRegistration addChangeHandler(ChangeHandler handler)
addChangeHandler in interface HasChangeHandlerspublic HandlerRegistration addKeyPressHandler(KeyPressHandler handler)
addKeyPressHandler in interface HasKeyPressHandlerspublic HandlerRegistration addKeyUpHandler(KeyUpHandler handler)
addKeyUpHandler in interface HasKeyUpHandlerspublic HandlerRegistration addParseErrorHandler(ParseErrorEvent.ParseErrorHandler handler)
ParseErrorEvent.HasParseErrorHandlersParseErrorEvent.ParseErrorHandler handler for ParseErrorEvent
events.addParseErrorHandler in interface ParseErrorEvent.HasParseErrorHandlershandler - the handlerpublic ValueBaseFieldCell<T> getCell()
CellComponentCell wrapped by this widget.public T getCurrentValue()
public int getCursorPos()
public HasDirection.Direction getDirection()
getDirection in interface HasDirectionpublic DirectionEstimator getDirectionEstimator()
getDirectionEstimator in interface HasDirectionEstimatorpublic String getEmptyText()
public PropertyEditor<T> getPropertyEditor()
public String getSelectedText()
public int getSelectionLength()
public String getText()
public T getValueOrThrow() throws ParseException
ParseException - if the value cannot be parsedpublic boolean isAllowBlank()
public boolean isCurrentValid()
public boolean isCurrentValid(boolean preventMark)
public boolean isSelectOnFocus()
public void redraw()
CellComponentpublic 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 new cursor positionpublic void setDirection(HasDirection.Direction direction)
setDirection in interface HasDirectiondirection - RTL if the directionality should be set to right-to-left,
LTR if the directionality should be set to left-to-right DEFAULT
if the directionality should not be explicitly setpublic void setDirectionEstimator(boolean enabled)
setDirectionEstimator in interface HasDirectionEstimatorenabled - Whether to enable direction estimation. If true, sets the
DirectionEstimator object to a default DirectionEstimator.public void setDirectionEstimator(DirectionEstimator directionEstimator)
setDirectionEstimator in interface HasDirectionEstimatordirectionEstimator - The {code DirectionEstimator} to be set. null
means turning off direction estimation.public void setEmptyText(String emptyText)
emptyText - the empty textpublic void setId(String id)
Componentpublic void setPropertyEditor(PropertyEditor<T> propertyEditor)
public void setReadOnly(boolean readOnly)
FieldsetReadOnly in class Field<T>readOnly - the read only statepublic void setSelectionRange(int pos,
int length)
pos - the position of the first character to be selectedlength - the number of characters to be selectedpublic void setSelectOnFocus(boolean selectOnFocus)
selectOnFocus - true to focuspublic void setText(String text)
\r from the text, except IE which will add a \r
before each \n. Use getText() to get the text
directly from the widget.public void setValue(T value)
setValue in interface TakesValue<T>setValue in interface HasValue<T>setValue in class CellComponent<T>value - the parsed valueCopyright © 2012. All Rights Reserved.