Class DateChooser

java.lang.Object
org.eclipse.swt.widgets.Widget
org.eclipse.swt.widgets.Control
org.eclipse.swt.widgets.Scrollable
org.eclipse.swt.widgets.Composite
org.eclipse.nebula.widgets.datechooser.DateChooser
All Implemented Interfaces:
org.eclipse.swt.graphics.Drawable

public class DateChooser
extends org.eclipse.swt.widgets.Composite
Calendar widget. Presents the monthly view of a calendar for date picking.

Calendar is composed of a header and a grid for date selection. The header display the current month and year, and the two buttons for navigation (previous and next month). An optional footer display the today date.

Features:

  • Month names, weekday names and first day of week depend of the locale set on the calendar
  • GUI (colors, font...) are customizable through themes (3 provided)
  • Shows days from adjacent months
  • Optionally shows weeks numbers
  • Optional footer showing today date
  • Multi selection and interval selection
  • Keyboard support.

To know which dates have been selected in the calendar, there is two means :

  • The getSelectedDate() method returns the currently selected date (single selection). The getSelectedDates() returns a list of all selected dates (multi selection).
  • Add a CalendarListener to the calendar. This listener will be notified of selection. event.data contain the selection if in single selection mode.

Keyboard navigation :

  • Arrows: Change the focus cell.
  • Page UP / DOWN: Next / previous month.
  • Ctrl-Page UP / DOWN: Next / previous year.
  • SPACE: Select the cell having the focus. If in multi selection mode, all previous selected dates are cleared.
  • Ctrl-SPACE: Add the cell having the focus to the selection (multi selection mode).
  • Shift-SPACE: Select all dates in the interval between the current focus and the last selected date.
  • HOME: Set the focus on the today date, and select it if autoselectOnFooter is true.
  • Nested Class Summary

    Nested Classes 
    Modifier and Type Class Description
    protected class  DateChooser.Cell
    Defines a grid cell.
    protected class  DateChooser.DateChooserLayout
    Calendar grid specific layout.
  • Field Summary

    Fields 
    Modifier and Type Field Description
    protected boolean autoChangeOnAdjacent
    If true, change the current month if an adjacent day is clicked
    protected boolean autoSelectOnFooter
    If true, the today date is automatically selected on footer selection event
    protected java.util.Date beginInterval
    Begin date of selection interval
    static java.lang.String BUNDLE_NAME
    Bundle name constant
    protected org.eclipse.swt.widgets.Label currentMonth
    Label for the display of current month and year (corresponding to curDate)
    protected java.util.Calendar currentMonthCal
    Date of 1st day of the currently displayed month
    protected DateChooser.Cell[] days
    Days numbers cells
    protected org.eclipse.swt.widgets.Composite daysPanel
    Panel for display of day numbers
    protected java.text.SimpleDateFormat df1
    Format for the display of month and year in the header
    protected java.text.DateFormat df2
    Format for the today date in the footer
    protected java.util.Date endInterval
    End date of selection interval
    protected org.eclipse.swt.widgets.Listener filter
    Listener for external events
    protected int firstDayIndex
    Index in the grid of the first day of displayed month
    protected int firstDayOfWeek
    Index of the first day of week
    protected int focusIndex
    Index of the focus in the days numbers grid
    protected boolean footerVisible
    Flag to set footer visible or not
    static int GRID_FULL  
    static int GRID_LINES  
    static int GRID_NONE  
    protected DateChooser.DateChooserLayout gridLayout
    Layout of the grid
    protected org.eclipse.swt.widgets.Composite gridPanel
    Grid panel
    protected int gridVisible
    Flag to set grid visible or not
    protected boolean hasFocus
    Flag indicating if the calendar has the focus
    protected static int HEADER_SPACING
    Header spacing constant
    protected org.eclipse.swt.widgets.Label[] headers
    Grid headers, displaying weekday names
    protected org.eclipse.swt.widgets.Composite headersPanel
    Panel for display of weekday names
    protected org.eclipse.swt.widgets.Listener listener
    Listener for all internal events
    protected java.util.Locale locale
    Locale used for localized names and formats
    protected int minimalDaysInFirstWeek
    Minimal number of days in the first week
    protected org.eclipse.swt.widgets.Composite monthPanel
    Month header panel
    protected org.eclipse.swt.widgets.Menu monthsMenu
    Popup menu for month selection
    protected boolean multi
    Multi selection flag
    protected boolean navigationEnabled
    Flag to set navigation enabled or not
    protected org.eclipse.swt.widgets.Button nextMonth
    Navigation button for next month
    protected static int NOFOCUS
    Value to use when there is none internal widget having the focus
    protected org.eclipse.swt.widgets.Button prevMonth
    Navigation button for previous month
    protected java.util.ResourceBundle resources
    Resources bundle
    protected java.util.List<java.util.Date> selection
    Selection
    protected DateChooserTheme theme
    Calendar theme
    protected java.util.Calendar todayCal
    The today date
    protected org.eclipse.swt.widgets.Label todayLabel
    Today label of the footer
    protected DateChooser.Cell[] weeks
    Weeks numbers cells
    protected org.eclipse.swt.widgets.Composite weeksPanel
    Panel for display of week numbers
    protected boolean weeksVisible
    Flag to set weeks numbers visible or not

    Fields inherited from class org.eclipse.swt.widgets.Control

    handle
  • Constructor Summary

    Constructors 
    Constructor Description
    DateChooser​(org.eclipse.swt.widgets.Composite parent, int style)
    Constructs a new instance of this class given its parent and a style value describing its behavior and appearance.
  • Method Summary

    Modifier and Type Method Description
    void addSelectionListener​(org.eclipse.swt.events.SelectionListener lsnr)
    Adds the listener to the collection of listeners who will be notified when the receiver's selection changes, by sending it one of the messages defined in the SelectionListener interface.
    protected void buttonsEvent​(org.eclipse.swt.widgets.Event event)
    Manages navigation buttons events.
    protected void calendarEvent​(org.eclipse.swt.widgets.Event event)
    Manages event at the calendar level.
    protected void changeCurrentMonth​(int add)
    Displays a new month in the grid.
    void clearSelection()
    Clears the selection.
    protected void clearSelection​(boolean refresh)
    Clears the selection.
    void dispose()
    Disposes of the operating system resources associated with the receiver and all its descendants.
    protected void footerEvent​(org.eclipse.swt.widgets.Event event)
    Manages events on the footer label.
    boolean forceFocus()
    Forces the receiver to have the keyboard focus, causing all keyboard events to be delivered to it.
    java.util.Date getCurrentMonth()
    Returns the current displayed month.
    int getFirstDayOfWeek()
    Gets what the first day of the week is.
    int getGridVisible()
    Returns the grid visibility status.
    int getMinimalDaysInFirstWeek()
    Gets what the minimal days required in the first week of the year are.
    java.util.Date getSelectedDate()
    Returns the selected date.
    java.util.Collection<java.util.Date> getSelectedDates()
    Returns all the selected dates.
    java.util.Date getTodayDate()
    Returns the today date.
    protected void gridEvent​(org.eclipse.swt.widgets.Event event)
    Manages events at the grid level.
    boolean isAutoChangeOnAdjacent()
    Returns the autoChangeOnAdjacent mode.
    boolean isAutoSelectOnFooter()
    Returns the autoSelectOnFooter mode.
    boolean isDateSelected​(java.util.Date date)
    Returns true if the given date is selected, else returns false.
    boolean isFocusControl()
    Returns true if the receiver has the user-interface focus, and false otherwise.
    boolean isFooterVisible()
    Returns true if footer is visible.
    boolean isGridVisible()
    Deprecated. 
    boolean isNavigationEnabled()
    Returns true if navigation is enabled.
    boolean isWeeksVisible()
    Returns true if weeks numbers are visible.
    protected void menuEvent​(org.eclipse.swt.widgets.Event event)
    Manages all events of the contextual menu on the month label of the header.
    protected void notifySelection()
    Sends selection event to the listeners.
    void removeSelectedDate​(java.util.Date d)
    Removes the given date from the selection.
    void removeSelectionListener​(org.eclipse.swt.events.SelectionListener lsnr)
    Removes the listener from the collection of listeners who will be notified when the receiver's selection changes.
    void setAutoChangeOnAdjacent​(boolean autoChangeOnAdjacent)
    Sets to true to enable the automatic change of current month when an adjacent day is clicked in the grid.
    void setAutoSelectOnFooter​(boolean autoselectOnFooter)
    Set the autoSelectOnFooter mode.
    void setCurrentMonth​(java.util.Date month)
    Sets a new month to display.
    void setFirstDayOfWeek​(int firstDayOfWeek)
    Sets what the first day of the week is.
    boolean setFocus()
    Causes the receiver to have the keyboard focus, such that all keyboard events will be delivered to it.
    void setFocusOnDate​(java.util.Date date)
    Sets the focus on the given date.
    void setFocusOnToday​(boolean autoselect)
    Sets the focus on the today date.
    void setFont​(org.eclipse.swt.graphics.Font font)
    Sets the font that the receiver will use to paint textual information to the font specified by the argument, or to the default font for that kind of control if the argument is null.
    void setFooterVisible​(boolean footerVisible)
    Sets the footer visible or not.
    void setGridVisible​(boolean gridVisible)
    Deprecated. 
    void setGridVisible​(int gridVisible)
    Sets the grid visible or not.
    void setLayout​(org.eclipse.swt.widgets.Layout layout)
    Sets the layout which is associated with the receiver to be the argument which may be null.
    void setLocale​(java.util.Locale locale)
    Sets a new locale to use for calendar.
    void setMinimalDaysInFirstWeek​(int minimalDaysInFirstWeek)
    Sets what the minimal days required in the first week of the year are; For example, if the first week is defined as one that contains the first day of the first month of a year, call this method with value 1.
    void setNavigationEnabled​(boolean navigationEnabled)
    Sets the header's navigation buttons visible or not.
    void setSelectedDate​(java.util.Date date)
    Sets the selected date.
    void setTheme​(DateChooserTheme theme)
    Sets the theme to apply to the calendar.
    void setTodayDate​(java.util.Date today)
    Sets the today date.
    void setWeeksVisible​(boolean weeksVisible)
    Sets the weeks numbers visible or not.

    Methods inherited from class org.eclipse.swt.widgets.Composite

    changed, checkSubclass, drawBackground, getBackgroundMode, getChildren, getLayout, getLayoutDeferred, getTabList, isLayoutDeferred, layout, layout, layout, layout, layout, setBackgroundMode, setLayoutDeferred, setTabList, toString

    Methods inherited from class org.eclipse.swt.widgets.Scrollable

    computeTrim, getClientArea, getHorizontalBar, getScrollbarsMode, getVerticalBar

    Methods inherited from class org.eclipse.swt.widgets.Control

    addControlListener, addDragDetectListener, addFocusListener, addGestureListener, addHelpListener, addKeyListener, addMenuDetectListener, addMouseListener, addMouseMoveListener, addMouseTrackListener, addMouseWheelListener, addPaintListener, addTouchListener, addTraverseListener, computeSize, computeSize, dragDetect, dragDetect, getAccessible, getBackground, getBackgroundImage, getBorderWidth, getBounds, getCursor, getDragDetect, getEnabled, getFont, getForeground, getLayoutData, getLocation, getMenu, getMonitor, getOrientation, getParent, getRegion, getShell, getSize, getTextDirection, getToolTipText, getTouchEnabled, getVisible, internal_dispose_GC, internal_new_GC, isEnabled, isReparentable, isVisible, moveAbove, moveBelow, pack, pack, print, redraw, redraw, removeControlListener, removeDragDetectListener, removeFocusListener, removeGestureListener, removeHelpListener, removeKeyListener, removeMenuDetectListener, removeMouseListener, removeMouseMoveListener, removeMouseTrackListener, removeMouseWheelListener, removePaintListener, removeTouchListener, removeTraverseListener, requestLayout, setBackground, setBackgroundImage, setBounds, setBounds, setCapture, setCursor, setDragDetect, setEnabled, setForeground, setLayoutData, setLocation, setLocation, setMenu, setOrientation, setParent, setRedraw, setRegion, setSize, setSize, setTextDirection, setToolTipText, setTouchEnabled, setVisible, toControl, toControl, toDisplay, toDisplay, traverse, traverse, traverse, update

    Methods inherited from class org.eclipse.swt.widgets.Widget

    addDisposeListener, addListener, checkWidget, getData, getData, getDisplay, getListeners, getStyle, isAutoDirection, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, removeListener, reskin, setData, setData

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

    Methods inherited from interface org.eclipse.swt.graphics.Drawable

    isAutoScalable
  • Field Details

    • BUNDLE_NAME

      public static final java.lang.String BUNDLE_NAME
      Bundle name constant
      See Also:
      Constant Field Values
    • HEADER_SPACING

      protected static final int HEADER_SPACING
      Header spacing constant
      See Also:
      Constant Field Values
    • NOFOCUS

      protected static final int NOFOCUS
      Value to use when there is none internal widget having the focus
      See Also:
      Constant Field Values
    • GRID_NONE

      public static final int GRID_NONE
      See Also:
      Constant Field Values
    • GRID_LINES

      public static final int GRID_LINES
      See Also:
      Constant Field Values
    • GRID_FULL

      public static final int GRID_FULL
      See Also:
      Constant Field Values
    • multi

      protected boolean multi
      Multi selection flag
    • selection

      protected java.util.List<java.util.Date> selection
      Selection
    • beginInterval

      protected java.util.Date beginInterval
      Begin date of selection interval
    • endInterval

      protected java.util.Date endInterval
      End date of selection interval
    • autoSelectOnFooter

      protected boolean autoSelectOnFooter
      If true, the today date is automatically selected on footer selection event
    • monthPanel

      protected org.eclipse.swt.widgets.Composite monthPanel
      Month header panel
    • prevMonth

      protected org.eclipse.swt.widgets.Button prevMonth
      Navigation button for previous month
    • currentMonth

      protected org.eclipse.swt.widgets.Label currentMonth
      Label for the display of current month and year (corresponding to curDate)
    • nextMonth

      protected org.eclipse.swt.widgets.Button nextMonth
      Navigation button for next month
    • monthsMenu

      protected org.eclipse.swt.widgets.Menu monthsMenu
      Popup menu for month selection
    • gridPanel

      protected org.eclipse.swt.widgets.Composite gridPanel
      Grid panel
    • gridLayout

      protected DateChooser.DateChooserLayout gridLayout
      Layout of the grid
    • headersPanel

      protected org.eclipse.swt.widgets.Composite headersPanel
      Panel for display of weekday names
    • headers

      protected org.eclipse.swt.widgets.Label[] headers
      Grid headers, displaying weekday names
    • daysPanel

      protected org.eclipse.swt.widgets.Composite daysPanel
      Panel for display of day numbers
    • days

      protected DateChooser.Cell[] days
      Days numbers cells
    • weeksPanel

      protected org.eclipse.swt.widgets.Composite weeksPanel
      Panel for display of week numbers
    • weeks

      protected DateChooser.Cell[] weeks
      Weeks numbers cells
    • firstDayIndex

      protected int firstDayIndex
      Index in the grid of the first day of displayed month
    • todayLabel

      protected org.eclipse.swt.widgets.Label todayLabel
      Today label of the footer
    • locale

      protected java.util.Locale locale
      Locale used for localized names and formats
    • df1

      protected java.text.SimpleDateFormat df1
      Format for the display of month and year in the header
    • df2

      protected java.text.DateFormat df2
      Format for the today date in the footer
    • firstDayOfWeek

      protected int firstDayOfWeek
      Index of the first day of week
    • minimalDaysInFirstWeek

      protected int minimalDaysInFirstWeek
      Minimal number of days in the first week
    • resources

      protected java.util.ResourceBundle resources
      Resources bundle
    • currentMonthCal

      protected java.util.Calendar currentMonthCal
      Date of 1st day of the currently displayed month
    • todayCal

      protected java.util.Calendar todayCal
      The today date
    • theme

      protected DateChooserTheme theme
      Calendar theme
    • gridVisible

      protected int gridVisible
      Flag to set grid visible or not
    • weeksVisible

      protected boolean weeksVisible
      Flag to set weeks numbers visible or not
    • footerVisible

      protected boolean footerVisible
      Flag to set footer visible or not
    • navigationEnabled

      protected boolean navigationEnabled
      Flag to set navigation enabled or not
    • autoChangeOnAdjacent

      protected boolean autoChangeOnAdjacent
      If true, change the current month if an adjacent day is clicked
    • listener

      protected org.eclipse.swt.widgets.Listener listener
      Listener for all internal events
    • filter

      protected org.eclipse.swt.widgets.Listener filter
      Listener for external events
    • hasFocus

      protected boolean hasFocus
      Flag indicating if the calendar has the focus
    • focusIndex

      protected int focusIndex
      Index of the focus in the days numbers grid
  • Constructor Details

    • DateChooser

      public DateChooser​(org.eclipse.swt.widgets.Composite parent, int style)
      Constructs a new instance of this class given its parent and a style value describing its behavior and appearance.

      The calendar is initialized by default with the default Locale, and the current date for today and selected date attributes.

      Parameters:
      parent - a composite control which will be the parent of the new instance (cannot be null)
      style - the style of control to construct
  • Method Details

    • addSelectionListener

      public void addSelectionListener​(org.eclipse.swt.events.SelectionListener lsnr)
      Adds the listener to the collection of listeners who will be notified when the receiver's selection changes, by sending it one of the messages defined in the SelectionListener interface.

      widgetSelected is called when the dates selection changes.

      Parameters:
      lsnr - the listener which should be notified
      See Also:
      SelectionListener, removeSelectionListener(org.eclipse.swt.events.SelectionListener)
    • buttonsEvent

      protected void buttonsEvent​(org.eclipse.swt.widgets.Event event)
      Manages navigation buttons events.
      Parameters:
      event - event
    • calendarEvent

      protected void calendarEvent​(org.eclipse.swt.widgets.Event event)
      Manages event at the calendar level.
      Parameters:
      event - event
    • changeCurrentMonth

      protected void changeCurrentMonth​(int add)
      Displays a new month in the grid. The new month is specified by delta from the currently displayed one.
      Parameters:
      add - delta from the current month
    • clearSelection

      public void clearSelection()
      Clears the selection.
    • clearSelection

      protected void clearSelection​(boolean refresh)
      Clears the selection. The refresh flag allows to indicate must be refreshed or not.
      Parameters:
      refresh - true to refresh display, else false
    • dispose

      public void dispose()
      Disposes of the operating system resources associated with the receiver and all its descendants.
      Overrides:
      dispose in class org.eclipse.swt.widgets.Widget
      See Also:
      Widget.dispose()
    • footerEvent

      protected void footerEvent​(org.eclipse.swt.widgets.Event event)
      Manages events on the footer label.
      Parameters:
      event - event
    • forceFocus

      public boolean forceFocus()
      Forces the receiver to have the keyboard focus, causing all keyboard events to be delivered to it.
      Overrides:
      forceFocus in class org.eclipse.swt.widgets.Control
      Returns:
      true if the control got focus, and false if it was unable to.
    • getCurrentMonth

      public java.util.Date getCurrentMonth()
      Returns the current displayed month.
      Returns:
      Date representing current month.
    • getFirstDayOfWeek

      public int getFirstDayOfWeek()
      Gets what the first day of the week is.
      Returns:
      the first day of the week.
    • getGridVisible

      public int getGridVisible()
      Returns the grid visibility status.
      Returns:
      Returns the grid visible status.
    • getMinimalDaysInFirstWeek

      public int getMinimalDaysInFirstWeek()
      Gets what the minimal days required in the first week of the year are.
      Returns:
      the minimal days required in the first week of the year.
    • getSelectedDate

      public java.util.Date getSelectedDate()
      Returns the selected date. If calendar is in multi selection mode, the first item of selection list is returned, with no guaranty of the selection order by the user. If no selection, return null.
      Returns:
      selected date
    • getSelectedDates

      public java.util.Collection<java.util.Date> getSelectedDates()
      Returns all the selected dates. The collection returned is a copy of the internal selection list.

      If the calendar is in single selection mode, it is preferable to use getSelectedDate that returns a Date value.

      Returns:
      Collection of selected dates
    • getTodayDate

      public java.util.Date getTodayDate()
      Returns the today date.
      Returns:
      today date
    • gridEvent

      protected void gridEvent​(org.eclipse.swt.widgets.Event event)
      Manages events at the grid level.
      Parameters:
      event - event
    • isAutoChangeOnAdjacent

      public boolean isAutoChangeOnAdjacent()
      Returns the autoChangeOnAdjacent mode.
      Returns:
      true / false
    • isAutoSelectOnFooter

      public boolean isAutoSelectOnFooter()
      Returns the autoSelectOnFooter mode.
      Returns:
      true / false
    • isDateSelected

      public boolean isDateSelected​(java.util.Date date)
      Returns true if the given date is selected, else returns false.
      Parameters:
      date -
      Returns:
      true if selected, else false.
    • isFocusControl

      public boolean isFocusControl()
      Returns true if the receiver has the user-interface focus, and false otherwise.
      Overrides:
      isFocusControl in class org.eclipse.swt.widgets.Control
      Returns:
      the receiver's focus state
      See Also:
      Control.isFocusControl()
    • isFooterVisible

      public boolean isFooterVisible()
      Returns true if footer is visible.
      Returns:
      true if footer visible, else false
    • isGridVisible

      @Deprecated public boolean isGridVisible()
      Deprecated.
      Returns true if grid is visible in the calendar popup.
      Returns:
      Returns the grid visible status.
    • isNavigationEnabled

      public boolean isNavigationEnabled()
      Returns true if navigation is enabled. If false, buttons are not visible.
      Returns:
      Returns the navigation status.
    • isWeeksVisible

      public boolean isWeeksVisible()
      Returns true if weeks numbers are visible.
      Returns:
      Returns the weeks numbers visible status.
    • menuEvent

      protected void menuEvent​(org.eclipse.swt.widgets.Event event)
      Manages all events of the contextual menu on the month label of the header.
      Parameters:
      event - event
    • notifySelection

      protected void notifySelection()
      Sends selection event to the listeners.
    • removeSelectedDate

      public void removeSelectedDate​(java.util.Date d)
      Removes the given date from the selection.
      Parameters:
      d - date to remove
    • removeSelectionListener

      public void removeSelectionListener​(org.eclipse.swt.events.SelectionListener lsnr)
      Removes the listener from the collection of listeners who will be notified when the receiver's selection changes.
      Parameters:
      lsnr - the listener which should no longer be notified
      See Also:
      SelectionListener, addSelectionListener(org.eclipse.swt.events.SelectionListener)
    • setAutoChangeOnAdjacent

      public void setAutoChangeOnAdjacent​(boolean autoChangeOnAdjacent)
      Sets to true to enable the automatic change of current month when an adjacent day is clicked in the grid.

      This mode is true by default.

      Parameters:
      autoChangeOnAdjacent - true / false
    • setAutoSelectOnFooter

      public void setAutoSelectOnFooter​(boolean autoselectOnFooter)
      Set the autoSelectOnFooter mode. If true, the today date is automatically selected on the footer selection event. This mode is false by default.
      Parameters:
      autoselectOnFooter - true /false
    • setCurrentMonth

      public void setCurrentMonth​(java.util.Date month)
      Sets a new month to display.
      Parameters:
      month - New month
    • setFirstDayOfWeek

      public void setFirstDayOfWeek​(int firstDayOfWeek)
      Sets what the first day of the week is.

      This method allows to change the default first day of the week set from the locale. It must be called after setLocale().

      Parameters:
      firstDayOfWeek - the given first day of the week.
    • setFocus

      public boolean setFocus()
      Causes the receiver to have the keyboard focus, such that all keyboard events will be delivered to it.
      Overrides:
      setFocus in class org.eclipse.swt.widgets.Composite
      Returns:
      true if the control got focus, and false if it was unable to.
    • setFocusOnDate

      public void setFocusOnDate​(java.util.Date date)
      Sets the focus on the given date. The current displayed month is changed if necessary.
      Parameters:
      date - date to set the focus on
    • setFocusOnToday

      public void setFocusOnToday​(boolean autoselect)
      Sets the focus on the today date. If autoselect is true, the today date is selected.
      Parameters:
      autoselect - true to select automatically the today date, else false
    • setFont

      public void setFont​(org.eclipse.swt.graphics.Font font)
      Sets the font that the receiver will use to paint textual information to the font specified by the argument, or to the default font for that kind of control if the argument is null.

      The new font is applied to all elements (labels) composing the calendar. The width of cells is adjusted.

      Overrides:
      setFont in class org.eclipse.swt.widgets.Control
      Parameters:
      font - the new font (or null)
    • setFooterVisible

      public void setFooterVisible​(boolean footerVisible)
      Sets the footer visible or not. The footer displays the today date. It is not visible by default.
      Parameters:
      footerVisible - true to set footer visible, else false
    • setGridVisible

      @Deprecated public void setGridVisible​(boolean gridVisible)
      Deprecated.
      Sets the grid visible or not in the calendar popup. By default, the grid is visible.
      Parameters:
      gridVisible - true to set grid visible, else false
    • setGridVisible

      public void setGridVisible​(int gridVisible)
      Sets the grid visible or not. By default, the grid is visible. The possible values are GRID_FULL, GRID_LINES and GRID_NONE.
      Parameters:
      gridVisible - grid visibility flag
    • setLayout

      public void setLayout​(org.eclipse.swt.widgets.Layout layout)
      Sets the layout which is associated with the receiver to be the argument which may be null.

      Note : No Layout can be set on this Control because it already manages the size and position of its children.

      Overrides:
      setLayout in class org.eclipse.swt.widgets.Composite
      Parameters:
      layout - the receiver's new layout or null
    • setLocale

      public void setLocale​(java.util.Locale locale)
      Sets a new locale to use for calendar. Locale will define the names of months and days, and the first day of week.
      Parameters:
      locale - new locale (must not be null)
    • setMinimalDaysInFirstWeek

      public void setMinimalDaysInFirstWeek​(int minimalDaysInFirstWeek)
      Sets what the minimal days required in the first week of the year are; For example, if the first week is defined as one that contains the first day of the first month of a year, call this method with value 1. If it must be a full week, use value 7.

      This method allows to change the default value set from the locale. It must be called after setLocale().

      Parameters:
      minimalDaysInFirstWeek - the given minimal days required in the first week of the year.
    • setNavigationEnabled

      public void setNavigationEnabled​(boolean navigationEnabled)
      Sets the header's navigation buttons visible or not.
      Parameters:
      navigationEnabled - true if enabled, false else
    • setSelectedDate

      public void setSelectedDate​(java.util.Date date)
      Sets the selected date. The grid is refreshed to display the corresponding month.
      Parameters:
      date - new selected date (must not be null)
    • setTheme

      public void setTheme​(DateChooserTheme theme)
      Sets the theme to apply to the calendar.
      Parameters:
      theme - new theme (must not be null)
    • setTodayDate

      public void setTodayDate​(java.util.Date today)
      Sets the today date.

      By default the today date is initialized to the current system date. But it can be needed to adjust it for specifics needs.

      Parameters:
      today - today date (must not be null)
    • setWeeksVisible

      public void setWeeksVisible​(boolean weeksVisible)
      Sets the weeks numbers visible or not. By default, the weeks are NOT visible.
      Parameters:
      weeksVisible - true to set weeks visible, else false