glimmer-cw-cdatetime-nebula 1.4.0.2.0 → 1.5.0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b37eeaba86e192bbf3f0e00c57b267ab0c56e6574c310567489c23f1837c2190
4
- data.tar.gz: 33f2acdd08fad52407236b598046aad6da491bdd61adc95c31ca89781acca617
3
+ metadata.gz: b2b27a5ece4803fbb7129f299f334db84f2e04a3493771b4450422960444feeb
4
+ data.tar.gz: aeb73d132ab04b909950c530699aa4ab32737c674318742e0331951f4ddb06c6
5
5
  SHA512:
6
- metadata.gz: 173b9ff49a578b5e5952eb88513c6b5bf5518eb47036d915bbfc52bba7ce90906d93f6b4cb1cb1e7f825f9c22bca4c78bfb99263bb182d0021f96b146802eec4
7
- data.tar.gz: a0b93d1badec9d7054197b44bfc3610b0f6ad0b8c5c329ae920c0d1ea083311c3335e7849ee0f32570b8b98eba7c5de60728347033f6ad9bb2d9054c89582864
6
+ metadata.gz: d4e3c7f7caa2e359da5ec4c799c573e18f3e35ca66d63b7b4aee3d5d4b72e73f8b0f39943a6d680f078b59a66f9272057e87fca41e8c6a3c2df2d295bbf3d036
7
+ data.tar.gz: 90080b9ed297c65bf21007debb9e6fe58a81513371bde8f25239e3e04e8b608b988341dcd17785f841f493e70a832f272cf41772762e55b015ebc6eb86805105
@@ -0,0 +1,49 @@
1
+ # Change Log
2
+
3
+ ## 1.5.0.2.0
4
+
5
+ - Support Glimmer DSL for Opal with `c_time`, `c_time_drop_down`, `c_time_compact`, `c_date`, and `c_date_drop_down`
6
+ - Update c_date_time_gallery sample to use data-binding
7
+ - c_date_time_gallery sample running in Glimmer DSL for Opal
8
+ - Upgraded gem to a Rails Engine gem to share assets with a Rails app
9
+
10
+ ## 1.5.0.1.0
11
+
12
+ - Upgraded to support glimmer-dsl-swt 4.17.2.0 up to 5.0.0.0
13
+
14
+ ## 1.5.0.0.1
15
+
16
+ - Just corrected gem documentation to avoid mentioning older Nebula CDateTime 1.4.0
17
+
18
+ ## 1.5.0.0.0
19
+
20
+ - Upgrade to Nebula CDateTime 1.5.0
21
+ - Upgrade to Glimmer DSL for SWT 4.17.0.0
22
+
23
+ ## 1.4.0.2.1
24
+
25
+ - Make sure `#text_widget_content` returns nil with plain style
26
+ - Support c_date_time keyword aliases as a table editor
27
+ - Fix issue with overwriting specified styles with default styles
28
+
29
+ ## 1.4.0.2.0
30
+
31
+ - Actual CDateTimeProxy class that is a subclass of WidgetProxy
32
+ - Smart defaults
33
+ ` `cdt` keyword for easily building `CDT` styles
34
+ - `c_date`, `c_time` aliases for date only and time only
35
+ - `c_date_time_drop_down`, `c_date_drop_down`, `c_time_drop_down` for drop down configured widgets
36
+ - `c_date_time_spinner`, `c_date_spinner`, `c_time_spinner` for spinner configured widgets
37
+ - `c_date_time_compact`, `c_date_compact`, `c_time_compact` for compact style configured widgets
38
+ - `text_widget_proxy` method to retrieve a Glimmer widget proxy for the inner text widget of CDateTime, thus enabling direct adding of observers and data-binding
39
+ - `toggle_open` method to programmatically toggle between open and closed (works better and is more convenient than `.swt_widget.set_open` in some situations)
40
+ - Nebula CDateTime Glimmer Custom Widget Gallery [sample](samples/nebula/c_date_time_gallery.rb)
41
+
42
+ ## 1.4.0.1
43
+
44
+ - Prevent table editor from saving upon traversing months in drop down Calendar
45
+
46
+ ## 1.4.0.0
47
+
48
+ - Initial version containing a Glimmer configured and wrapped CDateTime Nebula custom widget
49
+ - Support use as editor of Glimmer table items.
data/README.md CHANGED
@@ -1,45 +1,51 @@
1
- # Nebula CDateTime Widget 1.4.0.2.0
2
- ## [<img src="https://raw.githubusercontent.com/AndyObtiva/glimmer/master/images/glimmer-logo-hi-res.png" height=40 /> Glimmer Custom Widget](https://github.com/AndyObtiva/glimmer#custom-widget-gem)
1
+ # Nebula CDateTime Widget 1.5.0.2.0
2
+ ## [<img src="https://raw.githubusercontent.com/AndyObtiva/glimmer-dsl-swt/master/images/glimmer-logo-hi-res.png" height=40 /> Glimmer Custom Widget](https://github.com/AndyObtiva/glimmer-dsl-swt#custom-widget-gem)
3
3
  [![Gem Version](https://badge.fury.io/rb/glimmer-cw-cdatetime-nebula.svg)](http://badge.fury.io/rb/glimmer-cw-cdatetime-nebula)
4
4
 
5
5
  [<img alt="Nebula CDateTime Widget" src="https://www.eclipse.org/nebula/widgets/cdatetime/images/CDTSnippet02.png" />](https://www.eclipse.org/nebula/widgets/cdatetime/cdatetime.php)
6
6
 
7
- The [Nebula CDateTime Widget](https://www.eclipse.org/nebula/widgets/cdatetime/cdatetime.php) is a Date and Time selection widget that can be used in a plain (graphical), dropdown, spinner, or compact text style.
7
+ The [Nebula CDateTime Widget](https://www.eclipse.org/nebula/widgets/cdatetime/cdatetime.php) is a Date and Time selection widget that can be used in a simple, dropdown, spinner, or compact style.
8
8
 
9
- Packaged as a [Glimmer Custom Widget](https://github.com/AndyObtiva/glimmer#custom-widget-gem) to provide date/time selection via a combo/dropdown-style widget in [Glimmer](https://github.com/AndyObtiva/glimmer) using the `c_date_time` [Glimmer DSL](https://github.com/AndyObtiva/glimmer#glimmer-dsl-syntax) keyword.
9
+ Packaged as a [Glimmer Custom Widget](https://github.com/AndyObtiva/glimmer-dsl-swt#custom-widget-gem) to provide date/time selection via a combo/dropdown-style widget in [Glimmer DSL for SWT](https://github.com/AndyObtiva/glimmer-dsl-swt) using the `c_date_time` [Glimmer DSL](https://github.com/AndyObtiva/glimmer-dsl-swt#glimmer-gui-dsl-syntax) keyword.
10
10
 
11
- [glimmer-cw-cdatetime-nebula](https://rubygems.org/gems/glimmer-cw-cdatetime-nebula) 1.4.0.x.y gem versions map to Nebula CDateTime Widget version 1.4.0
11
+ Now, also supports [Glimmer DSL for Opal](#glimmer-dsl-for-opal) Auto-Webifier of Desktop Apps via Rails/Opal.
12
+
13
+ [glimmer-cw-cdatetime-nebula](https://rubygems.org/gems/glimmer-cw-cdatetime-nebula) 1.5.0.x.y gem versions map to Nebula CDateTime Widget version 1.5.0 (which comes with [Nebula 2.4.2](https://www.eclipse.org/nebula/releases/2.4.2/index.php))
12
14
 
13
15
  ## Table of contents
14
16
 
15
- - [Nebula CDateTime Widget 1.4.0.2.0](#nebula-cdatetime-widget-14020)
17
+ - [Nebula CDateTime Widget 1.5.0.2.0](#nebula-cdatetime-widget-15020)
16
18
  - [Pre-requisites](#pre-requisites)
17
19
  - [Setup](#setup)
18
- - [Glimmer Application](#glimmer-application)
19
- - [Glimmer Custom Shell or Glimmer Custom Widget](#glimmer-custom-shell-or-glimmer-custom-widget)
20
- - [Java Imports](#java-imports)
20
+ - [Glimmer DSL for SWT](#glimmer-dsl-for-swt)
21
+ - [Glimmer Application](#glimmer-application)
22
+ - [Glimmer Custom Shell or Glimmer Custom Widget](#glimmer-custom-shell-or-glimmer-custom-widget)
23
+ - [Java Imports](#java-imports)
24
+ - [Glimmer DSL for Opal](#glimmer-dsl-for-opal)
25
+ - [Setup](#setup)
21
26
  - [Instructions](#instructions)
22
27
  - [Sample](#sample)
23
- - [Plain](#plain)
28
+ - [Glimmer DSL for SWT Sample](#glimmer-dsl-for-swt-sample)
29
+ - [Glimmer DSL for Opal Sample](#glimmer-dsl-for-opal-sample)
30
+ - [Simple Style](#simple-style)
24
31
  - [`c_date_time`](#cdatetime)
25
32
  - [`c_date`](#cdate)
26
33
  - [`c_time`](#ctime)
27
- - [Drop Down](#drop-down)
34
+ - [Drop Down Style](#drop-down-style)
28
35
  - [`c_date_time_drop_down`](#cdatetimedropdown)
29
36
  - [`c_date_drop_down`](#cdatedropdown)
30
37
  - [`c_time_drop_down`](#ctimedropdown)
31
- - [Spinner](#spinner)
38
+ - [Spinner Style](#spinner-style)
32
39
  - [`c_date_time_spinner`](#cdatetimespinner)
33
40
  - [`c_date_spinner`](#cdatespinner)
34
41
  - [`c_time_spinner`](#ctimespinner)
35
- - [Compact](#compact)
42
+ - [Compact Style](#compact-style)
36
43
  - [`c_date_time_compact`](#cdatetimecompact)
37
44
  - [`c_date_compact`](#cdatecompact)
38
45
  - [`c_time_compact`](#ctimecompact)
39
- - [Style](#style)
40
- - [`cdt`](#cdt)
46
+ - [`CDT` Style Arguments](#cdt-style-arguments)
41
47
  - [Data-Binding and Observers:](#data-binding-and-observers)
42
- - [Table Editing](#table-editing)
48
+ - [Table Editor](#table-editor)
43
49
  - [API](#api)
44
50
  - [Glimmer Custom API](#glimmer-custom-api)
45
51
  - [`toggle_open`](#toggleopen)
@@ -51,22 +57,29 @@ Packaged as a [Glimmer Custom Widget](https://github.com/AndyObtiva/glimmer#cust
51
57
 
52
58
  ## Pre-requisites
53
59
 
54
- - [Glimmer](https://github.com/AndyObtiva/glimmer) application, [Glimmer](https://github.com/AndyObtiva/glimmer) custom shell, or another [Glimmer](https://github.com/AndyObtiva/glimmer) custom widget
55
- - JRuby version required by Glimmer
56
- - Java version required by Glimmer
60
+ - [Glimmer DSL for SWT](https://github.com/AndyObtiva/glimmer-dsl-swt) application, [Glimmer](https://github.com/AndyObtiva/glimmer-dsl-swt) custom shell, or another [Glimmer](https://github.com/AndyObtiva/glimmer-dsl-swt) custom widget
61
+ - JRuby version required by [Glimmer DSL for SWT](https://github.com/AndyObtiva/glimmer-dsl-swt)
62
+ - Java version required by [Glimmer DSL for SWT](https://github.com/AndyObtiva/glimmer-dsl-swt)
63
+
64
+ For [Glimmer DSL for Opal](https://github.com/AndyObtiva/glimmer-dsl-opal) auto-webification, this is also required:
65
+
66
+ - [Glimmer DSL for Opal](https://github.com/AndyObtiva/glimmer-dsl-opal) Rails application
67
+ - [Clocklet](https://github.com/luncheon/clocklet) (included in gem)
57
68
 
58
69
  ## Setup
59
70
 
60
71
  Versions follow this convention:
61
- - First 3 digits map to the official Nebula CDateTime library version (e.g. 1.4.0)
62
- - Last 2 digits map to minor and patch versions for Glimmer Custom Widget wrapper
72
+ - First 3 numbers map to the official Nebula CDateTime library version (e.g. 1.5.0)
73
+ - Last 2 numbers map to minor and patch versions for Glimmer Custom Widget wrapper
74
+
75
+ ### Glimmer DSL for SWT
63
76
 
64
- ### Glimmer Application
77
+ #### Glimmer Application
65
78
 
66
- Add the following to a [Glimmer](https://github.com/AndyObtiva/glimmer) application `Gemfile`:
79
+ Add the following to a [Glimmer](https://github.com/AndyObtiva/glimmer-dsl-swt) application `Gemfile`:
67
80
 
68
81
  ```ruby
