Interface DateChooser.YearTitleFormatter

Enclosing class:
DateChooser

public static interface DateChooser.YearTitleFormatter
A customizer that allows you to alter the year representations used in various places in the DateChooser widget. NOTE: DateChooser instances are typically not directly created by application code, they are normally created as autoChildren of DateItems, at the Javascript level. To use a YearTitleFormatter in this common case, you will need to create a DateChooser subclass, mark it for processing by the BeanFactory reflection mechanism, and specify it via the autoChild system. See the example code below, and refer to the autoChild and reflection documentation for more details.
  DateItem dateItem = new DateItem();
  dateItem.setAutoChildConstructor("picker", "com.mycompany.client.MyDateChooser");
  dateItem.setAutoChildProperties("picker", new MyDateChooser());
 
And the MyDateChooser subclass:
  • Method Summary

    Modifier and Type
    Method
    Description
    getHeaderYearTitle(int value)
    Method to provide the year representation that is shown in the DateChooser header.
    getYearTitle(int value)
    Method to provide the year representations that are shown in the DateChooser's "Select a year" dropdown.
  • Method Details

    • getYearTitle

      String getYearTitle(int value)
      Method to provide the year representations that are shown in the DateChooser's "Select a year" dropdown. The default implementation returns the full four-digit Gregorian year (ie, the same value that is passed in, converted to a String)
      Parameters:
      year - The Gregorian year number to derive a display value for
      Returns:
      The value to show for the parameter year
    • getHeaderYearTitle

      String getHeaderYearTitle(int value)
      Method to provide the year representation that is shown in the DateChooser header. The default implementation returns the full four-digit Gregorian year (ie, the same value that is passed in, converted to a String)
      Parameters:
      year - The Gregorian year number to derive a display value for
      Returns:
      The value to show for the parameter year