com.google.gwt.user.client.ui
Class TextBox
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<java.lang.String>
com.google.gwt.user.client.ui.TextBoxBase
com.google.gwt.user.client.ui.TextBox
- All Implemented Interfaces:
- HasAllFocusHandlers, HasAllKeyHandlers, HasAllMouseHandlers, HasBlurHandlers, HasChangeHandlers, HasClickHandlers, HasFocusHandlers, HasKeyDownHandlers, HasKeyPressHandlers, HasKeyUpHandlers, HasMouseDownHandlers, HasMouseMoveHandlers, HasMouseOutHandlers, HasMouseOverHandlers, HasMouseUpHandlers, HasMouseWheelHandlers, HasValueChangeHandlers<java.lang.String>, HasHandlers, AutoDirectionHandler.Target, HasDirection, HasDirectionEstimator, EventListener, Focusable, HasFocus, HasName, HasText, HasValue<java.lang.String>, SourcesChangeEvents, SourcesClickEvents, SourcesFocusEvents, SourcesKeyboardEvents, SourcesMouseEvents, TakesValue<java.lang.String>
- Direct Known Subclasses:
- PasswordTextBox
public class TextBox
- extends TextBoxBase
A standard single-line text box.
CSS Style Rules
- .gwt-TextBox { primary style }
- .gwt-TextBox-readonly { dependent style set when the text box is
read-only }
Example
|
Constructor Summary |
TextBox()
Creates an empty text box. |
|
Method Summary |
int |
getMaxLength()
Gets the maximum allowable length of the text box. |
int |
getVisibleLength()
Gets the number of visible characters in the text box. |
void |
setMaxLength(int length)
Sets the maximum allowable length of the text box. |
void |
setVisibleLength(int length)
Sets the number of visible characters in the text box. |
static TextBox |
wrap(Element element)
Creates a TextBox widget that wraps an existing <input type='text'>
element. |
| Methods inherited from class com.google.gwt.user.client.ui.ValueBoxBase |
addChangeHandler, addChangeListener, addValueChangeHandler, cancelKey, getCursorPos, getDirection, getDirectionEstimator, getName, getSelectedText, getSelectionLength, getText, getValueOrThrow, isReadOnly, onBrowserEvent, removeChangeListener, selectAll, setCursorPos, setDirection, setDirectionEstimator, setDirectionEstimator, setKey, setName, setReadOnly, setSelectionRange, setText, setTextAlignment, setValue, setValue |
| Methods inherited from class com.google.gwt.user.client.ui.FocusWidget |
addBlurHandler, addClickHandler, addClickListener, addFocusHandler, addFocusListener, addKeyboardListener, addKeyDownHandler, addKeyPressHandler, addKeyUpHandler, addMouseDownHandler, addMouseListener, addMouseMoveHandler, addMouseOutHandler, addMouseOverHandler, addMouseUpHandler, addMouseWheelHandler, addMouseWheelListener, getTabIndex, isEnabled, removeClickListener, removeFocusListener, removeKeyboardListener, removeMouseListener, removeMouseWheelListener, setAccessKey, setEnabled, setFocus, setTabIndex |
| Methods inherited from class com.google.gwt.user.client.ui.UIObject |
addStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleName, getStylePrimaryName, getTitle, isVisible, isVisible, removeStyleDependentName, removeStyleName, setHeight, setPixelSize, setSize, setStyleDependentName, setStyleName, setStyleName, setStylePrimaryName, setTitle, setVisible, setVisible, setWidth, toString, unsinkEvents |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
TextBox
public TextBox()
- Creates an empty text box.
wrap
public static TextBox wrap(Element element)
- Creates a TextBox widget that wraps an existing <input type='text'>
element.
This element must already be attached to the document. If the element is
removed from the document, you must call
RootPanel.detachNow(Widget).
- Parameters:
element - the element to be wrapped
getMaxLength
public int getMaxLength()
- Gets the maximum allowable length of the text box.
- Returns:
- the maximum length, in characters
getVisibleLength
public int getVisibleLength()
- Gets the number of visible characters in the text box.
- Returns:
- the number of visible characters
setMaxLength
public void setMaxLength(int length)
- Sets the maximum allowable length of the text box.
- Parameters:
length - the maximum length, in characters
setVisibleLength
public void setVisibleLength(int length)
- Sets the number of visible characters in the text box.
- Parameters:
length - the number of visible characters