com.google.gwt.user.client.ui
Class ValueBox<T>

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<T>
                  extended by com.google.gwt.user.client.ui.ValueBox<T>
Type Parameters:
T - the value type
All Implemented Interfaces:
HasAllFocusHandlers, HasAllKeyHandlers, HasAllMouseHandlers, HasBlurHandlers, HasChangeHandlers, HasClickHandlers, HasFocusHandlers, HasKeyDownHandlers, HasKeyPressHandlers, HasKeyUpHandlers, HasMouseDownHandlers, HasMouseMoveHandlers, HasMouseOutHandlers, HasMouseOverHandlers, HasMouseUpHandlers, HasMouseWheelHandlers, HasValueChangeHandlers<T>, HasHandlers, AutoDirectionHandler.Target, HasDirection, HasDirectionEstimator, EventListener, Focusable, HasFocus, HasName, HasText, HasValue<T>, SourcesChangeEvents, SourcesClickEvents, SourcesFocusEvents, SourcesKeyboardEvents, SourcesMouseEvents, TakesValue<T>
Direct Known Subclasses:
DoubleBox, IntegerBox, LongBox

public class ValueBox<T>
extends ValueBoxBase<T>
implements HasDirection

Experimental API: This class is still under rapid development, and is very likely to be deleted. Use it at your own risk.

A text box able to parse its displayed value.


Nested Class Summary
 
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.UIObject
DEBUG_ID_PREFIX
 
Method Summary
 HasDirection.Direction getDirection()
          Gets the directionality of the widget.
 int getMaxLength()
          Gets the maximum allowable length.
 int getVisibleLength()
          Gets the number of visible characters.
 void setDirection(HasDirection.Direction direction)
          Sets the directionality for a widget.
 void setMaxLength(int length)
          Sets the maximum allowable length.
 void setVisibleLength(int length)
          Sets the number of visible characters.
static
<T> ValueBox<T>
wrap(Element element, Renderer<T> renderer, Parser<T> parser)
          Creates a ValueBox 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, getDirectionEstimator, getName, getSelectedText, getSelectionLength, getText, getValue, getValueOrThrow, isReadOnly, onBrowserEvent, removeChangeListener, selectAll, setCursorPos, 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
 

Method Detail

wrap

public static <T> ValueBox<T> wrap(Element element,
                                   Renderer<T> renderer,
                                   Parser<T> parser)
Creates a ValueBox 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

getDirection

public HasDirection.Direction getDirection()
Description copied from interface: HasDirection
Gets the directionality of the widget.

Specified by:
getDirection in interface HasDirection
Overrides:
getDirection in class ValueBoxBase<T>
Returns:
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

getMaxLength

public int getMaxLength()
Gets the maximum allowable length.

Returns:
the maximum length, in characters

getVisibleLength

public int getVisibleLength()
Gets the number of visible characters.

Returns:
the number of visible characters

setDirection

public void setDirection(HasDirection.Direction direction)
Description copied from interface: HasDirection
Sets the directionality for a widget.

Specified by:
setDirection in interface HasDirection
Overrides:
setDirection in class ValueBoxBase<T>
Parameters:
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

setMaxLength

public void setMaxLength(int length)
Sets the maximum allowable length.

Parameters:
length - the maximum length, in characters

setVisibleLength

public void setVisibleLength(int length)
Sets the number of visible characters.

Parameters:
length - the number of visible characters