java.lang.Object | ||||
↳ | com.google.gwt.user.client.ui.UIObject | |||
↳ | com.google.gwt.user.client.ui.Widget | |||
↳ | com.google.gwt.user.client.ui.FocusWidget | |||
↳ | com.google.gwt.user.client.ui.ValueBoxBase<T> |
Known Direct Subclasses
TextBoxBase,
ValueBox<T>
|
Known Indirect Subclasses |
Abstract base class for all text entry widgets.
Nested Classes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
ValueBoxBase.TextAlignment | Alignment values for setAlignment(ValueBoxBase.TextAlignment) . |
[Expand]
Inherited Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
com.google.gwt.user.client.ui.UIObject
|
Protected Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Creates a value box that wraps the given browser element handle.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Adds a
ChangeEvent handler. | |||||||||||
Adds a
ValueChangeEvent handler. | |||||||||||
Returns an Editor that is backed by the ValueBoxBase.
| |||||||||||
If a keyboard event is currently being handled on this text box, calling
this method will suppress it.
| |||||||||||
Gets the current position of the cursor (this also serves as the beginning
of the text selection).
| |||||||||||
Gets the directionality of the widget.
| |||||||||||
Gets the direction estimation model of the auto-dir handler.
| |||||||||||
Gets the widget's name.
| |||||||||||
Gets the text currently selected within this text box.
| |||||||||||
Gets the length of the current text selection.
| |||||||||||
Gets this object's text.
| |||||||||||
Return the parsed value, or null if the field is empty or parsing fails.
| |||||||||||
Return the parsed value, or null if the field is empty.
| |||||||||||
Determines whether or not the widget is read-only.
| |||||||||||
Fired whenever a browser event is received.
| |||||||||||
This method is deprecated.
Use the
removeHandler() method on the
object returned by addChangeHandler(ChangeHandler) instead
| |||||||||||
Selects all of the text in the box.
| |||||||||||
Sets the cursor position.
| |||||||||||
Sets the directionality for a widget.
| |||||||||||
Sets the direction estimation model of the auto-dir handler.
| |||||||||||
Toggles on / off direction estimation.
| |||||||||||
This method is deprecated.
this method only works in IE and should not have been added to
the API
| |||||||||||
Sets the widget's name.
| |||||||||||
Turns read-only mode on or off.
| |||||||||||
Sets the range of text to be selected.
| |||||||||||
Sets this object's text.
| |||||||||||
Sets this object's value.
| |||||||||||
Sets this object's value without firing any events.
|
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
This method is called immediately after a widget becomes attached to the
browser's document.
|
Creates a value box that wraps the given browser element handle. This is only used by subclasses.
elem | the browser element to wrap |
---|
Adds a ChangeEvent
handler.
handler | the change handler |
---|
HandlerRegistration
used to remove this handler
Adds a ValueChangeEvent
handler.
handler | the handler |
---|
Returns an Editor that is backed by the ValueBoxBase. The default
implementation returns of(ValueBoxBase)
. Subclasses
may override this method to provide custom error-handling when using the
Editor framework.
Editor
of type E
If a keyboard event is currently being handled on this text box, calling this method will suppress it. This allows listeners to easily filter keyboard input.
Gets the current position of the cursor (this also serves as the beginning of the text selection).
Gets the directionality of the widget.
RTL
if the directionality is right-to-left,
LTR
if the directionality is left-to-right, or
DEFAULT
if the directionality is not explicitly specified
Gets the direction estimation model of the auto-dir handler.
Gets the text currently selected within this text box.
Gets the length of the current text selection.
Return the parsed value, or null if the field is empty or parsing fails.
Return the parsed value, or null if the field is empty.
ParseException | if the value cannot be parsed |
---|
Determines whether or not the widget is read-only.
true
if the widget is currently read-only,
false
if the widget is currently editable
Fired whenever a browser event is received.
event | the event received |
---|
This method is deprecated.
Use the removeHandler()
method on the
object returned by addChangeHandler(ChangeHandler)
instead
Selects all of the text in the box. This will only work when the widget is attached to the document and not hidden.
Sets the cursor position. This will only work when the widget is attached to the document and not hidden.
pos | the new cursor position |
---|
Sets the directionality for a widget.
direction | 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 set
|
---|
Sets the direction estimation model of the auto-dir handler.
directionEstimator | The {code DirectionEstimator} to be set. null means turning off direction estimation.
|
---|
Toggles on / off direction estimation.
enabled | Whether to enable direction estimation. If true ,
sets the DirectionEstimator object to a default
DirectionEstimator .
|
---|
This method is deprecated.
this method only works in IE and should not have been added to
the API
If a keyboard event is currently being handled by the text box, this method replaces the unicode character or key code associated with it. This allows listeners to easily filter keyboard input.
key | the new key value |
---|
Turns read-only mode on or off.
readOnly | if true , the widget becomes read-only; if
false the widget becomes editable
|
---|
Sets the range of text to be selected. This will only work when the widget is attached to the document and not hidden.
pos | the position of the first character to be selected |
---|---|
length | the number of characters to be selected |
Sets this object's text. Note that some browsers will manipulate the text
before adding it to the widget. For example, most browsers will strip all
\r
from the text, except IE which will add a \r
before each \n
. Use getText()
to get the text
directly from the widget.
text | the object's new text |
---|
Sets this object's value. Fires
ValueChangeEvent
when
fireEvents is true and the new value does not equal the existing value.
It is acceptable to fail assertions or throw (documented) unchecked exceptions in response to bad values.
value | the object's new value |
---|---|
fireEvents | fire events if true and value is new |
Sets this object's value without firing any events. This should be identical to calling setValue(value, false).
It is acceptable to fail assertions or throw (documented) unchecked exceptions in response to bad values.
Widgets must accept null as a valid value. By convention, setting a widget to
null clears value, calling getValue() on a cleared widget returns null. Widgets
that can not be cleared (e.g. CheckBox
) must find another valid meaning
for null input.
value | the object's new value |
---|
This method is called immediately after a widget becomes attached to the browser's document.