Class DateChooser

All Implemented Interfaces:
HasAttachHandlers, HasHandlers, EventListener, HasVisibility, IsWidget, LogicalStructure, HasClearHandlers, HasClickHandlers, HasDataChangedHandlers, HasDoubleClickHandlers, HasDragMoveHandlers, HasDragRepositionMoveHandlers, HasDragRepositionStartHandlers, HasDragRepositionStopHandlers, HasDragResizeMoveHandlers, HasDragResizeStartHandlers, HasDragResizeStopHandlers, HasDragStartHandlers, HasDragStopHandlers, HasDropHandlers, HasDropMoveHandlers, HasDropOutHandlers, HasDropOverHandlers, HasFocusChangedHandlers, HasHoverHandlers, HasHoverHiddenHandlers, HasKeyDownHandlers, HasKeyPressHandlers, HasMouseDownHandlers, HasMouseMoveHandlers, HasMouseOutHandlers, HasMouseOverHandlers, HasMouseStillDownHandlers, HasMouseUpHandlers, HasMouseWheelHandlers, HasMovedHandlers, HasParentMovedHandlers, HasResizedHandlers, HasRightMouseDownHandlers, HasRuleContextChangedHandlers, HasScrolledHandlers, HasShowContextMenuHandlers, HasVisibilityChangedHandlers, HasMembersChangedHandlers

