Class HeaderLevel

All Implemented Interfaces:
HasHandlers

public class HeaderLevel extends RefDataClass
Defines one level of headers shown above the event area in a Timeline.
  • Constructor Details

    • HeaderLevel

      public HeaderLevel()
    • HeaderLevel

      public HeaderLevel(JavaScriptObject jsObj)
    • HeaderLevel

      public HeaderLevel(TimeUnit unit)
    • HeaderLevel

      public HeaderLevel(TimeUnit unit, String[] titles)
  • Method Details

    • getOrCreateRef

      public static HeaderLevel getOrCreateRef(JavaScriptObject jsObj)
    • setHeaderWidth

      public HeaderLevel setHeaderWidth(Integer headerWidth)
      If set, the width for each of the spans in this headerLevel. Note that this setting only has an effect on the innermost headerLevel.
      Parameters:
      headerWidth - New headerWidth value. Default value is null
      Returns:
      HeaderLevel instance, for chaining setter calls
    • getHeaderWidth

      public Integer getHeaderWidth()
      If set, the width for each of the spans in this headerLevel. Note that this setting only has an effect on the innermost headerLevel.
      Returns:
      Current headerWidth value. Default value is null
    • setTitles

      public HeaderLevel setTitles(String... titles)
      Optional sparse array of titles for the spans on this headerLevel. If a given span in this headerLevel has a corresponding entry in this array, it will be used as the span's title.

      If not specified, default titles are generated (eg "Q1" for unit "quarter") and then passed into the formatter function, if one has been installed, for further customization.

      Parameters:
      titles - New titles value. Default value is null
      Returns:
      HeaderLevel instance, for chaining setter calls
    • getTitles

      public String[] getTitles()
      Optional sparse array of titles for the spans on this headerLevel. If a given span in this headerLevel has a corresponding entry in this array, it will be used as the span's title.

      If not specified, default titles are generated (eg "Q1" for unit "quarter") and then passed into the formatter function, if one has been installed, for further customization.

      Returns:
      Current titles value. Default value is null
    • setUnit

      public HeaderLevel setUnit(TimeUnit unit)
      Unit of time shown at this level of header.
      Parameters:
      unit - New unit value. Default value is null
      Returns:
      HeaderLevel instance, for chaining setter calls
    • getUnit

      public TimeUnit getUnit()
      Unit of time shown at this level of header.
      Returns:
      Current unit value. Default value is null
    • setTitleFormatter

      public void setTitleFormatter(HeaderLevelTitleCustomizer customizer)
      Customize the Title text for a given span in a HeaderLevel.
      Parameters:
      headerLevel - HeaderLevel a reference to this headerLevel
      startDate - Date the start of the date-range covered by this span in this level
      endDate - Date the end of the date-range covered by this span in this level - may be null
      defaultValue - String the default title as generated by the Timeline
      calendar - Calendar a reference to the Calendar or Timeline
    • setHoverCustomizer

      public void setHoverCustomizer(HeaderLevelHoverCustomizer customizer)
      Customize the Hover text for a given span in a HeaderLevel.
      Parameters:
      headerLevel - HeaderLevel a reference to this headerLevel
      startDate - Date the start of the date-range covered by this span in this level
      endDate - Date the end of the date-range covered by this span in this level - may be null
      defaultValue - String the default hover text as generated by the Timeline
      calendarView - CalendarView a reference to the CalendarView the headerLevel is in