69
- gem 'glimmer-cw-cdatetime-nebula', '1.4.0.2.0'
82
+ gem 'glimmer-cw-cdatetime-nebula', '~> 1.5.0.2.0'
70
83
  ```
71
84
 
72
85
  Run:
@@ -77,9 +90,9 @@ jruby -S bundle
77
90
 
78
91
  (or just `bundle` if using [RVM)
79
92
 
80
- ### Glimmer Custom Shell or Glimmer Custom Widget
93
+ #### Glimmer Custom Shell or Glimmer Custom Widget
81
94
 
82
- When reusing in a [Glimmer](https://github.com/AndyObtiva/glimmer) custom shell or custom widget, you can follow the same steps for Glimmer application, and then add a require statement to your library file after `glimmer-dsl-swt` and before additional library require statements:
95
+ When reusing in a [Glimmer](https://github.com/AndyObtiva/glimmer-dsl-swt) custom shell or custom widget, you can follow the same steps for Glimmer application, and then add a require statement to your library file after `glimmer-dsl-swt` and before additional library require statements:
83
96
 
84
97
  ```ruby
85
98
  require 'glimmer-dsl-swt'
@@ -87,17 +100,48 @@ require 'glimmer-cw-cdatetime-nebula'
87
100
  # ... more require statements follow
