glimmer-dsl-swt 4.25.0.2 → 4.26.0.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: 33dcda40fcdf220f308eacd22b6fa2071fd80f9bd8cd5cbc7d56c53f9e74fbb5
4
- data.tar.gz: 94874ac017afdbf04fe7d9c56f95ca5a6c9fd3c242db6414c55b23ddc9016c75
3
+ metadata.gz: 64899b22884e8dfc8b0a6f166485e404c56fcbdb134a2a71d237873d7cf58420
4
+ data.tar.gz: bbb1aa3ca961e50306ebf3475c71020e1cdc49f02db2b090abb6e8d773edb59d
5
5
  SHA512:
6
- metadata.gz: 60ad5e3647148971dd5dd11d6689d49d43dbad002d8a63df882f072c3bc2ac77cc01cabb0442483b33910c71f5a6c7c0aad418ef7fce73e8833097b0148ac669
7
- data.tar.gz: 27cadffe2d34a89dfbbad5159441adca861e91f57c76c4e7bf257624abbcb1b63f5d84fc87bc4aba4dbc42425298975e79089ac48eecf46bdedf1a47ce448e41
6
+ metadata.gz: b6a61eaf29771e2e3dd549ac97debf2d7d241aac5092da177591ed6630549f3b9197291eacfc678a56dd647a02afe3d1a3d6a48ab7b1eeeb31f9b154a542f99c
7
+ data.tar.gz: a8d235d26a235e33ab4c36b417580f732325ae7cff526867d3878540d6a492e86ef35cf2cfd2016b3b5b302f36b3bfa2d3b323d86139e81b5c7486fd3ff63ca3
data/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Change Log
2
2
 
3
+ ## 4.26.0.0
4
+
5
+ - Upgrade to SWT 4.26
6
+ - Ensure that scaffolded custom widget (red label) uses SWT constants passed to custom widget
7
+ - Update sash form weights in Meta Sample for bigger monitors (give more space to code)
8
+ - Pass border to multi-line lists since it will not be included by default anymore given they are overridden with :multi SWT style
9
+
3
10
  ## 4.25.0.2
4
11
 
5
12
  - Fix issue with Hello, Label! crashing because image width is getting passed as 0 and the new SWT 4.25 ImageData API rejecting it as not a valid argument
data/README.md CHANGED
@@ -1,5 +1,6 @@
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.25.0.2
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.26.0.0
2
2
  ## JRuby Desktop Development GUI Framework
