glimmer-cw-cdatetime-nebula 1.4.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 8e7eb36b345381aac61bd2a2bcefad34d3c511656173d24e839a3943fc386364
4
+ data.tar.gz: 957a2e0efc58695f55396422f7aedcdb444b307b8971f2fa28562ce8349895b1
5
+ SHA512:
6
+ metadata.gz: 9a20db611c320d7cff7d56204d6a1d62ff35a804a1f1c3e0411dfdc3b3019ef1dcc077a01cfeac0f038d89b75697d1ed0c60336d59513e4f8921b05790f125d8
7
+ data.tar.gz: '06059fb3b1c067502721700601280fe2f85a58d54e97d2daff67df8cc850eb2f83a67305db614cfce8c8a341a19af87bcad17bff1e109dcd8b783d390cb3dc4e'
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2020 - Andy Maleh
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,133 @@
1
+ # Nebula CDateTime Widget 1.4.0.0
2
+ ## [Glimmer Custom Widget](https://github.com/AndyObtiva/glimmer#custom-widget-gem)
3
+ [![Gem Version](https://badge.fury.io/rb/glimmer-cw-cdatetime-nebula.svg)](http://badge.fury.io/rb/glimmer-cw-cdatetime-nebula)
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)
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 textual, graphical, or combo mode.
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.
10
+
11
+ [glimmer-cw-cdatetime-nebula](https://rubygems.org/gems/glimmer-cw-cdatetime-nebula) 1.4.0.x gem versions map to Nebula CDateTime Widget version 1.4.0
12
+
13
+ ## Java Imports
14
+
15
+ [glimmer-cw-cdatetime-nebula](https://rubygems.org/gems/glimmer-cw-cdatetime-nebula) includes and imports the following Java JAR libraries:
16
+ - 'vendor/nebula/org.eclipse.nebula.cwt_1.1.0.jar'
17
+ - 'vendor/nebula/org.eclipse.nebula.widgets.cdatetime_1.4.0.jar'
18
+
19
+ It also configures them in [Glimmer](https://github.com/AndyObtiva/glimmer) for auto import via JRuby `include_package` on first use.
20
+
21
+ ## Pre-requisites
22
+
23
+ - [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
24
+ - JRuby version required by Glimmer
25
+ - Java version required by Glimmer
26
+
27
+ ## Setup
28
+
29
+ ### Glimmer Application
30
+
31
+ Add the following to a [Glimmer](https://github.com/AndyObtiva/glimmer) application `Gemfile`:
32
+
33
+ ```ruby
34
+ gem 'glimmer-cw-cdatetime-nebula', '1.4.0.0'
35
+ ```
36
+
37
+ Run:
38
+
39
+ ```
40
+ jruby -S bundle
41
+ ```
42
+
43
+ (or just `bundle` if using RVM)
44
+
45
+ ### Glimmer Custom Shell or Glimmer Custom Widget
46
+
47
+ 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` and before additional library require statements:
48
+
49
+ ```ruby
50
+ require 'glimmer'
51
+ require 'glimmer-cw-cdatetime-nebula'
52
+ # ... more require statements follow
53
+ ```
54
+
55
+ ## Instructions
56
+
57
+ `c_date_time` is the [Glimmer DSL](https://github.com/AndyObtiva/glimmer#glimmer-dsl-syntax) keyword to use.
58
+
59
+ Further instructions may be found at the [Nebula CDateTime Widget homepage](https://www.eclipse.org/nebula/widgets/cdatetime/cdatetime.php):
60
+
61
+ [https://www.eclipse.org/nebula/widgets/cdatetime/cdatetime.php](https://www.eclipse.org/nebula/widgets/cdatetime/cdatetime.php)
62
+
63
+ ## API
64
+
65
+ Here is the Nebula CDateTime Widget [Javadoc API page](https://www.eclipse.org/nebula/releases/latest/javadoc/org/eclipse/nebula/widgets/cdatetime/CDateTime.html):
66
+
67
+ [https://www.eclipse.org/nebula/releases/latest/javadoc/org/eclipse/nebula/widgets/cdatetime/CDateTime.html](https://www.eclipse.org/nebula/releases/latest/javadoc/org/eclipse/nebula/widgets/cdatetime/CDateTime.html)
68
+
69
+ ## Examples:
70
+
71
+ ### Example of using `c_date_time` widget:
72
+
73
+ ```ruby
74
+ # ...
75
+ composite {
76
+ # ...
77
+ @start_at = c_date_time(CDT::BORDER | CDT::COMPACT | CDT::DROP_DOWN | CDT::DATE_LONG) {
78
+ # ...
79
+ selection bind(@task, :start_at)
80
+ on_key_pressed { |event|
81
+ @end_at.swt_widget.set_focus if event.keyCode == swt(:cr)
82
+ }
83
+ }
84
+ }
85
+ # ...
86
+ ```
87
+
88
+ ![Nebula CDateTime Example](glimmer-cw-cdatetime-nebula-example.png)
89
+
90
+ ### Example of using `c_date_time` as a `table` / `table_column` editor:
91
+
92
+ ```ruby
93
+ # ...
94
+ table { |table_proxy|
95
+ # ... other table_column declarations
96
+ table_column {
97
+ text 'Start Date'
98
+ width CONFIG[:table_column_width_hint]
99
+ editor :c_date_time, CDT::BORDER | CDT::COMPACT | CDT::DROP_DOWN | CDT::DATE_LONG, property: :start_at
100
+ }
101
+ table_column {
102
+ text 'End Date'
103
+ width CONFIG[:table_column_width_hint]
104
+ editor :c_date_time, CDT::BORDER | CDT::COMPACT | CDT::DROP_DOWN | CDT::DATE_LONG, property: :end_at
105
+ }
106
+ # ... other table_column declarations
107
+ items bind(Task, :list), column_properties(:project_name, :task_type, :name, :start_date, :end_date, :duration, :priority)
108
+ # ... other table GUI code
109
+ }
110
+ # ...
111
+ ```
112
+
113
+ ![Nebula CDateTime Example](glimmer-cw-cdatetime-nebula-example-table-editor.png)
114
+
115
+ ## Change Log
116
+
117
+ - 1.4.0.0: Initial version
118
+
119
+ ## Contributing to glimmer-cw-cdatetime-nebula
120
+
121
+ - Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet.
122
+ - Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it.
123
+ - Fork the project.
124
+ - Start a feature/bugfix branch.
125
+ - Commit and push until you are happy with your contribution.
126
+ - Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
127
+ - Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
128
+
129
+ ## Copyright
130
+
131
+ [MIT](https://opensource.org/licenses/MIT)
132
+
133
+ Copyright (c) 2020 - Andy Maleh. See [LICENSE.txt](LICENSE.txt) for further details.
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 1.4.0.0
@@ -0,0 +1,14 @@
1
+ $LOAD_PATH.unshift(File.expand_path('..', __FILE__))
2
+ $LOAD_PATH.unshift(File.expand_path('../..', __FILE__))
3
+
4
+ require 'glimmer-dsl-swt'
5
+
6
+ require 'vendor/nebula/org.eclipse.nebula.cwt_1.1.0.jar'
7
+ require 'vendor/nebula/org.eclipse.nebula.widgets.cdatetime_1.4.0.jar'
8
+
9
+ Glimmer::Config.import_swt_packages += [
10
+ 'org.eclipse.nebula.cwt',
11
+ 'org.eclipse.nebula.widgets.cdatetime',
12
+ ]
13
+
14
+ require 'views/nebula/c_date_time'
@@ -0,0 +1,35 @@
1
+ module Nebula
2
+ # This modules just configures Glimmer to work with Nebula CDateTime
3
+ module CDateTime
4
+ include Glimmer
5
+
6
+ Glimmer::SWT::TableProxy.editors[:c_date_time] ||= {
7
+ widget_value_property: :selection,
8
+ editor_gui: lambda do |args, model, property, table_proxy|
9
+ args << CDT::DROP_DOWN if args.empty?
10
+ table_editor_widget_proxy = c_date_time(*args) {
11
+ table_proxy.table_editor.minimumHeight = 20
12
+ selection model.send(property)
13
+ focus true
14
+ on_focus_lost {
15
+ table_proxy.finish_edit!
16
+ }
17
+ on_key_pressed { |key_event|
18
+ if key_event.keyCode == swt(:cr)
19
+ table_proxy.finish_edit!
20
+ elsif key_event.keyCode == swt(:esc)
21
+ table_proxy.cancel_edit!
22
+ end
23
+ }
24
+ on_widget_selected { |event|
25
+ table_proxy.finish_edit!
26
+ }
27
+ on_widget_default_selected { |event|
28
+ table_proxy.finish_edit!
29
+ }
30
+ }
31
+ table_editor_widget_proxy
32
+ end
33
+ }
34
+ end
35
+ end
metadata ADDED
@@ -0,0 +1,128 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: glimmer-cw-cdatetime-nebula
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.4.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Andy Maleh
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2020-07-19 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ requirement: !ruby/object:Gem::Requirement
15
+ requirements:
16
+ - - ">="
17
+ - !ruby/object:Gem::Version
18
+ version: 0.3.1
19
+ - - "<"
20
+ - !ruby/object:Gem::Version
21
+ version: 2.0.0
22
+ name: glimmer-dsl-swt
23
+ type: :runtime
24
+ prerelease: false
25
+ version_requirements: !ruby/object:Gem::Requirement
26
+ requirements:
27
+ - - ">="
28
+ - !ruby/object:Gem::Version
29
+ version: 0.3.1
30
+ - - "<"
31
+ - !ruby/object:Gem::Version
32
+ version: 2.0.0
33
+ - !ruby/object:Gem::Dependency
34
+ requirement: !ruby/object:Gem::Requirement
35
+ requirements:
36
+ - - "~>"
37
+ - !ruby/object:Gem::Version
38
+ version: 3.5.0
39
+ name: rspec
40
+ type: :development
41
+ prerelease: false
42
+ version_requirements: !ruby/object:Gem::Requirement
43
+ requirements:
44
+ - - "~>"
45
+ - !ruby/object:Gem::Version
46
+ version: 3.5.0
47
+ - !ruby/object:Gem::Dependency
48
+ requirement: !ruby/object:Gem::Requirement
49
+ requirements:
50
+ - - '='
51
+ - !ruby/object:Gem::Version
52
+ version: 2.3.9
53
+ name: jeweler
54
+ type: :development
55
+ prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ requirements:
58
+ - - '='
59
+ - !ruby/object:Gem::Version
60
+ version: 2.3.9
61
+ - !ruby/object:Gem::Dependency
62
+ requirement: !ruby/object:Gem::Requirement
63
+ requirements:
64
+ - - ">="
65
+ - !ruby/object:Gem::Version
66
+ version: '0'
67
+ name: simplecov
68
+ type: :development
69
+ prerelease: false
70
+ version_requirements: !ruby/object:Gem::Requirement
71
+ requirements:
72
+ - - ">="
73
+ - !ruby/object:Gem::Version
74
+ version: '0'
75
+ - !ruby/object:Gem::Dependency
76
+ requirement: !ruby/object:Gem::Requirement
77
+ requirements:
78
+ - - ">="
79
+ - !ruby/object:Gem::Version
80
+ version: '0'
81
+ name: glimmer-cs-gladiator
82
+ type: :development
83
+ prerelease: false
84
+ version_requirements: !ruby/object:Gem::Requirement
85
+ requirements:
86
+ - - ">="
87
+ - !ruby/object:Gem::Version
88
+ version: '0'
89
+ description: Nebula CDateTime Widget - Glimmer Custom Widget - A Date and Time selection
90
+ widget that can be used in a textual, graphical, or combo mode.
91
+ email: andy.am@gmail.com
92
+ executables: []
93
+ extensions: []
94
+ extra_rdoc_files:
95
+ - LICENSE.txt
96
+ - README.md
97
+ files:
98
+ - LICENSE.txt
99
+ - README.md
100
+ - VERSION
101
+ - lib/glimmer-cw-cdatetime-nebula.rb
102
+ - lib/views/nebula/c_date_time.rb
103
+ - vendor/nebula/org.eclipse.nebula.cwt_1.1.0.jar
104
+ - vendor/nebula/org.eclipse.nebula.widgets.cdatetime_1.4.0.jar
105
+ homepage: http://github.com/AndyObtiva/glimmer-cw-cdatetime-nebula
106
+ licenses:
107
+ - MIT
108
+ metadata: {}
109
+ post_install_message:
110
+ rdoc_options: []
111
+ require_paths:
112
+ - lib
113
+ required_ruby_version: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - ">="
116
+ - !ruby/object:Gem::Version
117
+ version: '0'
118
+ required_rubygems_version: !ruby/object:Gem::Requirement
119
+ requirements:
120
+ - - ">="
121
+ - !ruby/object:Gem::Version
122
+ version: '0'
123
+ requirements: []
124
+ rubygems_version: 3.0.6
125
+ signing_key:
126
+ specification_version: 4
127
+ summary: Nebula CDateTime Widget - Glimmer Custom Widget
128
+ test_files: []