88
101
  ```
89
102
 
90
- ### Java Imports
103
+ #### Java Imports
91
104
 
92
- Requiring the gem automatically configures java imports in [Glimmer](https://github.com/AndyObtiva/glimmer) for auto import via [JRuby](https://www.jruby.org/) `include_package` on first use:
105
+ Requiring the gem automatically configures java imports in [Glimmer](https://github.com/AndyObtiva/glimmer-dsl-swt) for auto import via [JRuby](https://www.jruby.org/) `include_package` on first use:
93
106
  - `org.eclipse.nebula.cwt`
94
107
  - `org.eclipse.nebula.widgets.cdatetime`
95
108
 
96
- ## Usage Instructions
109
+ ### Glimmer DSL for Opal
110
+
111
+ The [glimmer-cw-cdatetime-nebula](https://rubygems.org/gems/glimmer-cw-cdatetime-nebula) gem is a Rails Engine gem that includes assets and supports [Glimmer DSL for Opal](https://github.com/AndyObtiva/glimmer-dsl-opal).
112
+
113
+ #### Setup
114
+
115
+ Please follow the following steps to setup assuming you have a pre-setup [Glimmer DSL for Opal](https://github.com/AndyObtiva/glimmer-dsl-opal) Rails app.
116
+
117
+ Add the following to `Gemfile` after `glimmer-dsl-opal` and other `glimer-dsl-*` gems:
118
+
119
+ ```ruby
120
+ gem 'glimmer-cw-cdatetime-nebula', '~> 1.5.0.2.0'
121
+ ```
122
+
123
+ Edit `app/views/layouts/application.html.erb` and add the following below other `stylesheet_link_tag` declarations:
124
+
125
+ ```erb
126
+ <%= stylesheet_link_tag 'glimmer_cw_cdatetime_nebula/glimmer_cw_cdatetime_nebula', media: 'all', 'data-turbolinks-track': 'reload' %>
127
+ ```
128
+
129
+ That's it! Now, you can use the following keywords:
130
+ - `c_date`
131
+ - `c_time`
132
+ - `c_date_drop_down`
133
+ - `c_time_drop_down`
134
+ - `c_time_compact`
97
135
 
98
- This [glimmer-cw-cdatetime-nebula](https://rubygems.org/gems/glimmer-cw-cdatetime-nebula) gem adds the `c_date_time` keyword to the [Glimmer GUI DSL](https://github.com/AndyObtiva/glimmer#glimmer-dsl-syntax) as well as other alias keywords as explained below.
136
+ Here is a sample Rails app that has everything configured (you just have to edit `app/assets/javascripts/application.rb` to enable the desired sample):
99
137
 
100
- The `c_date_time` keyword takes [`CDT`](#cdt) style bits as arguments.
138
+ https://github.com/AndyObtiva/sample-glimmer-dsl-opal-rails5-app
139
+
140
+ ## Instructions
141
+
142
+ This [glimmer-cw-cdatetime-nebula](https://rubygems.org/gems/glimmer-cw-cdatetime-nebula) gem adds the `c_date_time` keyword to the [Glimmer GUI DSL](https://github.com/AndyObtiva/glimmer-dsl-swt#glimmer-gui-dsl-syntax) as well as other alias keywords (e.g. drop down style, spinner style, and compact style) as explained below.
143
+
144
+ The `c_date_time` keyword optionally takes [`CDT`](#cdt) style bits as arguments. When not specified, [smart defaults](https://github.com/AndyObtiva/glimmer-cw-cdatetime-nebula#cdt-style-arguments) are used instead.
101
145
 
102
146
  Example:
103
147
 
@@ -109,85 +153,264 @@ Further instructions may be found at the [Nebula CDateTime Widget homepage](http
109
153
 
110
154
  ### Sample
111
155
 
156
+ #### Glimmer DSL for SWT Sample
157
+
112
158
  Please run the following command to launch the [Nebula CDateTime Glimmer Custom Widget Gallery](samples/nebula/c_date_time_gallery.rb) app:
113
159
 
114
160
  ```
