Class DateField

    • Constructor Detail

      • DateField

        public DateField()
        Deprecated.
        Constructs an empty DateField with no caption.
      • DateField

        public DateField​(String caption)
        Deprecated.
        Constructs an empty DateField with caption.
        Parameters:
        caption - the caption of the datefield.
      • DateField

        public DateField​(String caption,
                         Property dataSource)
        Deprecated.
        Constructs a new DateField that's bound to the specified Property and has the given caption String.
        Parameters:
        caption - the caption String for the editor.
        dataSource - the Property to be edited with this editor.
      • DateField

        public DateField​(Property dataSource)
                  throws IllegalArgumentException
        Deprecated.
        Constructs a new DateField that's bound to the specified Property and has no caption.
        Parameters:
        dataSource - the Property to be edited with this editor.
        Throws:
        IllegalArgumentException
      • DateField

        public DateField​(String caption,
                         Date value)
        Deprecated.
        Constructs a new DateField with the given caption and initial text contents. The editor constructed this way will not be bound to a Property unless Property.Viewer.setPropertyDataSource(Property) is called to bind it.
        Parameters:
        caption - the caption String for the editor.
        value - the Date value.
    • Method Detail

      • shouldHideErrors

        protected boolean shouldHideErrors()
        Deprecated.
        Description copied from class: AbstractField
        Returns true if the error indicator be hidden when painting the component even when there are errors. This is a mostly internal method, but can be overridden in subclasses e.g. if the error indicator should also be shown for empty fields in some cases.
        Overrides:
        shouldHideErrors in class AbstractField<Date>
        Returns:
        true to hide the error indicator, false to use the normal logic to show it when there are errors
      • setRangeStart

        public void setRangeStart​(Date startDate)
        Deprecated.
        Sets the start range for this component. If the value is set before this date (taking the resolution into account), the component will not validate. If startDate is set to null, any value before endDate will be accepted by the range
        Parameters:
        startDate - - the allowed range's start date
      • setDateOutOfRangeMessage

        public void setDateOutOfRangeMessage​(String dateOutOfRangeMessage)
        Deprecated.
        Sets the current error message if the range validation fails.
        Parameters:
        dateOutOfRangeMessage - - Localizable message which is shown when value (the date) is set outside allowed range
      • setRangeEnd

        public void setRangeEnd​(Date endDate)
        Deprecated.
        Sets the end range for this component. If the value is set after this date (taking the resolution into account), the component will not validate. If endDate is set to null, any value after startDate will be accepted by the range.
        Parameters:
        endDate - - the allowed range's end date (inclusive, based on the current resolution)
      • getRangeStart

        public Date getRangeStart()
        Deprecated.
        Returns the precise rangeStart used.
      • getRangeEnd

        public Date getRangeEnd()
        Deprecated.
        Returns the precise rangeEnd used.
      • discard

        public void discard()
        Deprecated.
        Description copied from interface: Buffered
        Discards all changes since last commit. The object updates its value from the data source.
        Specified by:
        discard in interface Buffered
        Overrides:
        discard in class AbstractField<Date>
      • fireValueChange

        protected void fireValueChange​(boolean repaintIsNotNeeded)
        Deprecated.
        Description copied from class: AbstractField
        Emits the value change event. The value contained in the field is validated before the event is created.
        Overrides:
        fireValueChange in class AbstractField<Date>
      • handleUnparsableDateString

        protected Date handleUnparsableDateString​(String dateString)
                                           throws Converter.ConversionException
        Deprecated.
        This method is called to handle a non-empty date string from the client if the client could not parse it as a Date. By default, a Converter.ConversionException is thrown, and the current value is not modified. This can be overridden to handle conversions, to return null (equivalent to empty input), to throw an exception or to fire an event.
        Parameters:
        dateString -
        Returns:
        parsed Date
        Throws:
        Converter.ConversionException - to keep the old value and indicate an error
      • getType

        public Class<Date> getType()
        Deprecated.
        Description copied from class: AbstractField
        Returns the type of the Field. The methods getValue and setValue must be compatible with this type: one must be able to safely cast the value returned from getValue to the given type and pass any variable assignable to this type as an argument to setValue.
        Specified by:
        getType in interface Property<Date>
        Specified by:
        getType in class AbstractField<Date>
        Returns:
        the type of the Field
      • setInternalValue

        protected void setInternalValue​(Date newValue)
        Deprecated.
        Description copied from class: AbstractField
        Sets the internal field value. This is purely used by AbstractField to change the internal Field value. It does not trigger valuechange events. It can be overridden by the inheriting classes to update all dependent variables. Subclasses can also override AbstractField.getInternalValue() if necessary.
        Overrides:
        setInternalValue in class AbstractField<Date>
        Parameters:
        newValue - the new value to be set.
      • getResolution

        public Resolution getResolution()
        Deprecated.
        Gets the resolution.
        Returns:
        int
      • setResolution

        public void setResolution​(Resolution resolution)
        Deprecated.
        Sets the resolution of the DateField. The default resolution is Resolution.DAY since Vaadin 7.0.
        Parameters:
        resolution - the resolution to set.
      • setDateFormat

        public void setDateFormat​(String dateFormat)
        Deprecated.
        Sets formatting used by some component implementations. See SimpleDateFormat for format details. By default it is encouraged to used default formatting defined by Locale, but due some JVM bugs it is sometimes necessary to use this method to override formatting. See Vaadin issue #2200.
        Parameters:
        dateFormat - the dateFormat to set
        See Also:
        AbstractComponent.setLocale(Locale)
      • getDateFormat

        public String getDateFormat()
        Deprecated.
        Returns a format string used to format date value on client side or null if default formatting from Component.getLocale() is used.
        Returns:
        the dateFormat
      • setLenient

        public void setLenient​(boolean lenient)
        Deprecated.
        Specifies whether or not date/time interpretation in component is to be lenient.
        Parameters:
        lenient - true if the lenient mode is to be turned on; false if it is to be turned off.
        See Also:
        Calendar.setLenient(boolean), isLenient()
      • isLenient

        public boolean isLenient()
        Deprecated.
        Returns whether date/time interpretation is to be lenient.
        Returns:
        true if the interpretation mode of this calendar is lenient; false otherwise.
        See Also:
        setLenient(boolean)
      • isShowISOWeekNumbers

        public boolean isShowISOWeekNumbers()
        Deprecated.
        Checks whether ISO 8601 week numbers are shown in the date selector.
        Returns:
        true if week numbers are shown, false otherwise.
      • setShowISOWeekNumbers

        public void setShowISOWeekNumbers​(boolean showWeekNumbers)
        Deprecated.
        Sets the visibility of ISO 8601 week numbers in the date selector. ISO 8601 defines that a week always starts with a Monday so the week numbers are only shown if this is the case.
        Parameters:
        showWeekNumbers - true if week numbers should be shown, false otherwise.
      • getParseErrorMessage

        public String getParseErrorMessage()
        Deprecated.
        Return the error message that is shown if the user inputted value can't be parsed into a Date object. If handleUnparsableDateString(String) is overridden and it throws a custom exception, the message returned by Throwable.getLocalizedMessage() will be used instead of the value returned by this method.
        Returns:
        the error message that the DateField uses when it can't parse the textual input from user to a Date object
        See Also:
        setParseErrorMessage(String)
      • setTimeZone

        public void setTimeZone​(TimeZone timeZone)
        Deprecated.
        Sets the time zone used by this date field. The time zone is used to convert the absolute time in a Date object to a logical time displayed in the selector and to convert the select time back to a Date object. If no time zone has been set, the current default time zone returned by TimeZone.getDefault() is used.
        Parameters:
        timeZone - the time zone to use for time calculations.
        See Also:
        getTimeZone()
      • getTimeZone

        public TimeZone getTimeZone()
        Deprecated.
        Gets the time zone used by this field. The time zone is used to convert the absolute time in a Date object to a logical time displayed in the selector and to convert the select time back to a Date object. If null is returned, the current default time zone returned by TimeZone.getDefault() is used.
        Returns:
        the current time zone
      • getDateOutOfRangeMessage

        public String getDateOutOfRangeMessage()
        Deprecated.
        Returns current date-out-of-range error message.
        Returns:
        Current error message for dates out of range.
        Since:
        7.4
        See Also:
        setDateOutOfRangeMessage(String)