Class CmsDateField

java.lang.Object
com.vaadin.server.AbstractClientConnector
com.vaadin.ui.AbstractComponent
com.vaadin.ui.AbstractField<T>
com.vaadin.ui.AbstractDateField<LocalDateTime,com.vaadin.shared.ui.datefield.DateTimeResolution>
com.vaadin.ui.AbstractLocalDateTimeField
com.vaadin.ui.DateTimeField
org.opencms.ui.components.CmsDateField
All Implemented Interfaces:
com.vaadin.data.HasValue<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, 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:
  • 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 Object>, com.vaadin.data.HasValue.ValueChangeListener<V extends 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
    Creates a new instance.<p<
  • Method Summary

    Modifier and Type
    Method
    Description
    Converts a Date object to a LocalDateTime object.
    Convenience method returning the field value converted to date.
    static Date
    Converts a LocalDateTime object to a Date object.
    void
    setDate(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 Details

    • CmsDateField

      public CmsDateField()
      Creates a new instance.<p<
  • Method Details

    • dateToLocalDateTime

      public static LocalDateTime dateToLocalDateTime(Date date)
      Converts a Date object to a LocalDateTime object.

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

      public static Date localDateTimeToDate(LocalDateTime local)
      Converts a LocalDateTime object to a Date object.

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

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

      Returns:
      the date
    • setDate

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

      Parameters:
      date - the date to set