Skip to main content

Nebula CDateTime Widget(Style Settings)

CDateTime can take on many forms depending upon the setting of the style in its constructor.
These styles are found in a separate file: CDT.java, simply for the convenience of typing 3 characters rather than 9 :)

Example: new CDateTime(parent, CDT.BORDER | CDT.SIMPLE | CDT.DATE_SHORT | CDT.TIME_SHORT);

General Styles
DROP_DOWN->Creates both the textual and graphical parts; the text is shown and there is a button to drop down the graphical
SIMPLE->Creates ONLY the graphical selection part; there is no text box and no button
(Note that if neither of the above styles is set, then ONLY the textual selection part will be created; there will be no graphical part and no button)
Date and Time Styles
Refer to Date/Time Formats and Patterns for details.
DATE_SHORT
DATE_MEDIUM
DATE_LONG
TIME_SHORT
TIME_MEDIUM
Styles relevant to the Text Area
BORDER->Creates the Text/Combo area with a border (by setting SWT.BORDER)
SPINNER->Only valid if DROP_DOWN is NOT set - create the Text Selector with an SWT Spinner widget for inc/dec of fields
TAB_FIELDS->Allows movement between fields with the Tab key
Styles relevant to the Graphics Area
BORDER->Creates the Graphical Selector with a border (by setting SWT.BORDER)
CLOCK_12_HOUR->Force the Graphical Time Selector to a 12 hour clock, regardless of the Locale or Pattern
CLOCK_24_HOUR->Force the Graphical Time Selector to a 24 hour clock, regardless of the Locale or Pattern
CLOCK_DISCRETE->Create a Discrete Time Selector, rather than an Analog one
COMPACT->Create the Compact version of the Graphical Selector
HORIZONTAL->Only valid for a Discrete Time Selector - create it horizontally rather than vertically
SPINNER->Only valid for an Analog Time Selector - Create it with an SWT Spinner widget for inc/dec of the time
Combo Styles (Only valid when DROP_DOWN is set)
BUTTON_ALWAYS->Always show the button
BUTTON_AUTO->Only show the button when the text widget has the focus
BUTTON_MANUAL->Allow hiding and show the button programmatically
BUTTON_NEVER->Never show the button (the button will not be created)
BUTTON_LEFT->Position the button to the left of the text
BUTTON_RIGHT->(Default) Position the button to the right of the text

Back to the top