glimmer-cw-cdatetime-nebula 1.4.0.2.0 → 1.5.0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +49 -0
- data/README.md +303 -67
- data/VERSION +1 -1
- data/app/assets/stylesheets/glimmer_cw_cdatetime_nebula/clocklet.min.css +1 -0
- data/app/assets/stylesheets/glimmer_cw_cdatetime_nebula/glimmer_cw_cdatetime_nebula.css +15 -0
- data/lib/glimmer-cw-cdatetime-nebula.rb +32 -59
- data/lib/glimmer-cw-cdatetime-nebula/ext/glimmer/swt/c_date_time_proxy.rb +58 -41
- data/lib/glimmer-cw-cdatetime-nebula/ext/glimmer/swt/cdt_proxy.rb +11 -10
- data/lib/glimmer-cw-cdatetime-nebula/vendor/clocklet.min.js +1 -0
- data/lib/glimmer_cw_cdatetime_nebula/engine.rb +9 -0
- data/lib/views/nebula/c_date_time.rb +36 -28
- data/opal/glimmer-cw-cdatetime-nebula/ext/glimmer/cdt.rb +499 -0
- data/opal/glimmer-cw-cdatetime-nebula/ext/glimmer/swt/c_date_time_proxy.rb +281 -0
- data/opal/views/nebula/c_date_time.rb +1 -0
- data/samples/nebula/c_date_time_gallery.rb +28 -14
- data/vendor/nebula/{org.eclipse.nebula.cwt_1.1.0.jar → org.eclipse.nebula.cwt_1.1.0.202007241204.jar} +0 -0
- data/vendor/nebula/org.eclipse.nebula.widgets.cdatetime_1.5.0.202007241204.jar +0 -0
- metadata +22 -28
- data/vendor/nebula/org.eclipse.nebula.widgets.cdatetime_1.4.0.jar +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b2b27a5ece4803fbb7129f299f334db84f2e04a3493771b4450422960444feeb
|
4
|
+
data.tar.gz: aeb73d132ab04b909950c530699aa4ab32737c674318742e0331951f4ddb06c6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d4e3c7f7caa2e359da5ec4c799c573e18f3e35ca66d63b7b4aee3d5d4b72e73f8b0f39943a6d680f078b59a66f9272057e87fca41e8c6a3c2df2d295bbf3d036
|
7
|
+
data.tar.gz: 90080b9ed297c65bf21007debb9e6fe58a81513371bde8f25239e3e04e8b608b988341dcd17785f841f493e70a832f272cf41772762e55b015ebc6eb86805105
|
data/CHANGELOG.md
ADDED
@@ -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.
|
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
|
[](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
|
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
|
-
[
|
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.
|
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
|
19
|
-
|
20
|
-
|
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
|
-
|
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
|
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
|
62
|
-
- Last 2
|
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
|
-
|
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.
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
+

|
119
326
|
|
120
|
-
|
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
|
+

|
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
|
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
|
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
|
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
|
-
|
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
|
-
|
351
|
+
`CDT::DROP_DOWN` style is applied by default but may be overriden by manually passing arguments to the keywords.
|
352
|
+
|
353
|
+

|
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
|
-

|
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
|
-

|
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
|
+

|
372
|
+
|
373
|
+
### Spinner Style
|
153
374
|
|
154
|
-
|
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
|
-
|
377
|
+
`CDT::SPINNER` style is applied by default but may be overriden by manually passing arguments to the keywords.
|
157
378
|
|
158
|
-

|
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
|
-
|
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
|
+

|
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::
|
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, :
|
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, :
|
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
|

|
253
476
|
|
254
|
-
### Table
|
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 :
|
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
|
+

|
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
|
-
|
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).
|