3
+ ### The Quickest Way From Zero To GUI
3
4
  [![Gem Version](https://badge.fury.io/rb/glimmer-dsl-swt.svg)](http://badge.fury.io/rb/glimmer-dsl-swt)
4
5
  [![Travis CI](https://travis-ci.com/AndyObtiva/glimmer-dsl-swt.svg?branch=master)](https://travis-ci.com/github/AndyObtiva/glimmer-dsl-swt)
5
6
  [![Coverage Status](https://coveralls.io/repos/github/AndyObtiva/glimmer-dsl-swt/badge.svg?branch=master)](https://coveralls.io/github/AndyObtiva/glimmer-dsl-swt?branch=master)
@@ -8,6 +9,8 @@
8
9
 
9
10
  **(The Original Glimmer Library Handling the World’s Ruby GUI Needs Since 2007. Beware of Imitators!)**
10
11
 
12
+ (**[Presenting ***"Building Native GUI Apps in Ruby"*** at RubyConf 2022](https://andymaleh.blogspot.com/2022/09/rubyconf-2022-building-native-gui-apps.html)**)
13
+
11
14
  [GLIMMER VIDEO TUTORIAL CHANNEL](https://www.youtube.com/channel/UC5hzDE23HZXsZLAxYk2UJEw)
12
15
 
13
16
  ![Glimmer DSL for SWT Demo of Hello, World!](/images/glimmer-dsl-swt-demo-hello-world.gif)
@@ -21,7 +24,7 @@ Featured in JRuby Cookbook](http://shop.oreilly.com/product/9780596519650.do) an
21
24
 
22
25
  ![Eclipse SWT RCP NASA Mars Rover](/images/glimmer-eclipse-swt-rcp-nasa-mars-rover.png)
23
26
 
24
- [Glimmer DSL for SWT](https://rubygems.org/gems/glimmer-dsl-swt) 4.25.0.2 includes [SWT 4.25](https://download.eclipse.org/eclipse/downloads/drops4/R-4.25-202208311800/), which was released on 31 Aug 2022. 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.
27
+ [Glimmer DSL for SWT](https://rubygems.org/gems/glimmer-dsl-swt) 4.26.0.0 includes [SWT 4.26](https://download.eclipse.org/eclipse/downloads/drops4/R-4.26-202211231800/), which was released on 23 Nov 2022. 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.
25
28
 
26
29
  **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. That was [originally conceived back in 2007](https://andymaleh.blogspot.com/2007/12/data-shining-in-glimmer.html).
27
30
 
@@ -338,7 +341,7 @@ jgem install glimmer-dsl-swt
338
341
 
339
342
  Or this command if you want a specific version:
340
343
  ```
341
- jgem install glimmer-dsl-swt -v 4.25.0.2
344
+ jgem install glimmer-dsl-swt -v 4.26.0.0
342
345
  ```
343
346
 
344
347
  `jgem` is JRuby's version of `gem` command.
@@ -366,7 +369,7 @@ Note: if you're using activerecord or activesupport, keep in mind that Glimmer u
366
369
 
367
370
  Add the following to `Gemfile`:
368
371
  ```
369
- gem 'glimmer-dsl-swt', '~> 4.25.0.2'
372
+ gem 'glimmer-dsl-swt', '~> 4.26.0.0'
370
373
  ```
371
374
 
372
375
  And, then run:
@@ -389,7 +392,7 @@ glimmer
389
392
  ```
390
393
 
391
394
  ```
392
- Glimmer (JRuby Desktop Development GUI Framework) - JRuby Gem: glimmer-dsl-swt v4.25.0.2
395
+ Glimmer (JRuby Desktop Development GUI Framework) - JRuby Gem: glimmer-dsl-swt v4.26.0.0
393
396
 
394
397
  Usage: glimmer [--bundler] [--pd] [--quiet] [--debug] [--log-level=VALUE] [[ENV_VAR=VALUE]...] [[-jruby-option]...] (application.rb or task[task_args]) [[application2.rb]...]
395
398
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 4.25.0.2
1
+ 4.26.0.0
@@ -146,7 +146,7 @@ You need to have your Git `user.name` and `github.user` configured before scaffo
146
146
 
147
147
  #### App
148
148
 
149
- Before you start, make sure you are in a JRuby environment with Glimmer gem installed as per "Direct Install" pre-requisites.
149
+ Before you start, make sure you are in a JRuby environment with [glimmer-dsl-swt](https://rubygems.org/gems/glimmer-dsl-swt) gem installed as per "Direct Install" pre-requisites.
150
150
 
151
151
  To scaffold a Glimmer app from scratch, run the following command:
152
152
 
@@ -65,6 +65,15 @@ This guide should help you get started with Glimmer DSL for SWT. For more advanc
65
65
  - [Observing Widgets](#observing-widgets)
66
66
  - [Alternative Syntax](#alternative-syntax)
67
67
  - [Observing Models](#observing-models)
68
+ - [Software Architecture](#software-architecture)
69
+ - [MVC](#mvc)
70
+ - [MVP](#mvp)
71
+ - [Software Architecture Examples](#software-architecture-examples)
72
+ - [MVC Example - Explicit Controller](#mvc-example---explicit-controller)
73
+ - [MVC Example - Implicit Controller](#mvc-example---implicit-controller)
74
+ - [MVP Example - Explicit Presenter](#mvp-example---explicit-presenter)
75
+ - [MVP Example - Implicit Presenter](#mvp-example---implicit-presenter)
76
+ - [MVP Example - Implicit Presenter with Bidirectional Data-Binding](#mvp-example---implicit-presenter-with-bidirectional-data-binding)
68
77
  - [Custom Widgets](#custom-widgets)
69
78
  - [Simple Example](#simple-example)
70
79
  - [Method-Based Custom Widget Example](#method-based-custom-widget-example)
@@ -1136,7 +1145,7 @@ Example:
1136
1145
 
1137
1146
  ```ruby
1138
1147
  # ...
1139
- list(:multi) { # SWT styles go inside ()
1148
+ list(:multi, :border) { # SWT styles go inside ()
1140
1149
  # ...
1141
1150
  }
1142
1151
  # ...
@@ -3971,7 +3980,7 @@ class HelloListMultiSelection
3971
3980
  person = Person.new
3972
3981
  shell {
3973
3982
  composite {
3974
- list(:multi) {
3983
+ list(:multi, :border) {
3975
3984
  selection bind(person, :provinces)
3976
3985
  }
3977
3986
  button {
@@ -4607,6 +4616,303 @@ class TicTacToe
4607
4616
  end
4608
4617
  ```
4609
4618
 
4619
+ ### Software Architecture
4620
+
4621
+ Glimmer DSL for SWT supports both MVC (Model View Controller) and MVP (Model View Presenter) architectural patterns.
4622
+
4623
+ #### MVC
4624
+
4625
+ Model View Controller architectural pattern is embodied by this diagram.
4626
+
4627
+ ![model view controller](/images/glimmer-software-architecture-model-view-controller.png)
4628
+
4629
+ #### MVP
4630
+
4631
+ Model View Presenter architectural pattern is embodied by this diagram.
4632
+
4633
+ ![model view presenter](/images/glimmer-software-architecture-model-view-presenter.png)
4634
+
4635
+ #### Software Architecture Examples
4636
+
4637
+ Here are 4 different ways of implementing the [Hello, Button!](/docs/reference/GLIMMER_SAMPLES.md#hello-button) sample (other than the included default implementation).
4638
+
4639
+ ![Hello Button](/images/glimmer-hello-button.png)
4640
+
4641
+ ##### MVC Example - Explicit Controller
4642
+
4643
+ (you may copy/paste in [`girb`](GLIMMER_GIRB.md))
4644
+
4645
+ ```ruby
4646
+ require 'glimmer-dsl-swt'
4647
+
4648
+ class Counter
4649
+ attr_accessor :count
4650
+
4651
+ def initialize
4652
+ self.count = 0
4653
+ end
4654
+
4655
+ def increment
4656
+ self.count += 1
4657
+ end
4658
+ end
4659
+
4660
+ class CounterController
4661
+ def initialize(counter)
4662
+ @counter = counter
4663
+ end
4664
+
4665
+ def increment_count
4666
+ @counter.increment
4667
+ end
4668
+ end
4669
+
4670
+ class HelloButton
4671
+ include Glimmer::UI::Application
4672
+
4673
+ before_body do
4674
+ @counter = Counter.new
4675
+ @counter_controller = CounterController.new(@counter)
4676
+ end
4677
+
4678
+ after_body do
4679
+ observe(@counter, :count) do |changed_count|
4680
+ @button.text = "Click To Increment: #{changed_count} "
4681
+ end
4682
+ end
4683
+
4684
+ body {
4685
+ shell {
4686
+ text 'Hello, Button!'
4687
+
4688
+ @button = button {
4689
+ text "Click To Increment: 0 "
4690
+
4691
+ on_widget_selected do
4692
+ @counter_controller.increment_count
4693
+ end
4694
+ }
4695
+ }
4696
+ }
4697
+ end
4698
+
4699
+ HelloButton.launch
4700
+ ```
4701
+
4702
+ ##### MVC Example - Implicit Controller
4703
+
4704
+ (you may copy/paste in [`girb`](GLIMMER_GIRB.md))
4705
+
4706
+ ```ruby
4707
+ require 'glimmer-dsl-swt'
4708
+
4709
+ class Counter
4710
+ attr_accessor :count
4711
+
4712
+ def initialize
4713
+ self.count = 0
4714
+ end
4715
+
4716
+ def increment
4717
+ self.count += 1
4718
+ end
4719
+ end
4720
+
4721
+ class HelloButton
4722
+ include Glimmer::UI::Application
4723
+
4724
+ before_body do
4725
+ @counter = Counter.new
4726
+ end
4727
+
4728
+ after_body do
4729
+ observe(@counter, :count) do |changed_count|
4730
+ @button.text = "Click To Increment: #{changed_count} "
4731
+ end
4732
+ end
4733
+
4734
+ body {
4735
+ shell {
4736
+ text 'Hello, Button!'
4737
+
4738
+ @button = button {
4739
+ text "Click To Increment: 0 "
4740
+
4741
+ on_widget_selected do
4742
+ @counter.increment
4743
+ end
4744
+ }
4745
+ }
4746
+ }
4747
+ end
4748
+
4749
+ HelloButton.launch
4750
+ ```
4751
+
4752
+ ##### MVP Example - Explicit Presenter
4753
+
4754
+ (you may copy/paste in [`girb`](GLIMMER_GIRB.md))
4755
+
4756
+ ```ruby
4757
+ require 'glimmer-dsl-swt'
4758
+
4759
+ class Counter
4760
+ attr_accessor :count
4761
+
4762
+ def initialize
4763
+ self.count = 0
4764
+ end
4765
+
4766
+ def increment
4767
+ self.count += 1
4768
+ end
4769
+ end
4770
+
4771
+ class CounterPresenter
4772
+ include Glimmer::DataBinding::Observer
4773
+
4774
+ def initialize
4775
+ @counter = Counter.new
4776
+
4777
+ Glimmer::DataBinding::Observer.proc do |changed_count|
4778
+ notify_observers(:count)
4779
+ end.observe(@counter, :count)
4780
+ end
4781
+
4782
+ def count
4783
+ @counter.count
4784
+ end
4785
+
4786
+ def increment_count
4787
+ @counter.increment
4788
+ end
4789
+ end
4790
+
4791
+ class HelloButton
4792
+ include Glimmer::UI::Application
4793
+
4794
+ before_body do
4795
+ @counter_presenter = CounterPresenter.new
4796
+ end
4797
+
4798
+ body {
4799
+ shell {
4800
+ text 'Hello, Button!'
4801
+
4802
+ button {
4803
+ text <= [@counter_presenter, :count, on_read: ->(value) { "Click To Increment: #{value} " }]
4804
+
4805
+ on_widget_selected do
4806
+ @counter_presenter.increment_count
4807
+ end
4808
+ }
4809
+
4810
+
4811
+ }
4812
+ }
4813
+ end
4814
+
4815
+ HelloButton.launch
4816
+ ```
4817
+
4818
+ ##### MVP Example - Implicit Presenter
4819
+
4820
+ (you may copy/paste in [`girb`](GLIMMER_GIRB.md))
4821
+
4822
+ ```ruby
4823
+ require 'glimmer-dsl-swt'
4824
+
4825
+ class Counter
4826
+ attr_accessor :count
4827
+
4828
+ def initialize
4829
+ self.count = 0
4830
+ end
4831
+
4832
+ def increment
4833
+ self.count += 1
4834
+ end
4835
+ end
4836
+
4837
+ class HelloButton
4838
+ include Glimmer::UI::Application
4839
+
4840
+ before_body do
4841
+ @counter = Counter.new
4842
+ end
4843
+
4844
+ body {
4845
+ shell {
4846
+ text 'Hello, Button!'
4847
+
4848
+ button {
4849
+ text <= [@counter, :count, on_read: ->(value) { "Click To Increment: #{value} " }]
4850
+
4851
+ on_widget_selected do
4852
+ @counter.count += 1
4853
+ end
4854
+ }
4855
+
4856
+
4857
+
4858
+ }
4859
+ }
4860
+ end
4861
+
4862
+ HelloButton.launch
4863
+ ```
4864
+
4865
+ ##### MVP Example - Implicit Presenter with Bidirectional Data-Binding
4866
+
4867
+ ![Hello Button](/images/glimmer-hello-button-with-text-bidirectional-data-binding.png)
4868
+
4869
+ This version diverges in behavior to demonstrate bidirectional data-binding through a text field that is data-bound bidirectionally to the same attribute that the button is data-bound to for the click count.
4870
+
4871
+ ```ruby
4872
+ require 'glimmer-dsl-swt'
4873
+
4874
+ class Counter
4875
+ attr_accessor :count
4876
+
4877
+ def initialize
4878
+ self.count = 0
4879
+ end
4880
+
4881
+ def increment
4882
+ self.count += 1
4883
+ end
4884
+ end
4885
+
4886
+ class HelloButton
4887
+ include Glimmer::UI::Application
4888
+
4889
+ before_body do
4890
+ @counter = Counter.new
4891
+ end
4892
+
4893
+ body {
4894
+ shell {
4895
+ fill_layout(:vertical)
4896
+ text 'Hello, Button!'
4897
+
4898
+ text {
4899
+ text <=> [@counter, :count, on_read: :to_s, on_write: :to_i]
4900
+ }
4901
+
4902
+ button {
4903
+ text <= [@counter, :count, on_read: ->(value) { "Click To Increment: #{value} " }]
4904
+
4905
+ on_widget_selected do
4906
+ @counter.count += 1
4907
+ end
4908
+ }
4909
+ }
4910
+ }
4911
+ end
4912
+
4913
+ HelloButton.launch
4914
+ ```
4915
+
4610
4916
  ### Custom Widgets
4611
4917
 
4612
4918
  Custom widgets are brand new Glimmer DSL keywords that represent aggregates of existing widgets (e.g. `address_form`), customized existing widgets (e.g. `greeting_label`), or brand new widgets (e.g. `oscilloscope`)
@@ -223,7 +223,7 @@ The `image` keyword in Glimmer automatically does that work when passing an imag
223
223
 
224
224
  5- NAME.app is damaged and can't be opened. You should move it to the trash
225
225
 
226
- If you package an app for the Mac and an end-user gets the error message above upon installing, note that you probably have a system incompatibility issue between your OS/CPU Architecture and the end-user's OS/CPU Architecture. To resolve the issue, make sure to repackage the app for the Mac on a system perfectly matching the end-user's OS/CPU Architecture (sometimes, packaging on a newer MacOS with the same CPU Architecture also works, but you would have to test that to confirm and ensure full compatibility).
226
+ If you package an app for the Mac and an end-user gets the error message above upon installing, note that you either have a security-blocked-app or a system incompatibility issue between your OS/CPU Architecture and the end-user's OS/CPU Architecture. To resolve the issue, first try to go to "System Preferences -> Privacy & Security" and open the security-blocked-app anyways. If that does not work, then make sure to repackage the app for the Mac on a system perfectly matching the end-user's OS/CPU Architecture (sometimes, packaging on a newer MacOS with the same CPU Architecture also works, but you would have to test that to confirm and ensure full compatibility).
227
227
 
228
228
  6- Message about a Mac app for which the developer cannot be verified (Move To Trash or Cancel)
229
229
 
Binary file
@@ -787,7 +787,7 @@ end
787
787
  #
788
788
  body {
789
789
  # Replace example content below with custom widget content
790
- label {
790
+ label(*swt_constants) {
791
791
  background :red
792
792
  }
793
793
  }
@@ -254,7 +254,7 @@ class MetaSampleApplication
254
254
  image File.expand_path('../../icons/scaffold_app.png', __dir__)
255
255
 
256
256
  sash_form {
257
- weights 1, 2
257
+ weights 1, 3
258
258
 
259
259
  composite {
260
260
  grid_layout(1, false) {
@@ -62,7 +62,7 @@ class HelloListMultiSelection
62
62
 
63
63
  text 'Hello, List Multi Selection!'
64
64
 
65
- list(:multi) {
65
+ list(:multi, :border) {
66
66
  selection <=> [@person, :provinces] # also binds to provinces_options by convention
67
67
  }
68
68
 
Binary file
Binary file
Binary file
Binary file
Binary file
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.25.0.2
4
+ version: 4.26.0.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: 2022-10-02 00:00:00.000000000 Z
11
+ date: 2022-12-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement