Class DateRenderer

All Implemented Interfaces:
ClientConnector, FAbstractClientConnector, Renderer<Date>, Serializable

public class DateRenderer extends FGrid.AbstractRenderer<Date>
A renderer for presenting date values.
Author:
Vaadin Ltd
See Also:
  • Constructor Details

    • DateRenderer

      public DateRenderer()
      Creates a new date renderer.

      The renderer is configured to render with the Date.toString() representation for the default locale.

    • DateRenderer

      public DateRenderer(Locale locale) throws IllegalArgumentException
      Creates a new date renderer.

      The renderer is configured to render with the Date.toString() representation for the given locale.

      Parameters:
      locale - the locale in which to present dates
      Throws:
      IllegalArgumentException - if locale is null
    • DateRenderer

      public DateRenderer(Locale locale, String nullRepresentation) throws IllegalArgumentException
      Creates a new date renderer.

      The renderer is configured to render with the Date.toString() representation for the given locale.

      Parameters:
      locale - the locale in which to present dates
      nullRepresentation - the textual representation of null value
      Throws:
      IllegalArgumentException - if locale is null
    • DateRenderer

      public DateRenderer(String formatString) throws IllegalArgumentException
      Creates a new date renderer.

      The renderer is configured to render with the given string format, as displayed in the default locale.

      Parameters:
      formatString - the format string with which to format the date
      Throws:
      IllegalArgumentException - if formatString is null
      See Also:
    • DateRenderer

      public DateRenderer(String formatString, String nullRepresentation) throws IllegalArgumentException
      Creates a new date renderer.

      The renderer is configured to render with the given string format, as displayed in the default locale.

      Parameters:
      formatString - the format string with which to format the date
      nullRepresentation - the textual representation of null value
      Throws:
      IllegalArgumentException - if formatString is null
      See Also:
    • DateRenderer

      public DateRenderer(String formatString, Locale locale) throws IllegalArgumentException
      Creates a new date renderer.

      The renderer is configured to render with the given string format, as displayed in the given locale.

      Parameters:
      formatString - the format string to format the date with
      locale - the locale to use
      Throws:
      IllegalArgumentException - if either argument is null
      See Also:
    • DateRenderer

      public DateRenderer(String formatString, Locale locale, String nullRepresentation) throws IllegalArgumentException
      Creates a new date renderer.

      The renderer is configured to render with the given string format, as displayed in the given locale.

      Parameters:
      formatString - the format string to format the date with
      locale - the locale to use
      nullRepresentation - the textual representation of null value
      Throws:
      IllegalArgumentException - if either argument is null
      See Also:
    • DateRenderer

      public DateRenderer(DateFormat dateFormat) throws IllegalArgumentException
      Creates a new date renderer.

      The renderer is configured to render with he given date format.

      Parameters:
      dateFormat - the date format to use when rendering dates
      Throws:
      IllegalArgumentException - if dateFormat is null
    • DateRenderer

      public DateRenderer(DateFormat dateFormat, String nullRepresentation) throws IllegalArgumentException
      Creates a new date renderer.

      The renderer is configured to render with he given date format.

      Parameters:
      dateFormat - the date format to use when rendering dates
      Throws:
      IllegalArgumentException - if dateFormat is null
  • Method Details

    • getNullRepresentation

      public String getNullRepresentation()
      Description copied from class: FGrid.AbstractRenderer
      Null representation for the renderer
      Overrides:
      getNullRepresentation in class FGrid.AbstractRenderer<Date>
      Returns:
      a textual representation of null
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getRenderer

      public com.vaadin.flow.data.renderer.Renderer<Date> getRenderer()
      Description copied from interface: Renderer
      Returns the Flow Renderer that will be used to render the items of type T.
      Returns:
      the Flow Renderer for type T