Package com.google.gwt.user.client.ui

## Class TextBoxBase

- 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

- All Implemented Interfaces:
    `IsEditor<ValueBoxEditor<java.lang.String>>`, `HasAllDragAndDropHandlers`, `HasAllFocusHandlers`, `HasAllGestureHandlers`, `HasAllKeyHandlers`, `HasAllMouseHandlers`, `HasAllTouchHandlers`, `HasBlurHandlers`, `HasChangeHandlers`, `HasClickHandlers`, `HasDoubleClickHandlers`, `HasDragEndHandlers`, `HasDragEnterHandlers`, `HasDragHandlers`, `HasDragLeaveHandlers`, `HasDragOverHandlers`, `HasDragStartHandlers`, `HasDropHandlers`, `HasFocusHandlers`, `HasGestureChangeHandlers`, `HasGestureEndHandlers`, `HasGestureStartHandlers`, `HasKeyDownHandlers`, `HasKeyPressHandlers`, `HasKeyUpHandlers`, `HasMouseDownHandlers`, `HasMouseMoveHandlers`, `HasMouseOutHandlers`, `HasMouseOverHandlers`, `HasMouseUpHandlers`, `HasMouseWheelHandlers`, `HasTouchCancelHandlers`, `HasTouchEndHandlers`, `HasTouchMoveHandlers`, `HasTouchStartHandlers`, `HasAttachHandlers`, `HasValueChangeHandlers<java.lang.String>`, `HasHandlers`, `AutoDirectionHandler.Target`, `HasDirection`, `HasDirectionEstimator`, `EventListener`, `TakesValue<java.lang.String>`, `Focusable`, `HasEnabled`, `HasFocus`, `HasName`, `HasText`, `HasValue<java.lang.String>`, `HasVisibility`, `IsWidget`, `SourcesChangeEvents`, `SourcesClickEvents`, `SourcesFocusEvents`, `SourcesKeyboardEvents`, `SourcesMouseEvents`
  Direct Known Subclasses:
    `TextArea`, `TextBox`

      public class TextBoxBase
      extends ValueBoxBase<java.lang.String>
      implements SourcesChangeEvents

  Abstract base class for most text entry widgets.

  The names of the static members of `TextBoxBase`, as well as simple alignment names (`left`, `center`, `right`, `justify`), can be used as values for a `textAlignment` attribute.

  For example,

       <g:TextBox textAlignment='ALIGN_RIGHT'/>
       <g:TextBox textAlignment='right'/>

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class | Description
    --- | --- | ---
    `static class` | `TextBoxBase.TextAlignConstant` | Deprecated. use `ValueBoxBase.setAlignment(ValueBoxBase.TextAlignment)`

    - ### Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.ValueBoxBase

      `ValueBoxBase.TextAlignment`

    - ### 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
    Modifier and Type | Field | Description
    --- | --- | ---
    `static TextBoxBase.TextAlignConstant` | `ALIGN_CENTER` | Center the text.
    `static TextBoxBase.TextAlignConstant` | `ALIGN_JUSTIFY` | Justify the text.
    `static TextBoxBase.TextAlignConstant` | `ALIGN_LEFT` | Align the text to the left edge.
    `static TextBoxBase.TextAlignConstant` | `ALIGN_RIGHT` | Align the text to the right.

    - ### Fields inherited from class com.google.gwt.user.client.ui.Widget

      `eventsToSink`

    - ### Fields inherited from class com.google.gwt.user.client.ui.UIObject

      `DEBUG_ID_PREFIX, MISSING_ELEMENT_ERROR, SETELEMENT_TWICE_ERROR`

  - ### Constructor Summary

    Constructors
    Modifier | Constructor | Description
    --- | --- | ---
    `protected` | `TextBoxBase​(Element elem)` | Creates a text box that wraps the given browser element handle.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `void` | `addChangeListener​(ChangeListener listener)` | Deprecated. Use `ValueBoxBase.addChangeHandler(com.google.gwt.event.dom.client.ChangeHandler)` instead
    `java.lang.String` | `getValue()` | Overridden to return "" from an empty text box.
    `void` | `setTextAlignment​(TextBoxBase.TextAlignConstant align)` | Deprecated. use `ValueBoxBase.setAlignment(TextAlignment)`

    - ### Methods inherited from class com.google.gwt.user.client.ui.ValueBoxBase

      `addChangeHandler, addValueChangeHandler, asEditor, cancelKey, getCursorPos, getDirection, getDirectionEstimator, getImpl, getName, getSelectedText, getSelectionLength, getText, getValueOrThrow, isReadOnly, onBrowserEvent, onLoad, removeChangeListener, selectAll, setAlignment, setCursorPos, setDirection, setDirectionEstimator, setDirectionEstimator, setKey, setName, setReadOnly, setSelectionRange, setText, setValue, setValue`

    - ### Methods inherited from class com.google.gwt.user.client.ui.FocusWidget

      `addBlurHandler, addClickHandler, addClickListener, addDoubleClickHandler, addDragEndHandler, addDragEnterHandler, addDragHandler, addDragLeaveHandler, addDragOverHandler, addDragStartHandler, addDropHandler, addFocusHandler, addFocusListener, addGestureChangeHandler, addGestureEndHandler, addGestureStartHandler, addKeyboardListener, addKeyDownHandler, addKeyPressHandler, addKeyUpHandler, addMouseDownHandler, addMouseListener, addMouseMoveHandler, addMouseOutHandler, addMouseOverHandler, addMouseUpHandler, addMouseWheelHandler, addMouseWheelListener, addTouchCancelHandler, addTouchEndHandler, addTouchMoveHandler, addTouchStartHandler, getFocusImpl, getTabIndex, isEnabled, onAttach, removeClickListener, removeFocusListener, removeKeyboardListener, removeMouseListener, removeMouseWheelListener, setAccessKey, setEnabled, setFocus, setTabIndex`

    - ### Methods inherited from class com.google.gwt.user.client.ui.Widget

      `addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, doAttachChildren, doDetachChildren, ensureHandlers, fireEvent, getHandlerCount, getHandlerManager, getLayoutData, getParent, isAttached, isOrWasAttached, onDetach, onUnload, removeFromParent, replaceElement, setLayoutData, setParent, sinkEvents, unsinkEvents`

    - ### Methods inherited from class com.google.gwt.user.client.ui.UIObject

      `addStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, getTitle, isVisible, isVisible, onEnsureDebugId, removeStyleDependentName, removeStyleName, resolvePotentialElement, setElement, setElement, setHeight, setPixelSize, setSize, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setTitle, setVisible, setVisible, setWidth, sinkBitlessEvent, toString`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

    - ### Methods inherited from interface com.google.gwt.event.shared.HasHandlers

      `fireEvent`

    - ### Methods inherited from interface com.google.gwt.event.dom.client.HasKeyUpHandlers

      `addKeyUpHandler`

    - ### Methods inherited from interface com.google.gwt.user.client.ui.SourcesChangeEvents

      `removeChangeListener`

