com.google.gwt.user.client.ui
Class TextBox

java.lang.Object
  extended by com.google.gwt.user.client.ui.UIObject
      extended by com.google.gwt.user.client.ui.Widget
          extended by com.google.gwt.user.client.ui.FocusWidget
              extended by com.google.gwt.user.client.ui.ValueBoxBase<java.lang.String>
                  extended by com.google.gwt.user.client.ui.TextBoxBase
                      extended by 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

Example


Nested Class Summary
 
Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.TextBoxBase
TextBoxBase.TextAlignConstant
 
Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.UIObject
UIObject.DebugIdImpl, UIObject.DebugIdImplEnabled
 
Nested classes/interfaces inherited from interface com.google.gwt.i18n.client.HasDirection
HasDirection.Direction
 
Field Summary
 
Fields inherited from class com.google.gwt.user.client.ui.TextBoxBase
ALIGN_CENTER, ALIGN_JUSTIFY, ALIGN_LEFT, ALIGN_RIGHT
 
Fields inherited from class com.google.gwt.user.client.ui.UIObject
DEBUG_ID_PREFIX
 
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.TextBoxBase
getValue
 
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.Widget
fireEvent, getLayoutData, getParent, isAttached, removeFromParent, setLayoutData, sinkEvents
 
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
 
Methods inherited from interface com.google.gwt.event.dom.client.HasKeyUpHandlers
addKeyUpHandler
 
Methods inherited from interface com.google.gwt.event.shared.HasHandlers
fireEvent
 

Constructor Detail

TextBox

public TextBox()
Creates an empty text box.

Method Detail

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