115
161
  glimmer sample:run[c_date_time_gallery]
116
162
  ```
117
163
 
118
- ### Plain
164
+ Glimmer Code:
165
+
166
+ ```ruby
167
+ require_relative '../../lib/glimmer-cw-cdatetime-nebula'
168
+
169
+ class CDateTimeGallery
170
+ include Glimmer
171
+
172
+ def open
173
+ shell {
174
+ grid_layout(4, false) {
175
+ vertical_spacing 20
176
+ }
177
+ text 'Nebula CDateTime Glimmer Custom Widget Gallery'
178
+
179
+ label {
180
+ layout_data(:center, :center, true, false) {
181
+ horizontal_span 4
182
+ }
183
+ text 'Nebula CDateTime Glimmer Custom Widget Gallery'
184
+ font height: 24, style: :bold
185
+ }
186
+
187
+ tab_folder {
188
+ tab_item {
189
+ grid_layout 2, false
190
+ text 'Simple'
191
+
192
+ label {
193
+ text 'c_date_time'
194
+ font name: 'Consolas', height: 14
195
+ }
196
+ c_date_time
197
+
198
+ label {
199
+ text 'c_date'
200
+ font name: 'Consolas', height: 14
201
+ }
202
+ c_date
203
+
204
+ label {
205
+ text 'c_time'
206
+ font name: 'Consolas', height: 14
207
+ }
208
+ c_time
209
+ }
210
+
211
+ tab_item {
212
+ grid_layout 2, false
213
+ text 'Drop Down'
214
+
215
+ label {
216
+ text 'c_date_time_drop_down'
217
+ font name: 'Consolas', height: 14
218
+ }
219
+ c_date_time_drop_down {
220
+ layout_data(:fill, :center, true, true)
221
+ }
222
+
223
+ label {
224
+ text 'c_date_drop_down'
225
+ font name: 'Consolas', height: 14
226
+ }
227
+ c_date_drop_down {
228
+ layout_data(:fill, :center, true, true)
229
+ }
230
+
231
+ label {
232
+ text 'c_time_drop_down'
233
+ font name: 'Consolas', height: 14
234
+ }
235
+ c_time_drop_down {
236
+ layout_data(:fill, :center, true, true)
237
+ }
238
+ }
239
+
240
+ tab_item {
241
+ grid_layout 2, false
242
+ text 'Spinner'
243
+
244
+ label {
245
+ text 'c_date_time_spinner'
246
+ font name: 'Consolas', height: 14
247
+ }
248
+ c_date_time_spinner {
249
+ layout_data(:fill, :center, true, true)
250
+ }
251
+
252
+ label {
253
+ text 'c_date_spinner'
254
+ font name: 'Consolas', height: 14
255
+ }
256
+ c_date_spinner {
257
+ layout_data(:fill, :center, true, true)
258
+ }
259
+
260
+ label {
261
+ text 'c_time_spinner'
262
+ font name: 'Consolas', height: 14
263
+ }
264
+ c_time_spinner {
265
+ layout_data(:fill, :center, true, true)
266
+ }
267
+ }
268
+
269
+ tab_item {
270
+ grid_layout 2, false
271
+ text 'Compact'
272
+
273
+ label {
274
+ text 'c_date_time_compact'
275
+ font name: 'Consolas', height: 14
276
+ }
277
+ c_date_time_compact {
278
+ layout_data(:fill, :center, true, true)
279
+ }
280
+
281
+ label {
282
+ text 'c_date_compact'
283
+ font name: 'Consolas', height: 14
284
+ }
285
+ c_date_compact {
286
+ layout_data(:fill, :center, true, true)
287
+ }
288
+
289
+ label {
290
+ text 'c_time_compact'
291
+ font name: 'Consolas', height: 14
292
+ }
293
+ c_time_compact {
294
+ layout_data(:fill, :center, true, true)
295
+ }
296
+ }
297
+ }
298
+ }.open
299
+ end
300
+ end
301
+
302
+ CDateTimeGallery.new.open
303
+ ```
304
+
305
+ #### Glimmer DSL for Opal Sample
306
+
307
+ The same Glimmer DSL for SWT sample runs in Glimmer DSL for Opal unchanged, albeit with partial support at the moment.
308
+
309
+ Open a `Document.ready?` block in `app/assets/javascripts/application.rb` and add inside it the Glimmer GUI DSL code above or a require statement as done below.
310
+
311
+ ```ruby
312
+ require 'glimmer-dsl-opal'
313
+
314
+ Document.ready? do
315
+ require 'samples/nebula/c_date_time_gallery.rb'
316
+ end
317
+ ```
318
+
319
+ Run:
320
+
321
+ `rails s`
322
+
323
+ Visit: 'http://localhost:3000'
324
+
325
+ ![simple screenshot](images/glimmer-cw-cdatetime-nebula-opal-simple.png)
119
326
 
120
- ![plain screenshot](images/glimmer-cw-cdatetime-nebula-plain.png)
327
+ ### Simple Style
328
+
329
+ Simple style is the default style when using `c_date_time`, `c_date`, and `c_time` keywords. It displays a graphical calendar/clock.
330
+
331
+ `CDT::SIMPLE` style is applied by default but may be overriden by manually passing arguments to the keywords.
332
+
333
+ ![simple screenshot](images/glimmer-cw-cdatetime-nebula-simple.png)
121
334
 
122
335
  #### `c_date_time`
123
336
 
124
- Main keyword representing the Nebula CDateTime custom widget. Defaults to date/time pattern `'MM/dd/yyyy hh:mm a'` and plain style with a border
337
+ Main keyword representing the Nebula CDateTime custom widget. Defaults to date/time [pattern](https://docs.oracle.com/javase/8/docs/api/java/text/SimpleDateFormat.html) `'MM/dd/yyyy hh:mm a'` and simple style with a border
125
338
 
126
339
  #### `c_date`
127
340
 
128
- Alias keyword that specifies date pattern `'MM/dd/yyyy'` and plain style with a border
341
+ Alias keyword that specifies date [pattern](https://docs.oracle.com/javase/8/docs/api/java/text/SimpleDateFormat.html) `'MM/dd/yyyy'` and simple style with a border
129
342
 
130
343
  #### `c_time`
131
344
 
132
- Alias keyword that specifies time pattern `'hh:mm a'` and plain style with a border
345
+ Alias keyword that specifies time [pattern](https://docs.oracle.com/javase/8/docs/api/java/text/SimpleDateFormat.html) `'hh:mm a'` and simple style with a border
346
+
347
+ ### Drop Down Style
133
348
 
134
- ### Drop Down
349
+ Drop down style is used with the `c_date_time_drop_down`, `c_date_drop_down`, and `c_time_drop_down` keywords to provide a text box for textual entry of date/time coupled with a drop down button for bringing up the calendar/clock to perform graphical selection.
135
350
 
136
- ![plain screenshot](images/glimmer-cw-cdatetime-nebula-drop-down.png)
351
+ `CDT::DROP_DOWN` style is applied by default but may be overriden by manually passing arguments to the keywords.
352
+
353
+ ![dropdown screenshot](images/glimmer-cw-cdatetime-nebula-drop-down.png)
137
354
 
138
355
  #### `c_date_time_drop_down`
139
356
 
140
- Alias keyword that specifies date/time pattern `'MM/dd/yyyy hh:mm a'` and drop down style with a border
357
+ Alias keyword that specifies date/time [pattern](https://docs.oracle.com/javase/8/docs/api/java/text/SimpleDateFormat.html) `'MM/dd/yyyy hh:mm a'` and drop down style with a border
141
358
 
142
- ![plain screenshot](images/glimmer-cw-cdatetime-nebula-drop-down-date-time.png)
359
+ ![date time dropdown screenshot](images/glimmer-cw-cdatetime-nebula-drop-down-date-time.png)
143
360
 
144
361
  #### `c_date_drop_down`
145
362
 
146
- Alias keyword that specifies date pattern `'MM/dd/yyyy'` and drop down style with a border
363
+ Alias keyword that specifies date [pattern](https://docs.oracle.com/javase/8/docs/api/java/text/SimpleDateFormat.html) `'MM/dd/yyyy'` and drop down style with a border
147
364
 
148
- ![plain screenshot](images/glimmer-cw-cdatetime-nebula-drop-down-date.png)
365
+ ![date dropdown screenshot](images/glimmer-cw-cdatetime-nebula-drop-down-date.png)
149
366
 
150
367
  #### `c_time_drop_down`
151
368
 
152
- Alias that specifies time pattern `'hh:mm a'` and drop down style with a border
369
+ Alias that specifies time [pattern](https://docs.oracle.com/javase/8/docs/api/java/text/SimpleDateFormat.html) `'hh:mm a'` and drop down style with a border
370
+
371
+ ![time dropdown screenshot](images/glimmer-cw-cdatetime-nebula-drop-down-time.png)
372
+
373
+ ### Spinner Style
153
374
 
154
- ![plain screenshot](images/glimmer-cw-cdatetime-nebula-drop-down-time.png)
375
+ Spinner style is used with the `c_date_time_spinner`, `c_date_spinner`, and `c_time_spinner` keywords to provide a spinner for textual entry of date/time accompanied by up and down spinner buttons.
155
376
 
156
- ### Spinner
377
+ `CDT::SPINNER` style is applied by default but may be overriden by manually passing arguments to the keywords.
157
378
 
158
- ![plain screenshot](images/glimmer-cw-cdatetime-nebula-spinner.png)
379
+ ![spinner screenshot](images/glimmer-cw-cdatetime-nebula-spinner.png)
159
380
 
160
381
  #### `c_date_time_spinner`
161
382
 
162
- Alias that specifies date/time pattern `'MM/dd/yyyy hh:mm a'` and spinner style with a border
383
+ Alias that specifies date/time [pattern](https://docs.oracle.com/javase/8/docs/api/java/text/SimpleDateFormat.html) `'MM/dd/yyyy hh:mm a'` and spinner style with a border
163
384
 
164
385
  #### `c_date_spinner`
165
386
 
166
- Alias that specifies date pattern `'MM/dd/yyyy'` and spinner style with a border
387
+ Alias that specifies date [pattern](https://docs.oracle.com/javase/8/docs/api/java/text/SimpleDateFormat.html) `'MM/dd/yyyy'` and spinner style with a border
167
388
 
168
389
  #### `c_time_spinner`
169
390
 
170
- Alias that specifies time pattern `'hh:mm a'` and spinner style with a border
391
+ Alias that specifies time [pattern](https://docs.oracle.com/javase/8/docs/api/java/text/SimpleDateFormat.html) `'hh:mm a'` and spinner style with a border
171
392
 
172
- ### Compact
393
+ ### Compact Style
173
394
 
174
- ![plain screenshot](images/glimmer-cw-cdatetime-nebula-compact.png)
395
+ Compact style is used with the `c_date_time_compact`, `c_date_compact`, and `c_time_compact` keywords to provide a compact text widget for date/time without any extra buttons.
396
+
397
+ `CDT::COMPACT` style is applied by default but may be overriden by manually passing arguments to the keywords.
398
+
399
+ ![compact screenshot](images/glimmer-cw-cdatetime-nebula-compact.png)
175
400
 
176
401
  #### `c_date_time_compact`
177
402
 
178
- Alias that specifies date/time pattern `'MM/dd/yyyy hh:mm a'` and compact style (just a text field) with a border
403
+ Alias that specifies date/time [pattern](https://docs.oracle.com/javase/8/docs/api/java/text/SimpleDateFormat.html) `'MM/dd/yyyy hh:mm a'` and compact style (just a text field) with a border
179
404
 
180
405
  #### `c_date_compact`
181
406
 
182
- Alias that specifies date pattern `'MM/dd/yyyy'` and compact style (just a text field) with a border
407
+ Alias that specifies date [pattern](https://docs.oracle.com/javase/8/docs/api/java/text/SimpleDateFormat.html) `'MM/dd/yyyy'` and compact style (just a text field) with a border
183
408
 
184
409
  #### `c_time_compact`
185
410
 
186
- Alias that specifies time pattern `'hh:mm a'` and compact style (just a text field) with a border
411
+ Alias that specifies time [pattern](https://docs.oracle.com/javase/8/docs/api/java/text/SimpleDateFormat.html) `'hh:mm a'` and compact style (just a text field) with a border
187
412
 
188
- ### Style
189
-
190
- #### `cdt`
413
+ ### `CDT` Style Arguments
191
414
 
192
415
  [`CDT`](https://www.eclipse.org/nebula/releases/latest/javadoc/org/eclipse/nebula/widgets/cdatetime/CDT.html) styles are fully documented in the [Nebula `CDT` Javadoc](https://www.eclipse.org/nebula/releases/latest/javadoc/org/eclipse/nebula/widgets/cdatetime/CDT.html).
193
416
 
@@ -196,19 +419,19 @@ The `cdt` keyword builds a [`CDT`](https://www.eclipse.org/nebula/releases/lates
196
419
  For example, instead of passing style as bit-or'ed `CDT` Constant style bits:
197
420
 
198
421
  ```ruby
