glimmer-dsl-swt 4.20.3.0 → 4.20.4.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: 581c69384ecd98621e42b9c109b26606bd02f971645d560b6a327a2afef193cd
4
- data.tar.gz: ff868723057cdcc85357713f63f1bcc449505bb79e28714e1ce95eada387c0e5
3
+ metadata.gz: db094d1b82d81c288c534731f7ea4e43427928f72aee2199d82add75356d382d
4
+ data.tar.gz: 7e4c4616df9aa65d9850b629d6c710318000b6e6fbcc567891a7bc0ab18aeb54
5
5
  SHA512:
6
- metadata.gz: fa48a538274e9a199d9f332d1fec5e3c99d235509673fcf2de5b3c646aa38306a093368adefe5161b81dcc8530b411b5bb1b304700cca4762d655185e5550916
7
- data.tar.gz: 1d04d38dcda31ef8c02c015cd558e62dc29ff54ad2e295d548f91633b8b6b6ec5e98dc9ef514c2250e4d90cce1a1764feb3be626af8a843bfb95a07722f2dbc6
6
+ metadata.gz: 856fd6405d5b996acc9804123a463ab03894c7b4c417fdbd0ddef2d214fa4f4b00de023d13d62d7107baa18d0d02e847bfe9960459ee7c1003cab487c5fa72a9
7
+ data.tar.gz: 400bdaea578f97d159c6773f58977b18a3776681c33a714b1a25aa2f66e236d6e1af7111b349ff222d2d8408cfe40148ecabc4459a9d4e6de5d78c93967ca241
data/README.md CHANGED
@@ -17,7 +17,7 @@ Featured in JRuby Cookbook](http://shop.oreilly.com/product/9780596519650.do) an
17
17
 
18
18
  [Glimmer DSL for SWT](https://rubygems.org/gems/glimmer-dsl-swt) 4.20.3.0 includes [SWT 4.20](https://download.eclipse.org/eclipse/downloads/drops4/R-4.20-202106111600/), which was released on June 11, 2021. Gem version numbers are in sync with the SWT library versions. The first two digits represent the SWT version number. The last two digits represent the minor and patch versions of Glimmer DSL for SWT. Note that SWT now supports AARCH64 on Mac and Linux, but it is not fully tested in Glimmer DSL for SWT yet, so deem its support experimental for the time being without guarantees for functionality until declared otherwise (report any issues you may encounter).
19
19
 
20
- **Starting in version 4.20.0.0, [Glimmer DSL for SWT](https://rubygems.org/gems/glimmer-dsl-swt) comes with the new [***Shine***](/docs/reference/GLIMMER_GUI_DSL_SYNTAX.md#shine) syntax** for highly intuitive and visually expressive View/Model Attribute Mapping, relying on `<=>` for bidirectional (two-way) data-binding and `<=` for unidirectional (one-way) data-binding, providing an alternative to the `bind` keyword (keep in mind that it is still an alpha, so default back to `bind` whenever needed).
20
+ **Starting in version 4.20.0.0, [Glimmer DSL for SWT](https://rubygems.org/gems/glimmer-dsl-swt) comes with the new [***Shine***](/docs/reference/GLIMMER_GUI_DSL_SYNTAX.md#shine) syntax** for highly intuitive and visually expressive View/Model Attribute Mapping, relying on `<=>` for bidirectional (two-way) data-binding and `<=` for unidirectional (one-way) data-binding, providing an alternative to the `bind` keyword (keep in mind that it is still a beta, so default back to `bind` whenever needed).
21
21
 
22
22
  Please help make [Glimmer DSL for SWT](https://rubygems.org/gems/glimmer-dsl-swt) better by providing feedback and [contributing](#contributing) whenever possible. Any feature suggestions that are accepted could be implemented within weeks if not days.
23
23
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 4.20.3.0
1
+ 4.20.4.0
@@ -2278,7 +2278,7 @@ Example from [samples/hello/hello_combo.rb](samples/hello_combo.rb) sample (you
2278
2278
 
2279
2279
  #### Shine
2280
2280
 
2281
- **(ALPHA FEATURE)**
2281
+ **(BETA FEATURE)**
2282
2282
 
2283
2283
  The new Shine syntax for View/Model Attribute Mapping allows data-binding visually with simple arrow operators in Ruby.
2284
2284
 
@@ -2302,7 +2302,7 @@ text <=> [@contact, :last_name]
2302
2302
  text <= [@contact, :name, computed_by: [:first_name, :last_name]]
2303
2303
  ```
2304
2304
 
2305
- Note that custom widgets and custom shapes are not supported by Shine syntax for data-binding yet, so continue to use `bind` with them for the time being.
2305
+ Given that Shine is new, if you encounter any issues, you can use `bind` instead.
2306
2306
 
2307
2307
  Check out [sample code](/samples) for more examples of Shine syntax in action, such as [Hello, Computed!](/docs/reference/GLIMMER_SAMPLES.md#hello-computed).
2308
2308
 
Binary file
@@ -30,6 +30,7 @@ if !['', 'false'].include?(ENV['GLIMMER_BUNDLER_SETUP'].to_s.strip.downcase)
30
30
  end
31
31
  require 'java'
32
32
  require 'puts_debuggerer' if ("#{ENV['pd']}#{ENV['PD']}").to_s.downcase.include?('true')
33
+ require 'concurrent-ruby' # ensures glimmer relies on Concurrent data-structure classes (e.g. Concurrent::Array)
33
34
  require 'glimmer'
34
35
  require 'logging'
35
36
  require 'nested_inherited_jruby_include_package'
@@ -1,5 +1,5 @@
1
1
  # Copyright (c) 2007-2021 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
@@ -20,6 +20,7 @@
20
20
  # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21
21
 
22
22
  require 'glimmer/dsl/static_expression'
23
+ require 'glimmer/dsl/bind_expression'
23
24
  require 'glimmer/data_binding/model_binding'
24
25
 
25
26
  module Glimmer
@@ -30,28 +31,7 @@ module Glimmer
30
31
  # DataBindingCommandHandler for text and selection properties on Text and Spinner
31
32
  # or TableItemsDataBindingCommandHandler for items in a Table
32
33
  class BindExpression < StaticExpression
33
- def can_interpret?(parent, keyword, *args, &block)
34
- (
35
- keyword == 'bind' and
36
- (
37
- (
38
- (args.size == 2) and
39
- textual?(args[1])
40
- ) ||
41
- (
42
- (args.size == 3) and
43
- textual?(args[1]) and
44
- (args[2].is_a?(Hash))
45
- )
46
- )
47
- )
48
- end
49
-
50
- def interpret(parent, keyword, *args, &block)
51
- binding_options = args[2] || {}
52
- binding_options[:on_read] = binding_options.delete(:on_read) || binding_options.delete('on_read') || block
53
- DataBinding::ModelBinding.new(args[0], args[1].to_s, binding_options)
54
- end
34
+ include Glimmer::DSL::BindExpression
55
35
  end
56
36
  end
57
37
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: glimmer-dsl-swt
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.20.3.0
4
+ version: 4.20.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andy Maleh
@@ -15,7 +15,7 @@ dependencies:
15
15
  requirements:
16
16
  - - "~>"
17
17
  - !ruby/object:Gem::Version
18
- version: 1.3.1
18
+ version: 2.0.0
19
19
  name: glimmer
20
20
  prerelease: false
21
21
  type: :runtime
@@ -23,7 +23,7 @@ dependencies:
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 1.3.1
26
+ version: 2.0.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  requirement: !ruby/object:Gem::Requirement
29
29
  requirements:
@@ -104,6 +104,46 @@ dependencies:
104
104
  - - "<"
105
105
  - !ruby/object:Gem::Version
106
106
  version: 2.0.0
107
+ - !ruby/object:Gem::Dependency
108
+ requirement: !ruby/object:Gem::Requirement
109
+ requirements:
110
+ - - ">="
111
+ - !ruby/object:Gem::Version
112
+ version: 1.1.7
113
+ - - "<"
114
+ - !ruby/object:Gem::Version
115
+ version: 2.0.0
116
+ name: concurrent-ruby
117
+ prerelease: false
118
+ type: :runtime
119
+ version_requirements: !ruby/object:Gem::Requirement
120
+ requirements:
121
+ - - ">="
122
+ - !ruby/object:Gem::Version
123
+ version: 1.1.7
124
+ - - "<"
125
+ - !ruby/object:Gem::Version
126
+ version: 2.0.0
127
+ - !ruby/object:Gem::Dependency
128
+ requirement: !ruby/object:Gem::Requirement
129
+ requirements:
130
+ - - ">="
131
+ - !ruby/object:Gem::Version
132
+ version: 0.8.5
133
+ - - "<"
134
+ - !ruby/object:Gem::Version
135
+ version: 2.0.0
136
+ name: jruby-win32ole
137
+ prerelease: false
138
+ type: :runtime
139
+ version_requirements: !ruby/object:Gem::Requirement
140
+ requirements:
141
+ - - ">="
142
+ - !ruby/object:Gem::Version
143
+ version: 0.8.5
144
+ - - "<"
145
+ - !ruby/object:Gem::Version
146
+ version: 2.0.0
107
147
  - !ruby/object:Gem::Dependency
108
148
  requirement: !ruby/object:Gem::Requirement
109
149
  requirements:
@@ -198,26 +238,6 @@ dependencies:
198
238
  - - "<"
199
239
  - !ruby/object:Gem::Version
200
240
  version: 4.0.0
201
- - !ruby/object:Gem::Dependency
202
- requirement: !ruby/object:Gem::Requirement
203
- requirements:
204
- - - ">="
205
- - !ruby/object:Gem::Version
206
- version: 0.8.5
207
- - - "<"
208
- - !ruby/object:Gem::Version
209
- version: 2.0.0
210
- name: jruby-win32ole
211
- prerelease: false
212
- type: :runtime
213
- version_requirements: !ruby/object:Gem::Requirement
214
- requirements:
215
- - - ">="
216
- - !ruby/object:Gem::Version
217
- version: 0.8.5
218
- - - "<"
219
- - !ruby/object:Gem::Version
220
- version: 2.0.0
221
241
  - !ruby/object:Gem::Dependency
222
242
  requirement: !ruby/object:Gem::Requirement
223
243
  requirements:
@@ -390,7 +410,6 @@ files:
390
410
  - lib/glimmer/Rakefile
391
411
  - lib/glimmer/data_binding/list_selection_binding.rb
392
412
  - lib/glimmer/data_binding/observable_widget.rb
393
- - lib/glimmer/data_binding/shine.rb
394
413
  - lib/glimmer/data_binding/table_items_binding.rb
395
414
  - lib/glimmer/data_binding/tree_items_binding.rb
396
415
  - lib/glimmer/data_binding/widget_binding.rb
@@ -1,60 +0,0 @@
1
- # Copyright (c) 2007-2021 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.
21
-
22
- module Glimmer
23
- module DataBinding
24
- class Shine
25
- include Glimmer
26
-
27
- def initialize(parent, parent_attribute)
28
- @parent = parent
29
- @parent_attribute = parent_attribute
30
- end
31
-
32
- alias original_compare <=>
33
-
34
- def <=>(other)
35
- if other.is_a?(Array)
36
- args_clone = other.clone
37
- @parent.content {
38
- send(@parent_attribute, bind(*args_clone))
39
- }
40
- else # || other.is_a?(Hash) # TODO support hash e.g. {model: model_obj, attribute: :some_attribute, more-options...}
41
- original_compare(other)
42
- end
43
- end
44
-
45
- def <=(other)
46
- if other.is_a?(Array)
47
- args_clone = other.clone
48
- if args_clone.last.is_a?(Hash)
49
- args_clone.last[:read_only] = true
50
- else # || other.is_a?(Hash) # TODO support hash e.g. {model: model_obj, attribute: :some_attribute, more-options...}
51
- args_clone << {read_only: true}
52
- end
53
- @parent.content {
54
- send(@parent_attribute, bind(*args_clone))
55
- }
56
- end
57
- end
58
- end
59
- end
60
- end