public class UTCTimeBoxImplHtml4 extends UTCTimeBoxImplShared
It will use the GWT DateTimeFormat to parse in the browser timezone, but it will then convert the time to be independent of timezone.
It will first parse a manually typed date using the time format specified (defaulting to TIME_SHORT). It will then attempt the following formats in order: "hh:mm a", "hh:mma", "HH:mm". If all of these fail, it will attempt to insert a colon in the right place (e.g. 12 -> 12:00, 123 -> 1:23, and 1234 -> 12:34) and try the specified time format and the fallback formats again.
The control supports an unspecified value of null with a blank textbox.
UIObject.DebugIdImpl, UIObject.DebugIdImplEnabled
fallbackFormatStrings, fallbackTimeFormats, timeFormat
DEBUG_ID_PREFIX
Constructor and Description |
---|
UTCTimeBoxImplHtml4()
Allows a UTCTimeBox to be created with a specified format.
|
Modifier and Type | Method and Description |
---|---|
HandlerRegistration |
addValueChangeHandler(ValueChangeHandler<Long> handler) |
void |
clearInvalidStyle() |
String |
getText() |
TextBox |
getTextBox()
Returns the TextBox on which this control is based.
|
Long |
getValue()
Returns the time value (as milliseconds since midnight
independent of time zone)
|
boolean |
hasValidValue()
A valid value is either empty (null) or filled with a valid
time.
|
boolean |
hasValue() |
void |
hideMenu()
Hides the time picker menu
|
protected boolean |
isSameValue(Long a,
Long b) |
void |
setTabIndex(int tabIndex)
Sets the tab index for the control.
|
void |
setText(String text) |
void |
setTimeFormat(DateTimeFormat timeFormat)
Sets the DateTimeFormat for this UTCTimeBox.
|
void |
setValue(Long value,
boolean fireEvents)
Sets the time value (as milliseconds since midnight independent
of time zone)
|
protected void |
setValue(Long value,
boolean updateTextBox,
boolean fireEvents) |
void |
setVisibleLength(int length)
Sets the visible length of the time input.
|
void |
showMenu()
Displays the time picker menu
|
protected void |
syncTextToValue(Long value) |
protected void |
syncValueToText() |
void |
validate()
Validates the value that has been typed into the text input.
|
formatUsingFormat, normalizeInLocalRange, parseUsingFallbacks, parseUsingFallbacksWithColon, parseUsingFormat, setValue, text2value, value2text
claimElement, getWidget, initializeClaimedElement, initWidget, isAttached, onAttach, onBrowserEvent, onDetach, render, render, resolvePotentialElement, setWidget
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, doAttachChildren, doDetachChildren, fireEvent, getHandlerCount, getLayoutData, getParent, isOrWasAttached, onLoad, onUnload, removeFromParent, setLayoutData, sinkEvents, unsinkEvents
addStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, getTitle, isVisible, isVisible, onEnsureDebugId, removeStyleDependentName, removeStyleName, setElement, setElement, setHeight, setPixelSize, setSize, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setTitle, setVisible, setVisible, setWidth, sinkBitlessEvent, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
fireEvent
public UTCTimeBoxImplHtml4()
public void setTimeFormat(DateTimeFormat timeFormat)
UTCTimeBoxImplShared
setTimeFormat
in interface UTCTimeBoxImpl
setTimeFormat
in class UTCTimeBoxImplShared
public TextBox getTextBox()
public void showMenu()
public void hideMenu()
public boolean hasValue()
public boolean hasValidValue()
public Long getValue()
public void setValue(Long value, boolean fireEvents)
protected void setValue(Long value, boolean updateTextBox, boolean fireEvents)
public HandlerRegistration addValueChangeHandler(ValueChangeHandler<Long> handler)
public String getText()
public void setText(String text)
protected void syncTextToValue(Long value)
protected void syncValueToText()
public void validate()
UTCTimeBoxImplShared
validate
in interface UTCTimeBoxImpl
validate
in class UTCTimeBoxImplShared
public void setVisibleLength(int length)
UTCTimeBoxImplShared
setVisibleLength
in interface UTCTimeBoxImpl
setVisibleLength
in class UTCTimeBoxImplShared
public void setTabIndex(int tabIndex)
UTCTimeBoxImpl
public void clearInvalidStyle()
Copyright © 2015. All Rights Reserved.