- - ### Field Detail

    - #### ALIGN_CENTER

          public static final TextBoxBase.TextAlignConstant ALIGN_CENTER

      Center the text.

    - #### ALIGN_JUSTIFY

          public static final TextBoxBase.TextAlignConstant ALIGN_JUSTIFY

      Justify the text.

    - #### ALIGN_LEFT

          public static final TextBoxBase.TextAlignConstant ALIGN_LEFT

      Align the text to the left edge.

    - #### ALIGN_RIGHT

          public static final TextBoxBase.TextAlignConstant ALIGN_RIGHT

      Align the text to the right.

  - ### Constructor Detail

    - #### TextBoxBase

          protected TextBoxBase​(Element elem)

      Creates a text box that wraps the given browser element handle. This is only used by subclasses.
      Parameters:
        `elem` - the browser element to wrap

  - ### Method Detail

    - #### addChangeListener

          @Deprecated
          public void addChangeListener​(ChangeListener listener)

      Deprecated.
      Use `ValueBoxBase.addChangeHandler(com.google.gwt.event.dom.client.ChangeHandler)` instead
      Description copied from interface: `SourcesChangeEvents`
      Adds a listener interface to receive change events.
      Specified by:
        `addChangeListener` in interface `SourcesChangeEvents`
      Parameters:
        `listener` - the listener interface to add

    - #### getValue

          public java.lang.String getValue()

      Overridden to return "" from an empty text box.
      Specified by:
        `getValue` in interface `HasValue<java.lang.String>`
      Specified by:
        `getValue` in interface `TakesValue<java.lang.String>`
      Overrides:
        `getValue` in class `ValueBoxBase<java.lang.String>`
      Returns:
        the object's value
      See Also:
        `TakesValue.setValue(V)`

    - #### setTextAlignment

          @Deprecated
          public void setTextAlignment​(TextBoxBase.TextAlignConstant align)

      Deprecated.
      use `ValueBoxBase.setAlignment(TextAlignment)`
      Legacy wrapper for `ValueBoxBase.setAlignment(TextAlignment)`.