Class CmsDateField

  • All Implemented Interfaces:
    com.vaadin.data.HasValue<java.time.LocalDateTime>, com.vaadin.event.ContextClickEvent.ContextClickNotifier, com.vaadin.event.FieldEvents.BlurNotifier, com.vaadin.event.FieldEvents.FocusNotifier, com.vaadin.event.MethodEventSource, com.vaadin.server.ClientConnector, com.vaadin.server.Sizeable, com.vaadin.shared.Connector, com.vaadin.ui.Component, com.vaadin.ui.Component.Focusable, java.io.Serializable

    public class CmsDateField
    extends com.vaadin.ui.DateTimeField
    Convenience subclass of PopupDateField which comes preconfigured with a resolution and validation error message.

    See Also:
    Serialized Form
    • Nested Class Summary

      • Nested classes/interfaces inherited from interface com.vaadin.server.ClientConnector

        com.vaadin.server.ClientConnector.AttachEvent, com.vaadin.server.ClientConnector.AttachListener, com.vaadin.server.ClientConnector.ConnectorErrorEvent, com.vaadin.server.ClientConnector.DetachEvent, com.vaadin.server.ClientConnector.DetachListener
      • Nested classes/interfaces inherited from interface com.vaadin.ui.Component

        com.vaadin.ui.Component.ErrorEvent, com.vaadin.ui.Component.Event, com.vaadin.ui.Component.Focusable, com.vaadin.ui.Component.Listener
      • Nested classes/interfaces inherited from interface com.vaadin.data.HasValue

        com.vaadin.data.HasValue.ValueChangeEvent<V extends java.lang.Object>, com.vaadin.data.HasValue.ValueChangeListener<V extends java.lang.Object>
      • Nested classes/interfaces inherited from interface com.vaadin.server.Sizeable

        com.vaadin.server.Sizeable.Unit
    • Field Summary

      • Fields inherited from class com.vaadin.ui.AbstractComponent

        DESIGN_ATTR_PLAIN_TEXT
      • Fields inherited from interface com.vaadin.server.Sizeable

        SIZE_UNDEFINED, UNITS_CM, UNITS_EM, UNITS_EX, UNITS_INCH, UNITS_MM, UNITS_PERCENTAGE, UNITS_PICAS, UNITS_PIXELS, UNITS_POINTS
    • Constructor Summary

      Constructors 
      Constructor Description
      CmsDateField()
      Creates a new instance.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static java.time.LocalDateTime dateToLocalDateTime​(java.util.Date date)
      Converts a Date object to a LocalDateTime object.
      java.util.Date getDate()
      Convenience method returning the field value converted to date.
      static java.util.Date localDateTimeToDate​(java.time.LocalDateTime local)
      Converts a LocalDateTime object to a Date object.
      void setDate​(java.util.Date date)
      Convenience method to set the LocalDateTime field value to the given date.
      • Methods inherited from class com.vaadin.ui.DateTimeField

        getAssistiveText, getPlaceholder, getState, getState, isTextFieldEnabled, setAssistiveText, setPlaceholder, setTextFieldEnabled
      • Methods inherited from class com.vaadin.ui.AbstractLocalDateTimeField

        adjustToResolution, buildDate, convertFromDate, convertToDate, formatDate, getDatePart, getRangeValidator, toType
      • Methods inherited from class com.vaadin.ui.AbstractDateField

        addBlurListener, addFocusListener, afterDate, beforeClientResponse, convertFromDateString, convertToDateString, doSetValue, getAssistiveLabel, getDateFormat, getDateOutOfRangeMessage, getDateStyle, getDateStyles, getDefaultValidator, getDefaultValue, getParseErrorMessage, getRangeEnd, getRangeStart, getResolution, getValue, getZoneId, handleUnparsableDateString, isLenient, isPreventInvalidInput, isShowISOWeekNumbers, readDesign, reconstructDateFromFields, setAssistiveLabel, setDateFormat, setDateOutOfRangeMessage, setDateStyle, setDaylightSavingTimeRange, setDefaultValue, setLenient, setLocale, setParseErrorMessage, setPreventInvalidInput, setRangeEnd, setRangeStart, setResolution, setShowISOWeekNumbers, setValue, setZoneId, writeDesign
      • Methods inherited from class com.vaadin.ui.AbstractField

        addValueChangeListener, createValueChange, focus, getCustomAttributes, getTabIndex, isDifferentValue, isReadOnly, isRequiredIndicatorVisible, setReadOnly, setRequiredIndicatorVisible, setTabIndex, setValue
      • Methods inherited from class com.vaadin.ui.AbstractComponent

        addContextClickListener, addListener, addShortcutListener, addStyleName, attach, detach, findAncestor, fireComponentErrorEvent, fireComponentEvent, getActionManager, getCaption, getComponentError, getData, getDebugId, getDescription, getErrorMessage, getHeight, getHeightUnits, getIcon, getId, getLocale, getParent, getPrimaryStyleName, getStyleName, getWidth, getWidthUnits, isCaptionAsHtml, isConnectorEnabled, isEnabled, isOrHasAncestor, isResponsive, isVisible, removeContextClickListener, removeListener, removeShortcutListener, removeStyleName, setCaption, setCaptionAsHtml, setComponentError, setData, setDebugId, setDescription, setDescription, setEnabled, setHeight, setHeight, setHeightFull, setHeightUndefined, setIcon, setId, setParent, setPrimaryStyleName, setResponsive, setSizeFull, setSizeUndefined, setStyleName, setVisible, setWidth, setWidth, setWidthFull, setWidthUndefined
      • Methods inherited from class com.vaadin.server.AbstractClientConnector

        addAttachListener, addDetachListener, addExtension, addListener, addListener, addListener, addListener, addListener, addListener, addMethodInvocationToQueue, createState, encodeState, equals, fireEvent, getAllChildrenIterable, getConnectorId, getErrorHandler, getExtensions, getListeners, getResource, getRpcManager, getRpcProxy, getSession, getStateType, getUI, handleConnectorRequest, hashCode, hasListeners, isAttached, isThis, markAsDirty, markAsDirtyRecursive, registerRpc, registerRpc, removeAttachListener, removeDetachListener, removeExtension, removeListener, removeListener, removeListener, removeListener, removeListener, requestRepaint, requestRepaintAll, retrievePendingRpcCalls, setErrorHandler, setResource, updateDiffstate
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface com.vaadin.server.ClientConnector

        addAttachListener, addDetachListener, detach, encodeState, getErrorHandler, getExtensions, getRpcManager, getStateType, handleConnectorRequest, isAttached, isConnectorEnabled, markAsDirty, markAsDirtyRecursive, removeAttachListener, removeDetachListener, removeExtension, requestRepaint, requestRepaintAll, retrievePendingRpcCalls, setErrorHandler
      • Methods inherited from interface com.vaadin.ui.Component

        addListener, addStyleName, addStyleNames, attach, getCaption, getDescription, getIcon, getId, getLocale, getParent, getPrimaryStyleName, getStyleName, getUI, isEnabled, isVisible, removeListener, removeStyleName, removeStyleNames, setCaption, setEnabled, setIcon, setId, setParent, setPrimaryStyleName, setStyleName, setStyleName, setVisible
      • Methods inherited from interface com.vaadin.shared.Connector

        getConnectorId
      • Methods inherited from interface com.vaadin.data.HasValue

        clear, getEmptyValue, getOptionalValue, isEmpty
      • Methods inherited from interface com.vaadin.server.Sizeable

        getHeight, getHeightUnits, getWidth, getWidthUnits, setHeight, setHeight, setHeightFull, setHeightUndefined, setSizeFull, setSizeUndefined, setWidth, setWidth, setWidthFull, setWidthUndefined
    • Constructor Detail

      • CmsDateField

        public CmsDateField()
        Creates a new instance.
    • Method Detail

      • dateToLocalDateTime

        public static java.time.LocalDateTime dateToLocalDateTime​(java.util.Date date)
        Converts a Date object to a LocalDateTime object.

        Parameters:
        date - the date
        Returns:
        the local date time
      • localDateTimeToDate

        public static java.util.Date localDateTimeToDate​(java.time.LocalDateTime local)
        Converts a LocalDateTime object to a Date object.

        Parameters:
        local - the local date time
        Returns:
        the date
      • getDate

        public java.util.Date getDate()
        Convenience method returning the field value converted to date.

        Returns:
        the date
      • setDate

        public void setDate​(java.util.Date date)
        Convenience method to set the LocalDateTime field value to the given date.

        Parameters:
        date - the date to set