Package com.vaadin.client.ui
Class VPopupTimeCalendar
- java.lang.Object
-
- com.google.gwt.user.client.ui.UIObject
-
- com.google.gwt.user.client.ui.Widget
-
- com.google.gwt.user.client.ui.Panel
-
- com.google.gwt.user.client.ui.ComplexPanel
-
- com.google.gwt.user.client.ui.FlowPanel
-
- com.vaadin.client.ui.VDateField<R>
-
- com.vaadin.client.ui.VAbstractTextualDate<R>
-
- com.vaadin.client.ui.VAbstractPopupCalendar<VDateTimeCalendarPanel,DateTimeResolution>
-
- com.vaadin.client.ui.VPopupTimeCalendar
-
- All Implemented Interfaces:
com.google.gwt.event.dom.client.ChangeHandler,com.google.gwt.event.dom.client.ClickHandler,com.google.gwt.event.dom.client.KeyDownHandler,com.google.gwt.event.logical.shared.CloseHandler<com.google.gwt.user.client.ui.PopupPanel>,com.google.gwt.event.logical.shared.HasAttachHandlers,com.google.gwt.event.shared.EventHandler,com.google.gwt.event.shared.HasHandlers,com.google.gwt.user.client.EventListener,com.google.gwt.user.client.ui.HasEnabled,com.google.gwt.user.client.ui.HasVisibility,com.google.gwt.user.client.ui.HasWidgets,com.google.gwt.user.client.ui.HasWidgets.ForIsWidget,com.google.gwt.user.client.ui.IndexedPanel,com.google.gwt.user.client.ui.IndexedPanel.ForIsWidget,com.google.gwt.user.client.ui.InsertPanel,com.google.gwt.user.client.ui.InsertPanel.ForIsWidget,com.google.gwt.user.client.ui.IsWidget,Focusable,HandlesAriaCaption,HandlesAriaInvalid,HandlesAriaRequired,Field,SubPartAware,Iterable<com.google.gwt.user.client.ui.Widget>
public class VPopupTimeCalendar extends VAbstractPopupCalendar<VDateTimeCalendarPanel,DateTimeResolution>
Represents a date-time selection component with a text field and a pop-up date-and-time selector.- Since:
- 8.0
- Author:
- Vaadin Ltd
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.UIObject
com.google.gwt.user.client.ui.UIObject.DebugIdImpl, com.google.gwt.user.client.ui.UIObject.DebugIdImplEnabled
-
Nested classes/interfaces inherited from interface com.google.gwt.user.client.ui.HasWidgets
com.google.gwt.user.client.ui.HasWidgets.ForIsWidget
-
-
Field Summary
-
Fields inherited from class com.vaadin.client.ui.VAbstractPopupCalendar
calendar, calendarToggle, parsable, popup
-
Fields inherited from class com.vaadin.client.ui.VAbstractTextualDate
lenient, text
-
Fields inherited from class com.vaadin.client.ui.VDateField
bufferedDateString, bufferedResolutions, CLASSNAME, client, connector, currentLocale, dts, enabled, readonly, rpc, showISOWeekNumbers
-
-
Constructor Summary
Constructors Constructor Description VPopupTimeCalendar()Constructs a date-time selection component with a text field and a pop-up date-and-time selector.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected StringcleanFormat(String format)Clean date format string to make it suitable forVAbstractTextualDate.getFormatString().protected StringcreateFormatString()Create a format string suitable for the widget in its current state.protected DateTimeResolution[]doGetResolutions()Returns all available resolutions as an array.protected DategetDate(Map<DateTimeResolution,Integer> dateValues)Returns a date based on the provided date values map.booleanisYear(DateTimeResolution resolution)Checks whether the givenresolutionrepresents an year.static DatemakeDate(Map<DateTimeResolution,Integer> dateValues)Creates a date based on the provided date values map.StringresolutionAsString()Returns a current resolution as a string.voidsetCurrentResolution(DateTimeResolution resolution)Sets the resolution.protected booleansupportsTime()Checks whether time is supported by this widget.protected voidupdateBufferedResolutions()UpdatesbufferedResolutionsbefore sending a response to the server.voidupdateValue(Date newDate)Changes the current date, and updates theVDateField.bufferedResolutions, possiblyVDateField.sendBufferedValues()to the server if needed.-
Methods inherited from class com.vaadin.client.ui.VAbstractPopupCalendar
bindAriaCaption, buildDate, buildDate, closeCalendarPanel, getDescriptionForAssistiveDevices, getOpenCalenderPanelKey, getSubPartElement, getSubPartName, hasChildFocus, isTextFieldEnabled, onAttach, onBrowserEvent, onClick, onClose, onDetach, openCalendarPanel, setDescriptionForAssistiveDevices, setEnabled, setFocus, setFocusedDate, setRangeEnd, setRangeStart, setStyleName, setStylePrimaryName, setTextFieldEnabled, setTextFieldTabIndex, updateStyleNames, updateTextFieldEnabled
-
Methods inherited from class com.vaadin.client.ui.VAbstractTextualDate
checkGroupFocus, focus, getFormatString, getISODate, getPlaceHolder, getText, onChange, onKeyDown, setAriaInvalid, setAriaRequired, setFormatString, setISODate, setPlaceholder, setText, setTimeZone, updateAndSendBufferedValues, updateBufferedValues
-
Methods inherited from class com.vaadin.client.ui.VDateField
getClient, getCurrentDate, getCurrentLocale, getCurrentResolution, getDate, getDateTimeService, getDefaultDate, getId, getResolutions, getResolutionVariable, isEnabled, isReadonly, isShowISOWeekNumbers, sendBufferedValues, sendBufferedValuesWithDelay, setCurrentDate, setCurrentDate, setCurrentLocale, setDate, setDefaultDate, setDefaultDate, setReadonly, setShowISOWeekNumbers
-
Methods inherited from class com.google.gwt.user.client.ui.ComplexPanel
add, add, adjustIndex, checkIndexBoundsForAccess, checkIndexBoundsForInsertion, getChildren, getWidget, getWidgetCount, getWidgetIndex, getWidgetIndex, insert, insert, iterator, remove, remove
-
Methods inherited from class com.google.gwt.user.client.ui.Panel
add, adopt, doAttachChildren, doDetachChildren, orphan, remove
-
Methods inherited from class com.google.gwt.user.client.ui.Widget
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, fireEvent, getHandlerCount, getLayoutData, getParent, isAttached, isOrWasAttached, onLoad, onUnload, removeFromParent, setLayoutData, 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, 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.user.client.ui.IndexedPanel
getWidget, getWidgetCount, getWidgetIndex, remove
-
Methods inherited from interface com.google.gwt.user.client.ui.IndexedPanel.ForIsWidget
getWidgetIndex
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Constructor Detail
-
VPopupTimeCalendar
public VPopupTimeCalendar()
Constructs a date-time selection component with a text field and a pop-up date-and-time selector. Uses aVDateTimeCalendarPanelas the pop-up content. Default resolution isDateTimeResolution.MINUTE.
-
-
Method Detail
-
doGetResolutions
protected DateTimeResolution[] doGetResolutions()
Description copied from class:VDateFieldReturns all available resolutions as an array.No any order is required (in contrary to
VDateField.getResolutions().- Specified by:
doGetResolutionsin classVDateField<DateTimeResolution>- Returns:
- all available resolutions
- See Also:
VDateField.getResolutions()
-
resolutionAsString
public String resolutionAsString()
Description copied from class:VDateFieldReturns a current resolution as a string.The method is used to generate a style name for the current resolution.
- Specified by:
resolutionAsStringin classVDateField<DateTimeResolution>- Returns:
- the current resolution as a string
-
setCurrentResolution
public void setCurrentResolution(DateTimeResolution resolution)
Description copied from class:VDateFieldSets the resolution.- Overrides:
setCurrentResolutionin classVDateField<DateTimeResolution>- Parameters:
resolution- the new resolution
-
makeDate
public static Date makeDate(Map<DateTimeResolution,Integer> dateValues)
Creates a date based on the provided date values map.- Parameters:
dateValues- a map with date values to convert into a date- Returns:
- the date based on the dateValues map
-
isYear
public boolean isYear(DateTimeResolution resolution)
Description copied from class:VDateFieldChecks whether the givenresolutionrepresents an year.- Specified by:
isYearin classVDateField<DateTimeResolution>- Parameters:
resolution- the given resolution- Returns:
trueif theresolutionrepresents an year
-
getDate
protected Date getDate(Map<DateTimeResolution,Integer> dateValues)
Description copied from class:VDateFieldReturns a date based on the provided date values map.- Specified by:
getDatein classVDateField<DateTimeResolution>- Parameters:
dateValues- a map with date values to convert into a date- Returns:
- the date based on the dateValues map
- See Also:
VDateField.setCurrentDate(Map)
-
updateBufferedResolutions
protected void updateBufferedResolutions()
Description copied from class:VAbstractTextualDateUpdatesbufferedResolutionsbefore sending a response to the server.The method can be overridden by subclasses to provide a custom logic for date variables to avoid overriding the
VAbstractTextualDate.onChange(ChangeEvent)method.Note that this method should not send the buffered values. For that, use
VDateField.sendBufferedValues().- Overrides:
updateBufferedResolutionsin classVAbstractTextualDate<DateTimeResolution>
-
updateValue
public void updateValue(Date newDate)
Description copied from class:VAbstractPopupCalendarChanges the current date, and updates theVDateField.bufferedResolutions, possiblyVDateField.sendBufferedValues()to the server if needed.- Overrides:
updateValuein classVAbstractPopupCalendar<VDateTimeCalendarPanel,DateTimeResolution>- Parameters:
newDate- the newDateto update
-
createFormatString
protected String createFormatString()
Description copied from class:VAbstractTextualDateCreate a format string suitable for the widget in its current state.- Overrides:
createFormatStringin classVAbstractTextualDate<DateTimeResolution>- Returns:
- a date format string to use when formatting and parsing the text in the input field
-
cleanFormat
protected String cleanFormat(String format)
Description copied from class:VAbstractTextualDateClean date format string to make it suitable forVAbstractTextualDate.getFormatString().- Overrides:
cleanFormatin classVAbstractTextualDate<DateTimeResolution>- Parameters:
format- date format string- Returns:
- cleaned up string
- See Also:
VAbstractTextualDate.getFormatString()
-
supportsTime
protected boolean supportsTime()
Description copied from class:VDateFieldChecks whether time is supported by this widget.- Specified by:
supportsTimein classVDateField<DateTimeResolution>- Returns:
trueif time is supported in addition to date,falseif only dates are supported
-
-