public class DateChooser extends VLayout implements HasDataChangedHandlers
Simple interactive calendar interface used to pick a date. Used by the DateItem class.
  • Constructor Details

    • DateChooser

      public DateChooser()
    • DateChooser

      public DateChooser(JavaScriptObject jsObj)
  • Method Details

    • getOrCreateRef

      public static DateChooser getOrCreateRef(JavaScriptObject jsObj)
    • changeAutoChildDefaults

      public static void changeAutoChildDefaults(String autoChildName, Canvas defaults)
      Changes the defaults for Canvas AutoChildren named autoChildName.
      Parameters:
      autoChildName - name of an AutoChild to customize the defaults for.
      defaults - Canvas defaults to apply. These defaults override any existing properties without destroying or wiping out non-overridden properties. For usage tips on this param, see SGWTProperties.
      See Also:
    • changeAutoChildDefaults

      public static void changeAutoChildDefaults(String autoChildName, FormItem defaults)
      Changes the defaults for FormItem AutoChildren named autoChildName.
      Parameters:
      autoChildName - name of an AutoChild to customize the defaults for.
      defaults - FormItem defaults to apply. These defaults override any existing properties without destroying or wiping out non-overridden properties. For usage tips on this param, see SGWTProperties.
      See Also:
    • create

      protected JavaScriptObject create()
      Overrides:
      create in class VLayout
    • setAlternateStyleSuffix

      public DateChooser setAlternateStyleSuffix(String alternateStyleSuffix)
      The text appended to the style name when using alternateWeekStyles.
      Parameters:
      alternateStyleSuffix - New alternateStyleSuffix value. Default value is "Dark"
      Returns:
      DateChooser instance, for chaining setter calls
    • getAlternateStyleSuffix

      public String getAlternateStyleSuffix()
      The text appended to the style name when using alternateWeekStyles.
      Returns:
      Current alternateStyleSuffix value. Default value is "Dark"
    • setAlternateWeekStyles

      public DateChooser setAlternateWeekStyles(Boolean alternateWeekStyles)
      Whether alternating weeks should be drawn in alternating styles. If enabled, the cell style for alternate rows will have alternateStyleSuffix appended to it.
      Parameters:
      alternateWeekStyles - New alternateWeekStyles value. Default value is null
      Returns:
      DateChooser instance, for chaining setter calls
    • getAlternateWeekStyles

      public Boolean getAlternateWeekStyles()
      Whether alternating weeks should be drawn in alternating styles. If enabled, the cell style for alternate rows will have alternateStyleSuffix appended to it.
      Returns:
      Current alternateWeekStyles value. Default value is null
    • getApplyButton

      public IButton getApplyButton() throws IllegalStateException
      When a DateChooser is configured for a "datetime" value, clicking on a date cell in the grid will not automatically dismiss the DateChooser canvas. In this case, use the Apply button to accept the selected date and time and dismiss the chooser.

      This component is an AutoChild named "applyButton". For an overview of how to use and configure AutoChildren, see Using AutoChildren.

      Returns:
      Current applyButton value. Default value is null
      Throws:
      IllegalStateException - if this widget has not yet been rendered.
    • setApplyButtonTitle

      public DateChooser setApplyButtonTitle(String applyButtonTitle)
      Title for the Apply button.
      Parameters:
      applyButtonTitle - New applyButtonTitle value. Default value is "Apply"
      Returns:
      DateChooser instance, for chaining setter calls
    • getApplyButtonTitle

      public String getApplyButtonTitle()
      Title for the Apply button.
      Returns:
      Current applyButtonTitle value. Default value is "Apply"
    • setBaseBottomButtonStyle

      public DateChooser setBaseBottomButtonStyle(String baseBottomButtonStyle)
      CSS style to apply to the buttons at the bottom of the DateChooser ("Today" and "Cancel"). If null, the CSS style specified in baseButtonStyle is used.
      Parameters:
      baseBottomButtonStyle - New baseBottomButtonStyle value. Default value is null
      Returns:
      DateChooser instance, for chaining setter calls
      See Also:
    • getBaseBottomButtonStyle

      public String getBaseBottomButtonStyle()
      CSS style to apply to the buttons at the bottom of the DateChooser ("Today" and "Cancel"). If null, the CSS style specified in baseButtonStyle is used.
      Returns:
      Current baseBottomButtonStyle value. Default value is null
      See Also:
    • setBaseButtonStyle

      public DateChooser setBaseButtonStyle(String baseButtonStyle)
      Base CSS style applied to this picker's buttons. Will have "Over", "Selected" and "Down" suffix appended as the user interacts with buttons.

      See CellStyleSuffixes for details on how stateful suffixes are combined with the base style to generate stateful cell styles in Grids.

      Parameters:
      baseButtonStyle - New baseButtonStyle value. Default value is "dateChooserButton"
      Returns:
      DateChooser instance, for chaining setter calls
      See Also:
    • getBaseButtonStyle

      public String getBaseButtonStyle()
      Base CSS style applied to this picker's buttons. Will have "Over", "Selected" and "Down" suffix appended as the user interacts with buttons.

      See CellStyleSuffixes for details on how stateful suffixes are combined with the base style to generate stateful cell styles in Grids.

      Returns:
      Current baseButtonStyle value. Default value is "dateChooserButton"
      See Also:
    • setBaseFiscalYearStyle

      public DateChooser setBaseFiscalYearStyle(String baseFiscalYearStyle)
      Base CSS style applied to cells in the fiscal year column.

      See CellStyleSuffixes for details on how stateful suffixes are combined with the base style to generate stateful cell styles in Grids.

      Parameters:
      baseFiscalYearStyle - New baseFiscalYearStyle value. Default value is "dateChooserFiscalYearCell"
      Returns:
      DateChooser instance, for chaining setter calls
      See Also:
    • getBaseFiscalYearStyle

      public String getBaseFiscalYearStyle()
      Base CSS style applied to cells in the fiscal year column.

      See CellStyleSuffixes for details on how stateful suffixes are combined with the base style to generate stateful cell styles in Grids.

      Returns:
      Current baseFiscalYearStyle value. Default value is "dateChooserFiscalYearCell"
      See Also:
    • setBaseNavButtonStyle

      public DateChooser setBaseNavButtonStyle(String baseNavButtonStyle)
      CSS style to apply to navigation buttons and date display at the top of the component. If null, the CSS style specified in baseButtonStyle is used.
      Parameters:
      baseNavButtonStyle - New baseNavButtonStyle value. Default value is null
      Returns:
      DateChooser instance, for chaining setter calls
      See Also:
    • getBaseNavButtonStyle

      public String getBaseNavButtonStyle()
      CSS style to apply to navigation buttons and date display at the top of the component. If null, the CSS style specified in baseButtonStyle is used.
      Returns:
      Current baseNavButtonStyle value. Default value is null
      See Also:
    • setBaseWeekdayStyle

      public DateChooser setBaseWeekdayStyle(String baseWeekdayStyle)
      Base CSS style applied to weekdays. Will have "Over", "Selected" and "Down" suffix appended as the user interacts with buttons. Defaults to baseButtonStyle.

      See CellStyleSuffixes for details on how stateful suffixes are combined with the base style to generate stateful cell styles in Grids.

      Parameters:
      baseWeekdayStyle - New baseWeekdayStyle value. Default value is "dateChooserWeekday"
      Returns:
      DateChooser instance, for chaining setter calls
      See Also:
    • getBaseWeekdayStyle

      public String getBaseWeekdayStyle()
      Base CSS style applied to weekdays. Will have "Over", "Selected" and "Down" suffix appended as the user interacts with buttons. Defaults to baseButtonStyle.

      See CellStyleSuffixes for details on how stateful suffixes are combined with the base style to generate stateful cell styles in Grids.

      Returns:
      Current baseWeekdayStyle value. Default value is "dateChooserWeekday"
      See Also:
    • setBaseWeekendStyle

      public DateChooser setBaseWeekendStyle(String baseWeekendStyle)
      Base CSS style applied to weekends. Will have "Over", "Selected" and "Down" suffix appended as the user interacts with buttons. Defaults to baseWeekdayStyle.

      See CellStyleSuffixes for details on how stateful suffixes are combined with the base style to generate stateful cell styles in Grids.

      Parameters:
      baseWeekendStyle - New baseWeekendStyle value. Default value is "dateChooserWeekend"
      Returns:
      DateChooser instance, for chaining setter calls
      See Also:
    • getBaseWeekendStyle

      public String getBaseWeekendStyle()
      Base CSS style applied to weekends. Will have "Over", "Selected" and "Down" suffix appended as the user interacts with buttons. Defaults to baseWeekdayStyle.

      See CellStyleSuffixes for details on how stateful suffixes are combined with the base style to generate stateful cell styles in Grids.

      Returns:
      Current baseWeekendStyle value. Default value is "dateChooserWeekend"
      See Also:
    • setBaseWeekStyle

      public DateChooser setBaseWeekStyle(String baseWeekStyle)
      Base CSS style applied to cells in the fiscal week column.
      Parameters:
      baseWeekStyle - New baseWeekStyle value. Default value is "dateChooserWeekCell"
      Returns:
      DateChooser instance, for chaining setter calls
      See Also:
    • getBaseWeekStyle

      public String getBaseWeekStyle()
      Base CSS style applied to cells in the fiscal week column.
      Returns:
      Current baseWeekStyle value. Default value is "dateChooserWeekCell"
      See Also:
    • getButtonLayout

      public HLayout getButtonLayout() throws IllegalStateException
      An com.smartgwt.client.types.AutoChild HLayout, rendered below the date grid, and showing the Today, Cancel and, when working with "datetime" values, Apply buttons.

      This component is an AutoChild named "buttonLayout". For an overview of how to use and configure AutoChildren, see Using AutoChildren.

      Returns:
      Current buttonLayout value. Default value is null
      Throws:
      IllegalStateException - if this widget has not yet been rendered.
    • setButtonLayoutControls

      public DateChooser setButtonLayoutControls(String... buttonLayoutControls) throws IllegalStateException
      Array of members to show in the buttonLayout.

      The default value of buttonLayoutControls is an Array of Strings listing the standard buttons in their default order:

           buttonLayoutControls : ["todayButton", "cancelButton", "applyButton"]
        
      You can override buttonLayoutControls to change the order of the standard buttons. You can also omit standard buttons this way, although it's more efficient to use the related "show" property if available (eg showTodayButton).

      By embedding a Canvas directly in this list you can add arbitrary additional controls to the buttonLayout.

      Note that having added controls to buttonLayoutControls, you can still call APIs directly on those controls to change their appearance, and you can also show() and hide() them if they should not be shown in some circumstances.

      Tip: custom controls need to set layoutAlign:"center" to appear vertically centered.

      Parameters:
      buttonLayoutControls - New buttonLayoutControls value. Default value is (see below)
      Returns:
      DateChooser instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
    • getButtonLayoutControls

      public String[] getButtonLayoutControls()
      Array of members to show in the buttonLayout.

      The default value of buttonLayoutControls is an Array of Strings listing the standard buttons in their default order:

           buttonLayoutControls : ["todayButton", "cancelButton", "applyButton"]
        
      You can override buttonLayoutControls to change the order of the standard buttons. You can also omit standard buttons this way, although it's more efficient to use the related "show" property if available (eg showTodayButton).

      By embedding a Canvas directly in this list you can add arbitrary additional controls to the buttonLayout.

      Note that having added controls to buttonLayoutControls, you can still call APIs directly on those controls to change their appearance, and you can also show() and hide() them if they should not be shown in some circumstances.

      Tip: custom controls need to set layoutAlign:"center" to appear vertically centered.

      Returns:
      Current buttonLayoutControls value. Default value is (see below)
    • getCancelButton

      public IButton getCancelButton() throws IllegalStateException
      A button shown below the calendar grid which, when clicked, closes the DateChooser without selecting a value.

      This component is an AutoChild named "cancelButton". For an overview of how to use and configure AutoChildren, see Using AutoChildren.

      Returns:
      Current cancelButton value. Default value is null
      Throws:
      IllegalStateException - if this widget has not yet been rendered.
    • setCancelButtonTitle

      public DateChooser setCancelButtonTitle(String cancelButtonTitle)
      Title for the cancellation button.
      Parameters:
      cancelButtonTitle - New cancelButtonTitle value. Default value is "Cancel"
      Returns:
      DateChooser instance, for chaining setter calls
    • getCancelButtonTitle

      public String getCancelButtonTitle()
      Title for the cancellation button.
      Returns:
      Current cancelButtonTitle value. Default value is "Cancel"
    • setCloseOnDateClick

      public DateChooser setCloseOnDateClick(Boolean closeOnDateClick)
      When editing a "date" value, with no time portion, clicking on a date-cell selects the date and closes the DateChooser. When a time portion is required, however, the apply button must be clicked to close the chooser, by default.

      Set this attribute to true to have the DateChooser close when a user clicks in a date-cell, even if the timeItem is showing.

      Parameters:
      closeOnDateClick - New closeOnDateClick value. Default value is null
      Returns:
      DateChooser instance, for chaining setter calls
    • getCloseOnDateClick

      public Boolean getCloseOnDateClick()
      When editing a "date" value, with no time portion, clicking on a date-cell selects the date and closes the DateChooser. When a time portion is required, however, the apply button must be clicked to close the chooser, by default.

      Set this attribute to true to have the DateChooser close when a user clicks in a date-cell, even if the timeItem is showing.

      Returns:
      Current closeOnDateClick value. Default value is null
    • setCloseOnEscapeKeypress

      public DateChooser setCloseOnEscapeKeypress(boolean closeOnEscapeKeypress) throws IllegalStateException
      Should this dateChooser be dismissed if the user presses the Escape key?
      Parameters:
      closeOnEscapeKeypress - New closeOnEscapeKeypress value. Default value is false
      Returns:
      DateChooser instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
    • getCloseOnEscapeKeypress

      public boolean getCloseOnEscapeKeypress()
      Should this dateChooser be dismissed if the user presses the Escape key?
      Returns:
      Current closeOnEscapeKeypress value. Default value is false
    • getDateGrid

      public DateGrid getDateGrid() throws IllegalStateException
      A ListGrid subclass, responsible for rendering the calendar view.

      This component is an AutoChild named "dateGrid". For an overview of how to use and configure AutoChildren, see Using AutoChildren.

      Returns:
      Current dateGrid value. Default value is null
      Throws:
      IllegalStateException - if this widget has not yet been rendered.
    • setDayNameLength

      public DateChooser setDayNameLength(int dayNameLength) throws IllegalStateException
      How long (how many characters) should be day names be. May be 1, 2 or 3 characters.
      Parameters:
      dayNameLength - New dayNameLength value. Default value is 2
      Returns:
      DateChooser instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
    • getDayNameLength

      public int getDayNameLength()
      How long (how many characters) should be day names be. May be 1, 2 or 3 characters.
      Returns:
      Current dayNameLength value. Default value is 2
    • setDisabledDates

      public DateChooser setDisabledDates(Date... disabledDates)
      An array of Date instances that should be disabled if they appear in the calendar view.
      Parameters:
      disabledDates - New disabledDates value. Default value is null
      Returns:
      DateChooser instance, for chaining setter calls
    • getDisabledDates

      public Date[] getDisabledDates()
      An array of Date instances that should be disabled if they appear in the calendar view.
      Returns:
      Current disabledDates value. Default value is null
    • setDisabledWeekdayStyle

      public DateChooser setDisabledWeekdayStyle(String disabledWeekdayStyle)
      Base CSS style applied to weekday dates which have been disabled.
      Parameters:
      disabledWeekdayStyle - New disabledWeekdayStyle value. Default value is "dateChooserDisabledWeekday"
      Returns:
      DateChooser instance, for chaining setter calls
      See Also:
    • getDisabledWeekdayStyle

      public String getDisabledWeekdayStyle()
      Base CSS style applied to weekday dates which have been disabled.
      Returns:
      Current disabledWeekdayStyle value. Default value is "dateChooserDisabledWeekday"
      See Also:
    • setDisabledWeekendStyle

      public DateChooser setDisabledWeekendStyle(String disabledWeekendStyle)
      Base CSS style applied to weekend dates which have been disabled.
      Parameters:
      disabledWeekendStyle - New disabledWeekendStyle value. Default value is "dateChooserDisabledWeekend"
      Returns:
      DateChooser instance, for chaining setter calls
      See Also:
    • getDisabledWeekendStyle

      public String getDisabledWeekendStyle()
      Base CSS style applied to weekend dates which have been disabled.
      Returns:
      Current disabledWeekendStyle value. Default value is "dateChooserDisabledWeekend"
      See Also:
    • setDisableWeekends

      public DateChooser setDisableWeekends(Boolean disableWeekends) throws IllegalStateException
      Whether it should be valid to pick a weekend day. If set to true, weekend days appear in disabled style and cannot be picked.

      Which days are considered weekends is controlled by weekendDays if set or by weekendDays otherwise.

      Parameters:
      disableWeekends - New disableWeekends value. Default value is false
      Returns:
      DateChooser instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
    • getDisableWeekends

      public Boolean getDisableWeekends()
      Whether it should be valid to pick a weekend day. If set to true, weekend days appear in disabled style and cannot be picked.

      Which days are considered weekends is controlled by weekendDays if set or by weekendDays otherwise.

      Returns:
      Current disableWeekends value. Default value is false
    • setEndDate

      public DateChooser setEndDate(Date endDate)
      Limits the selectable range of this DateChooser.

      If unset, the chooser's range-end is dictated by endYear.

      Parameters:
      endDate - New endDate value. Default value is null
      Returns:
      DateChooser instance, for chaining setter calls
      See Also:
    • getEndDate

      public Date getEndDate()
      Limits the selectable range of this DateChooser.

      If unset, the chooser's range-end is dictated by endYear.

      Returns:
      Current endDate value. Default value is null
      See Also:
    • setEndYear

      public DateChooser setEndYear(int endYear) throws IllegalStateException
      Latest year that may be selected.

      If set to null, no minimum year is enforced.

      If this chooser was opened by a DateItem, the default is inherited from DateItem.endDate. Otherwise, the default is 5 years after today.

      When opened from a RelativeDateItem, this property and startYear are defaulted to null, and the year-picker shows years surrounding the current year, according to startYearRange and endYearRange.

      Parameters:
      endYear - New endYear value. Default value is 2025
      Returns:
      DateChooser instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
    • getEndYear

      public int getEndYear()
      Latest year that may be selected.

      If set to null, no minimum year is enforced.

      If this chooser was opened by a DateItem, the default is inherited from DateItem.endDate. Otherwise, the default is 5 years after today.

      When opened from a RelativeDateItem, this property and startYear are defaulted to null, and the year-picker shows years surrounding the current year, according to startYearRange and endYearRange.

      Returns:
      Current endYear value. Default value is 2025
    • setEndYearRange

      public DateChooser setEndYearRange(Integer endYearRange) throws IllegalStateException
      When endYear is unset, this is the years after today that will be available for selection in the year menu.
      Parameters:
      endYearRange - New endYearRange value. Default value is 10
      Returns:
      DateChooser instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
    • getEndYearRange

      public Integer getEndYearRange()
      When endYear is unset, this is the years after today that will be available for selection in the year menu.
      Returns:
      Current endYearRange value. Default value is 10
    • setFirstDayOfWeek

      public DateChooser setFirstDayOfWeek(int firstDayOfWeek) throws IllegalStateException
      Day of the week to show in the first column. 0=Sunday, 1=Monday, ..., 6=Saturday. The default value for this attribute is picked up from the current locale and can also be altered system-wide with the global setter.
      Parameters:
      firstDayOfWeek - New firstDayOfWeek value. Default value is 0
      Returns:
      DateChooser instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
      See Also:
    • getFirstDayOfWeek

      public int getFirstDayOfWeek()
      Day of the week to show in the first column. 0=Sunday, 1=Monday, ..., 6=Saturday. The default value for this attribute is picked up from the current locale and can also be altered system-wide with the global setter.
      Returns:
      Current firstDayOfWeek value. Default value is 0
      See Also:
    • getFiscalYearChooserButton

      public IButton getFiscalYearChooserButton() throws IllegalStateException
      A button shown in the navigation layout which, when clicked, shows a picker for selecting a specific fiscal year.

      This component is an AutoChild named "fiscalYearChooserButton". For an overview of how to use and configure AutoChildren, see Using AutoChildren.

      Returns:
      Current fiscalYearChooserButton value. Default value is null
      Throws:
      IllegalStateException - if this widget has not yet been rendered.
    • setFiscalYearFieldTitle

      public DateChooser setFiscalYearFieldTitle(String fiscalYearFieldTitle)
      Title for the fiscal year field in the date grid.
      Parameters:
      fiscalYearFieldTitle - New fiscalYearFieldTitle value. Default value is "Year"
      Returns:
      DateChooser instance, for chaining setter calls
    • getFiscalYearFieldTitle

      public String getFiscalYearFieldTitle()
      Title for the fiscal year field in the date grid.
      Returns:
      Current fiscalYearFieldTitle value. Default value is "Year"
    • setFiscalYearHeaderStyle

      public DateChooser setFiscalYearHeaderStyle(String fiscalYearHeaderStyle)
      Base CSS style applied to the header of the fiscal year column in the calendar view.
      Parameters:
      fiscalYearHeaderStyle - New fiscalYearHeaderStyle value. Default value is null
      Returns:
      DateChooser instance, for chaining setter calls
      See Also:
    • getFiscalYearHeaderStyle

      public String getFiscalYearHeaderStyle()
      Base CSS style applied to the header of the fiscal year column in the calendar view.
      Returns:
      Current fiscalYearHeaderStyle value. Default value is null
      See Also:
    • setHeaderHeight

      public DateChooser setHeaderHeight(Integer headerHeight) throws IllegalStateException
      Deprecated.
      Height of the header area (containing the navigation buttons) in pixels.
      Parameters:
      headerHeight - New headerHeight value. Default value is 20
      Returns:
      DateChooser instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
    • getHeaderHeight

      public Integer getHeaderHeight()
      Deprecated.
      Height of the header area (containing the navigation buttons) in pixels.
      Returns:
      Current headerHeight value. Default value is 20
    • setHeaderStyle

      public DateChooser setHeaderStyle(String headerStyle)
      CSS style applied to the day-of-week headers. By default this applies to all days of the week. To apply a separate style to weekend headers, set weekendHeaderStyle
      Parameters:
      headerStyle - New headerStyle value. Default value is "dateChooserButtonDisabled"
      Returns:
      DateChooser instance, for chaining setter calls
      See Also:
    • getHeaderStyle

      public String getHeaderStyle()
      CSS style applied to the day-of-week headers. By default this applies to all days of the week. To apply a separate style to weekend headers, set weekendHeaderStyle
      Returns:
      Current headerStyle value. Default value is "dateChooserButtonDisabled"
      See Also:
    • setMenuItemStyle

      public DateChooser setMenuItemStyle(String menuItemStyle)
      Base CSS style applied to cells in the Year, Week and Month popup-menus. In some skins, this attribute is set to dateChooserMenuItem which provides custom styles for items in these menus.
      Parameters:
      menuItemStyle - New menuItemStyle value. Default value is "dateChooserButton"
      Returns:
      DateChooser instance, for chaining setter calls
      See Also:
    • getMenuItemStyle

      public String getMenuItemStyle()
      Base CSS style applied to cells in the Year, Week and Month popup-menus. In some skins, this attribute is set to dateChooserMenuItem which provides custom styles for items in these menus.
      Returns:
      Current menuItemStyle value. Default value is "dateChooserButton"
      See Also:
    • getMonthChooserButton

      public IButton getMonthChooserButton() throws IllegalStateException
      A button shown in the navigation layout that shows a picker for selecting a specific month.

      This component is an AutoChild named "monthChooserButton". For an overview of how to use and configure AutoChildren, see Using AutoChildren.

      Returns:
      Current monthChooserButton value. Default value is null
      Throws:
      IllegalStateException - if this widget has not yet been rendered.
    • setMonthMenuStyle

      public DateChooser setMonthMenuStyle(String monthMenuStyle) throws IllegalStateException
      Style for the pop-up year menu.
      Parameters:
      monthMenuStyle - New monthMenuStyle value. Default value is "dateChooserMonthMenu"
      Returns:
      DateChooser instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
      See Also:
    • getMonthMenuStyle

      public String getMonthMenuStyle()
      Style for the pop-up year menu.
      Returns:
      Current monthMenuStyle value. Default value is "dateChooserMonthMenu"
      See Also:
    • setNavigationButtonHeight

      public DateChooser setNavigationButtonHeight(Integer navigationButtonHeight) throws IllegalStateException
      Height of buttons in the navigation area, used for navigating the calendar view. If unset, the default, buttons are sized by settings applied by the current skin.

      If this attribute is set to a value greater than navigationLayoutHeight, it will cause the layout to expand to match the button height.

      Parameters:
      navigationButtonHeight - New navigationButtonHeight value. Default value is null
      Returns:
      DateChooser instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
    • getNavigationButtonHeight

      public Integer getNavigationButtonHeight()
      Height of buttons in the navigation area, used for navigating the calendar view. If unset, the default, buttons are sized by settings applied by the current skin.

      If this attribute is set to a value greater than navigationLayoutHeight, it will cause the layout to expand to match the button height.

      Returns:
      Current navigationButtonHeight value. Default value is null
    • getNavigationLayout

      public HLayout getNavigationLayout() throws IllegalStateException
      An com.smartgwt.client.types.AutoChild HLayout, rendered above the date grid, and showing a number of widgets for navigating the DateChooser. These include buttons for moving to the previous year or month, the next year or month, and for selecting a specific year, month or week.

      This component is an AutoChild named "navigationLayout". For an overview of how to use and configure AutoChildren, see Using AutoChildren.

      Returns:
      Current navigationLayout value. Default value is null
      Throws:
      IllegalStateException - if this widget has not yet been rendered.
    • setNavigationLayoutHeight

      public DateChooser setNavigationLayoutHeight(int navigationLayoutHeight) throws IllegalStateException
      Height of the navigation area, containing the various buttons for navigating the calendar view.

      If navigationButtonHeight or the navigation buttons themselves specify a height taller than navigationLayoutHeight, this setting acts as a minimum height and the layout will expand to fit the buttons.

      Parameters:
      navigationLayoutHeight - New navigationLayoutHeight value. Default value is 20
      Returns:
      DateChooser instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
    • getNavigationLayoutHeight

      public int getNavigationLayoutHeight()
      Height of the navigation area, containing the various buttons for navigating the calendar view.

      If navigationButtonHeight or the navigation buttons themselves specify a height taller than navigationLayoutHeight, this setting acts as a minimum height and the layout will expand to fit the buttons.

      Returns:
      Current navigationLayoutHeight value. Default value is 20
    • getNextMonthButton

      public IButton getNextMonthButton() throws IllegalStateException
      A button shown in the navigation layout that shifts the calendar view forward by a month.

      This component is an AutoChild named "nextMonthButton". For an overview of how to use and configure AutoChildren, see Using AutoChildren.

      Returns:
      Current nextMonthButton value. Default value is null
      Throws:
      IllegalStateException - if this widget has not yet been rendered.
    • setNextMonthButtonAriaLabel

      public DateChooser setNextMonthButtonAriaLabel(String nextMonthButtonAriaLabel) throws IllegalStateException
      Parameters:
      nextMonthButtonAriaLabel - New nextMonthButtonAriaLabel value. Default value is "Next month"
      Returns:
      DateChooser instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
    • getNextMonthButtonAriaLabel

      public String getNextMonthButtonAriaLabel()
      Returns:
      Current nextMonthButtonAriaLabel value. Default value is "Next month"
    • setNextMonthIcon

      public DateChooser setNextMonthIcon(String nextMonthIcon)
      Icon for the next month button
      Parameters:
      nextMonthIcon - New nextMonthIcon value. Default value is "[SKIN]arrow_right.gif"
      Returns:
      DateChooser instance, for chaining setter calls
      See Also:
    • getNextMonthIcon

      public String getNextMonthIcon()
      Icon for the next month button
      Returns:
      Current nextMonthIcon value. Default value is "[SKIN]arrow_right.gif"
      See Also:
    • setNextMonthIconHeight

      public DateChooser setNextMonthIconHeight(int nextMonthIconHeight)
      Height of the icon for the next month button
      Parameters:
      nextMonthIconHeight - New nextMonthIconHeight value. Default value is 7
      Returns:
      DateChooser instance, for chaining setter calls
    • getNextMonthIconHeight

      public int getNextMonthIconHeight()
      Height of the icon for the next month button
      Returns:
      Current nextMonthIconHeight value. Default value is 7
    • setNextMonthIconRTL

      public DateChooser setNextMonthIconRTL(String nextMonthIconRTL)
      Icon for the next month button
      Parameters:
      nextMonthIconRTL - New nextMonthIconRTL value. Default value is null
      Returns:
      DateChooser instance, for chaining setter calls
      See Also:
    • getNextMonthIconRTL

      public String getNextMonthIconRTL()
      Icon for the next month button
      Returns:
      Current nextMonthIconRTL value. Default value is null
      See Also:
    • setNextMonthIconWidth

      public DateChooser setNextMonthIconWidth(int nextMonthIconWidth)
      Width of the icon for the next month button if Page.isRTL() is true. If not set, and the page is in RTL mode, the nextMonthIcon will be used in place of the prevMonthIcon and vice versa.
      Parameters:
      nextMonthIconWidth - New nextMonthIconWidth value. Default value is 7
      Returns:
      DateChooser instance, for chaining setter calls
    • getNextMonthIconWidth

      public int getNextMonthIconWidth()
      Width of the icon for the next month button if Page.isRTL() is true. If not set, and the page is in RTL mode, the nextMonthIcon will be used in place of the prevMonthIcon and vice versa.
      Returns:
      Current nextMonthIconWidth value. Default value is 7
    • getNextYearButton

      public IButton getNextYearButton() throws IllegalStateException
      A button shown in the navigation layout that shifts the calendar view forward by a year.

      This component is an AutoChild named "nextYearButton". For an overview of how to use and configure AutoChildren, see Using AutoChildren.

      Returns:
      Current nextYearButton value. Default value is null
      Throws:
      IllegalStateException - if this widget has not yet been rendered.
    • setNextYearButtonAriaLabel

      public DateChooser setNextYearButtonAriaLabel(String nextYearButtonAriaLabel) throws IllegalStateException
      Parameters:
      nextYearButtonAriaLabel - New nextYearButtonAriaLabel value. Default value is "Next year"
      Returns:
      DateChooser instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
    • getNextYearButtonAriaLabel

      public String getNextYearButtonAriaLabel()
      Returns:
      Current nextYearButtonAriaLabel value. Default value is "Next year"
    • setNextYearIcon

      public DateChooser setNextYearIcon(String nextYearIcon) throws IllegalStateException
      Icon for the next year button
      Parameters:
      nextYearIcon - New nextYearIcon value. Default value is "[SKIN]doubleArrow_right.gif"
      Returns:
      DateChooser instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
      See Also:
      • com.smartgwt.client.widgets.DateChooser#setShowDoubleYearIcon
      • URL
    • getNextYearIcon

      public String getNextYearIcon()
      Icon for the next year button
      Returns:
      Current nextYearIcon value. Default value is "[SKIN]doubleArrow_right.gif"
      See Also:
      • com.smartgwt.client.widgets.DateChooser#getShowDoubleYearIcon
      • URL
    • setNextYearIconHeight

      public DateChooser setNextYearIconHeight(int nextYearIconHeight)
      Height of the icon for the next year button
      Parameters:
      nextYearIconHeight - New nextYearIconHeight value. Default value is 7
      Returns:
      DateChooser instance, for chaining setter calls
    • getNextYearIconHeight

      public int getNextYearIconHeight()
      Height of the icon for the next year button
      Returns:
      Current nextYearIconHeight value. Default value is 7
    • setNextYearIconRTL

      public DateChooser setNextYearIconRTL(String nextYearIconRTL) throws IllegalStateException
      Icon for the next year button if Page.isRTL() is true. If not set, and the page is in RTL mode, the nextYearIcon will be used in place of the prevYearIcon and vice versa.
      Parameters:
      nextYearIconRTL - New nextYearIconRTL value. Default value is null
      Returns:
      DateChooser instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
      See Also:
      • com.smartgwt.client.widgets.DateChooser#setShowDoubleYearIcon
      • URL
    • getNextYearIconRTL

      public String getNextYearIconRTL()
      Icon for the next year button if Page.isRTL() is true. If not set, and the page is in RTL mode, the nextYearIcon will be used in place of the prevYearIcon and vice versa.
      Returns:
      Current nextYearIconRTL value. Default value is null
      See Also:
      • com.smartgwt.client.widgets.DateChooser#getShowDoubleYearIcon
      • URL
    • setNextYearIconWidth

      public DateChooser setNextYearIconWidth(int nextYearIconWidth) throws IllegalStateException
      Width of the icon for the next year button
      Parameters:
      nextYearIconWidth - New nextYearIconWidth value. Default value is 14
      Returns:
      DateChooser instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
    • getNextYearIconWidth

      public int getNextYearIconWidth()
      Width of the icon for the next year button
      Returns:
      Current nextYearIconWidth value. Default value is 14
    • getPreviousMonthButton

      public IButton getPreviousMonthButton() throws IllegalStateException
      A button shown in the navigation layout that shifts the calendar view backward by a month.

      This component is an AutoChild named "previousMonthButton". For an overview of how to use and configure AutoChildren, see Using AutoChildren.

      Returns:
      Current previousMonthButton value. Default value is null
      Throws:
      IllegalStateException - if this widget has not yet been rendered.
    • setPreviousMonthButtonAriaLabel

      public DateChooser setPreviousMonthButtonAriaLabel(String previousMonthButtonAriaLabel) throws IllegalStateException
      Parameters:
      previousMonthButtonAriaLabel - New previousMonthButtonAriaLabel value. Default value is "Previous month"
      Returns:
      DateChooser instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
    • getPreviousMonthButtonAriaLabel

      public String getPreviousMonthButtonAriaLabel()
      Returns:
      Current previousMonthButtonAriaLabel value. Default value is "Previous month"
    • getPreviousYearButton

      public IButton getPreviousYearButton() throws IllegalStateException
      A button shown in the navigation layout that shifts the calendar view backward by a year.

      This component is an AutoChild named "previousYearButton". For an overview of how to use and configure AutoChildren, see Using AutoChildren.

      Returns:
      Current previousYearButton value. Default value is null
      Throws:
      IllegalStateException - if this widget has not yet been rendered.
    • setPreviousYearButtonAriaLabel

      public DateChooser setPreviousYearButtonAriaLabel(String previousYearButtonAriaLabel) throws IllegalStateException
      Parameters:
      previousYearButtonAriaLabel - New previousYearButtonAriaLabel value. Default value is "Previous year"
      Returns:
      DateChooser instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
    • getPreviousYearButtonAriaLabel

      public String getPreviousYearButtonAriaLabel()
      Returns:
      Current previousYearButtonAriaLabel value. Default value is "Previous year"
    • setPrevMonthIcon

      public DateChooser setPrevMonthIcon(String prevMonthIcon) throws IllegalStateException
      Icon for the previous month button
      Parameters:
      prevMonthIcon - New prevMonthIcon value. Default value is "[SKIN]arrow_left.gif"
      Returns:
      DateChooser instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
      See Also:
    • getPrevMonthIcon

      public String getPrevMonthIcon()
      Icon for the previous month button
      Returns:
      Current prevMonthIcon value. Default value is "[SKIN]arrow_left.gif"
      See Also:
    • setPrevMonthIconHeight

      public DateChooser setPrevMonthIconHeight(int prevMonthIconHeight) throws IllegalStateException
      Height of the icon for the previous month button
      Parameters:
      prevMonthIconHeight - New prevMonthIconHeight value. Default value is 7
      Returns:
      DateChooser instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
    • getPrevMonthIconHeight

      public int getPrevMonthIconHeight()
      Height of the icon for the previous month button
      Returns:
      Current prevMonthIconHeight value. Default value is 7
    • setPrevMonthIconRTL

      public DateChooser setPrevMonthIconRTL(String prevMonthIconRTL) throws IllegalStateException
      Icon for the previous month button if Page.isRTL() is true. If not set, and the page is in RTL mode, the nextMonthIcon will be used in place of the prevMonthIcon and vice versa.
      Parameters:
      prevMonthIconRTL - New prevMonthIconRTL value. Default value is null
      Returns:
      DateChooser instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
      See Also:
    • getPrevMonthIconRTL

      public String getPrevMonthIconRTL()
      Icon for the previous month button if Page.isRTL() is true. If not set, and the page is in RTL mode, the nextMonthIcon will be used in place of the prevMonthIcon and vice versa.
      Returns:
      Current prevMonthIconRTL value. Default value is null
      See Also:
    • setPrevMonthIconWidth

      public DateChooser setPrevMonthIconWidth(int prevMonthIconWidth) throws IllegalStateException
      Width of the icon for the previous month button
      Parameters:
      prevMonthIconWidth - New prevMonthIconWidth value. Default value is 7
      Returns:
      DateChooser instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
    • getPrevMonthIconWidth

      public int getPrevMonthIconWidth()
      Width of the icon for the previous month button
      Returns:
      Current prevMonthIconWidth value. Default value is 7
    • setPrevYearIcon

      public DateChooser setPrevYearIcon(String prevYearIcon) throws IllegalStateException
      Icon for the previous year button
      Parameters:
      prevYearIcon - New prevYearIcon value. Default value is "[SKIN]doubleArrow_left.gif"
      Returns:
      DateChooser instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
      See Also:
      • com.smartgwt.client.widgets.DateChooser#setShowDoubleYearIcon
      • URL
    • getPrevYearIcon

      public String getPrevYearIcon()
      Icon for the previous year button
      Returns:
      Current prevYearIcon value. Default value is "[SKIN]doubleArrow_left.gif"
      See Also:
      • com.smartgwt.client.widgets.DateChooser#getShowDoubleYearIcon
      • URL
    • setPrevYearIconHeight

      public DateChooser setPrevYearIconHeight(int prevYearIconHeight) throws IllegalStateException
      Height of the icon for the previous year button
      Parameters:
      prevYearIconHeight - New prevYearIconHeight value. Default value is 7
      Returns:
      DateChooser instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
    • getPrevYearIconHeight

      public int getPrevYearIconHeight()
      Height of the icon for the previous year button
      Returns:
      Current prevYearIconHeight value. Default value is 7
    • setPrevYearIconRTL

      public DateChooser setPrevYearIconRTL(String prevYearIconRTL)
      Icon for the previous year button if Page.isRTL() is true. If not set, and the page is in RTL mode, the nextYearIcon will be used in place of the prevYearIcon and vice versa.
      Parameters:
      prevYearIconRTL - New prevYearIconRTL value. Default value is null
      Returns:
      DateChooser instance, for chaining setter calls
      See Also:
      • com.smartgwt.client.widgets.DateChooser#setShowDoubleYearIcon
      • URL
    • getPrevYearIconRTL

      public String getPrevYearIconRTL()
      Icon for the previous year button if Page.isRTL() is true. If not set, and the page is in RTL mode, the nextYearIcon will be used in place of the prevYearIcon and vice versa.
      Returns:
      Current prevYearIconRTL value. Default value is null
      See Also:
      • com.smartgwt.client.widgets.DateChooser#getShowDoubleYearIcon
      • URL
    • setPrevYearIconWidth

      public DateChooser setPrevYearIconWidth(int prevYearIconWidth) throws IllegalStateException
      Width of the icon for the previous year button
      Parameters:
      prevYearIconWidth - New prevYearIconWidth value. Default value is 14
      Returns:
      DateChooser instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
    • getPrevYearIconWidth

      public int getPrevYearIconWidth()
      Width of the icon for the previous year button
      Returns:
      Current prevYearIconWidth value. Default value is 14
    • setSelectedWeekStyle

      public DateChooser setSelectedWeekStyle(String selectedWeekStyle)
      CSS style applied to the Fiscal Year and Week columns for the currently selected week (the one being displayed in the week chooser).
      Parameters:
      selectedWeekStyle - New selectedWeekStyle value. Default value is "dateChooserSelectedWeek"
      Returns:
      DateChooser instance, for chaining setter calls
      See Also:
    • getSelectedWeekStyle

      public String getSelectedWeekStyle()
      CSS style applied to the Fiscal Year and Week columns for the currently selected week (the one being displayed in the week chooser).
      Returns:
      Current selectedWeekStyle value. Default value is "dateChooserSelectedWeek"
      See Also:
    • setShowApplyButton

      public DateChooser setShowApplyButton(Boolean showApplyButton)
      Determines whether the applyButton will be displayed.
      Parameters:
      showApplyButton - New showApplyButton value. Default value is null
      Returns:
      DateChooser instance, for chaining setter calls
    • getShowApplyButton

      public Boolean getShowApplyButton()
      Determines whether the applyButton will be displayed.
      Returns:
      Current showApplyButton value. Default value is null
    • setShowCancelButton

      public DateChooser setShowCancelButton(Boolean showCancelButton)
      Determines whether the "Cancel" button will be displayed.
      Parameters:
      showCancelButton - New showCancelButton value. Default value is false
      Returns:
      DateChooser instance, for chaining setter calls
    • getShowCancelButton

      public Boolean getShowCancelButton()
      Determines whether the "Cancel" button will be displayed.
      Returns:
      Current showCancelButton value. Default value is false
    • setShowFiscalYearChooser

      public DateChooser setShowFiscalYearChooser(Boolean showFiscalYearChooser)
      When set to true, show a button that allows the calendar to be navigated by fiscal year.
      Parameters:
      showFiscalYearChooser - New showFiscalYearChooser value. Default value is false
      Returns:
      DateChooser instance, for chaining setter calls
    • getShowFiscalYearChooser

      public Boolean getShowFiscalYearChooser()
      When set to true, show a button that allows the calendar to be navigated by fiscal year.
      Returns:
      Current showFiscalYearChooser value. Default value is false
    • setShowSecondItem

      public DateChooser setShowSecondItem(Boolean showSecondItem)
      When showing the time field, whether to show the "second" picker. When unset, the second field is not shown.
      Parameters:
      showSecondItem - New showSecondItem value. Default value is null
      Returns:
      DateChooser instance, for chaining setter calls
    • getShowSecondItem

      public Boolean getShowSecondItem()
      When showing the time field, whether to show the "second" picker. When unset, the second field is not shown.
      Returns:
      Current showSecondItem value. Default value is null
    • setShowTimeItem

      public DateChooser setShowTimeItem(Boolean showTimeItem)
      Whether to show the time field for editing the time portion of the date. When unset, the time field is shown automatically if the field type is "datetime". Note that the item's second chooser is not shown by default.
      Parameters:
      showTimeItem - New showTimeItem value. Default value is null
      Returns:
      DateChooser instance, for chaining setter calls
    • getShowTimeItem

      public Boolean getShowTimeItem()
      Whether to show the time field for editing the time portion of the date. When unset, the time field is shown automatically if the field type is "datetime". Note that the item's second chooser is not shown by default.
      Returns:
      Current showTimeItem value. Default value is null
    • setShowTodayButton

      public DateChooser setShowTodayButton(Boolean showTodayButton)
      Determines whether the "Today" button will be displayed, allowing the user to select the current date.
      Parameters:
      showTodayButton - New showTodayButton value. Default value is true
      Returns:
      DateChooser instance, for chaining setter calls
    • getShowTodayButton

      public Boolean getShowTodayButton()
      Determines whether the "Today" button will be displayed, allowing the user to select the current date.
      Returns:
      Current showTodayButton value. Default value is true
    • setShowWeekChooser

      public DateChooser setShowWeekChooser(Boolean showWeekChooser)
      When set to true, show a button that allows the calendar to be navigated by week or fiscal week, depending on the value of showFiscalYearChooser.
      Parameters:
      showWeekChooser - New showWeekChooser value. Default value is false
      Returns:
      DateChooser instance, for chaining setter calls
    • getShowWeekChooser

      public Boolean getShowWeekChooser()
      When set to true, show a button that allows the calendar to be navigated by week or fiscal week, depending on the value of showFiscalYearChooser.
      Returns:
      Current showWeekChooser value. Default value is false
    • setShowWeekends

      public DateChooser setShowWeekends(Boolean showWeekends) throws IllegalStateException
      Whether weekend days should be shown. Which days are considered weekends is controlled by weekendDays if set or by weekendDays otherwise.
      Parameters:
      showWeekends - New showWeekends value. Default value is true
      Returns:
      DateChooser instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
    • getShowWeekends

      public Boolean getShowWeekends()
      Whether weekend days should be shown. Which days are considered weekends is controlled by weekendDays if set or by weekendDays otherwise.
      Returns:
      Current showWeekends value. Default value is true
    • setSkinImgDir

      public DateChooser setSkinImgDir(String skinImgDir)
      Overridden directory where images for this widget (such as the month and year button icons) may be found.

      Note : This is an advanced setting

      Overrides:
      setSkinImgDir in class Canvas
      Parameters:
      skinImgDir - New skinImgDir value. Default value is "images/common/"
      Returns:
      DateChooser instance, for chaining setter calls
      See Also:
    • getSkinImgDir

      public String getSkinImgDir()
      Overridden directory where images for this widget (such as the month and year button icons) may be found.
      Overrides:
      getSkinImgDir in class Canvas
      Returns:
      Current skinImgDir value. Default value is "images/common/"
      See Also:
    • setStartDate

      public DateChooser setStartDate(Date startDate)
      Limits the selectable range of this DateChooser.

      If unset, the chooser's range-start is dictated by startYear.

      Parameters:
      startDate - New startDate value. Default value is null
      Returns:
      DateChooser instance, for chaining setter calls
      See Also:
    • getStartDate

      public Date getStartDate()
      Limits the selectable range of this DateChooser.

      If unset, the chooser's range-start is dictated by startYear.

      Returns:
      Current startDate value. Default value is null
      See Also:
    • setStartYear

      public DateChooser setStartYear(int startYear) throws IllegalStateException
      Earliest year that may be selected.

      If set to null, no minimum year is enforced.

      If this chooser was opened by a DateItem, the default is inherited from DateItem.startDate. Otherwise, the default is 10 years before today.

      When opened from a RelativeDateItem, this property and endYear are defaulted to null, and the year-picker shows years surrounding the current year, according to startYearRange and endYearRange.

      Parameters:
      startYear - New startYear value. Default value is 2010
      Returns:
      DateChooser instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
    • getStartYear

      public int getStartYear()
      Earliest year that may be selected.

      If set to null, no minimum year is enforced.

      If this chooser was opened by a DateItem, the default is inherited from DateItem.startDate. Otherwise, the default is 10 years before today.

      When opened from a RelativeDateItem, this property and endYear are defaulted to null, and the year-picker shows years surrounding the current year, according to startYearRange and endYearRange.

      Returns:
      Current startYear value. Default value is 2010
    • setStartYearRange

      public DateChooser setStartYearRange(Integer startYearRange) throws IllegalStateException
      When startYear is unset, this is the years before today that will be available for selection in the year menu.
      Parameters:
      startYearRange - New startYearRange value. Default value is 30
      Returns:
      DateChooser instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
    • getStartYearRange

      public Integer getStartYearRange()
      When startYear is unset, this is the years before today that will be available for selection in the year menu.
      Returns:
      Current startYearRange value. Default value is 30
    • setStyleWeekends

      public DateChooser setStyleWeekends(Boolean styleWeekends) throws IllegalStateException
      Whether weekend days should be styled differently from weekdays. If false, suppresses the custom baseWeekendStyle and weekendHeaderStyle, instead using the baseWeekdayStyle and weekendHeaderStyle.
      Parameters:
      styleWeekends - New styleWeekends value. Default value is true
      Returns:
      DateChooser instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
    • getStyleWeekends

      public Boolean getStyleWeekends()
      Whether weekend days should be styled differently from weekdays. If false, suppresses the custom baseWeekendStyle and weekendHeaderStyle, instead using the baseWeekdayStyle and weekendHeaderStyle.
      Returns:
      Current styleWeekends value. Default value is true
    • getTimeItem

      public TimeItem getTimeItem() throws IllegalStateException
      TimeItem for editing the time portion of dates. Visible by default for fields of type "datetime" and can be controlled by setting showTimeItem.

      This component is an AutoChild named "timeItem". For an overview of how to use and configure AutoChildren, see Using AutoChildren.

      Returns:
      Current timeItem value. Default value is null
      Throws:
      IllegalStateException - if this widget has not yet been rendered.
    • setTimeItemProperties

      public DateChooser setTimeItemProperties(TimeItem timeItemProperties) throws IllegalStateException
      Custom properties to apply to the time field used for editing the time portion of the date.

      Note : This is an advanced setting

      Parameters:
      timeItemProperties - New timeItemProperties value. Default value is null
      Returns:
      DateChooser instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
    • getTimeItemProperties

      public TimeItem getTimeItemProperties()
      Custom properties to apply to the time field used for editing the time portion of the date.
      Returns:
      Current timeItemProperties value. Default value is null
    • setTimeItemTitle

      public DateChooser setTimeItemTitle(String timeItemTitle)
      Title for the time field.
      Parameters:
      timeItemTitle - New timeItemTitle value. Default value is "Time"
      Returns:
      DateChooser instance, for chaining setter calls
    • getTimeItemTitle

      public String getTimeItemTitle()
      Title for the time field.
      Returns:
      Current timeItemTitle value. Default value is "Time"
    • getTodayButton

      public IButton getTodayButton() throws IllegalStateException
      A button shown below the calendar grid which, when clicked, navigates the calendar to today.

      This component is an AutoChild named "todayButton". For an overview of how to use and configure AutoChildren, see Using AutoChildren.

      Returns:
      Current todayButton value. Default value is null
      Throws:
      IllegalStateException - if this widget has not yet been rendered.
    • setTodayButtonHeight

      public DateChooser setTodayButtonHeight(Integer todayButtonHeight)
      If set specifies a fixed height for the Today and Cancel buttons.
      Parameters:
      todayButtonHeight - New todayButtonHeight value. Default value is null
      Returns:
      DateChooser instance, for chaining setter calls
    • getTodayButtonHeight

      public Integer getTodayButtonHeight()
      If set specifies a fixed height for the Today and Cancel buttons.
      Returns:
      Current todayButtonHeight value. Default value is null
    • setTodayButtonTitle

      public DateChooser setTodayButtonTitle(String todayButtonTitle)
      Title for "Today" button.
      Parameters:
      todayButtonTitle - New todayButtonTitle value. Default value is "Today"
      Returns:
      DateChooser instance, for chaining setter calls
    • getTodayButtonTitle

      public String getTodayButtonTitle()
      Title for "Today" button.
      Returns:
      Current todayButtonTitle value. Default value is "Today"
    • setUse24HourTime

      public DateChooser setUse24HourTime(Boolean use24HourTime)
      When showing the time field, whether the TimeItem should be set to use 24-hour time. The default is true.
      Parameters:
      use24HourTime - New use24HourTime value. Default value is true
      Returns:
      DateChooser instance, for chaining setter calls
    • getUse24HourTime

      public Boolean getUse24HourTime()
      When showing the time field, whether the TimeItem should be set to use 24-hour time. The default is true.
      Returns:
      Current use24HourTime value. Default value is true
    • setUseFirstDayOfFiscalWeek

      public DateChooser setUseFirstDayOfFiscalWeek(Boolean useFirstDayOfFiscalWeek)
      When showing the fiscal year chooser, should firstDayOfWeek be defaulted to the same day as the fiscal start date? If true and a fiscal year starts on a Tuesday, the calendar will display Tuesday to Monday from left to right.
      Parameters:
      useFirstDayOfFiscalWeek - New useFirstDayOfFiscalWeek value. Default value is true
      Returns:
      DateChooser instance, for chaining setter calls
    • getUseFirstDayOfFiscalWeek

      public Boolean getUseFirstDayOfFiscalWeek()
      When showing the fiscal year chooser, should firstDayOfWeek be defaulted to the same day as the fiscal start date? If true and a fiscal year starts on a Tuesday, the calendar will display Tuesday to Monday from left to right.
      Returns:
      Current useFirstDayOfFiscalWeek value. Default value is true
    • getWeekChooserButton

      public IButton getWeekChooserButton() throws IllegalStateException
      A button shown in the navigation layout which shows a picker for selecting a specific week of the year. When showFiscalYearChooser is true, the week number represents a fiscal week number, one offset from the start of the fiscal year. Otherwise, it represents a week number offset from the start of the calendar year.

      This component is an AutoChild named "weekChooserButton". For an overview of how to use and configure AutoChildren, see Using AutoChildren.

      Returns:
      Current weekChooserButton value. Default value is null
      Throws:
      IllegalStateException - if this widget has not yet been rendered.
    • setWeekendDays

      public DateChooser setWeekendDays(int... weekendDays)
      An array of integer day-numbers that should be considered to be weekend days by this DateChooser instance. If unset, defaults to the set of days indicated globally.
      Parameters:
      weekendDays - New weekendDays value. Default value is null
      Returns:
      DateChooser instance, for chaining setter calls
      See Also:
    • getWeekendDays

      public int[] getWeekendDays()
      An array of integer day-numbers that should be considered to be weekend days by this DateChooser instance. If unset, defaults to the set of days indicated globally.
      Returns:
      Current weekendDays value. Default value is null
      See Also:
    • setWeekendHeaderStyle

      public DateChooser setWeekendHeaderStyle(String weekendHeaderStyle)
      Optional CSS style applied to the day-of-week headers for weekend days. If unset headerStyle will be applied to both weekdays and weekend days.
      Parameters:
      weekendHeaderStyle - New weekendHeaderStyle value. Default value is null
      Returns:
      DateChooser instance, for chaining setter calls
    • getWeekendHeaderStyle

      public String getWeekendHeaderStyle()
      Optional CSS style applied to the day-of-week headers for weekend days. If unset headerStyle will be applied to both weekdays and weekend days.
      Returns:
      Current weekendHeaderStyle value. Default value is null
    • setWeekFieldTitle

      public DateChooser setWeekFieldTitle(String weekFieldTitle)
      Title for the week field in the date grid.
      Parameters:
      weekFieldTitle - New weekFieldTitle value. Default value is "Wk"
      Returns:
      DateChooser instance, for chaining setter calls
    • getWeekFieldTitle

      public String getWeekFieldTitle()
      Title for the week field in the date grid.
      Returns:
      Current weekFieldTitle value. Default value is "Wk"
    • setWeekHeaderStyle

      public DateChooser setWeekHeaderStyle(String weekHeaderStyle)
      Base CSS style applied to the header of the fiscal or calendar week column in the calendar view.
      Parameters:
      weekHeaderStyle - New weekHeaderStyle value. Default value is null
      Returns:
      DateChooser instance, for chaining setter calls
      See Also:
    • getWeekHeaderStyle

      public String getWeekHeaderStyle()
      Base CSS style applied to the header of the fiscal or calendar week column in the calendar view.
      Returns:
      Current weekHeaderStyle value. Default value is null
      See Also:
    • setWeekMenuStyle

      public DateChooser setWeekMenuStyle(String weekMenuStyle) throws IllegalStateException
      Style for the pop-up week menu.
      Parameters:
      weekMenuStyle - New weekMenuStyle value. Default value is "dateChooserWeekMenu"
      Returns:
      DateChooser instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
      See Also:
    • getWeekMenuStyle

      public String getWeekMenuStyle()
      Style for the pop-up week menu.
      Returns:
      Current weekMenuStyle value. Default value is "dateChooserWeekMenu"
      See Also:
    • getYearChooserButton

      public IButton getYearChooserButton() throws IllegalStateException
      A button shown in the navigation layout that shows a picker for selecting a specific calendar year.

      This component is an AutoChild named "yearChooserButton". For an overview of how to use and configure AutoChildren, see Using AutoChildren.

      Returns:
      Current yearChooserButton value. Default value is null
      Throws:
      IllegalStateException - if this widget has not yet been rendered.
    • setYearMenuStyle

      public DateChooser setYearMenuStyle(String yearMenuStyle) throws IllegalStateException
      Style for the pop-up year menu.
      Parameters:
      yearMenuStyle - New yearMenuStyle value. Default value is "dateChooserYearMenu"
      Returns:
      DateChooser instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
      See Also:
    • getYearMenuStyle

      public String getYearMenuStyle()
      Style for the pop-up year menu.
      Returns:
      Current yearMenuStyle value. Default value is "dateChooserYearMenu"
      See Also:
    • cancelClick

      public void cancelClick()
      Fired when the user clicks the cancel button in this date chooser. Default implementation clears the date chooser.
    • addDataChangedHandler

      public HandlerRegistration addDataChangedHandler(DataChangedHandler handler)
      Add a dataChanged handler.

      Add a notification to be fired whenever the data changes.

      Has no default behavior (so no need to call Super).

      Use DateChooser.getData() to get the current date value.

      Specified by:
      addDataChangedHandler in interface HasDataChangedHandlers
      Parameters:
      handler - the dataChanged handler
      Returns:
      HandlerRegistration used to remove this handler
    • getData

      public Date getData()
      Get the current value of the picker.

      See DateChooser.dataChanged() for how to respond to the user picking a date.

      Returns:
      current date
    • getFiscalCalendar

      public FiscalCalendar getFiscalCalendar()
      Returns the FiscalCalendar object that will be used by this DateChooser.
      Returns:
      the fiscal calendar for this chooser, if set, or the global one otherwise
    • setData

      public void setData(Date date)
      Set the picker to show the given date.
      Parameters:
      date - new value
    • setFiscalCalendar

      public void setFiscalCalendar()
      Sets the FiscalCalendar object that will be used by this DateChooser. If unset, the global fiscal calendar is used.
    • setFiscalCalendar

      public void setFiscalCalendar(FiscalCalendar fiscalCalendar)
      Sets the FiscalCalendar object that will be used by this DateChooser. If unset, the global fiscal calendar is used.
      Parameters:
      fiscalCalendar - the fiscal calendar for this chooser
    • todayClick

      public void todayClick()
      Fired when the user clicks the Today button. Default implementation will select the current date in the date chooser.
    • setDefaultProperties

      public static void setDefaultProperties(DateChooser dateChooserProperties)
      Class level method to set the default properties of this class. If set, then all existing and subsequently created instances of this class will automatically have default properties corresponding to the properties set on the SmartGWT class instance passed to this function before its underlying SmartClient JS object was created. This is a powerful feature that eliminates the need for users to create a separate hierarchy of subclasses that only alter the default properties of this class. Can also be used for skinning / styling purposes.

      Note: This method is intended for setting default attributes only and will affect all instances of the underlying class (including those automatically generated in JavaScript). This method should not be used to apply standard EventHandlers or override methods for a class - use a custom subclass instead. Calling this method after instances have been created can result in undefined behavior, since it bypasses any setters and a class instance may have already examined a particular property and not be expecting any changes through this route.

      Parameters:
      dateChooserProperties - properties that should be used as new defaults when instances of this class are created
      See Also:
    • setYearTitleFormatter

      public void setYearTitleFormatter(DateChooser.YearTitleFormatter formatter)
    • setLogicalStructure

      public LogicalStructureObject setLogicalStructure(DateChooserLogicalStructure s)
      Setter implementing the LogicalStructure interface, which supports Eclipse's logical structure debugging facility.
    • getLogicalStructure

      public LogicalStructureObject getLogicalStructure()
      Getter implementing the LogicalStructure interface, which supports Eclipse's logical structure debugging facility.
      Specified by:
      getLogicalStructure in interface LogicalStructure
      Overrides:
      getLogicalStructure in class VLayout