homecalypsoworkbenchwidgetsscreenshots

This project is hosted on Sourceforge.net:
Project Page
Downloads
Bugs Reports
Feature Requests
Browse CVS

CDatepickerCombo - A Textual Date Selection Widget with optional Drop CDatepicker


Style: NONE (GTK shown)

Style: DROP_DOWN (Win32 shown)

Description

The CDatepickerCombo is a textual version of a date selection widget which can display both dates and times in many different formats, patterns, and locales. It is also able to set a CDatepicker as its drop component so that the date and time may be selected graphically.
top

I18N

The CDatepickerCombo makes full use of Java's Locale object throughout, allowing it to be set via the constructor or a setter method at runtime. Locale can be changed any number of times and will automatically update the locale of the corresponding CDatepicker, if there is one.
An area of concern is BIDI languages, though the project has little means of testing them. If you are someone who can assist with this, please file a Feature Request.
top

Date Formats and Patterns

The CDatepickerCombo uses Java's abstract class, DateFormat, to maintain the format of its text and assist in navigation of its fields. Because of this, any Formatting object that can be assigned to a DateFormat can be used: This allows the setting of formats to be as simple as setFormat(ACW.DATE_SHORT) or as complex as setFormat("'Meeting on' EEEE, MMMM d '@' h:mm 'in the'a"). In both instances CDatepickerCombo will navigate through, and allow editing of, each text region which relates to a Calendar Field.
top

Text Operation

When the CDatepicker gains focus, by a means other than a mouse click (such as tabbing through a form), its entire text area is selected. The intent is to allow it to be copied and has the side affect that no field is actually selected, and thus the CDatepickerCombo cannot be edited. When the CDatepicker looses focus, by any means, all fields are unselected and again, the CDatepickerCombo cannot be edited. Before editing, an individual field must be selected.
Fortunately, though, it is pretty intuitive: simply select the field to be edited by clicking on it with the mouse.
Once the CDatepicker has focus, there are also many other ways of moving between fields: Once the user has navigated to a field they want to change, they again have multiple options: top

Drop Operation

When the user selects the "drop button" a CDatepicker will be dropped to allow graphical editing of the date and / or time, as appropriate for its format. This CDatepicker works exactly as it does on its own (refer to CDatepicker) with the exception that it will be operating in a "Combo" mode, and will thus have two extra buttons - an Accept Button, and a Cancel Button - in the upper right:


CDatepickerCombo with Clock dropped (Win32 shown)

These buttons allow the user to adjust each hand individually without the pop-up shell closing before they have completed the setting the time.
top

Developer API

View the full JavaDoc

The CDatepickerCombo has the following public constructors:

CDatepickerCombo(Composite parent, int style)
CDatepickerCombo(Composite parent, int style, Date date)
CDatepickerCombo(Composite parent, int style, Date date, Locale locale)
CDatepickerCombo(Composite parent, int style, Locale locale)

The CDatepickerCombo exposes the following public methods:

void        addSelectionListener(SelectionListener listener);
Locale[]    getAvailableLocales()
CDatepicker getCDatepicker()
int         getFormat()
String      getFormatPattern()
Locale      getLocale()
Date        getSelection()
void        popUp(boolean pop)
void        removeSelectionListener(SelectionListener listener)
void        setFormat(int format)
void        setFormat(String pattern)
void        setLocale(Locale locale)
void        setSelection(Date date)

top

Road Map

Current Priorities: top