public class UTCDateBox extends com.google.gwt.user.client.ui.Composite implements com.google.gwt.user.client.ui.HasValue<Long>, com.google.gwt.event.logical.shared.HasValueChangeHandlers<Long>, com.google.gwt.user.client.ui.HasText, com.google.gwt.user.client.ui.HasEnabled
Note: In keeping with the behavior of the GWT DateBox, null is used to represent no value. This means that you should check for null when calling getValue(), just as you would for DateBox. With auto-boxing Long/long, this may seem strange but is consistent.
| Modifier and Type | Field and Description |
|---|---|
static long |
DAY_IN_MS |
| Constructor and Description |
|---|
UTCDateBox()
Creates a new UTCDateBox with the medium date format for the
current locale.
|
UTCDateBox(com.google.gwt.user.datepicker.client.DatePicker picker,
long date,
com.google.gwt.user.datepicker.client.DateBox.Format format)
Deprecated.
Use
UTCDateBox(DateTimeFormat)
instead. DatePicker and DateBox.Format are now
ignored. |
UTCDateBox(com.google.gwt.i18n.client.DateTimeFormat format)
Creates a new UTCDateBox with the specified date format.
|
| Modifier and Type | Method and Description |
|---|---|
com.google.gwt.event.shared.HandlerRegistration |
addValueChangeHandler(com.google.gwt.event.logical.shared.ValueChangeHandler<Long> handler) |
static Long |
date2utc(Date date)
Converts a gwt Date in the timezone of the current browser to a time in
UTC.
|
com.google.gwt.user.datepicker.client.DateBox |
getDateBox() |
String |
getText() |
Long |
getValue()
Returns the date value specified by the DateBox measured in number of
milliseconds since January 1, 1970, 00:00:00 GMT.
|
static Long |
getValueForToday() |
boolean |
isEnabled() |
void |
setEnabled(boolean enabled) |
void |
setTabIndex(int tabIndex)
Sets the tabindex for this control.
|
void |
setText(String text) |
void |
setValue(Long value)
Sets the value in the DateBox.
|
void |
setValue(Long value,
boolean fireEvents)
Sets the value in the DateBox.
|
void |
setVisibleLength(int length)
Sets the visible length of the text input for this date box.
|
static long |
timezoneOffsetMillis(Date date)
Returns the timezone offset for the specified Date.
|
static long |
trimTimeToMidnight(long time) |
static Date |
utc2date(Long time)
Converts a time in UTC to a gwt Date object which is in the timezone of
the current browser.
|
claimElement, getWidget, initializeClaimedElement, initWidget, isAttached, onAttach, onBrowserEvent, onDetach, render, render, resolvePotentialElement, setWidgetaddAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, doAttachChildren, doDetachChildren, fireEvent, getHandlerCount, getLayoutData, getParent, isOrWasAttached, onLoad, onUnload, removeFromParent, setLayoutData, sinkEvents, unsinkEventsaddStyleDependentName, 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, toStringpublic static final long DAY_IN_MS
public UTCDateBox()
public UTCDateBox(com.google.gwt.i18n.client.DateTimeFormat format)
@Deprecated public UTCDateBox(com.google.gwt.user.datepicker.client.DatePicker picker, long date, com.google.gwt.user.datepicker.client.DateBox.Format format)
UTCDateBox(DateTimeFormat)
instead. DatePicker and DateBox.Format are now
ignored.public String getText()
getText in interface com.google.gwt.user.client.ui.HasTextpublic void setText(String text)
setText in interface com.google.gwt.user.client.ui.HasTextpublic Long getValue()
public void setValue(Long value)
setValue in interface com.google.gwt.user.client.TakesValue<Long>setValue in interface com.google.gwt.user.client.ui.HasValue<Long>value - A time measured in the number of milliseconds since January 1,
1970, 00:00:00 GMT. This time should be at midnight in GMT for
the Date selected.
If value is null or represents a negative number, the DateBox will have no value.
public void setValue(Long value, boolean fireEvents)
setValue in interface com.google.gwt.user.client.ui.HasValue<Long>value - A time measured in the number of milliseconds since January 1,
1970, 00:00:00 GMT. This time should be at midnight in GMT for
the Date selected.
If value is null or represents a negative number, the DateBox will have no value.
public com.google.gwt.event.shared.HandlerRegistration addValueChangeHandler(com.google.gwt.event.logical.shared.ValueChangeHandler<Long> handler)
addValueChangeHandler in interface com.google.gwt.event.logical.shared.HasValueChangeHandlers<Long>public boolean isEnabled()
isEnabled in interface com.google.gwt.user.client.ui.HasEnabledpublic void setEnabled(boolean enabled)
setEnabled in interface com.google.gwt.user.client.ui.HasEnabledpublic void setVisibleLength(int length)
public void setTabIndex(int tabIndex)
public com.google.gwt.user.datepicker.client.DateBox getDateBox()
public static final long trimTimeToMidnight(long time)
public static final Date utc2date(Long time)
public static final Long date2utc(Date date)
public static final Long getValueForToday()
public static final long timezoneOffsetMillis(Date date)
Copyright © 2001–2016 JBoss by Red Hat. All rights reserved.