glimmer-dsl-swt 4.20.1.0 → 4.20.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: e9779424dd8dd9fca77f9252ae072a455d2d74bf628952d02650a462bbc1021e
4
- data.tar.gz: 1894fba96b987a4a6b7b3c6e65f5d8088396863e076deb69d90871aeff233229
3
+ metadata.gz: 833c707b308578391e1ce4676ed517d6297250cb9272f6f3c7539c2b538403c6
4
+ data.tar.gz: 9f9bc412c837ba8389333587638638b95534634464f5084e9471de028747dc9e
5
5
  SHA512:
6
- metadata.gz: 4caa0f594b722c39b0ea2586be80a2b52362fac9c6ad0bcf0c53581525af4b96ded22090c681271795503f7f99094dc1721ef6eebdbe1d314a45ef9c9ff3815c
7
- data.tar.gz: 67472ac71632e32e4ec6dd903a88895b2e73c0c6ce00f7ab40856f4cceda34b1e36c7ac326ba5dc6a5fe81c57645a3270e33676e02cd26f164f520e0a2ade335
6
+ metadata.gz: f46c2d58b167cd75c807fce955eae9a1abc6895414311b93fdf6950d54c8fc14f15384dd8a19bfef0f2503e2f732c73e79e342e9d03d7f9a69990844dacc9c81
7
+ data.tar.gz: 9e41adb252a09d397cb1b81cf91c9a37e89c95fdbf00b74134d38baaaac920ed74396df92b926e593b5ba4ae9005a7b43b3d64f4aec5576ef0ae237c0de35db2
data/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # Change Log
2
2
 
3
+ ### 4.20.2.0
4
+
5
+ - Shine data-binding syntax support for `tree` widget
6
+ - Use Shine syntax in Hello, Tree! sample
7
+
3
8
  ### 4.20.1.0
4
9
 
5
10
  - Shine data-binding syntax support for `table` widget
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # [<img src="https://raw.githubusercontent.com/AndyObtiva/glimmer/master/images/glimmer-logo-hi-res.png" height=85 />](https://github.com/AndyObtiva/glimmer) Glimmer DSL for SWT 4.20.1.0
1
+ # [<img src="https://raw.githubusercontent.com/AndyObtiva/glimmer/master/images/glimmer-logo-hi-res.png" height=85 />](https://github.com/AndyObtiva/glimmer) Glimmer DSL for SWT 4.20.2.0
2
2
  ## JRuby Desktop Development GUI Framework
