Style: DATE_TIME - Footer: Off (GTK shown)
Description
The CDatepicker is a graphical version of a date selection widget which can display both a calendar and clock. Either the calendar or the clock can be displayed individually or both together depending upon the style settings, which can be set via the constructor or programatically at runtime.I18N
The locale of the CDatepicker can be set via the contstructor or a setter method at runtime.The CDatepicker does contain some locale specific Strings which cannot be handled with Java's Date / Calendar classes and thus it relies on external property files to be translated correctly.
Presently only English (US) and Romanian (RO) translations are available. If you are someone who can assist with this, simply file a Feature Request for CDatepicker/I18N and attach your translation.
View the properties file: English (US), Romanian
top
Calendar Operation
The user is able to select a date (year, month, and day) by selecting a day on the calenar. As the user mouses over the days, a button will appear under the cursor (like mousing over a toolbar) and this button can be clicked to generate a selection event.The user may navigate to dates that off-screen in sereral ways:
- Selecting Left and Right Arrows in the upper left increments/decrements the Month
- Selecting the Round Button between the Arrows set the selection to the Current Date
- Clicking the Month Label brings up a Context Menu with all 12 months
- Scrolling the mouse wheel over the Month Label increments/decrements the Month
- Scrolling the mouse wheel over the Year Label increments/decrements the Year
- Scrolling the mouse wheel over the Days scrolls the visible dates by 1 Week
- Alt-Clicking the Days brings up a Context Menu to set selection to the Current Date
- The Left and Right Arrow Keys (on the keyboard) increment/decrement the selected Day
- The Up and Down Arrow Keys (on the keyboard) increment/decrement the selected Week
- The Page UP and Page Down Keys scrolls the visible dates by 4 weeks
- The Home and End Keys scrolls the visible dates by 52 weeks
- Selecting the Year Label switches to Year Edit Mode where the year can be entered via the
keyboard - clicking anywhere other than on the Accept button will cancel the edit (Escape and
Carriage Return work as expected).
The CDatepicker Header when editing the Year via Keyboard
Clock Operation
The user selects a time (hour, minute, and second) by dragging the hands of the clock with the mouse. The AM_PM field is toggled when it's selected.The user can also adjust the Time in programmatically settable increments by scrolling with the mouse wheel when the cursor is over the Clock portion of the CDatepicker.
Selecting the Round Button in the center of the Clock (the pivot of the hands) sets the selection to the current time.
top
Developer API
View the full JavaDocThe CDatepicker has the following public constructors:
CDatepicker(Composite parent, int style)
CDatepicker(Composite parent, int style, Date date)
CDatepicker(Composite parent, int style, Date date, Locale locale)
CDatepicker(Composite parent, int style, Locale locale)
void addSelectionListener(SelectionListener listener)
Locale[] getAvailableLocales()
long getClockIncrement()
boolean getFooterVisible()
boolean getGridVisible()
int getFormat()
Locale getLocale()
boolean getSecondsHandDefault()
Date getSelection()
int getTimeSnap()
boolean isFooterVisible()
boolean isGridVisible()
void removeSelectionListener(SelectionListener listener)
void scrollCalendar(int keycode)
void setClockIncrement(long millis)
void setFooterVisible(boolean visible)
void setFormat(int style)
void setGridVisible(boolean visible)
void setLocale(Locale locale)
void setSecondsHandDefault(boolean on)
void setSelection(Date date)
void setSelection(Date date, boolean alignMonth)
void setTimeSnap(int minute, int second)
void traverseSelection(int keycode)
Road Map
Current Priorities:- Stability
- I18N
- Additional Features: