glimmer-cw-cdatetime-nebula 1.4.0.2.1 → 1.5.0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +53 -0
- data/README.md +105 -37
- 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 +29 -16
- data/lib/glimmer-cw-cdatetime-nebula/ext/glimmer/swt/c_date_time_proxy.rb +7 -7
- 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 +3 -3
- 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 +326 -0
- data/opal/views/nebula/c_date_time.rb +1 -0
- data/samples/nebula/c_date_time_gallery.rb +39 -15
- 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 +24 -29
- 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: 3eed11d34e046c49e1784c672e4b8a857e42415c6edfa51525367a43f36cd95b
|
4
|
+
data.tar.gz: f0f22840c3b0629c4da6e895325bbcddc8604b11efb5b914f2c67b84831ec6b2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b4288432cfd5ce4fb201a4d104716eaaffb8c3cbb92a1f82e5ddd12f0ead0386c0b47a793a80ad1e9cdee5bb30e234258cf86a0e4762213d32acf122ab5ae534
|
7
|
+
data.tar.gz: 13245e207fd752175fee1ea8af52d8471d6b55f94c5a9c1e7282c5ba003e83a61acbe1841eb3bb7f863720f085987b44da8577a37a01115580e32056b0b9cd19
|
data/CHANGELOG.md
ADDED
@@ -0,0 +1,53 @@
|
|
1
|
+
# Change Log
|
2
|
+
|
3
|
+
## 1.5.0.3.0
|
4
|
+
|
5
|
+
- Support Glimmer DSL for Opal with the `c_date_time` and `c_date_time_drop_down` keywords
|
6
|
+
|
7
|
+
## 1.5.0.2.0
|
8
|
+
|
9
|
+
- Support Glimmer DSL for Opal with `c_time`, `c_time_drop_down`, `c_time_compact`, `c_date`, and `c_date_drop_down`
|
10
|
+
- Update c_date_time_gallery sample to use data-binding
|
11
|
+
- c_date_time_gallery sample running in Glimmer DSL for Opal
|
12
|
+
- Upgraded gem to a Rails Engine gem to share assets with a Rails app
|
13
|
+
|
14
|
+
## 1.5.0.1.0
|
15
|
+
|
16
|
+
- Upgraded to support glimmer-dsl-swt 4.17.2.0 up to 5.0.0.0
|
17
|
+
|
18
|
+
## 1.5.0.0.1
|
19
|
+
|
20
|
+
- Just corrected gem documentation to avoid mentioning older Nebula CDateTime 1.4.0
|
21
|
+
|
22
|
+
## 1.5.0.0.0
|
23
|
+
|
24
|
+
- Upgrade to Nebula CDateTime 1.5.0
|
25
|
+
- Upgrade to Glimmer DSL for SWT 4.17.0.0
|
26
|
+
|
27
|
+
## 1.4.0.2.1
|
28
|
+
|
29
|
+
- Make sure `#text_widget_content` returns nil with plain style
|
30
|
+
- Support c_date_time keyword aliases as a table editor
|
31
|
+
- Fix issue with overwriting specified styles with default styles
|
32
|
+
|
33
|
+
## 1.4.0.2.0
|
34
|
+
|
35
|
+
- Actual CDateTimeProxy class that is a subclass of WidgetProxy
|
36
|
+
- Smart defaults
|
37
|
+
` `cdt` keyword for easily building `CDT` styles
|
38
|
+
- `c_date`, `c_time` aliases for date only and time only
|
39
|
+
- `c_date_time_drop_down`, `c_date_drop_down`, `c_time_drop_down` for drop down configured widgets
|
40
|
+
- `c_date_time_spinner`, `c_date_spinner`, `c_time_spinner` for spinner configured widgets
|
41
|
+
- `c_date_time_compact`, `c_date_compact`, `c_time_compact` for compact style configured widgets
|
42
|
+
- `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
|
43
|
+
- `toggle_open` method to programmatically toggle between open and closed (works better and is more convenient than `.swt_widget.set_open` in some situations)
|
44
|
+
- Nebula CDateTime Glimmer Custom Widget Gallery [sample](samples/nebula/c_date_time_gallery.rb)
|
45
|
+
|
46
|
+
## 1.4.0.1
|
47
|
+
|
48
|
+
- Prevent table editor from saving upon traversing months in drop down Calendar
|
49
|
+
|
50
|
+
## 1.4.0.0
|
51
|
+
|
52
|
+
- Initial version containing a Glimmer configured and wrapped CDateTime Nebula custom widget
|
53
|
+
- Support use as editor of Glimmer table items.
|
data/README.md
CHANGED
@@ -1,27 +1,32 @@
|
|
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
|
[![Gem Version](https://badge.fury.io/rb/glimmer-cw-cdatetime-nebula.svg)](http://badge.fury.io/rb/glimmer-cw-cdatetime-nebula)
|
4
4
|
|
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)
|
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
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
12
|
|
13
|
-
|
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))
|
14
14
|
|
15
|
-
|
15
|
+
## Table of contents
|
16
16
|
|
17
|
-
- [Nebula CDateTime Widget 1.
|
17
|
+
- [Nebula CDateTime Widget 1.5.0.2.0](#nebula-cdatetime-widget-15020)
|
18
18
|
- [Pre-requisites](#pre-requisites)
|
19
19
|
- [Setup](#setup)
|
20
|
-
- [Glimmer
|
21
|
-
|
22
|
-
|
23
|
-
|
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)
|
26
|
+
- [Instructions](#instructions)
|
24
27
|
- [Sample](#sample)
|
28
|
+
- [Glimmer DSL for SWT Sample](#glimmer-dsl-for-swt-sample)
|
29
|
+
- [Glimmer DSL for Opal Sample](#glimmer-dsl-for-opal-sample)
|
25
30
|
- [Simple Style](#simple-style)
|
26
31
|
- [`c_date_time`](#cdatetime)
|
27
32
|
- [`c_date`](#cdate)
|
@@ -52,22 +57,29 @@ Packaged as a [Glimmer Custom Widget](https://github.com/AndyObtiva/glimmer#cust
|
|
52
57
|
|
53
58
|
## Pre-requisites
|
54
59
|
|
55
|
-
- [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
|
56
|
-
- JRuby version required by Glimmer
|
57
|
-
- 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)
|
58
68
|
|
59
69
|
## Setup
|
60
70
|
|
61
71
|
Versions follow this convention:
|
62
|
-
- First 3
|
63
|
-
- 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
|
64
76
|
|
65
|
-
|
77
|
+
#### Glimmer Application
|
66
78
|
|
67
|
-
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`:
|
68
80
|
|
69
81
|
```ruby
|
70
|
-
gem 'glimmer-cw-cdatetime-nebula', '1.
|
82
|
+
gem 'glimmer-cw-cdatetime-nebula', '~> 1.5.0.2.0'
|
71
83
|
```
|
72
84
|
|
73
85
|
Run:
|
@@ -78,9 +90,9 @@ jruby -S bundle
|
|
78
90
|
|
79
91
|
(or just `bundle` if using [RVM)
|
80
92
|
|
81
|
-
|
93
|
+
#### Glimmer Custom Shell or Glimmer Custom Widget
|
82
94
|
|
83
|
-
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:
|
84
96
|
|
85
97
|
```ruby
|
86
98
|
require 'glimmer-dsl-swt'
|
@@ -88,15 +100,48 @@ require 'glimmer-cw-cdatetime-nebula'
|
|
88
100
|
# ... more require statements follow
|
89
101
|
```
|
90
102
|
|
91
|
-
|
103
|
+
#### Java Imports
|
92
104
|
|
93
|
-
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:
|
94
106
|
- `org.eclipse.nebula.cwt`
|
95
107
|
- `org.eclipse.nebula.widgets.cdatetime`
|
96
108
|
|
97
|
-
|
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
|
+
```
|
98
128
|
|
99
|
-
|
129
|
+
That's it! Now, you can use the following keywords (with other keywords mentioned under [instructions](#instructions) having partial support):
|
130
|
+
- `c_date_time`
|
131
|
+
- `c_date`
|
132
|
+
- `c_time`
|
133
|
+
- `c_date_time_drop_down`
|
134
|
+
- `c_date_drop_down`
|
135
|
+
- `c_time_drop_down`
|
136
|
+
- `c_time_compact`
|
137
|
+
|
138
|
+
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):
|
139
|
+
|
140
|
+
https://github.com/AndyObtiva/sample-glimmer-dsl-opal-rails5-app
|
141
|
+
|
142
|
+
## Instructions
|
143
|
+
|
144
|
+
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.
|
100
145
|
|
101
146
|
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.
|
102
147
|
|
@@ -110,6 +155,8 @@ Further instructions may be found at the [Nebula CDateTime Widget homepage](http
|
|
110
155
|
|
111
156
|
### Sample
|
112
157
|
|
158
|
+
#### Glimmer DSL for SWT Sample
|
159
|
+
|
113
160
|
Please run the following command to launch the [Nebula CDateTime Glimmer Custom Widget Gallery](samples/nebula/c_date_time_gallery.rb) app:
|
114
161
|
|
115
162
|
```
|
@@ -125,10 +172,10 @@ class CDateTimeGallery
|
|
125
172
|
include Glimmer
|
126
173
|
|
127
174
|
def open
|
128
|
-
shell {
|
175
|
+
shell {
|
129
176
|
grid_layout(4, false) {
|
130
177
|
vertical_spacing 20
|
131
|
-
}
|
178
|
+
}
|
132
179
|
text 'Nebula CDateTime Glimmer Custom Widget Gallery'
|
133
180
|
|
134
181
|
label {
|
@@ -141,7 +188,7 @@ class CDateTimeGallery
|
|
141
188
|
|
142
189
|
tab_folder {
|
143
190
|
tab_item {
|
144
|
-
grid_layout 2, false
|
191
|
+
grid_layout 2, false
|
145
192
|
text 'Simple'
|
146
193
|
|
147
194
|
label {
|
@@ -193,7 +240,7 @@ class CDateTimeGallery
|
|
193
240
|
}
|
194
241
|
|
195
242
|
tab_item {
|
196
|
-
grid_layout 2, false
|
243
|
+
grid_layout 2, false
|
197
244
|
text 'Spinner'
|
198
245
|
|
199
246
|
label {
|
@@ -222,7 +269,7 @@ class CDateTimeGallery
|
|
222
269
|
}
|
223
270
|
|
224
271
|
tab_item {
|
225
|
-
grid_layout 2, false
|
272
|
+
grid_layout 2, false
|
226
273
|
text 'Compact'
|
227
274
|
|
228
275
|
label {
|
@@ -248,15 +295,37 @@ class CDateTimeGallery
|
|
248
295
|
c_time_compact {
|
249
296
|
layout_data(:fill, :center, true, true)
|
250
297
|
}
|
251
|
-
}
|
298
|
+
}
|
252
299
|
}
|
253
|
-
}.open
|
254
|
-
end
|
300
|
+
}.open
|
301
|
+
end
|
255
302
|
end
|
256
303
|
|
257
304
|
CDateTimeGallery.new.open
|
258
305
|
```
|
259
306
|
|
307
|
+
#### Glimmer DSL for Opal Sample
|
308
|
+
|
309
|
+
The same Glimmer DSL for SWT sample runs in Glimmer DSL for Opal unchanged, albeit with partial support at the moment.
|
310
|
+
|
311
|
+
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.
|
312
|
+
|
313
|
+
```ruby
|
314
|
+
require 'glimmer-dsl-opal'
|
315
|
+
|
316
|
+
Document.ready? do
|
317
|
+
require 'samples/nebula/c_date_time_gallery.rb'
|
318
|
+
end
|
319
|
+
```
|
320
|
+
|
321
|
+
Run:
|
322
|
+
|
323
|
+
`rails s`
|
324
|
+
|
325
|
+
Visit: 'http://localhost:3000'
|
326
|
+
|
327
|
+
![simple screenshot](images/glimmer-cw-cdatetime-nebula-opal-simple.png)
|
328
|
+
|
260
329
|
### Simple Style
|
261
330
|
|
262
331
|
Simple style is the default style when using `c_date_time`, `c_date`, and `c_time` keywords. It displays a graphical calendar/clock.
|
@@ -391,7 +460,7 @@ The `selection` property provides access to the value selected by the user. It c
|
|
391
460
|
Example:
|
392
461
|
|
393
462
|
```ruby
|
394
|
-
# ...
|
463
|
+
# ...
|
395
464
|
composite {
|
396
465
|
# ...
|
397
466
|
@start_at = c_date_time(:border, :drop_down, :date_long) {
|
@@ -478,7 +547,6 @@ c_time { |proxy|
|
|
478
547
|
}
|
479
548
|
```
|
480
549
|
|
481
|
-
|
482
550
|
## TODO
|
483
551
|
|
484
552
|
[TODO.md](TODO.md)
|
@@ -505,4 +573,4 @@ Copyright (c) 2020 - Andy Maleh
|
|
505
573
|
|
506
574
|
--
|
507
575
|
|
508
|
-
[<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).
|
576
|
+
[<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).
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.
|
1
|
+
1.5.0.3.0
|
@@ -0,0 +1 @@
|
|
1
|
+
.clocklet,.clocklet-ampm,.clocklet-container,.clocklet-dial,.clocklet-hand,.clocklet-hand-origin,.clocklet-plate,.clocklet-tick{touch-action:manipulation;touch-action:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-touch-callout:none;-webkit-tap-highlight-color:transparent;box-sizing:border-box;position:absolute;font-size:inherit}.clocklet--inline,.clocklet-container--inline{position:static}.clocklet-container{display:inline;width:0;height:0}.clocklet{font-size:16px;width:270px;height:270px;margin-top:1px;padding:8px;border-radius:3px}.clocklet:not(.clocklet--showing){transition:opacity .2s ease-out}.clocklet:not(.clocklet--shown):not(.clocklet--inline){opacity:0;pointer-events:none}[data-clocklet-placement=bottom][data-clocklet-alignment=left]{transform-origin:0 0}[data-clocklet-placement=bottom][data-clocklet-alignment=right]{transform-origin:100% 0}[data-clocklet-placement=top][data-clocklet-alignment=left]{transform-origin:0 100%}[data-clocklet-placement=top][data-clocklet-alignment=right]{transform-origin:100% 100%}.clocklet-plate{position:relative;height:100%;border-radius:50%}.clocklet-dial{left:0;top:0;right:0;bottom:0;margin:auto;border-radius:50%}.clocklet-ampm:before,.clocklet-hand,.clocklet-hand-origin,.clocklet-tick{z-index:1}.clocklet-hand{left:0;top:6.4%;right:0;bottom:50%;margin:auto;transform-origin:50% 100%}.clocklet-tick{width:1.75em;height:1.75em;margin:-.875em;border-radius:50%;padding:0;outline:0;border:0;cursor:pointer;background-color:transparent;color:inherit;font-family:inherit;font-weight:inherit}.clocklet-tick:before{content:attr(data-clocklet-tick-value)}.clocklet-ampm{top:calc(50% + .75em);left:0;right:0;margin:auto;width:3em;height:1.5em;border-radius:.75em;cursor:pointer}.clocklet-ampm,.clocklet-ampm:before{display:flex;align-items:center;justify-content:center}.clocklet-ampm:before{position:relative;width:2em;height:2em;border-radius:50%;content:attr(data-clocklet-ampm);transform:translateX(-1em)}.clocklet--shown .clocklet-ampm:before{transition:transform .1s ease-out}.clocklet-ampm[data-clocklet-ampm=pm]:before{transform:translateX(1em)}.clocklet-ampm[data-clocklet-ampm-formatted]:not([data-clocklet-ampm-formatted=""]):before{content:attr(data-clocklet-ampm-formatted)}.clocklet-hand-origin{left:calc(50% - 5px);top:calc(50% - 5px);right:calc(50% - 5px);bottom:calc(50% - 5px);border-radius:50%}.clocklet:not([data-clocklet-value]) .clocklet-hand,.clocklet:not([data-clocklet-value]) .clocklet-hand-origin,.clocklet[data-clocklet-value=""] .clocklet-hand,.clocklet[data-clocklet-value=""] .clocklet-hand-origin{display:none}.clocklet-dial--hour{width:calc(40% + 56px);height:calc(40% + 56px)}.clocklet-hand--hour{width:8px}.clocklet-tick--hour[data-clocklet-tick-value="0"]:before{content:"12"}.clocklet-dial--minute{width:100%;height:100%}.clocklet-hand--minute{width:2px}.clocklet-tick--minute:not([data-clocklet-tick-value$="0"]):not([data-clocklet-tick-value$="5"]){transform:scale(.6)}@media screen and (max-width:480px){.clocklet{transform:scale(.8)}}@media screen and (max-width:400px){.clocklet{transform:scale(.75)}}.clocklet{border:1px solid #ddd;background-color:#eee}[data-clocklet-placement=top]{box-shadow:4px -4px 4px hsla(0,0%,50.2%,.5)}[data-clocklet-placement=bottom]{box-shadow:4px 4px 4px hsla(0,0%,50.2%,.5)}.clocklet-plate{background-color:#fff}.clocklet-hand{background-color:#a1ddff}.clocklet-hand-origin{background-color:#4bf}.clocklet-tick--selected{background-color:#57c2ff;color:#fff}.clocklet--hoverable:not(.clocklet--dragging) .clocklet-tick:hover{background-color:#7ccfff}.clocklet-ampm{background-color:hsla(0,0%,80%,.6)}.clocklet-ampm:before{background-color:#57c2ff;color:#fff}.clocklet-ampm:hover:before{background-color:#7ccfff}
|
@@ -0,0 +1,15 @@
|
|
1
|
+
/*
|
2
|
+
* This is a manifest file that'll be compiled into application.css, which will include all the files
|
3
|
+
* listed below.
|
4
|
+
*
|
5
|
+
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, or any plugin's
|
6
|
+
* vendor/assets/stylesheets directory can be referenced here using a relative path.
|
7
|
+
*
|
8
|
+
* You're free to add application-wide styles to this file and they'll appear at the bottom of the
|
9
|
+
* compiled file so the styles you add here take precedence over styles defined in any other CSS/SCSS
|
10
|
+
* files in this directory. Styles in this file should be added after the last require_* statement.
|
11
|
+
* It is generally better to create a new file per style scope.
|
12
|
+
*
|
13
|
+
*= require_tree .
|
14
|
+
*= require_self
|
15
|
+
*/
|
@@ -1,5 +1,5 @@
|
|
1
1
|
# Copyright (c) 2020 - Andy Maleh
|
2
|
-
#
|
2
|
+
#
|
3
3
|
# Permission is hereby granted, free of charge, to any person obtaining
|
4
4
|
# a copy of this software and associated documentation files (the
|
5
5
|
# "Software"), to deal in the Software without restriction, including
|
@@ -7,10 +7,10 @@
|
|
7
7
|
# distribute, sublicense, and/or sell copies of the Software, and to
|
8
8
|
# permit persons to whom the Software is furnished to do so, subject to
|
9
9
|
# the following conditions:
|
10
|
-
#
|
10
|
+
#
|
11
11
|
# The above copyright notice and this permission notice shall be
|
12
12
|
# included in all copies or substantial portions of the Software.
|
13
|
-
#
|
13
|
+
#
|
14
14
|
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
15
|
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
16
|
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
@@ -19,20 +19,33 @@
|
|
19
19
|
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
20
|
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
21
21
|
|
22
|
-
|
22
|
+
if RUBY_ENGINE == 'ruby'
|
23
|
+
require 'opal'
|
24
|
+
Opal.append_path File.expand_path('../../opal', __FILE__).untaint
|
25
|
+
Opal.append_path File.expand_path('..', __FILE__).untaint
|
26
|
+
Opal.append_path File.expand_path('../..', __FILE__).untaint
|
27
|
+
|
28
|
+
require_relative 'glimmer_cw_cdatetime_nebula/engine'
|
29
|
+
elsif RUBY_ENGINE == 'opal'
|
30
|
+
require 'glimmer-dsl-swt'
|
23
31
|
|
24
|
-
require 'glimmer-
|
32
|
+
require 'glimmer-cw-cdatetime-nebula/vendor/clocklet.min'
|
25
33
|
|
26
|
-
|
27
|
-
|
34
|
+
require 'glimmer-cw-cdatetime-nebula/ext/glimmer/dsl/swt/cdt_expression'
|
35
|
+
require 'glimmer-cw-cdatetime-nebula/ext/glimmer/swt/c_date_time_proxy'
|
36
|
+
require 'views/nebula/c_date_time'
|
37
|
+
else # jruby
|
38
|
+
require 'glimmer-dsl-swt'
|
39
|
+
|
40
|
+
require_relative '../vendor/nebula/org.eclipse.nebula.cwt_1.1.0.202007241204.jar'
|
41
|
+
require_relative '../vendor/nebula/org.eclipse.nebula.widgets.cdatetime_1.5.0.202007241204.jar'
|
28
42
|
|
29
|
-
Glimmer::Config.import_swt_packages += [
|
30
|
-
|
31
|
-
|
32
|
-
]
|
43
|
+
Glimmer::Config.import_swt_packages += [
|
44
|
+
'org.eclipse.nebula.cwt',
|
45
|
+
'org.eclipse.nebula.widgets.cdatetime',
|
46
|
+
]
|
33
47
|
|
34
|
-
require 'glimmer-cw-cdatetime-nebula/ext/glimmer/dsl/swt/cdt_expression'
|
35
|
-
require 'glimmer-cw-cdatetime-nebula/ext/glimmer/swt/c_date_time_proxy'
|
36
|
-
require 'views/nebula/c_date_time'
|
37
|
-
|
38
|
-
Glimmer::Config::SAMPLE_DIRECTORIES << File.expand_path('../../samples/nebula', __FILE__)
|
48
|
+
require 'glimmer-cw-cdatetime-nebula/ext/glimmer/dsl/swt/cdt_expression'
|
49
|
+
require 'glimmer-cw-cdatetime-nebula/ext/glimmer/swt/c_date_time_proxy'
|
50
|
+
require 'views/nebula/c_date_time'
|
51
|
+
end
|
@@ -1,5 +1,5 @@
|
|
1
1
|
# Copyright (c) 2020 - Andy Maleh
|
2
|
-
#
|
2
|
+
#
|
3
3
|
# Permission is hereby granted, free of charge, to any person obtaining
|
4
4
|
# a copy of this software and associated documentation files (the
|
5
5
|
# "Software"), to deal in the Software without restriction, including
|
@@ -7,10 +7,10 @@
|
|
7
7
|
# distribute, sublicense, and/or sell copies of the Software, and to
|
8
8
|
# permit persons to whom the Software is furnished to do so, subject to
|
9
9
|
# the following conditions:
|
10
|
-
#
|
10
|
+
#
|
11
11
|
# The above copyright notice and this permission notice shall be
|
12
12
|
# included in all copies or substantial portions of the Software.
|
13
|
-
#
|
13
|
+
#
|
14
14
|
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
15
|
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
16
|
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
@@ -22,8 +22,8 @@
|
|
22
22
|
module Glimmer
|
23
23
|
module SWT
|
24
24
|
# This modules just configures Glimmer to work with Nebula CDateTime
|
25
|
-
# Since it is wrapping an existing SWT widget with the same name,
|
26
|
-
# it is not implemented as a typical "Glimmer Custom Widget", yet
|
25
|
+
# Since it is wrapping an existing SWT widget with the same name,
|
26
|
+
# it is not implemented as a typical "Glimmer Custom Widget", yet
|
27
27
|
# just a Glimmer widget proxy that extends Glimmer::SWT::WidgetProxy
|
28
28
|
class CDateTimeProxy < WidgetProxy
|
29
29
|
def text_widget_proxy
|
@@ -61,7 +61,7 @@ module Glimmer
|
|
61
61
|
end
|
62
62
|
end
|
63
63
|
WidgetProxy::DEFAULT_INITIALIZERS['c_time'] = WidgetProxy::DEFAULT_INITIALIZERS['c_time_compact'] = WidgetProxy::DEFAULT_INITIALIZERS['c_time_spinner'] = WidgetProxy::DEFAULT_INITIALIZERS['c_time_drop_down'] = lambda do |widget|
|
64
|
-
has_pattern_style = %w[time_short time_medium date_short date_medium date_long].reduce(false) {|result, style| result || widget.get_data('proxy').has_style?(style)}
|
64
|
+
has_pattern_style = %w[time_short time_medium date_short date_medium date_long].reduce(false) {|result, style| result || widget.get_data('proxy').has_style?(style)}
|
65
65
|
unless has_pattern_style
|
66
66
|
widget.format = Glimmer::SWT::CDTProxy[:time_short]
|
67
67
|
widget.pattern = 'hh:mm a'
|
@@ -80,7 +80,7 @@ module Glimmer
|
|
80
80
|
'c_date_time_drop_down' => 'c_date_time',
|
81
81
|
'c_date_drop_down' => 'c_date_time',
|
82
82
|
'c_time_drop_down' => 'c_date_time',
|
83
|
-
)
|
83
|
+
)
|
84
84
|
|
85
85
|
private
|
86
86
|
|