3
3
  [![Gem Version](https://badge.fury.io/rb/glimmer-dsl-swt.svg)](http://badge.fury.io/rb/glimmer-dsl-swt)
4
4
  [![Travis CI](https://travis-ci.com/AndyObtiva/glimmer-dsl-swt.svg?branch=master)](https://travis-ci.com/github/AndyObtiva/glimmer-dsl-swt)
@@ -15,7 +15,7 @@
15
15
  [<img src="https://covers.oreillystatic.com/images/9780596519650/lrg.jpg" width=105 /><br />
16
16
  Featured in JRuby Cookbook](http://shop.oreilly.com/product/9780596519650.do) and [Chalmers/Gothenburg University Software Engineering Master's Lecture Material](http://www.cse.chalmers.se/~bergert/slides/guest_lecture_DSLs.pdf)
17
17
 
18
- [Glimmer DSL for SWT](https://rubygems.org/gems/glimmer-dsl-swt) 4.20.1.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).
18
+ [Glimmer DSL for SWT](https://rubygems.org/gems/glimmer-dsl-swt) 4.20.2.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
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 early alpha, so default back to `bind` whenever needed).
21
21
 
@@ -341,7 +341,7 @@ jgem install glimmer-dsl-swt
341
341
 
342
342
  Or this command if you want a specific version:
343
343
  ```
344
- jgem install glimmer-dsl-swt -v 4.20.1.0
344
+ jgem install glimmer-dsl-swt -v 4.20.2.0
345
345
  ```
346
346
 
347
347
  `jgem` is JRuby's version of `gem` command.
@@ -369,7 +369,7 @@ Note: if you're using activerecord or activesupport, keep in mind that Glimmer u
369
369
 
370
370
  Add the following to `Gemfile`:
371
371
  ```
372
- gem 'glimmer-dsl-swt', '~> 4.20.1.0'
372
+ gem 'glimmer-dsl-swt', '~> 4.20.2.0'
373
373
  ```
374
374
 
375
375
  And, then run:
@@ -390,7 +390,7 @@ glimmer
390
390
  ```
391
391
 
392
392
  ```
393
- Glimmer (JRuby Desktop Development GUI Framework) - JRuby Gem: glimmer-dsl-swt v4.20.1.0
393
+ Glimmer (JRuby Desktop Development GUI Framework) - JRuby Gem: glimmer-dsl-swt v4.20.2.0
394
394
 
395
395
  Usage: glimmer [--bundler] [--pd] [--quiet] [--debug] [--log-level=VALUE] [[ENV_VAR=VALUE]...] [[-jruby-option]...] (application.rb or task[task_args]) [[application2.rb]...]
396
396
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 4.20.1.0
1
+ 4.20.2.0
Binary file
@@ -34,10 +34,10 @@ module Glimmer
34
34
  include_package 'org.eclipse.swt'
35
35
  include_package 'org.eclipse.swt.widgets'
36
36
 
37
- def initialize(parent, model_binding, tree_properties)
37
+ def initialize(parent, model_binding, tree_properties = nil)
38
38
  @tree = parent
39
39
  @model_binding = model_binding
40
- @tree_properties = [tree_properties].flatten.first.to_h
40
+ @tree_properties = @model_binding.binding_options[:tree_properties] || @model_binding.binding_options[:tree_attributes] || [tree_properties].compact.flatten.first.to_h
41
41
  if @tree.respond_to?(:tree_properties=)
42
42
  @tree.tree_properties = @tree_properties
43
43
  else # assume custom widget
@@ -36,7 +36,7 @@ module Glimmer
36
36
  block.nil? and
37
37
  (
38
38
  (parent.respond_to?(:set_attribute) and parent.respond_to?(:has_attribute?) and parent.has_attribute?(keyword)) or
39
- (parent.respond_to?(:swt_widget) and parent.swt_widget.is_a?(Table))
39
+ (parent.respond_to?(:swt_widget) and (parent.swt_widget.is_a?(Table) or parent.swt_widget.is_a?(Tree)))
40
40
  ) and
41
41
  !parent.is_a?(Glimmer::UI::CustomWidget) and
42
42
  !parent.is_a?(Glimmer::UI::CustomShape) and
@@ -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
@@ -30,15 +30,20 @@ module Glimmer
30
30
  include_package 'org.eclipse.swt.widgets'
31
31
 
32
32
  def can_interpret?(parent, keyword, *args, &block)
33
- initial_condition = ((keyword == "items") and block.nil? and parent.respond_to?(:swt_widget) and parent.swt_widget.is_a?(Tree))
34
- return false unless initial_condition
35
- raise Glimmer::Error, 'Tree items args must be 2' unless args.size == 2
36
- raise Glimmer::Error, 'Tree items first arg must be a bind expression' unless args[0].is_a?(DataBinding::ModelBinding)
37
- raise Glimmer::Error, 'Tree items data-binding initial value must not be an array yet a single item representing tree root' unless !args[0].evaluate_property.is_a?(Array)
38
- raise Glimmer::Error, 'Tree items second arg must be an array' unless args[1].is_a?(Array)
39
- raise Glimmer::Error, 'Tree items second arg must not be empty' unless !args[1].empty?
40
- raise Glimmer::Error, 'Tree items second arg array elements must be of type hash' unless args[1].first.is_a?(Hash)
41
- true
33
+ keyword == 'items' and
34
+ block.nil? and
35
+ parent.respond_to?(:swt_widget) and
36
+ parent.swt_widget.is_a?(Tree) and
37
+ args.size.between?(1, 2)
38
+ # TODO delete these checks if they are too granular
39
+ # return false unless initial_condition
40
+ # raise Glimmer::Error, 'Tree items args must be 1 or 2' unless args.size.between?(1, 2)
41
+ # raise Glimmer::Error, 'Tree items first arg must be a bind expression' unless args[0].is_a?(DataBinding::ModelBinding)
42
+ # raise Glimmer::Error, 'Tree items data-binding initial value must not be an array yet a single item representing tree root' unless !args[0].evaluate_property.is_a?(Array)
43
+ # raise Glimmer::Error, 'Tree items second arg must be an array' unless args[1].is_a?(Array)
44
+ # raise Glimmer::Error, 'Tree items second arg must not be empty' unless !args[1].empty?
45
+ # raise Glimmer::Error, 'Tree items second arg array elements must be of type hash' unless args[1].first.is_a?(Hash)
46
+ # true
42
47
  end
43
48
 
44
49
  def interpret(parent, keyword, *args, &block)
@@ -102,14 +102,14 @@ class Tetris
102
102
  }
103
103
 
104
104
  after_body {
105
- @game_over_observer = observe(@game, :game_over) do |game_over|
105
+ observe(@game, :game_over) do |game_over|
106
106
  if game_over
107
107
  show_high_score_dialog
108
108
  else
109
109
  start_moving_tetrominos_down
110
110
  end
111
111
  end
112
- @show_high_scores_observer = observe(@game, :show_high_scores) do |show_high_scores|
112
+ observe(@game, :show_high_scores) do |show_high_scores|
113
113
  if show_high_scores
114
114
  show_high_score_dialog
115
115
  else
@@ -40,7 +40,7 @@ class Tetris
40
40
  type :vertical
41
41
  center true
42
42
  }
43
- text 'Tetris'
43
+ text 'Glimmer Tetris'
44
44
 
45
45
  tetris_menu_bar(game: game)
46
46
 
@@ -314,8 +314,8 @@ class HelloTree
314
314
  margin_height 5
315
315
  }
316
316
  @tree = tree {
317
- items bind(Employee, :ceo), tree_properties(children: :subordinates, text: :to_s)
318
- selection bind(Employee, :selected_employee)
317
+ items <= [Employee, :ceo, tree_properties: {children: :subordinates, text: :to_s}]
318
+ selection <=> [Employee, :selected_employee]
319
319
  }
320
320
  }
321
321
 
@@ -329,7 +329,7 @@ class HelloTree
329
329
  }
330
330
  text {
331
331
  layout_data(:fill, :center, true, false)
332
- text bind(Employee, "selected_employee.first_name")
332
+ text <=> [Employee, "selected_employee.first_name"]
333
333
  font height: 16
334
334
  }
335
335
 
@@ -340,7 +340,7 @@ class HelloTree
340
340
  }
341
341
  text {
342
342
  layout_data(:fill, :center, true, false)
343
- text bind(Employee, "selected_employee.last_name")
343
+ text <=> [Employee, "selected_employee.last_name"]
344
344
  font height: 16
345
345
  }
346
346
 
@@ -351,7 +351,7 @@ class HelloTree
351
351
  }