199
- c_date_time(CDT::BORDER | CDT::COMPACT | CDT::DROP_DOWN | CDT::DATE_LONG)
422
+ c_date_time(CDT::BORDER | CDT::TAB_FIELDS | CDT::DROP_DOWN | CDT::DATE_LONG)
200
423
  ```
201
424
 
202
425
  You instead pass style as comma-separated symbols:
203
426
 
204
427
  ```ruby
205
- c_date_time(cdt(:border, :compact, :drop_down, :date_long))
428
+ c_date_time(cdt(:border, :tab_fields, :drop_down, :date_long))
206
429
  ```
207
430
 
208
431
  However, `c_date_time` goes one step further and uses it internally automatically by all `c_date_time` keyword initializers, so you could ditch the `cdt` entirely when constructing a widget.
209
432
 
210
433
  ```ruby
211
- c_date_time(:border, :compact, :drop_down, :date_long)
434
+ c_date_time(:border, :tab_fields, :drop_down, :date_long)
212
435
  ```
213
436
 
214
437
  Furthermore, `c_date_time` has pre-configured smart defaults for `CDT` styles:
@@ -235,7 +458,7 @@ The `selection` property provides access to the value selected by the user. It c
235
458
  Example:
236
459
 
237
460
  ```ruby
238
- # ...
461
+ # ...
239
462
  composite {
240
463
  # ...
241
464
  @start_at = c_date_time(:border, :drop_down, :date_long) {
@@ -251,9 +474,9 @@ Example:
251
474
 
252
475
  ![Nebula CDateTime Example](images/glimmer-cw-cdatetime-nebula-example.png)
253
476
 
254
- ### Table Editing
477
+ ### Table Editor
255
478
 
256
- `c_date_time` can be used as a `table` / `table_column` editor.
479
+ `c_date_time` (and any keyword aliases) can be used as a `table` / `table_column` editor by passing as symbol to `editor` property (optionally followed by args model editing property).
257
480
 
258
481
  Example:
259
482
 
@@ -269,7 +492,7 @@ Example:
269
492
  table_column {
270
493
  text 'End Date'
271
494
  width CONFIG[:table_column_width_hint]
272
- editor :c_date_time, cdt(:border, :drop_down, :date_long), property: :end_at
495
+ editor :c_date_drop_down, property: :end_at
273
496
  }
274
497
  # ... other table_column declarations
275
498
  items bind(Task, :list), column_properties(:project_name, :task_type, :name, :start_date, :end_date, :duration, :priority)
@@ -284,6 +507,20 @@ Example:
284
507
 
285
508
  You may check out the Nebula CDateTime Widget [Javadoc API](https://www.eclipse.org/nebula/releases/latest/javadoc/org/eclipse/nebula/widgets/cdatetime/CDateTime.html).
286
509
 
510
+ One noteworthy property is [pattern](https://docs.oracle.com/javase/8/docs/api/java/text/SimpleDateFormat.html), which can be customized according to the date/time pattern [SimpleDateFormat Javadoc](https://docs.oracle.com/javase/8/docs/api/java/text/SimpleDateFormat.html).
511
+
512
+ Example:
513
+
514
+ ```ruby
515
+ c_date_time(:border, :drop_down) {
516
+ pattern 'hh:mm a'
517
+ }
518
+ ```
519
+
520
+ This should customize `c_date_time` to function just like `c_time_drop_down`
521
+
522
+ ![time drop down screenshot](images/glimmer-cw-cdatetime-nebula-drop-down-time.png)
523
+
287
524
  ### Glimmer Custom API
288
525
 
289
526
  Glimmer adds a few extra API methods to CDateTime from Nebula.
@@ -302,13 +539,12 @@ Example:
302
539
  c_time { |proxy|
303
540
  proxy.text_widget_proxy.content {
304
541
  on_swt_mouseup { |event|
305
- proxy.toggle_open
542
+ proxy.toggle_open
306
543
  }
307
544
  }
308
545
  }
309
546
  ```
310
547
 
311
-
312
548
  ## TODO
313
549
 
314
550
  [TODO.md](TODO.md)
@@ -335,4 +571,4 @@ Copyright (c) 2020 - Andy Maleh
335
571
 
336
572
  --
337
573
 
338
- [<img src="https://raw.githubusercontent.com/AndyObtiva/glimmer/master/images/glimmer-logo-hi-res.png" height=40 />](https://github.com/AndyObtiva/glimmer) Built for [Glimmer](https://github.com/AndyObtiva/glimmer) (Ruby Desktop Development GUI Library).
574
+ [<img src="https://raw.githubusercontent.com/AndyObtiva/glimmer/master/images/glimmer-logo-hi-res.png" height=40 />](https://github.com/AndyObtiva/glimmer) Built for [Glimmer DSL for SWT](https://github.com/AndyObtiva/glimmer-dsl-swt) (Ruby Desktop Development GUI Library).