glimmer-dsl-swt 4.21.0.1 → 4.21.2.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (36) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +31 -0
  3. data/README.md +17 -11
  4. data/RUBY_VERSION +1 -1
  5. data/VERSION +1 -1
  6. data/docs/reference/GLIMMER_COMMAND.md +1 -1
  7. data/docs/reference/GLIMMER_GUI_DSL_SYNTAX.md +45 -26
  8. data/docs/reference/GLIMMER_PACKAGING_AND_DISTRIBUTION.md +73 -16
  9. data/glimmer-dsl-swt.gemspec +0 -0
  10. data/lib/glimmer/data_binding/widget_binding.rb +3 -3
  11. data/lib/glimmer/rake_task/package.rb +1 -1
  12. data/lib/glimmer/rake_task/scaffold.rb +4 -22
  13. data/lib/glimmer/rake_task.rb +1 -5
  14. data/lib/glimmer/swt/image_proxy.rb +5 -3
  15. data/lib/glimmer/swt/shell_proxy.rb +5 -3
  16. data/lib/glimmer/swt/style_constantizable.rb +2 -0
  17. data/lib/glimmer/swt/widget_proxy.rb +80 -0
  18. data/samples/elaborate/battleship/view/grid.rb +3 -3
  19. data/samples/elaborate/battleship/view/ship.rb +1 -1
  20. data/samples/elaborate/meta_sample.rb +12 -5
  21. data/samples/elaborate/tetris/view/tetris_menu_bar.rb +2 -2
  22. data/samples/elaborate/tetris.rb +12 -14
  23. data/samples/elaborate/tic_tac_toe.rb +6 -3
  24. data/samples/elaborate/timer.rb +0 -1
  25. data/samples/elaborate/weather.rb +3 -0
  26. data/samples/hello/hello_canvas.rb +1 -1
  27. data/samples/hello/hello_canvas_transform.rb +1 -1
  28. data/samples/hello/hello_cool_bar.rb +5 -60
  29. data/samples/hello/hello_drag_and_drop.rb +172 -11
  30. data/samples/hello/hello_scale.rb +1 -4
  31. data/samples/hello/hello_slider.rb +1 -4
  32. data/samples/hello/hello_tool_bar.rb +7 -53
  33. data/samples/hello/images/copy.png +0 -0
  34. data/samples/hello/images/cut.png +0 -0
  35. data/samples/hello/images/paste.png +0 -0
  36. metadata +11 -9
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6383b92b5f4c8f3a860fb3a73d80e65d5abc3b0d2f0bdfe485ccdb07eceb109e
4
- data.tar.gz: efe07cb31a4f44808d6b7252dc6a9d67792212003a67da29e40d32e61216e8fb
3
+ metadata.gz: 07f68ad917d0e734926d2f4064fdaa7c7982d3164cb1ca8e26b183b49da1d2ef
4
+ data.tar.gz: 859a163ecd57d0324135b8c29fced778c2f008a078af54c17d6497525ceda9dc
5
5
  SHA512:
6
- metadata.gz: 79ac1cb74da5aa66b283fc82d668c3b3bb5b08cba5d9676f715eee26be6091dfe0c21c34b40a929da1dee76270cbbe6ce932957c11fd36d49835a10786e0f11e
7
- data.tar.gz: 7a2df33551574e5252af42923d31a2e2d25d50407c2ac9ac59a71ef58542959cbbaf4a020a38a253597f0f79aa35466ca1f138389652b15229c048a756c9d244
6
+ metadata.gz: d9ff675ec4fc1b36815a1198be7aebcc35bc73c16fecb329f8ebfb2e182f0c9dff279098299ae665ea9edfe3f53c387e8e9ca841193c2b309558f4d3fcfba13a
7
+ data.tar.gz: 93fbf2d0bed61c27cfe64163ed0a05e878ad588c93ca87522ace6b0e67c0e8c4cf559119cf0562ba4d9d864a93fcec18438f6035037dd37a9a6a5c19fab8989d
data/CHANGELOG.md CHANGED
@@ -1,5 +1,36 @@
1
1
  # Change Log
2
2
 
3
+ ### 4.21.2.1
4
+
5
+ - Update Hello, Drag and Drop! to include `list`, `label`, `text`, and `spinner` examples
6
+ - Add manual and fully customizable drag and drop syntax alternatives to Hello, Drag and Drop!
7
+ - Support simpler drag and drop syntax (`drag_source true`/`drop_target true`) for simple cases concerning `list`, `label`, `text`, and `spinner`
8
+
9
+ ### 4.21.2.0
10
+
11
+ - Support Linux packaging of deb/rpm native executable installers (not just gems) through standard `glimmer package` call (e.g. `glimmer package[deb]` or `glimmer package[rpm]`)
12
+ - Update `Glimmer::SWT::ImageProxy` implementation of image loading from JAR to use `JRuby.runtime.jruby_class_loader.get_resource_as_stream(file_path).to_io.to_input_stream`
13
+ - Remove scaffolding/packaging building/using of a generated Java `Resource` class
14
+ - Force installing `gem 'psych', '3.3.2'` in scaffolded app as a temporary workaround to `psych` issues with the latest jruby (jruby-9.3.1.0)
15
+
16
+ ### 4.21.1.1
17
+
18
+ - Fix samples for Windows, espcially Hello, Cool Bar!, Hello, Tool Bar!, and Weather
19
+ - Fix down button for Tetris on Windows/Linux
20
+ - Fix pause menu item for Tetris
21
+
22
+ ### 4.21.1.0
23
+
24
+ - Upgrade to jruby 9.3.1.0
25
+ - Upgrade to glimmer 2.4.0 (with better observing of array of arrays nested changes)
26
+ - Minor sample fixes for Linux: Tetris (down button now works), Hello, Scale! (now fits horizontally), and Hello, Slider! (now fits horizontally)
27
+ - Adjusted minimum size of Meta-Sample to allow more shrinking (`minimum_size 640, 384`)
28
+ - Do not clean observers when disposing of a widget while closing the last shell (e.g. when closing an app, it is not needed to clean observers, so it is better to exit faster)
29
+
30
+ ### 4.21.0.1
31
+
32
+ - Updated default width for `shell` to `190` (was `130` before)
33
+
3
34
  ### 4.21.0.0
4
35
 
5
36
  - Upgrade to SWT 4.21
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.21.0.1
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.21.2.1
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)
@@ -10,12 +10,12 @@
10
10
 
11
11
  **(The Original Glimmer Library Handling the World’s Ruby GUI Needs Since 2007. Beware of Imitators!)**
12
12
 
13
- [Glimmer](https://github.com/AndyObtiva/glimmer) DSL for [SWT](https://www.eclipse.org/swt/) is a native-GUI cross-platform desktop development library written in [JRuby](https://www.jruby.org/), an OS-threaded faster JVM version of [Ruby](https://www.ruby-lang.org/en/). [Glimmer](https://github.com/AndyObtiva/glimmer)'s main innovation is a declarative [Ruby DSL](docs/reference/GLIMMER_GUI_DSL_SYNTAX.md#glimmer-dsl-syntax) that enables productive and efficient authoring of desktop application user-interfaces by relying on the robust [Eclipse SWT library](https://www.eclipse.org/swt/). [Glimmer](https://rubygems.org/gems/glimmer) additionally innovates by having built-in [data-binding](docs/reference/GLIMMER_GUI_DSL_SYNTAX.md#data-binding) support, which greatly facilitates synchronizing the GUI with domain models, thus achieving true decoupling of object oriented components and enabling developers to solve business problems (test-first) without worrying about GUI concerns, or alternatively drive development GUI-first, and then write clean business models afterwards. Not only does Glimmer provide a large set of GUI [widgets](docs/reference/GLIMMER_GUI_DSL_SYNTAX.md#widgets), but it also supports drawing Canvas Graphics like [Shapes](docs/reference/GLIMMER_GUI_DSL_SYNTAX.md#canvas-shape-dsl) and [Animations](docs/reference/GLIMMER_GUI_DSL_SYNTAX.md#canvas-animation-dsl). To get started quickly, [Glimmer](https://rubygems.org/gems/glimmer) offers [scaffolding](docs/reference/GLIMMER_COMMAND.md#scaffolding) options for [Apps](#in-production), [Gems](docs/reference/GLIMMER_COMMAND.md#custom-shell-gem), and [Custom Widgets](docs/reference/GLIMMER_GUI_DSL_SYNTAX.md#custom-widgets). [Glimmer](https://rubygems.org/gems/glimmer) also includes native-executable [packaging](docs/reference/GLIMMER_PACKAGING_AND_DISTRIBUTION.md) support, sorely lacking in other libraries, thus enabling the delivery of desktop apps written in [Ruby](https://www.ruby-lang.org/en/) as truly native DMG/PKG/APP files on the [Mac](https://www.apple.com/ca/macos), MSI/EXE files on [Windows](https://www.microsoft.com/en-ca/windows), and [Gems](docs/reference/GLIMMER_COMMAND.md#packaging) on [Linux](https://www.linux.org/). [Glimmer](https://github.com/AndyObtiva/glimmer) was the [first Ruby gem](https://rubygems.org/gems/glimmer) to bring [SWT](https://www.eclipse.org/swt/) (Standard Widget Toolkit) to [Ruby](https://www.ruby-lang.org/en/), thanks to creator [Andy Maleh](https://andymaleh.blogspot.com/), EclipseCon/EclipseWorld/RubyConf speaker.
13
+ [Glimmer](https://github.com/AndyObtiva/glimmer) DSL for [SWT](https://www.eclipse.org/swt/) is a native-GUI cross-platform desktop development library written in [JRuby](https://www.jruby.org/), an OS-threaded faster JVM version of [Ruby](https://www.ruby-lang.org/en/). [Glimmer](https://github.com/AndyObtiva/glimmer)'s main innovation is a declarative [Ruby DSL](docs/reference/GLIMMER_GUI_DSL_SYNTAX.md#glimmer-dsl-syntax) that enables productive and efficient authoring of desktop application user-interfaces by relying on the robust [Eclipse SWT library](https://www.eclipse.org/swt/). [Glimmer](https://rubygems.org/gems/glimmer) additionally innovates by having built-in [data-binding](docs/reference/GLIMMER_GUI_DSL_SYNTAX.md#data-binding) support, which greatly facilitates synchronizing the GUI with domain models, thus achieving true decoupling of object oriented components and enabling developers to solve business problems (test-first) without worrying about GUI concerns, or alternatively drive development GUI-first, and then write clean business models afterwards. Not only does Glimmer provide a large set of GUI [widgets](docs/reference/GLIMMER_GUI_DSL_SYNTAX.md#widgets), but it also supports drawing Canvas Graphics like [Shapes](docs/reference/GLIMMER_GUI_DSL_SYNTAX.md#canvas-shape-dsl) and [Animations](docs/reference/GLIMMER_GUI_DSL_SYNTAX.md#canvas-animation-dsl). To get started quickly, [Glimmer](https://rubygems.org/gems/glimmer) offers [scaffolding](docs/reference/GLIMMER_COMMAND.md#scaffolding) options for [Apps](#in-production), [Gems](docs/reference/GLIMMER_COMMAND.md#custom-shell-gem), and [Custom Widgets](docs/reference/GLIMMER_GUI_DSL_SYNTAX.md#custom-widgets). [Glimmer](https://rubygems.org/gems/glimmer) also includes native-executable [packaging](docs/reference/GLIMMER_PACKAGING_AND_DISTRIBUTION.md) support, sorely lacking in other libraries, thus enabling the delivery of desktop apps written in [Ruby](https://www.ruby-lang.org/en/) as truly native DMG/PKG/APP files on the [Mac](https://www.apple.com/ca/macos), MSI/EXE files on [Windows](https://www.microsoft.com/en-ca/windows), and DEB/RPM files on [Linux](https://www.linux.org/). [Glimmer](https://github.com/AndyObtiva/glimmer) was the [first Ruby gem](https://rubygems.org/gems/glimmer) to bring [SWT](https://www.eclipse.org/swt/) (Standard Widget Toolkit) to [Ruby](https://www.ruby-lang.org/en/), thanks to creator [Andy Maleh](https://andymaleh.blogspot.com/), EclipseCon/EclipseWorld/RubyConf speaker.
14
14
 
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.21.0.1 includes [SWT 4.21](https://download.eclipse.org/eclipse/downloads/drops4/R-4.21-202109060500/), which was released on September 6, 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 (please report any issues you may encounter).
18
+ [Glimmer DSL for SWT](https://rubygems.org/gems/glimmer-dsl-swt) 4.21.2.1 includes [SWT 4.21](https://download.eclipse.org/eclipse/downloads/drops4/R-4.21-202109060500/), which was released on September 6, 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 (please 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 a beta, so default back to `bind` whenever needed).
21
21
 
@@ -24,10 +24,11 @@ Please help make [Glimmer DSL for SWT](https://rubygems.org/gems/glimmer-dsl-swt
24
24
  Glimmer DSL gems:
25
25
  - [glimmer-dsl-swt](https://github.com/AndyObtiva/glimmer-dsl-swt): Glimmer DSL for SWT (JRuby Desktop Development GUI Framework)
26
26
  - [glimmer-dsl-opal](https://github.com/AndyObtiva/glimmer-dsl-opal): Glimmer DSL for Opal (Pure Ruby Web GUI and Auto-Webifier of Desktop Apps)
27
- - [glimmer-dsl-xml](https://github.com/AndyObtiva/glimmer-dsl-xml): Glimmer DSL for XML (& HTML)
28
- - [glimmer-dsl-css](https://github.com/AndyObtiva/glimmer-dsl-css): Glimmer DSL for CSS
29
27
  - [glimmer-dsl-tk](https://github.com/AndyObtiva/glimmer-dsl-tk): Glimmer DSL for Tk (MRI Ruby Desktop Development GUI Library)
30
28
  - [glimmer-dsl-libui](https://github.com/AndyObtiva/glimmer-dsl-libui): Glimmer DSL for LibUI (Prerequisite-Free Ruby Desktop Development GUI Library)
29
+ - [glimmer-dsl-gtk](https://github.com/AndyObtiva/glimmer-dsl-gtk): Glimmer DSL for GTK (Ruby-GNOME Desktop Development GUI Library)
30
+ - [glimmer-dsl-xml](https://github.com/AndyObtiva/glimmer-dsl-xml): Glimmer DSL for XML (& HTML)
31
+ - [glimmer-dsl-css](https://github.com/AndyObtiva/glimmer-dsl-css): Glimmer DSL for CSS
31
32
 
32
33
  ## Examples
33
34
 
@@ -290,9 +291,9 @@ https://www.eclipse.org/swt/faq.php
290
291
 
291
292
  ## Pre-requisites
292
293
 
293
- - JDK 16 (16.0.2) (find at https://www.oracle.com/java/technologies/downloads/#java16 / On Windows, ensure PATH includes Java bin directory for jpackage to work during packaging Glimmer applications)
294
+ - JDK 16 (16.0.2) (find at https://www.oracle.com/java/technologies/javase/jdk16-archive-downloads.html / Ensure PATH includes Java bin directory for `jpackage` command to work when packaging Glimmer applications)
294
295
  - [RVM](http://rvm.io) on Mac & Linux (not available on Windows)
295
- - JRuby 9.3.0.0 (supporting Ruby 2.6.x syntax) (get via [RVM](http://rvm.io) on Mac and Linux by running `rvm install jruby-9.3.0.0`; On Windows, find at [https://www.jruby.org/download](https://www.jruby.org/download) [you might have to dual-install JDK8 temporarily as it might be required by jruby installer and then switch JAVA_HOME to JDK16 once done installing and restart command prompt/git bash])
296
+ - JRuby 9.3.1.0 (supporting Ruby 2.6.x syntax) (get via [RVM](http://rvm.io) on Mac and Linux by running `rvm install jruby-9.3.1.0`; On Windows, find at [https://www.jruby.org/download](https://www.jruby.org/download))
296
297
  - SWT 4.21 (already included in the [glimmer-dsl-swt](https://rubygems.org/gems/glimmer-dsl-swt) gem). Note that SWT now supports AARCH64 on Mac and Linux, but it is not fully tested with Glimmer DSL for SWT yet, so it is considered experimental until declared otherwise.
297
298
  - Git (comes with Mac and Linux. Install on Windows: https://git-scm.com/download/win )
298
299
 
@@ -322,7 +323,7 @@ jgem install glimmer-dsl-swt
322
323
 
323
324
  Or this command if you want a specific version:
324
325
  ```
325
- jgem install glimmer-dsl-swt -v 4.21.0.1
326
+ jgem install glimmer-dsl-swt -v 4.21.2.1
326
327
  ```
327
328
 
328
329
  `jgem` is JRuby's version of `gem` command.
@@ -350,7 +351,7 @@ Note: if you're using activerecord or activesupport, keep in mind that Glimmer u
350
351
 
351
352
  Add the following to `Gemfile`:
352
353
  ```
353
- gem 'glimmer-dsl-swt', '~> 4.21.0.1'
354
+ gem 'glimmer-dsl-swt', '~> 4.21.2.1'
354
355
  ```
355
356
 
356
357
  And, then run:
@@ -371,7 +372,7 @@ glimmer
371
372
  ```
372
373
 
373
374
  ```
374
- Glimmer (JRuby Desktop Development GUI Framework) - JRuby Gem: glimmer-dsl-swt v4.21.0.1
375
+ Glimmer (JRuby Desktop Development GUI Framework) - JRuby Gem: glimmer-dsl-swt v4.21.2.1
375
376
 
376
377
  Usage: glimmer [--bundler] [--pd] [--quiet] [--debug] [--log-level=VALUE] [[ENV_VAR=VALUE]...] [[-jruby-option]...] (application.rb or task[task_args]) [[application2.rb]...]
377
378
 
@@ -535,6 +536,10 @@ If you have a Glimmer app you would like referenced here, please mention in a Pu
535
536
 
536
537
  [<img alt="Connector Logo" src="https://raw.githubusercontent.com/AndyObtiva/dcr/f31cd45a8503051e899ed8e831fd03654d38e418/package/linux/Draw%20Color%20Repeat.png" height=40 /> Draw Color Repeat](https://github.com/AndyObtiva/dcr): A young boy programming language for Drawing and Coloring with Repetition
537
538
 
539
+ ### Befunge 98 Programming Language
540
+
541
+ [Befunge 98 GUI](https://github.com/AndyObtiva/befunge98/tree/gui)
542
+
538
543
  ## Packaging & Distribution
539
544
 
540
545
  Glimmer simplifies the process of native-executable packaging and distribution on Mac and Windows via a single command:
@@ -672,7 +677,8 @@ You may apply for contributing to any of these Glimmer DSL gems whether you pref
672
677
  ## Contributors
673
678
 
674
679
  * [Andy Maleh](https://github.com/AndyObtiva) (Founder)
675
- * [Dennis Theisen](https://github.com/Soleone) (Contributor, originally in [Glimmer](https://github.com/AndyObtiva/glimmer/graphs/contributors) before splitting glimmer-dsl-swt)
680
+ * [Dennis Theisen](https://github.com/Soleone) (Contributor, originally in [Glimmer](https://github.com/AndyObtiva/glimmer/graphs/contributors) before splitting [glimmer-dsl-swt](https://rubygems.org/gems/glimmer))
681
+ * [Wayne Vucenic](https://github.com/rubycoder)
676
682
 
677
683
  [Click here to view contributor commits.](https://github.com/AndyObtiva/glimmer-dsl-swt/graphs/contributors)
678
684
 
data/RUBY_VERSION CHANGED
@@ -1 +1 @@
1
- jruby-9.3.0.0
1
+ jruby-9.3.1.0
data/VERSION CHANGED
@@ -1 +1 @@
1
- 4.21.0.1
1
+ 4.21.2.1
@@ -213,7 +213,7 @@ In order to run the app after making changes, you must run the `glimmer run`. It
213
213
  glimmer run
214
214
  ```
215
215
 
216
- Alternatively, to mantually run the app, you may type:
216
+ Alternatively, to manually run the app, you may type:
217
217
 
218
218
  ```
219
219
  glimmer run[bin/greeter]
@@ -1270,6 +1270,17 @@ It is a graphics `Image` object (not a widget), but is used used in setting the
1270
1270
 
1271
1271
  Glimmer recently included **EXPERIMENTAL** gif animation support for the `background_image` property on `composite' since SWT does not support animation by default. On Windows, it only works inside composites nested under standard shells, not ones that have the SWT styles :on_top or :no_trim
1272
1272
 
1273
+ When an app is packaged (i.e. JAR inside a DMG or MSI native executable), jruby generates file paths that start with "uri:classloader". The `image` keyword automatically knows how to interpret such paths when passed as an argument.
1274
+
1275
+ Should you need to read a file from a JAR file manually, you may use this code (assuming a `file_path` formed using standard Ruby `File.expand_path` call, which jruby automatically overrides when running from a JAR to generate a `uri:classloader` path) :
1276
+ ```ruby
1277
+ require 'jruby'
1278
+ file_path = file_path.sub(/^uri\:classloader\:/, '').sub(/^\/+/, '')
1279
+ jcl = JRuby.runtime.jruby_class_loader
1280
+ resource = jcl.get_resource_as_stream(file_path)
1281
+ file_input_stream = resource.to_io.to_input_stream
1282
+ ```
1283
+
1273
1284
  Learn more about images in general at this SWT Image guide: https://www.eclipse.org/articles/Article-SWT-images/graphics-resources.html
1274
1285
 
1275
1286
  #### Image Options
@@ -1498,7 +1509,7 @@ https://help.eclipse.org/2019-12/nftopic/org.eclipse.platform.doc.isv/reference/
1498
1509
 
1499
1510
  ### Canvas Shape DSL
1500
1511
 
1501
- **(ALPHA FEATURE)**
1512
+ **(BETA FEATURE)**
1502
1513
 
1503
1514
  While other GUI toolkits only offer a way to draw graphics imperatively (e.g. fill_rectangle, draw_point, etc...), Glimmer DSL for SWT breaks away from the mold by enabling software engineers to draw graphics declaratively. Simply declare all the shapes you want to see with their attributes, like background/foreground colors, and Glimmer DSL for SWT takes care of the rest, painting graphics on a blank `canvas` widget or amending/decorating an existing widget. This is accomplished through the Canvas Shape DSL, a sub-DSL of the Glimmer GUI DSL, which makes it possible to draw graphics declaratively with very understandable and maintainable syntax. Still, for the rare cases where imperative logic is needed, Glimmer DSL for SWT supports imperative painting of graphics through direct usage of SWT.
1504
1515
 
@@ -1933,7 +1944,7 @@ Check [Hello, Canvas!](GLIMMER_SAMPLES.md#hello-canvas) for an example.
1933
1944
 
1934
1945
  #### Pixel Graphics
1935
1946
 
1936
- **(Early Alpha Feature)**
1947
+ **(BETA FEATURE)**
1937
1948
 
1938
1949
  If you need to paint pixel graphics, use the optimized `pixel` keyword alternative to `point`, which takes foreground as a hash argument and bypasses the [Glimmer DSL Engine chain of responsibility](https://github.com/AndyObtiva/glimmer#dsl-engine), thus rendering faster when having very large pixel counts.
1939
1950
 
@@ -2115,7 +2126,7 @@ As they say, there are many ways to skin a cat! This is in line with the Ruby wa
2115
2126
 
2116
2127
  ### Canvas Path DSL
2117
2128
 
2118
- **(ALPHA FEATURE)**
2129
+ **(BETA FEATURE)**
2119
2130
 
2120
2131
  Unlike common imperative GUI graphing toolkits, Glimmer enables declarative rendering of paths with the new Canvas Path DSL (Early Alpha) via the new `path { }` keyword and by nesting one of the following path segment keywords underneath:
2121
2132
  - `point(x1, y1)`: renders a Point (Dot) as part of a path.
@@ -2161,7 +2172,7 @@ Every path segment object (mixing in [`Glimmer::SWT::Custom::PathSegment`](/lib/
2161
2172
 
2162
2173
  ### Canvas Transform DSL
2163
2174
 
2164
- **(ALPHA FEATURE)**
2175
+ **(BETA FEATURE)**
2165
2176
 
2166
2177
  The transform DSL builds [org.eclipse.swt.graphics.Transform](https://help.eclipse.org/2020-12/topic/org.eclipse.platform.doc.isv/reference/api/org/eclipse/swt/graphics/Transform.html) objects with a nice declarative syntax.
2167
2178
 
@@ -2245,7 +2256,7 @@ Learn more at the [Hello, Canvas Transform! Sample](GLIMMER_SAMPLES.md#hello-can
2245
2256
 
2246
2257
  ### Canvas Animation DSL
2247
2258
 
2248
- **(EXPERIMENTAL EARLY ALPHA FEATURE)**
2259
+ **(ALPHA FEATURE)**
2249
2260
 
2250
2261
  (note: this is a very new feature of Glimmer. It may change a bit while getting battle tested. As always, you could default to basic SWT usage if needed.)
2251
2262
 
@@ -2341,14 +2352,10 @@ This example adds on the one above it by specifying converters on read and write
2341
2352
 
2342
2353
  `text bind(contact, 'address.street', sync_exec: true)`
2343
2354
 
2344
- **(BETA FEATURE)**
2345
-
2346
2355
  This example forces GUI updates via [sync_exec](#sync_exec) assuming they are coming from another thread (different from the GUI thread)
2347
2356
 
2348
2357
  `text bind(contact, 'address.street', async_exec: true)`
2349
2358
 
2350
- **(BETA FEATURE)**
2351
-
2352
2359
  This example forces GUI updates via [async_exec](#async_exec) assuming they are coming from another thread (different from the GUI thread)
2353
2360
 
2354
2361
  `text bind(contact, 'address.street', on_read: lambda { |s| s[0..10] })`
@@ -2383,8 +2390,6 @@ Example from [samples/hello/hello_combo.rb](samples/hello_combo.rb) sample (you
2383
2390
 
2384
2391
  #### Shine
2385
2392
 
2386
- **(BETA FEATURE)**
2387
-
2388
2393
  The new Shine syntax for View/Model Attribute Mapping allows data-binding visually with simple arrow operators in Ruby.
2389
2394
 
2390
2395
  Use `<=> [model, attribute, options]` for bidirectional (two-way) data-binding instead of `bind(model, attribute, options)`.
@@ -3297,8 +3302,6 @@ Keep in mind that if the text grows and required a wider line numbers area, it g
3297
3302
  **theme**
3298
3303
  (default: `'glimmer'`)
3299
3304
 
3300
- **(BETA FEATURE)**
3301
-
3302
3305
  Changes syntax color highlighting theme. Can be one of the following:
3303
3306
  - glimmer
3304
3307
  - github
@@ -3307,8 +3310,6 @@ Changes syntax color highlighting theme. Can be one of the following:
3307
3310
  **language**
3308
3311
  (default: `'ruby'`)
3309
3312
 
3310
- **(BETA FEATURE)**
3311
-
3312
3313
  Sets the code language, which can be one of the following [rouge gem](#https://rubygems.org/gems/rouge) supported languages:
3313
3314
  - abap
3314
3315
  - actionscript
@@ -3618,15 +3619,27 @@ You may check out [Hello, Custom Shell!](GLIMMER_SAMPLES.md#hello-custom-shell)
3618
3619
 
3619
3620
  ### Drag and Drop
3620
3621
 
3621
- Glimmer s Drag and Drop support, thanks to [SWT](https://www.eclipse.org/swt/) and Glimmer's lightweight [DSL syntax](#glimmer-dsl-syntax).
3622
+ As a first option, Glimmer's Drag and Drop support requires no more than adding `drag_source true` and `drop_target true` for the most basic case concerning `list`, `label`, `text`, and `spinner`, thanks to [SWT](https://www.eclipse.org/swt/) and Glimmer's lightweight [DSL syntax](#glimmer-dsl-syntax).
3623
+
3624
+ Example:
3625
+
3626
+ ```ruby
3627
+ label {
3628
+ text 'Text To Drag and Drop'
3629
+ drag_source true
3630
+ }
3622
3631
 
3623
- You may learn more about SWT Drag and Drop support over here: [https://www.eclipse.org/articles/Article-SWT-DND/DND-in-SWT.html](https://www.eclipse.org/articles/Article-SWT-DND/DND-in-SWT.html)
3632
+ label {
3633
+ text 'Text To Replace'
3634
+ drop_target true
3635
+ }
3636
+ ```
3624
3637
 
3625
- To get started, simply follow these steps:
3638
+ As a second option, you may customize the data being transferred through drag and drop:
3626
3639
  1. On the drag source widget, add `on_drag_set_data` [DragSourceListener](https://help.eclipse.org/2020-03/topic/org.eclipse.platform.doc.isv/reference/api/org/eclipse/swt/dnd/DragSourceListener.html) event handler block at minimum (you may also add `on_drag_start` and `on_drag_finished` if needed)
3627
- 1. Set `event.data` to transfer via drag and drop inside the `on_drag_set_data` event handler block (defaults to `transfer` type of `:text`, as in a Ruby String)
3628
- 1. On the drop target widget, add `on_drop` [DropTargetListener](https://help.eclipse.org/2020-03/topic/org.eclipse.platform.doc.isv/reference/api/org/eclipse/swt/dnd/DropTargetListener.html) event handler block at minimum (you may also add `on_drag_enter` [must set [`event.detail`](https://help.eclipse.org/2020-06/topic/org.eclipse.platform.doc.isv/reference/api/org/eclipse/swt/dnd/DropTargetEvent.html#detail) if added], `on_drag_over`, `on_drag_leave`, `on_drag_operation_changed` and `on_drop_accept` if needed)
3629
- 1. Read `event.data` and consume it (e.g. change widget text) inside the `on_drop` event handler block.
3640
+ 2. Set `event.data` to transfer via drag and drop inside the `on_drag_set_data` event handler block (defaults to `transfer` type of `:text`, as in a Ruby String)
3641
+ 3. On the drop target widget, add `on_drop` [DropTargetListener](https://help.eclipse.org/2020-03/topic/org.eclipse.platform.doc.isv/reference/api/org/eclipse/swt/dnd/DropTargetListener.html) event handler block at minimum (you may also add `on_drag_enter` [must set [`event.detail`](https://help.eclipse.org/2020-06/topic/org.eclipse.platform.doc.isv/reference/api/org/eclipse/swt/dnd/DropTargetEvent.html#detail) if added], `on_drag_over`, `on_drag_leave`, `on_drag_operation_changed` and `on_drop_accept` if needed)
3642
+ 4. Read `event.data` and consume it (e.g. change widget text) inside the `on_drop` event handler block.
3630
3643
 
3631
3644
  Example (taken from [samples/hello/hello_drag_and_drop.rb](GLIMMER_SAMPLES.md#hello-drag-and-drop) / you may copy/paste in [`girb`](GLIMMER_GIRB.md)):
3632
3645
 
@@ -3645,18 +3658,22 @@ include Glimmer
3645
3658
 
3646
3659
  shell {
3647
3660
  text 'Hello, Drag and Drop!'
3661
+
3648
3662
  list {
3649
3663
  selection bind(@location, :country)
3664
+
3650
3665
  on_drag_set_data do |event|
3651
- list = event.widget.getControl
3652
- event.data = list.getSelection.first
3666
+ list = event.widget.control
3667
+ event.data = list.selection.first
3653
3668
  end
3654
3669
  }
3670
+
3655
3671
  label(:center) {
3656
3672
  text 'Drag a country here!'
3657
3673
  font height: 20
3674
+
3658
3675
  on_drop do |event|
3659
- event.widget.getControl.setText(event.data)
3676
+ event.widget.control.text = event.data
3660
3677
  end
3661
3678
  }
3662
3679
  }.open
@@ -3664,7 +3681,7 @@ shell {
3664
3681
 
3665
3682
  ![Hello Drag and Drop](/images/glimmer-hello-drag-and-drop.gif)
3666
3683
 
3667
- Optional steps:
3684
+ As a third most advanced option, you may:
3668
3685
  - Set a `transfer` property (defaults to `:text`). Values may be: :text (default), :html :image, :rtf, :url, and :file, or an array of multiple values. The `transfer` property will automatically convert your option into a [Transfer](https://help.eclipse.org/2020-03/topic/org.eclipse.platform.doc.isv/reference/api/org/eclipse/swt/dnd/Transfer.html) object as per the SWT API.
3669
3686
  - Specify `drag_source_style` operation (may be: :drop_copy (default), :drop_link, :drop_move, :drop_none, or an array of multiple operations)
3670
3687
  - Specify `drag_source_effect` (Check [DragSourceEffect](https://help.eclipse.org/2020-06/topic/org.eclipse.platform.doc.isv/reference/api/org/eclipse/swt/dnd/DragSourceEffect.html) SWT API for details)
@@ -3672,6 +3689,8 @@ Optional steps:
3672
3689
  - Specify `drop_target_effect` (Check [DropTargetEffect](https://help.eclipse.org/2020-06/topic/org.eclipse.platform.doc.isv/reference/api/org/eclipse/swt/dnd/DropTargetEffect.html) SWT API for details)
3673
3690
  - Set drag operation in `event.detail` (e.g. DND::DROP_COPY) inside `on_drag_enter`
3674
3691
 
3692
+ You may learn more about advanced SWT Drag and Drop cases over here: [https://www.eclipse.org/articles/Article-SWT-DND/DND-in-SWT.html](https://www.eclipse.org/articles/Article-SWT-DND/DND-in-SWT.html)
3693
+
3675
3694
  ### Miscellaneous
3676
3695
 
3677
3696
  #### Multi-DSL Support
@@ -3872,7 +3891,7 @@ class Example
3872
3891
  text 'Application Menu Items'
3873
3892
  font height: 30
3874
3893
  }
3875
- }
3894
+ }
3876
3895
  }
3877
3896
  end
3878
3897
 
@@ -1,16 +1,12 @@
1
1
  ## Glimmer Packaging and Distribution
2
2
 
3
- Note: this section mostly applies to Mac and Windows. On Linux, you can just run `glimmer package:gem` and after installing the gem, you get an executable matching the name of the app/custom-shell-gem you are building (e.g. `calculator` command becomes available after installing the [glimmer-cs-calculator](https://github.com/AndyObtiva/glimmer-cs-calculator) gem). On Windows, ensure system PATH includes Java bin directory `"C:\Program Files\Java\jdk-16.0.2\bin"` at the top for `jpackage` command to work during packaging Glimmer applications.
4
-
5
- Note 2: Glimmer packaging has a strong dependency on JDK16 since it includes the packaging tool `jpackage`.
6
-
7
- Glimmer simplifies the process of native-executable packaging and distribution on Mac and Windows via a single `glimmer package` command:
3
+ Glimmer simplifies the process of native-executable packaging and distribution on Mac, Windows, and Linux via a single `glimmer package` command:
8
4
 
9
5
  ```
10
6
  glimmer package
11
7
  ```
12
8
 
13
- It works out of the box for any application scaffolded by [Glimmer Scaffolding](#scaffolding), generating default packaging type on the current platform if not specified (i.e. `app-image`) and displaying a message indicating what pre-requisite setup tools are needed if not installed already (e.g. [Wix Toolset](https://wixtoolset.org/) to generate MSI files on Windows). If you install Wix, make sure it is on the system PATH by adding for example "C:\Program Files (x86)\WiX Toolset v3.11\bin" to the Windows Environment Variables.
9
+ It works out of the box for any application scaffolded by [Glimmer Scaffolding](#scaffolding), generating default packaging type on the current platform if not specified (i.e. `app-image`) and displaying a message indicating what pre-requisite setup tools are needed if not installed already (e.g. [Wix Toolset](https://wixtoolset.org/) to generate MSI files on Windows. If you install Wix, make sure it is on the system PATH by adding for example "C:\Program Files (x86)\WiX Toolset v3.11\bin" to the Windows Environment Variables.).
14
10
 
15
11
  You may choose to generate a specific type of packaging instead by addionally passing in the `[type]` option. For example, this generates an MSI setup file on Windows:
16
12
 
@@ -18,7 +14,9 @@ You may choose to generate a specific type of packaging instead by addionally pa
18
14
  glimmer package[msi]
19
15
  ```
20
16
 
21
- This generates a DMG file on the Mac:
17
+ ![glimmer packaging windows msi](/images/glimmer-packaging-windows-msi.png)
18
+
19
+ This command generates a DMG file on the Mac:
22
20
 
23
21
  ```
24
22
  glimmer package[dmg]
@@ -30,11 +28,37 @@ Make sure to surround with double-quotes when running from ZShell (zsh):
30
28
  glimmer "package[dmg]"
31
29
  ```
32
30
 
31
+ ![glimmer packaging mac dmg license screen](/images/glimmer-packaging-mac-dmg-license-screen.png)
32
+
33
+ ![glimmer packaging mac dmg](/images/glimmer-packaging-mac-dmg.png)
34
+
35
+ This command generates a DEB file on a Linux that supports deb packages (e.g. Linux Mint Cinnamon):
36
+
37
+ ```
38
+ glimmer package[deb]
39
+ ```
40
+
41
+ ![glimmer packaging linux deb](/images/glimmer-packaging-linux-deb.png)
42
+
43
+ This command generates an RPM file on a Linux that supports rpm packages (e.g. Red Hat Enterprise Linux):
44
+
45
+ ```
46
+ glimmer package[rpm]
47
+ ```
48
+
49
+ ![glimmer packaging linux rpm](/images/glimmer-packaging-linux-rpm.png)
50
+
33
51
  - Available Mac packaging types are `dmg`, `pkg`, and `app-image` (image means a pure Mac `app` without a setup program). Keep in mind that the packages you produce are compatible with the same MacOS you are on or older.
34
52
  - Available Windows packaging types are `msi`, `exe`, and `app-image` (image means a Windows application directory without a setup program). Learn more about Windows packaging are [over here](#windows-application-packaging).
35
- - Available Linux packaging types are `deb`, `rpm`, and `app-image` (Note: Linux native packaging has not been tested successfully, which is why `glimmer package:gem` is recommended on Linux instead. If you get it working, please contribute to this doc file with a Pull Request).
53
+ - Available Linux packaging types are `deb`, `rpm`, and `app-image` (note the prerequisites: for Red Hat Linux, the `rpm-build` package is required (for rpm) and for Ubuntu Linux, the `fakeroot` package is required (for deb). Also, use common sense to know which package type to generate on what Linux [e.g. use `deb` on `Linux Mint Cinnamon` or use `rpm` on `Fedora Linux`]).
54
+
55
+ Note 1: On Windows, ensure system environment PATH includes Java bin directory `"C:\Program Files\Java\jdk-16.0.2\bin"` at the top for `jpackage` command to work during packaging Glimmer applications (the default Oracle setup path for Java after installing the JDK is usually not sufficient).
56
+
57
+ Note 2: Glimmer packaging has a strong dependency on JDK16 since it includes the packaging tool `jpackage`. On the Mac, it seems there is a new gotcha in the latest JDK 16 DMG/PKG installable that is resulting in `jpackage` to be missing from `PATH`. To include, you might need to add `export PATH="/Library/Java/JavaVirtualMachines/jdk-16.0.2.jdk/Contents/Home/bin:$PATH"` to `~/.zprofile` or `~/.bashrc`
36
58
 
37
- Note: if you are using Glimmer manually, to make the `glimmer package` command available, you must add the following line to your application `Rakefile` (automatically done for you if you scaffold an app or gem with `glimmer scaffold[AppName]` or `glimmer scaffold:gem:customshell[GemName]`):
59
+ Note 3: On Linux, note the prerequisites: for Red Hat Linux, the `rpm-build` package is required (for rpm) and for Ubuntu Linux, the `fakeroot` package is required (for deb). Also, use common sense to know which package type to generate on what Linux (e.g. use `deb` on `Linux Mint Cinnamon` or use `rpm` on `Fedora Linux`)
60
+
61
+ Note 4: if you are using Glimmer packaging with a manually generated app (without scaffolding), in order to make the `glimmer package` command available, you must add the following line to your application `Rakefile` (automatically done for you if you scaffold an app or gem with `glimmer scaffold[AppName]` or `glimmer scaffold:gem:customshell[GemName]`):
38
62
 
39
63
  ```ruby
40
64
  require 'glimmer/rake_task'
@@ -45,7 +69,7 @@ The Glimmer packaging process done in the `glimmer package` command consists of
45
69
  1. Lock JAR versions (`glimmer package:lock_jars`): This locks versions of JAR dependencies leveraged by the `jar-dependencies` JRuby gem, downloading them into the `./vendor` directory so they would get inside the top-level Glimmer app/gem JAR file.
46
70
  1. Generate [Warbler](https://github.com/jruby/warbler) config (`glimmer package:config`): Generates initial Warbler config file (under `./config/warble.rb`) to use for generating JAR file.
47
71
  1. Generate JAR file using [Warbler](https://github.com/jruby/warbler) (`glimmer package:jar`): Enables bundling a Glimmer app into a JAR file under the `./dist` directory
48
- 1. Generate native executable using [jpackage](https://docs.oracle.com/en/java/javase/14/jpackage/packaging-tool-user-guide.pdf) (`glimmer package:native`): Enables packaging a JAR file as a DMG/PKG/APP file on Mac, MSI/EXE/APP on Windows, and DEB/RPM/APP on Linux (Glimmer does not officially support Linux with the `glimmer package` command yet, but it generates the JAR file successfully, and you could use `jpackage` manually afterwards if needed).
72
+ 1. Generate native executable using [jpackage](https://docs.oracle.com/en/java/javase/16/jpackage/packaging-tool-user-guide.pdf) (`glimmer package:native`): Enables packaging a JAR file as a DMG/PKG/APP file on Mac, MSI/EXE/APP on Windows, and DEB/RPM/APP on Linux (Glimmer does not officially support Linux with the `glimmer package` command yet, but it generates the JAR file successfully, and you could use `jpackage` manually afterwards if needed).
49
73
 
50
74
  Those steps automatically ensure generating a JAR file under the `./dist` directory using [Warbler](https://github.com/jruby/warbler), which is then used to automatically generate a DMG/MSI file (and other executables) under the `./packages/bundles` directory using `jpackage`.
51
75
  The JAR file name will match your application local directory name (e.g. `MathBowling.jar` for `~/code/MathBowling`)
@@ -88,7 +112,7 @@ require_relative '../app/my_application.rb'
88
112
 
89
113
  In order to explicitly configure jpackage, Mac package attributes, or sign your Mac app to distribute on the App Store, you can follow more advanced instructions for `jpackage` here:
90
114
  - Run `jpackage --help` for more info
91
- - https://docs.oracle.com/en/java/javase/14/jpackage/packaging-tool-user-guide.pdf
115
+ - https://docs.oracle.com/en/java/javase/16/jpackage/packaging-tool-user-guide.pdf
92
116
  - https://developer.apple.com/library/archive/releasenotes/General/SubmittingToMacAppStore/index.html#//apple_ref/doc/uid/TP40010572-CH16-SW8
93
117
 
94
118
  The Glimmer rake task allows passing extra options to jpackage via:
@@ -117,17 +141,17 @@ Pass `-v` to jpackage in `Glimmer::RakeTask::Package.jpackage_extra_args` or by
117
141
 
118
142
  ### Windows Application Packaging
119
143
 
120
- Windows s two options for setup packaging:
144
+ Windows offers two options for packaging:
121
145
  - `msi` (recommended): simpler packaging option. Requires [WiX Toolset](https://wixtoolset.org/) and [.NET Framework](https://dotnet.microsoft.com/download/dotnet-framework). Simply run `glimmer package[msi]` (or `glimmer package:native[msi]` if it's not your first time) and it will give you more details on the pre-requisites you need to install (e.g. [WiX Toolset](https://wixtoolset.org/) and [.NET Framework 3.5 SP1](https://dotnet.microsoft.com/download/dotnet-framework/net35-sp1)).
122
146
  - `exe`: more advanced packaging option. Requires [Inno Setup](https://jrsoftware.org/isinfo.php). Simply run `glimmer package[exe]` (or `glimmer package:native[exe]` if it's not your first time) and it will tell you what you need to install.
123
147
 
124
- If you just want to test out packaging into a native Windows app that is not packaged for Windows setup, just pass `image` to generate a native Windows app only.
148
+ If you just want to test out packaging into a native Windows app that is not packaged for Windows setup, just pass `app-image` (default) to generate a native Windows app only.
125
149
 
126
150
  ### Mac Application Distribution
127
151
 
128
- Recent macOS versions (starting with Catalina) have very stringent security requirements requiring all applications to be signed before running (unless the user goes to System Preferences -> Privacy -> General tab and clicks "Open Anyway" after failing to open application the first time they run it). So, to release a desktop application on the Mac, it is recommended to enroll in the [Apple Developer Program](https://developer.apple.com/programs/) to distribute on the [Mac App Store](https://developer.apple.com/distribute/) or otherwise request [app notarization from Apple](https://developer.apple.com/documentation/xcode/notarizing_macos_software_before_distribution) to distribute independently.
152
+ Recent macOS versions (starting with Catalina) have very stringent security requirements requiring all applications to be signed before running (unless the user goes to System Preferences -> Security & Privacy -> General tab and clicks "Open Anyway" after failing to open application the first time they run it). So, to release a desktop application on the Mac, it is recommended to enroll in the [Apple Developer Program](https://developer.apple.com/programs/) to distribute on the [Mac App Store](https://developer.apple.com/distribute/) or otherwise request [app notarization from Apple](https://developer.apple.com/documentation/xcode/notarizing_macos_software_before_distribution) to distribute independently.
129
153
 
130
- Afterwards, you may add signing arguments to `jpackage` via `Glimmer::RakeTask::Package.jpackage_extra_args` or `JPACKAGE_EXTRA_ARGS` according to this webpage: https://docs.oracle.com/en/java/javase/14/jpackage/packaging-tool-user-guide.pdf
154
+ Afterwards, you may add signing arguments to `jpackage` via `Glimmer::RakeTask::Package.jpackage_extra_args` or `JPACKAGE_EXTRA_ARGS` according to this webpage: https://docs.oracle.com/en/java/javase/16/jpackage/packaging-tool-user-guide.pdf
131
155
 
132
156
  ```
133
157
  --mac-package-signing-prefix <prefix string>
@@ -180,6 +204,12 @@ org.apache.maven.InternalErrorException: Internal error: org.jruby.exceptions.Ra
180
204
  Caused by: org.jruby.exceptions.RaiseException: (LoadError) library `java' could not be loaded: java.lang.reflect.InaccessibleObjectException: Unable to make protected native java.lang.Object java.lang.Object.clone() throws java.lang.CloneNotSupportedException accessible: module java.base does not "opens java.lang" to unnamed module @138caeca
181
205
  [ERROR]
182
206
  [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
207
+ ```
208
+
209
+ 3. jpackage missing from PATH on the Mac
210
+
211
+ On the Mac, the latest JDK 16 installable DMG/PKG is resulting in `jpackage` to be missing from `PATH`. To include, you might need to add `export PATH="/Library/Java/JavaVirtualMachines/jdk-16.0.2.jdk/Contents/Home/bin:$PATH"` to `~/.zprofile` or `~/.bashrc`
212
+ ```
183
213
  [ERROR] Re-run Maven using the -X switch to enable full debug logging.
184
214
  [ERROR]
185
215
  [ERROR] For more information about the errors and possible solutions, please read the following articles:
@@ -188,7 +218,7 @@ Caused by: org.jruby.exceptions.RaiseException: (LoadError) library `java' could
188
218
 
189
219
  Please ignore. It should be harmless. If you get blocked by it for any reason, please open an Issue about it.
190
220
 
191
- 3. Java on Windows System PATH
221
+ 4. Java on Windows System PATH
192
222
 
193
223
  If you get any errors running Java on Windows, keep in mind that you need to have the Java binaries "C:\Program Files\Java\jdk-16.0.2\bin" on the Windows System PATH environment variable.
194
224
 
@@ -198,3 +228,30 @@ The problem is Oracle seems to be adding an indirect Java path junction in later
198
228
  Simply replace it with the simple path mentioned above (`"C:\Program Files\Java\jdk-16.0.2\bin"` matching your correct version number)
199
229
 
200
230
  Lastly, reinstall JRuby to ensure it is using Java from the right path.
231
+
232
+ 5. File paths in app running from packaged JAR file
233
+
234
+ Glimmer packaged apps always reside within a JAR file before being wrapped by a native executable.
235
+
236
+ JRuby automatically converts any paths produced by File.expand_path inside packaged JAR file into uri:classloader prefixed paths. They work just fine when performing File.read, but if you need to access as a Java input stream, you need to use special code:
237
+
238
+ ```ruby
239
+ require 'jruby'
240
+ file_path = File.expand_path(some_path, __dir__)
241
+ file_path = file_path.sub(/^uri\:classloader\:/, '').sub(/^\/+/, '')
242
+ jcl = JRuby.runtime.jruby_class_loader
243
+ resource = jcl.get_resource_as_stream(file_path)
244
+ file_input_stream = resource.to_io.to_input_stream
245
+ ```
246
+
247
+ The `image` keyword in Glimmer automatically does that work when passing an image path produced from inside a JAR file.
248
+
249
+ 6. NAME.app is damaged and can't be opened. You should move it to the trash
250
+
251
+ 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).
252
+
253
+ 7. Message about a Mac app for which the developer cannot be verified (Move To Trash or Cancel)
254
+
255
+ If you get the above message when running a packaged Mac app for the first time, choose cancel and then immediately go to System Preferences -> Security & Privacy -> General Tab -> Choose Open Anyway at the bottom where the app name should be showing.
256
+
257
+ This would not be an issue if the app was [signed by Apple as per Mac Application Distribution instructions](#mac-application-distribution)
Binary file
@@ -40,7 +40,7 @@ module Glimmer
40
40
  SWT::DisplayProxy.instance.auto_exec(override_sync_exec: @sync_exec, override_async_exec: @async_exec) do
41
41
  if @widget.respond_to?(:on_widget_disposed)
42
42
  @widget.on_widget_disposed do |dispose_event|
43
- unregister_all_observables
43
+ deregister_all_observables unless @widget.shell_proxy.last_shell_closing?
44
44
  end
45
45
  end
46
46
  end
@@ -49,7 +49,7 @@ module Glimmer
49
49
  def call(value)
50
50
  SWT::DisplayProxy.instance.auto_exec(override_sync_exec: @sync_exec, override_async_exec: @async_exec) do
51
51
  if @widget.respond_to?(:disposed?) && @widget.disposed?
52
- unregister_all_observables
52
+ deregister_all_observables
53
53
  return
54
54
  end
55
55
  # need the rescue false for a scenario with tree items not being equal to model objects raising an exception
@@ -61,7 +61,7 @@ module Glimmer
61
61
 
62
62
  def evaluate_property
63
63
  if @widget.respond_to?(:disposed?) && @widget.disposed?
64
- unregister_all_observables
64
+ deregister_all_observables
65
65
  return
66
66
  end
67
67
  @widget.get_attribute(@property)
@@ -112,7 +112,7 @@ module Glimmer
112
112
  FileUtils.mkdir_p('packages/bundles')
113
113
  command = "jpackage"
114
114
  command += " --type #{native_type}"
115
- command += " --dest 'packages/bundles' --input 'dist' --main-class JarMain --main-jar '#{project_name}.jar' --java-options '-Dproject_name=#{project_name}' --name '#{human_name}' --vendor '#{human_name}' --icon '#{icon}' "
115
+ command += " --dest 'packages/bundles' --input 'dist' --main-class JarMain --main-jar '#{project_name}.jar' --name '#{human_name}' --vendor '#{human_name}' --icon '#{icon}' "
116
116
  command += " --win-per-user-install --win-dir-chooser --win-menu --win-menu-group '#{human_name}' " if OS.windows? && native_type != 'app-image'
117
117
  command += " --linux-menu-group '#{human_name}' " if OS.linux? && native_type != 'app-image'
118
118
  command += " --java-options '-XstartOnFirstThread' --mac-package-name '#{human_name}' --mac-package-identifier 'org.#{project_name}.application.#{project_name}' " if OS.mac?