352
352
  combo {
353
353
  layout_data(:fill, :center, true, false)
354
- selection bind(Employee, "selected_employee.position")
354
+ selection <=> [Employee, "selected_employee.position"]
355
355
  font height: 16
356
356
  }
357
357
 
@@ -373,7 +373,7 @@ class HelloTree
373
373
  spinner {
374
374
  maximum 999_999
375
375
  minimum 0
376
- selection bind(Employee, "selected_employee.salary")
376
+ selection <=> [Employee, "selected_employee.salary"]
377
377
  font height: 16
378
378
  }
379
379
  }
@@ -385,7 +385,7 @@ class HelloTree
385
385
  }
386
386
  combo(:read_only) {
387
387
  layout_data(:fill, :center, true, false)
388
- selection bind(Employee, "selected_employee.health_insurance")
388
+ selection <=> [Employee, "selected_employee.health_insurance"]
389
389
  font height: 16
390
390
  }
391
391
 
@@ -396,7 +396,7 @@ class HelloTree
396
396
  }
397
397
  combo(:read_only) {
398
398
  layout_data(:fill, :center, true, false)
399
- selection bind(Employee, "selected_employee.desk_location")
399
+ selection <=> [Employee, "selected_employee.desk_location"]
400
400
  font height: 16
401
401
  }
402
402
 
@@ -414,7 +414,7 @@ class HelloTree
414
414
  spinner {
415
415
  maximum 100
416
416
  minimum 0
417
- selection bind(Employee, "selected_employee.sales_bonus_percentage")
417
+ selection <=> [Employee, "selected_employee.sales_bonus_percentage"]
418
418
  font height: 16
419
419
  }
420
420
  label {
@@ -441,7 +441,7 @@ class HelloTree
441
441
  spinner {
442
442
  maximum 999_999
443
443
  minimum 0
444
- selection bind(Employee, "selected_employee.merit_bonus")
444
+ selection <=> [Employee, "selected_employee.merit_bonus"]
445
445
  font height: 16
446
446
  }
447
447
  }
@@ -467,7 +467,7 @@ class HelloTree
467
467
  maximum 999_999_00
468
468
  minimum 0
469
469
  increment 100
470
- selection bind(Employee, "selected_employee.#{attribute}", on_read: ->(v) {v.to_f * 100}, on_write: ->(v) {v.to_f / 100})
470
+ selection <=> [Employee, "selected_employee.#{attribute}", on_read: ->(v) {v.to_f * 100}, on_write: ->(v) {v.to_f / 100}]
471
471
  font height: 16
472
472
  }
473
473
  }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: glimmer-dsl-swt
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.20.1.0
4
+ version: 4.20.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andy Maleh
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-07-06 00:00:00.000000000 Z
11
+ date: 2021-07-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement