glimmer-dsl-swt 4.17.6.0 → 4.17.8.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +34 -2
- data/README.md +211 -82
- data/VERSION +1 -1
- data/glimmer-dsl-swt.gemspec +14 -3
- data/lib/glimmer/data_binding/tree_items_binding.rb +20 -2
- data/lib/glimmer/dsl/swt/checkbox_group_selection_data_binding_expression.rb +61 -0
- data/lib/glimmer/dsl/swt/custom_widget_expression.rb +1 -0
- data/lib/glimmer/dsl/swt/dialog_expression.rb +1 -0
- data/lib/glimmer/dsl/swt/directory_dialog_expression.rb +48 -0
- data/lib/glimmer/dsl/swt/dsl.rb +1 -0
- data/lib/glimmer/dsl/swt/file_dialog_expression.rb +48 -0
- data/lib/glimmer/dsl/swt/radio_group_selection_data_binding_expression.rb +3 -3
- data/lib/glimmer/dsl/swt/shell_expression.rb +3 -3
- data/lib/glimmer/dsl/swt/widget_expression.rb +8 -8
- data/lib/glimmer/swt/custom/checkbox_group.rb +181 -0
- data/lib/glimmer/swt/custom/code_text.rb +43 -33
- data/lib/glimmer/swt/custom/radio_group.rb +94 -19
- data/lib/glimmer/swt/directory_dialog_proxy.rb +65 -0
- data/lib/glimmer/swt/expand_item_proxy.rb +0 -1
- data/lib/glimmer/swt/file_dialog_proxy.rb +66 -0
- data/lib/glimmer/swt/menu_proxy.rb +3 -3
- data/lib/glimmer/swt/shell_proxy.rb +5 -5
- data/lib/glimmer/swt/tab_item_proxy.rb +3 -3
- data/lib/glimmer/swt/table_proxy.rb +25 -25
- data/lib/glimmer/swt/widget_listener_proxy.rb +4 -4
- data/lib/glimmer/swt/widget_proxy.rb +27 -27
- data/lib/glimmer/ui/custom_shell.rb +3 -3
- data/samples/elaborate/contact_manager.rb +3 -3
- data/samples/elaborate/meta_sample.rb +24 -19
- data/samples/hello/hello_browser.rb +3 -3
- data/samples/hello/hello_checkbox.rb +18 -18
- data/samples/hello/hello_checkbox_group.rb +68 -0
- data/samples/hello/hello_combo.rb +12 -12
- data/samples/hello/hello_directory_dialog.rb +60 -0
- data/samples/hello/hello_expand_bar.rb +3 -1
- data/samples/hello/hello_file_dialog.rb +60 -0
- data/samples/hello/hello_group.rb +104 -0
- data/samples/hello/hello_list_multi_selection.rb +23 -23
- data/samples/hello/hello_list_single_selection.rb +18 -17
- data/samples/hello/hello_menu_bar.rb +3 -3
- data/samples/hello/hello_pop_up_context_menu.rb +3 -3
- data/samples/hello/hello_radio.rb +20 -20
- data/samples/hello/hello_radio_group.rb +25 -25
- data/samples/hello/hello_table.rb +130 -0
- data/samples/hello/hello_world.rb +3 -3
- metadata +13 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 05bc3d6096231cccf821c2aaf5d42a2ef28b23f999d058bc2b2ad2cbf19a1a32
|
4
|
+
data.tar.gz: b10d240123f7e7ccd7994c9493abf5d51062c402e96dc6ddd357f6809645c77a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a6b6e9c28482d8dbd6daadb3daab9820a091d961baef5ddd197b9c4198221130487ff44eed35285f5476e9a82c3dc41f89de4652c3375d382a19fb3ef35c6d2b
|
7
|
+
data.tar.gz: 2663c8de064e9bbb6f94ac7703e80bb14bb1c5c7cad9ceab69265c84cbacc4d8ae5a87a5fb41533c3e46ba46bb6f3b897fac5091a1108168d216a183faf4d585
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,37 @@
|
|
1
1
|
# Change Log
|
2
2
|
|
3
|
+
### 4.17.8.3
|
4
|
+
|
5
|
+
- Hello, Table! Sample
|
6
|
+
- Disable editing on a column with `editor :none`
|
7
|
+
- Improve `code_text` performance immensely by only styling the lines being shown upon editing
|
8
|
+
- Fix dead spots with syntax highlighting in some files in Gladiator like file.rb
|
9
|
+
|
10
|
+
### 4.17.8.2
|
11
|
+
|
12
|
+
- Hello, Group! Sample
|
13
|
+
|
14
|
+
### 4.17.8.1
|
15
|
+
|
16
|
+
- Fixed an issue in Windows with code_text
|
17
|
+
|
18
|
+
### 4.17.8.0
|
19
|
+
|
20
|
+
- Officially Support SWT FileDialog with the `file_dialog` keyword (was unofficially supported before via standard SWT)
|
21
|
+
- Officially Support SWT DirectoryDialog with the `directory_dialog` keyword (was unofficially supported before via standard SWT)
|
22
|
+
- Hello, File Dialog! Sample
|
23
|
+
- Hello, Directory Dialog! Sample
|
24
|
+
- Prevent tree items data-binding from updating if no tree data change occurred
|
25
|
+
- Performance optimization for `code_text` syntax highlighting through caching
|
26
|
+
|
27
|
+
### 4.17.7.0
|
28
|
+
|
29
|
+
- `checkbox_group` built-in custom widget
|
30
|
+
- Hello, Checkbox Group! Sample
|
31
|
+
- Refactor `radio_group` to render labels instead of relying on radio button text since they are better stylable
|
32
|
+
- Refactor Glimmer Meta-Sample to use `radio_group` instead of `radio`
|
33
|
+
- Fix issue with ExpandBar fill_layout with the extra element at the end (remove it)
|
34
|
+
|
3
35
|
### 4.17.6.0
|
4
36
|
|
5
37
|
- New `radio_group` built-in Glimmer custom widget
|
@@ -130,7 +162,7 @@
|
|
130
162
|
|
131
163
|
- Add User Profile sample from DZone article
|
132
164
|
- Colored Ruby syntax highlighting for sample:code and sample:run tasks courtesy of tty-markdown
|
133
|
-
- Support `check` as alias to `checkbox` DSL keyword for Button widget with :check style.
|
165
|
+
- Support `check` as alias to `checkbox` DSL keyword for Button widget with :check style.
|
134
166
|
- Validate scaffolded custom shell gem name to ensure it doesn't clash with a built in Ruby method
|
135
167
|
- GLIMMER_LOGGER_ASYNC env var for disabling async logging when needed for immediate troubleshooting purposes
|
136
168
|
- Fix issue with table equivalent sort edge case (that is two sorts that are equivalent causing an infinite loop of resorting since the table is not correctly identified as sorted already)
|
@@ -329,7 +361,7 @@
|
|
329
361
|
## 0.1.3
|
330
362
|
|
331
363
|
- Added 'org.eclipse.swt.dnd' to glimmer auto-included Java packages
|
332
|
-
- Updated Tic Tac Toe sample to use new `message_box` keyword
|
364
|
+
- Updated Tic Tac Toe sample to use new `message_box` keyword
|
333
365
|
- Add DragSource and DropTarget transfer expression that takes a symbol or symbol array representing one or more of the following: FileTransfer, HTMLTransfer, ImageTransfer, RTFTransfer, TextTransfer, URLTransfer
|
334
366
|
- Set default style DND::DROP_COPY in DragSource and DropTarget widgets
|
335
367
|
- Support Glimmer::SWT::DNDProxy for handling Drop & Drop styles
|
data/README.md
CHANGED
@@ -1,4 +1,5 @@
|
|
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.17.
|
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.17.8.3
|
2
|
+
|
2
3
|
## JRuby Desktop Development GUI Library
|
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)
|
@@ -18,7 +19,7 @@ Gem version numbers are in sync with the SWT library versions. The first two dig
|
|
18
19
|
|
19
20
|
[Glimmer DSL for SWT](https://rubygems.org/gems/glimmer-dsl-swt) versions 4.17.x.y come with [SWT 4.17](https://download.eclipse.org/eclipse/downloads/drops4/R-4.17-202009021800/), which was released on September 2, 2020.
|
20
21
|
|
21
|
-
[<img src="https://covers.oreillystatic.com/images/9780596519650/lrg.jpg" width=105 /><br />
|
22
|
+
[<img src="https://covers.oreillystatic.com/images/9780596519650/lrg.jpg" width=105 /><br />
|
22
23
|
Featured in<br />JRuby Cookbook](http://shop.oreilly.com/product/9780596519650.do)
|
23
24
|
|
24
25
|
Glimmer DSL gems:
|
@@ -349,7 +350,11 @@ Glimmer App:
|
|
349
350
|
- [Hello, Expand Bar!](#hello-expand-bar)
|
350
351
|
- [Hello, Radio!](#hello-radio)
|
351
352
|
- [Hello, Radio Group!](#hello-radio-group)
|
353
|
+
- [Hello, Group!](#hello-group)
|
352
354
|
- [Hello, Checkbox!](#hello-checkbox)
|
355
|
+
- [Hello, Checkbox Group!](#hello-checkbox-group)
|
356
|
+
- [Hello, Directory Dialog!](#hello-directory-dialog)
|
357
|
+
- [Hello, File Dialog!](#hello-file-dialog)
|
353
358
|
- [Elaborate Samples](#elaborate-samples)
|
354
359
|
- [User Profile](#user-profile)
|
355
360
|
- [Login](#login)
|
@@ -433,7 +438,7 @@ Otherwise, Option 2 ([Bundler](#option-2-bundler)) can be followed in rare cases
|
|
433
438
|
|
434
439
|
Note: if you encounter any [issues](https://github.com/AndyObtiva/glimmer-dsl-swt/issues), please [report](https://github.com/AndyObtiva/glimmer-dsl-swt/issues) and then install a previous version instead from the list of [Glimmer Releases](https://rubygems.org/gems/glimmer-dsl-swt/versions).
|
435
440
|
|
436
|
-
### Option 1: Direct Install
|
441
|
+
### Option 1: Direct Install
|
437
442
|
(Use for [Scaffolding](#scaffolding))
|
438
443
|
|
439
444
|
Run this command to install directly:
|
@@ -443,10 +448,11 @@ jgem install glimmer-dsl-swt
|
|
443
448
|
|
444
449
|
Or this command if you want a specific version:
|
445
450
|
```
|
446
|
-
jgem install glimmer-dsl-swt -v 4.17.
|
451
|
+
jgem install glimmer-dsl-swt -v 4.17.8.3
|
452
|
+
|
447
453
|
```
|
448
454
|
|
449
|
-
`jgem` is JRuby's version of `gem` command.
|
455
|
+
`jgem` is JRuby's version of `gem` command.
|
450
456
|
RVM allows running `gem install` directly as an alias.
|
451
457
|
Otherwise, you may also run `jruby -S gem install ...`
|
452
458
|
|
@@ -456,7 +462,7 @@ Otherwise, if you are ready to build a Glimmer app, you can jump to the [Glimmer
|
|
456
462
|
|
457
463
|
Note: if you're using activerecord or activesupport, keep in mind that Glimmer unhooks ActiveSupport::Dependencies as it does not rely on it.
|
458
464
|
|
459
|
-
### Option 2: Bundler
|
465
|
+
### Option 2: Bundler
|
460
466
|
(Use for Manual App Creation)
|
461
467
|
|
462
468
|
Add the following to `Gemfile`:
|
@@ -483,7 +489,7 @@ You can bring up usage instructions by running the `glimmer` command without arg
|
|
483
489
|
glimmer
|
484
490
|
```
|
485
491
|
|
486
|
-
On Mac and Linux, it additionally brings up a TUI (Text-based User Interface) for interactive navigation and execution of Glimmer tasks (courtesy of [rake-tui](https://github.com/AndyObtiva/rake-tui)).
|
492
|
+
On Mac and Linux, it additionally brings up a TUI (Text-based User Interface) for interactive navigation and execution of Glimmer tasks (courtesy of [rake-tui](https://github.com/AndyObtiva/rake-tui)).
|
487
493
|
|
488
494
|
On Windows, it simply lists the available Glimmer tasks at the end (courtsey of [rake](https://github.com/ruby/rake)).
|
489
495
|
|
@@ -519,13 +525,14 @@ bin/glimmer samples
|
|
519
525
|
Below are the full usage instructions that come up when running `glimmer` without args.
|
520
526
|
|
521
527
|
```
|
522
|
-
Glimmer (Ruby Desktop Development GUI Library) - JRuby Gem: glimmer-dsl-swt v4.17.
|
528
|
+
Glimmer (Ruby Desktop Development GUI Library) - JRuby Gem: glimmer-dsl-swt v4.17.8.3
|
529
|
+
|
523
530
|
|
524
531
|
Usage: glimmer [--bundler] [--pd] [--quiet] [--debug] [--log-level=VALUE] [[ENV_VAR=VALUE]...] [[-jruby-option]...] (application.rb or task[task_args]) [[application2.rb]...]
|
525
532
|
|
526
|
-
Runs Glimmer applications and tasks.
|
533
|
+
Runs Glimmer applications and tasks.
|
527
534
|
|
528
|
-
When applications are specified, they are run using JRuby,
|
535
|
+
When applications are specified, they are run using JRuby,
|
529
536
|
automatically preloading the glimmer Ruby gem and SWT jar dependency.
|
530
537
|
|
531
538
|
Optionally, extra Glimmer options, JRuby options, and/or environment variables may be passed in.
|
@@ -548,11 +555,11 @@ Select a Glimmer task to run: (Press ↑/↓ arrow to move, Enter to select and
|
|
548
555
|
glimmer package[type] # Package app for distribution (generating config, jar, and native files) (type is optional)
|
549
556
|
glimmer package:clean # Clean by removing "dist" and "packages" directories
|
550
557
|
glimmer package:config # Generate JAR config file
|
551
|
-
glimmer package:gemspec # Generate gemspec
|
558
|
+
glimmer package:gemspec # Generate gemspec
|
552
559
|
glimmer package:jar # Generate JAR file
|
553
560
|
glimmer package:lock_jars # Lock JARs
|
554
561
|
glimmer package:native[type] # Generate Native files
|
555
|
-
glimmer run[app_path] # Runs Glimmer app or custom shell gem in the current directory, unless app_path is specified, then runs it instead (app_path is optional)
|
562
|
+
glimmer run[app_path] # Runs Glimmer app or custom shell gem in the current directory, unless app_path is specified, then runs it instead (app_path is optional)
|
556
563
|
glimmer samples # Brings up the Glimmer Meta-Sample app to allow browsing, running, and viewing code of Glimmer samples
|
557
564
|
glimmer scaffold[app_name] # Scaffold Glimmer application directory structure to build a new app
|
558
565
|
glimmer scaffold:customshell[name,namespace] # Scaffold Glimmer::UI::CustomShell subclass (full window view) under app/views (namespace is optional) [alt: scaffold:cs]
|
@@ -592,10 +599,10 @@ This brings up the [Glimmer Meta-Sample (The Sample of Samples)](#samples):
|
|
592
599
|
Glimmer borrows from Rails the idea of Scaffolding, that is generating a structure for your app files that
|
593
600
|
helps you get started just like true building scaffolding helps construction workers, civil engineers, and architects.
|
594
601
|
|
595
|
-
Glimmer scaffolding goes beyond just scaffolding the app files that Rails does. It also packages it and launches it,
|
602
|
+
Glimmer scaffolding goes beyond just scaffolding the app files that Rails does. It also packages it and launches it,
|
596
603
|
getting you to a running and delivered state of an advanced "Hello, World!" Glimmer application right off the bat.
|
597
604
|
|
598
|
-
This should greatly facilitate building a new Glimmer app by helping you be productive and focus on app details while
|
605
|
+
This should greatly facilitate building a new Glimmer app by helping you be productive and focus on app details while
|
599
606
|
letting Glimmer scaffolding take care of initial app file structure concerns, such as adding:
|
600
607
|
- Main application class that includes Glimmer (`app/{app_name}.rb`)
|
601
608
|
- Main application view that houses main window content, menu, about dialog, and preferences dialog
|
@@ -610,7 +617,7 @@ You need to have your Git `user.name` and `github.user` configured before scaffo
|
|
610
617
|
|
611
618
|
#### App
|
612
619
|
|
613
|
-
Before you start, make sure you are in a JRuby environment with Glimmer gem installed as per "Direct Install" pre-requisites.
|
620
|
+
Before you start, make sure you are in a JRuby environment with Glimmer gem installed as per "Direct Install" pre-requisites.
|
614
621
|
|
615
622
|
To scaffold a Glimmer app from scratch, run the following command:
|
616
623
|
|
@@ -704,7 +711,7 @@ The app even remembers your cookies if you log into the website, close the app,
|
|
704
711
|
|
705
712
|
Note that on Linux, the default SWT browser, which runs on webkit, does not support HTML5 Video out of the box. If you need video support, open `Gemfile` after scaffolding and enable the line that has the `glimmer-cw-browser-chromium` gem then replace the `browser` in "app/views/snowboard_utah/app_view.rb" with `browser(:chromium)`
|
706
713
|
|
707
|
-
Before you start, make sure you are in a JRuby environment with Glimmer gem installed as per "Direct Install" pre-requisites.
|
714
|
+
Before you start, make sure you are in a JRuby environment with Glimmer gem installed as per "Direct Install" pre-requisites.
|
708
715
|
|
709
716
|
To scaffold a Glimmer desktopify app from scratch, run the following command:
|
710
717
|
|
@@ -819,8 +826,8 @@ glimmer scaffold:cw[name]
|
|
819
826
|
|
820
827
|
#### Custom Shell Gem
|
821
828
|
|
822
|
-
Custom shell gems are self-contained Glimmer apps as well as reusable custom shells.
|
823
|
-
They have everything scaffolded Glimmer apps come with in addition to gem content like a [Juwelier](https://rubygems.org/gems/juwelier) Rakefile that can build gemspec and release gems.
|
829
|
+
Custom shell gems are self-contained Glimmer apps as well as reusable custom shells.
|
830
|
+
They have everything scaffolded Glimmer apps come with in addition to gem content like a [Juwelier](https://rubygems.org/gems/juwelier) Rakefile that can build gemspec and release gems.
|
824
831
|
Unlike scaffolded Glimmer apps, custom shell gem content lives under the `lib` directory (not `app`).
|
825
832
|
They can be packaged as both a native executable (e.g. Mac DMG/PKG/APP) and a Ruby gem.
|
826
833
|
Of course, you can just build a Ruby gem and disregard native executable packaging if you do not need it.
|
@@ -847,7 +854,7 @@ Since custom shell gems are both an app and a gem, they provide two ways to run:
|
|
847
854
|
- Run the `glimmer` command and pass it the generated script under the `bin` directory that matches the gem name (e.g. run `glimmer bin/glimmer-cs-calculator`)
|
848
855
|
- Run the executable shell script that ships with the gem directly (does not need the `glimmer` command). It intentionally has a shorter name for convenience since it is meant to be used on the command line (not in a package), so you can leave out the `glimmer-cs-` prefix (e.g. run `bin/calculator` directly). This is also used as the main way of running custom shell gems on Linux.
|
849
856
|
|
850
|
-
Examples:
|
857
|
+
Examples:
|
851
858
|
|
852
859
|
- [glimmer-cs-gladiator](https://github.com/AndyObtiva/glimmer-cs-gladiator): Gladiator (Glimmer Editor)
|
853
860
|
- [glimmer-cs-calculator](https://github.com/AndyObtiva/glimmer-cs-calculator): Glimmer Calculator
|
@@ -873,7 +880,7 @@ The Ruby gem name will follow the convention "glimmer-cw-customwidgetname-namesp
|
|
873
880
|
|
874
881
|
Only official Glimmer gems created by the Glimmer project committers will have no namespace (e.g. [glimmer-cw-video](https://rubygems.org/gems/glimmer-cw-video) Ruby gem)
|
875
882
|
|
876
|
-
Examples:
|
883
|
+
Examples:
|
877
884
|
|
878
885
|
- [glimmer-cw-video](https://github.com/AndyObtiva/glimmer-cw-video): Video Widget
|
879
886
|
- [glimmer-cw-cdatetime-nebula](https://github.com/AndyObtiva/glimmer-cw-cdatetime-nebula): Nebula CDateTime Widget
|
@@ -908,11 +915,11 @@ Output:
|
|
908
915
|
|
909
916
|
Glimmer Custom Shell Gems at rubygems.org:
|
910
917
|
|
911
|
-
Name Gem Version Author Description
|
918
|
+
Name Gem Version Author Description
|
912
919
|
|
913
|
-
Calculator glimmer-cs-calculator 1.0.2 Andy Maleh Calculator - Glimmer Custom Shell
|
914
|
-
Gladiator glimmer-cs-gladiator 0.2.4 Andy Maleh Gladiator (Glimmer Editor) - Glimmer Custom Shell
|
915
|
-
Timer glimmer-cs-timer 1.0.0 Andy Maleh Timer - Glimmer Custom Shell
|
920
|
+
Calculator glimmer-cs-calculator 1.0.2 Andy Maleh Calculator - Glimmer Custom Shell
|
921
|
+
Gladiator glimmer-cs-gladiator 0.2.4 Andy Maleh Gladiator (Glimmer Editor) - Glimmer Custom Shell
|
922
|
+
Timer glimmer-cs-timer 1.0.0 Andy Maleh Timer - Glimmer Custom Shell
|
916
923
|
|
917
924
|
```
|
918
925
|
|
@@ -944,9 +951,9 @@ Output:
|
|
944
951
|
|
945
952
|
Glimmer Custom Widget Gems matching [video] at rubygems.org:
|
946
953
|
|
947
|
-
Name Gem Version Author Description
|
954
|
+
Name Gem Version Author Description
|
948
955
|
|
949
|
-
Video glimmer-cw-video 1.0.0 Andy Maleh Glimmer Custom Widget - Video
|
956
|
+
Video glimmer-cw-video 1.0.0 Andy Maleh Glimmer Custom Widget - Video
|
950
957
|
|
951
958
|
```
|
952
959
|
|
@@ -964,11 +971,11 @@ Output:
|
|
964
971
|
|
965
972
|
Glimmer Custom Widget Gems at rubygems.org:
|
966
973
|
|
967
|
-
Name Gem Version Author Description
|
974
|
+
Name Gem Version Author Description
|
968
975
|
|
969
|
-
Browser (Chromium) glimmer-cw-browser-chromium 1.0.0 Andy Maleh Chromium Browser - Glimmer Custom Widget
|
970
|
-
Cdatetime (Nebula) glimmer-cw-cdatetime-nebula 1.5.0.0.1 Andy Maleh Nebula CDateTime Widget - Glimmer Custom Widget
|
971
|
-
Video glimmer-cw-video 1.0.0 Andy Maleh Glimmer Custom Widget - Video
|
976
|
+
Browser (Chromium) glimmer-cw-browser-chromium 1.0.0 Andy Maleh Chromium Browser - Glimmer Custom Widget
|
977
|
+
Cdatetime (Nebula) glimmer-cw-cdatetime-nebula 1.5.0.0.1 Andy Maleh Nebula CDateTime Widget - Glimmer Custom Widget
|
978
|
+
Video glimmer-cw-video 1.0.0 Andy Maleh Glimmer Custom Widget - Video
|
972
979
|
|
973
980
|
```
|
974
981
|
|
@@ -992,13 +999,14 @@ Output:
|
|
992
999
|
|
993
1000
|
Glimmer DSL Gems at rubygems.org:
|
994
1001
|
|
995
|
-
Name Gem Version Author Description
|
1002
|
+
Name Gem Version Author Description
|
996
1003
|
|
997
|
-
Css glimmer-dsl-css 1.1.0 AndyMaleh Glimmer DSL for CSS
|
998
|
-
Opal glimmer-dsl-opal 0.4.0 AndyMaleh Glimmer DSL for Opal
|
999
|
-
Swt glimmer-dsl-swt 4.17.
|
1000
|
-
|
1001
|
-
|
1004
|
+
Css glimmer-dsl-css 1.1.0 AndyMaleh Glimmer DSL for CSS
|
1005
|
+
Opal glimmer-dsl-opal 0.4.0 AndyMaleh Glimmer DSL for Opal
|
1006
|
+
Swt glimmer-dsl-swt 4.17.8.3
|
1007
|
+
AndyMaleh Glimmer DSL for SWT
|
1008
|
+
Tk glimmer-dsl-tk 0.0.6 AndyMaleh Glimmer DSL for Tk
|
1009
|
+
Xml glimmer-dsl-xml 1.1.0 AndyMaleh Glimmer DSL for XML
|
1002
1010
|
```
|
1003
1011
|
|
1004
1012
|
### Packaging
|
@@ -1141,7 +1149,7 @@ Static keywords are pre-identified keywords in the Glimmer DSL, such as `shell`,
|
|
1141
1149
|
|
1142
1150
|
Dynamic keywords are dynamically figured out from currently imported (aka required/loaded) SWT widgets and custom widgets. Examples are: `label`, `combo`, and `list` for SWT widgets and `c_date_time`, `video`, and `gantt_chart` for custom widgets.
|
1143
1151
|
|
1144
|
-
The only reason to distinguish between the two is to realize that importing new Glimmer [custom widgets](#custom-widgets) and Java SWT custom widget libraries automatically expands Glimmer's DSL vocabulary with new dynamic keywords.
|
1152
|
+
The only reason to distinguish between the two is to realize that importing new Glimmer [custom widgets](#custom-widgets) and Java SWT custom widget libraries automatically expands Glimmer's DSL vocabulary with new dynamic keywords.
|
1145
1153
|
|
1146
1154
|
For example, if a project adds this custom Java SWT library from the [Nebula Project](https://www.eclipse.org/nebula/):
|
1147
1155
|
|
@@ -1393,10 +1401,10 @@ message_box {
|
|
1393
1401
|
|
1394
1402
|
#### Display
|
1395
1403
|
|
1396
|
-
The SWT `Display` class is a singleton in Glimmer. It is used in SWT to represent your display device, allowing you to manage GUI globally
|
1404
|
+
The SWT `Display` class is a singleton in Glimmer. It is used in SWT to represent your display device, allowing you to manage GUI globally
|
1397
1405
|
and access available monitors. Additionally, it is responsible for the SWT event loop, which runs on the first thread the Glimmer application starts on. In multi-threaded programming, `Display` provides the methods `async_exec` and `sync_exec` to enable enqueuing GUI changes asynchronously or synchronously from threads other than the main (first) thread since direct GUI changes are forbidden from other threads by design.
|
1398
1406
|
|
1399
|
-
`Display` is automatically instantiated upon first instantiation of a `shell` widget.
|
1407
|
+
`Display` is automatically instantiated upon first instantiation of a `shell` widget.
|
1400
1408
|
|
1401
1409
|
Alternatively, for advanced use cases, a `Display` can be created explicitly with the Glimmer `display` keyword. When a `shell` is later declared, it
|
1402
1410
|
automatically uses the `display` created earlier without having to explicitly hook it.
|
@@ -1412,7 +1420,7 @@ automatically uses the `display` created earlier without having to explicitly ho
|
|
1412
1420
|
@shell = shell { # uses display created above
|
1413
1421
|
}
|
1414
1422
|
```
|
1415
|
-
The benefit of instantiating an SWT Display explicitly is to set [Properties](#widget-properties) or [Observers](#observer).
|
1423
|
+
The benefit of instantiating an SWT Display explicitly is to set [Properties](#widget-properties) or [Observers](#observer).
|
1416
1424
|
Although SWT Display is not technically a widget, it has similar APIs and DSL support.
|
1417
1425
|
|
1418
1426
|
#### Multi-Threading
|
@@ -1634,8 +1642,8 @@ https://help.eclipse.org/2019-12/nftopic/org.eclipse.platform.doc.isv/reference/
|
|
1634
1642
|
|
1635
1643
|
When building a widget-related SWT object manually (e.g. `GridData.new(...)`), you are expected to use `SWT::CONSTANT` directly or BIT-OR a few SWT constants together like `SWT::BORDER | SWT::V_SCROLL`.
|
1636
1644
|
|
1637
|
-
Glimmer facilitates that with `swt` keyword by allowing you to pass multiple styles as an argument array of symbols instead of dealing with BIT-OR.
|
1638
|
-
Example:
|
1645
|
+
Glimmer facilitates that with `swt` keyword by allowing you to pass multiple styles as an argument array of symbols instead of dealing with BIT-OR.
|
1646
|
+
Example:
|
1639
1647
|
|
1640
1648
|
```ruby
|
1641
1649
|
style = swt(:border, :v_scroll)
|
@@ -1643,7 +1651,7 @@ style = swt(:border, :v_scroll)
|
|
1643
1651
|
|
1644
1652
|
#### Negative SWT Style Bits
|
1645
1653
|
|
1646
|
-
In rare occasions, you might need to apply & with a negative (not) style bit to negate it from another style bit that includes it.
|
1654
|
+
In rare occasions, you might need to apply & with a negative (not) style bit to negate it from another style bit that includes it.
|
1647
1655
|
Glimmer facilitates that by declaring the negative style bit via postfixing a symbol with `!`.
|
1648
1656
|
|
1649
1657
|
Example:
|
@@ -1652,13 +1660,13 @@ Example:
|
|
1652
1660
|
style = swt(:shell_trim, :max!) # creates a shell trim style without the maximize button (negated)
|
1653
1661
|
```
|
1654
1662
|
|
1655
|
-
#### Extra SWT Styles
|
1663
|
+
#### Extra SWT Styles
|
1656
1664
|
|
1657
1665
|
##### Non-resizable Window
|
1658
1666
|
|
1659
1667
|
SWT Shell widget by default is resizable. To make it non-resizable, one must pass a complicated style bit concoction like `swt(:shell_trim, :resize!, :max!)`.
|
1660
1668
|
|
1661
|
-
Glimmer makes this easier by alternatively offering a `:no_resize` extra SWT style, added for convenience.
|
1669
|
+
Glimmer makes this easier by alternatively offering a `:no_resize` extra SWT style, added for convenience.
|
1662
1670
|
This makes declaring a non-resizable window as easy as:
|
1663
1671
|
|
1664
1672
|
```ruby
|
@@ -1821,7 +1829,7 @@ Example:
|
|
1821
1829
|
|
1822
1830
|
```ruby
|
1823
1831
|
shell {
|
1824
|
-
minimum_size 128, 128
|
1832
|
+
minimum_size 128, 128
|
1825
1833
|
cursor :appstarting
|
1826
1834
|
}
|
1827
1835
|
```
|
@@ -2210,7 +2218,7 @@ It assumes you have defined the table columns via `table_column` widget.
|
|
2210
2218
|
Example:
|
2211
2219
|
|
2212
2220
|
```ruby
|
2213
|
-
shell {
|
2221
|
+
shell {
|
2214
2222
|
@table = table {
|
2215
2223
|
table_column {
|
2216
2224
|
text "Name"
|
@@ -2228,13 +2236,13 @@ shell {
|
|
2228
2236
|
selection bind(group, :selected_person)
|
2229
2237
|
on_mouse_up { |event|
|
2230
2238
|
@table.edit_table_item(event.table_item, event.column_index)
|
2231
|
-
}
|
2239
|
+
}
|
2232
2240
|
}
|
2233
2241
|
}
|
2234
2242
|
```
|
2235
2243
|
|
2236
2244
|
The code above includes two data-bindings:
|
2237
|
-
- Table `items`, which first bind to the model collection property (group.people), and then maps each column property (name, age, adult) for displaying each table item column.
|
2245
|
+
- Table `items`, which first bind to the model collection property (group.people), and then maps each column property (name, age, adult) for displaying each table item column.
|
2238
2246
|
- Table `selection`, which binds the single table item selected by the user to the attribute denoted by the `bind` keyword (or binds multiple table items selected for a table with `:multi` SWT style)
|
2239
2247
|
- The `on_mouse_up` event handler invokes `@table.edit_table_item(event.table_item, event.column_index)` to start edit mode on the clicked table item cell, and then saves or cancel depending on whether the user hits ENTER or ESC once done editing (or focus-out after either making a change or not making any changes.)
|
2240
2248
|
|
@@ -2251,16 +2259,16 @@ found_array = @table.search { |table_item| table_item.getData == company.owner }
|
|
2251
2259
|
|
2252
2260
|
This finds a person. The array is a Java array. This enables easy passing of it to SWT `Table#setSelection` method, which expects a Java array of `TableItem` objects.
|
2253
2261
|
|
2254
|
-
To edit a table, you must invoke `TableProxy#edit_selected_table_item(column_index, before_write: nil, after_write: nil, after_cancel: nil)` or `TableProxy#edit_table_item(table_item, column_index, before_write: nil, after_write: nil, after_cancel: nil)`.
|
2255
|
-
This automatically leverages the SWT TableEditor custom class behind the scenes, displaying a text widget to the user to change the selected or
|
2256
|
-
passed table item text into something else.
|
2262
|
+
To edit a table, you must invoke `TableProxy#edit_selected_table_item(column_index, before_write: nil, after_write: nil, after_cancel: nil)` or `TableProxy#edit_table_item(table_item, column_index, before_write: nil, after_write: nil, after_cancel: nil)`.
|
2263
|
+
This automatically leverages the SWT TableEditor custom class behind the scenes, displaying a text widget to the user to change the selected or
|
2264
|
+
passed table item text into something else.
|
2257
2265
|
It automatically persists the change to `items` data-bound model on ENTER/FOCUS-OUT or cancels on ESC/NO-CHANGE.
|
2258
2266
|
|
2259
2267
|
##### Table Sorting
|
2260
2268
|
|
2261
|
-
Glimmer automatically adds sorting support to the SWT `Table` widget.
|
2269
|
+
Glimmer automatically adds sorting support to the SWT `Table` widget.
|
2262
2270
|
|
2263
|
-
Check out the [Contact Manager](#contact-manager) sample for an example.
|
2271
|
+
Check out the [Contact Manager](#contact-manager) sample for an example.
|
2264
2272
|
You may click on any column and it will sort by ascending order first and descending if you click again.
|
2265
2273
|
|
2266
2274
|
Glimmer automatic table sorting supports `String`, `Integer`, and `Float` columns out of the box as well as any column data that is comparable.
|
@@ -2268,7 +2276,7 @@ Glimmer automatic table sorting supports `String`, `Integer`, and `Float` column
|
|
2268
2276
|
In cases where data is nil, depending on the data-type, it is automatically converted to `Float` with `to_f`, `Integer` with `to_i`, or `String` with `to_s`.
|
2269
2277
|
|
2270
2278
|
Should you have a special data type that could not be compared automatically, Glimmer offers the following 3 alternatives for custom sorting:
|
2271
|
-
- `sort_property`: this may be set to an alternative property to the one data-bound to the table column. For example, a table column called 'adult', which returns `true` or `false` may be sorted with `sort_property :dob` instead. This also support multi-property (aka multi-column) sorting (e.g. `sort_property :dob, :name`).
|
2279
|
+
- `sort_property`: this may be set to an alternative property to the one data-bound to the table column. For example, a table column called 'adult', which returns `true` or `false` may be sorted with `sort_property :dob` instead. This also support multi-property (aka multi-column) sorting (e.g. `sort_property :dob, :name`).
|
2272
2280
|
- `sort_by(&block)`: this works just like Ruby `Enumerable` `sort_by`. The block receives the table column data as argument.
|
2273
2281
|
- `sort(&comparator)`: this works just like Ruby `Enumerable` `sort`. The comparator block receives two objects from the table column data.
|
2274
2282
|
|
@@ -2328,7 +2336,7 @@ This involves using the `bind` keyword mentioned above in addition to a special
|
|
2328
2336
|
Example:
|
2329
2337
|
|
2330
2338
|
```ruby
|
2331
|
-
shell {
|
2339
|
+
shell {
|
2332
2340
|
@tree = tree {
|
2333
2341
|
items bind(company, :owner), tree_properties(children: :coworkers, text: :name)
|
2334
2342
|
selection bind(company, :selected_coworker)
|
@@ -2337,7 +2345,7 @@ shell {
|
|
2337
2345
|
```
|
2338
2346
|
|
2339
2347
|
The code above includes two data-bindings:
|
2340
|
-
- Tree `items`, which first bind to the root node (company.owner), and then dig down via `coworkers` `children` method, using the `name` `text` attribute for displaying each tree item.
|
2348
|
+
- Tree `items`, which first bind to the root node (company.owner), and then dig down via `coworkers` `children` method, using the `name` `text` attribute for displaying each tree item.
|
2341
2349
|
- Tree `selection`, which binds the single tree item selected by the user to the attribute denoted by the `bind` keyword
|
2342
2350
|
|
2343
2351
|
Additionally, Tree `items` data-binding automatically stores each node model unto the SWT TreeItem object via `setData` method. This enables things like searchability.
|
@@ -2391,7 +2399,7 @@ Let's revisit the Tic Tac Toe example shown near the beginning of the page:
|
|
2391
2399
|
shell {
|
2392
2400
|
text "Tic-Tac-Toe"
|
2393
2401
|
minimum_size 150, 178
|
2394
|
-
composite {
|
2402
|
+
composite {
|
2395
2403
|
grid_layout 3, true
|
2396
2404
|
(1..3).each { |row|
|
2397
2405
|
(1..3).each { |column|
|
@@ -2441,7 +2449,7 @@ shell {
|
|
2441
2449
|
@button1.swt_widget.setVisible(false)
|
2442
2450
|
}
|
2443
2451
|
on_widget_selected {
|
2444
|
-
@button1.swt_widget.setVisible(true)
|
2452
|
+
@button1.swt_widget.setVisible(true)
|
2445
2453
|
}
|
2446
2454
|
}
|
2447
2455
|
}.open
|
@@ -2463,7 +2471,7 @@ Example (you may copy/paste in [`girb`](#girb-glimmer-irb-command)):
|
|
2463
2471
|
}
|
2464
2472
|
@shell.on_shell_iconified {
|
2465
2473
|
@shell.close
|
2466
|
-
}
|
2474
|
+
}
|
2467
2475
|
@shell.open
|
2468
2476
|
```
|
2469
2477
|
|
@@ -2585,7 +2593,7 @@ Usage:
|
|
2585
2593
|
```ruby
|
2586
2594
|
shell {
|
2587
2595
|
red_label(:center) {
|
2588
|
-
text 'Red Label'
|
2596
|
+
text 'Red Label'
|
2589
2597
|
foreground :green
|
2590
2598
|
}
|
2591
2599
|
}.open
|
@@ -2652,7 +2660,7 @@ Additionally, custom widgets can call the following class methods:
|
|
2652
2660
|
- `::options(*option_names)`: declares a list of options by taking an option name array (symbols/strings). This generates option attribute accessors (e.g. `options :orientation, :bg_color` generates `#orientation`, `#orientation=(v)`, `#bg_color`, and `#bg_color=(v)` attribute accessors)
|
2653
2661
|
- `::option(option_name, default: nil)`: declares a single option taking option name and default value as arguments (also generates attribute accessors just like `::options`)
|
2654
2662
|
|
2655
|
-
#### Content/Options Example
|
2663
|
+
#### Content/Options Example
|
2656
2664
|
|
2657
2665
|
(you may copy/paste in [`girb`](#girb-glimmer-irb-command))
|
2658
2666
|
|
@@ -2784,7 +2792,7 @@ shell { |app_shell|
|
|
2784
2792
|
app_shell.hide
|
2785
2793
|
@wizard_steps[@current_step_number - 1].open
|
2786
2794
|
end
|
2787
|
-
}
|
2795
|
+
}
|
2788
2796
|
}
|
2789
2797
|
}
|
2790
2798
|
button {
|
@@ -3078,6 +3086,55 @@ shell(:no_resize) {
|
|
3078
3086
|
|
3079
3087
|
Also, you may invoke `Display.setAppVersion('1.0.0')` if needed for OS app version identification reasons during development, replacing `'1.0.0'` with your application version.
|
3080
3088
|
|
3089
|
+
#### Checkbox Group Widget
|
3090
|
+
|
3091
|
+
`checkbox_group` (or alias `check_group`) is a Glimmer built-in custom widget that displays a list of `checkbox` buttons (`button(:check)`) based on its `items` property.
|
3092
|
+
|
3093
|
+
`checkbox_group` consists of a root `composite` (with `grid_layout 1, false` by default) that holds nested `checkbox` (`button(:check)`) widgets.
|
3094
|
+
|
3095
|
+
The `selection` property determines which `checkbox` buttons are checked. It expects an `Array` of `String` objects
|
3096
|
+
The `selection_indices` property determines which `checkbox` button indices are checked. It expects an `Array` of index `Integer` objects that are zero-based.
|
3097
|
+
The `checkboxes` property returns the list of nested `checkbox` widgets.
|
3098
|
+
|
3099
|
+
When data-binding `selection`, the model property should have a matching property with `_options` suffix (e.g. `activities_options` for `activities`) to provide an `Array` of `String` objects for `checkbox` buttons.
|
3100
|
+
|
3101
|
+
You may see an example at the [Hello, Checkbox Group!](#hello-checkbox-group) sample.
|
3102
|
+
|
3103
|
+
![Hello Checkbox Group](images/glimmer-hello-checkbox-group.png)
|
3104
|
+
|
3105
|
+
#### Radio Group Widget
|
3106
|
+
|
3107
|
+
`radio_group` is a Glimmer built-in custom widget that displays a list of `radio` buttons (`button(:radio)`) based on its `items` property, which expects an `Array` of `String` objects.
|
3108
|
+
|
3109
|
+
`radio_group` consists of a root `composite` (with `grid_layout 1, false` by default) that holds nested `radio` widgets.
|
3110
|
+
|
3111
|
+
The `selection` property determines which `radio` button is selected. It expects a `String`
|
3112
|
+
The `selection_index` property determines which `radio` button index is selected. It expects an index integer that is zero-based.
|
3113
|
+
The `radios` property returns the list of nested `radio` widgets.
|
3114
|
+
|
3115
|
+
When data-binding `selection`, the model property should have a matching property with `_options` suffix (e.g. `country_options` for `country`) to provide text for `radio` buttons.
|
3116
|
+
|
3117
|
+
This custom widget is used in the [Glimmer Meta-Sample (The Sample of Samples)](#samples):
|
3118
|
+
|
3119
|
+
![Glimmer Meta-Sample](images/glimmer-meta-sample.png)
|
3120
|
+
|
3121
|
+
Glimmer Meta-Sample Code Example:
|
3122
|
+
|
3123
|
+
```ruby
|
3124
|
+
# ...
|
3125
|
+
radio_group { |radio_group_proxy|
|
3126
|
+
row_layout(:vertical) {
|
3127
|
+
fill true
|
3128
|
+
}
|
3129
|
+
selection bind(sample_directory, :selected_sample_name)
|
3130
|
+
font height: 24
|
3131
|
+
}
|
3132
|
+
|
3133
|
+
# ...
|
3134
|
+
```
|
3135
|
+
|
3136
|
+
You may see another example at the [Hello, Radio Group!](#hello-radio-group) sample.
|
3137
|
+
|
3081
3138
|
#### Code Text Widget
|
3082
3139
|
|
3083
3140
|
`code_text` is a Glimmer built-in custom widget that displays syntax highlighted Ruby code in a customized SWT [StyledText](https://help.eclipse.org/2020-09/topic/org.eclipse.platform.doc.isv/reference/api/org/eclipse/swt/custom/StyledText.html) widget.
|
@@ -3104,7 +3161,7 @@ To use, simply use `code_text` in place of `text` or `styled_text` widget. If yo
|
|
3104
3161
|
|
3105
3162
|
[![Video Widget](images/glimmer-video-widget.png)](https://github.com/AndyObtiva/glimmer-cw-video)
|
3106
3163
|
|
3107
|
-
Glimmer supports a [video custom widget](https://github.com/AndyObtiva/glimmer-cw-video) not in SWT.
|
3164
|
+
Glimmer supports a [video custom widget](https://github.com/AndyObtiva/glimmer-cw-video) not in SWT.
|
3108
3165
|
|
3109
3166
|
You may obtain via `glimmer-cw-video` gem.
|
3110
3167
|
|
@@ -3207,7 +3264,7 @@ Glimmer configuration may be done via the `Glimmer::Config` module.
|
|
3207
3264
|
### logger
|
3208
3265
|
|
3209
3266
|
The Glimmer DSL engine supports logging via a standard `STDOUT` Ruby `Logger` configured in the `Glimmer::Config.logger` config option.
|
3210
|
-
It is set to level Logger::ERROR by default.
|
3267
|
+
It is set to level Logger::ERROR by default.
|
3211
3268
|
Log level may be adjusted via `Glimmer::Config.logger.level` just like any other Ruby Logger.
|
3212
3269
|
|
3213
3270
|
Example:
|
@@ -3249,13 +3306,13 @@ This is an array of these possible values: `:stdout` (default), `:stderr`, `:fil
|
|
3249
3306
|
|
3250
3307
|
It defaults to `[:stdout, :syslog]`
|
3251
3308
|
|
3252
|
-
When `:file` is included, Glimmer creates a 'log' directory directly below the Glimmer app local directory.
|
3309
|
+
When `:file` is included, Glimmer creates a 'log' directory directly below the Glimmer app local directory.
|
3253
3310
|
It may also be customized further via the `logging_device_file_options` option.
|
3254
3311
|
This is useful on Windows as an alternative to `syslog`, which is not available on Windows by default.
|
3255
3312
|
|
3256
3313
|
#### logging_device_file_options
|
3257
3314
|
|
3258
|
-
This is a hash of [`logging`](https://github.com/TwP/logging) gem options for the `:file` logging device.
|
3315
|
+
This is a hash of [`logging`](https://github.com/TwP/logging) gem options for the `:file` logging device.
|
3259
3316
|
|
3260
3317
|
Default: `{size: 1_000_000, age: 'daily', roll_by: 'number'}`
|
3261
3318
|
|
@@ -3273,7 +3330,7 @@ That ensures asynchronous buffered logging that is flushed every 500 messages an
|
|
3273
3330
|
|
3274
3331
|
This is a [`logging`](https://github.com/TwP/logging) gem layout that formats the logging output.
|
3275
3332
|
|
3276
|
-
Default:
|
3333
|
+
Default:
|
3277
3334
|
|
3278
3335
|
```
|
3279
3336
|
Logging.layouts.pattern(
|
@@ -3333,8 +3390,8 @@ https://github.com/jruby/jruby/wiki/CallingJavaFromJRuby
|
|
3333
3390
|
|
3334
3391
|
### loop_max_count
|
3335
3392
|
|
3336
|
-
Glimmer has infinite loop detection support.
|
3337
|
-
It can detect when an infinite loop is about to occur in method_missing and stops it.
|
3393
|
+
Glimmer has infinite loop detection support.
|
3394
|
+
It can detect when an infinite loop is about to occur in method_missing and stops it.
|
3338
3395
|
It detects potential infinite loops when the same keyword and args repeat more than 100 times, which is unusual in a GUI app.
|
3339
3396
|
|
3340
3397
|
The max limit can be changed via the `Glimmer::Config::loop_max_count=(count)` config option.
|
@@ -3662,7 +3719,7 @@ Hello, Radio!
|
|
3662
3719
|
|
3663
3720
|
#### Hello, Radio Group!
|
3664
3721
|
|
3665
|
-
This sample demonstrates the use of a `radio_group` in Glimmer, which
|
3722
|
+
This sample demonstrates the use of a `radio_group` in Glimmer, which provides terser syntax for representing multiple radio buttons by relying on data-binding to automatically spawn the `radio` widgets based on available options on the model.
|
3666
3723
|
|
3667
3724
|
Code:
|
3668
3725
|
|
@@ -3680,10 +3737,82 @@ Code:
|
|
3680
3737
|
|
3681
3738
|
[samples/hello/hello_checkbox.rb](https://github.com/AndyObtiva/glimmer-dsl-swt/blob/master/samples/hello/hello_checkbox.rb)
|
3682
3739
|
|
3740
|
+
#### Hello, Group!
|
3741
|
+
|
3742
|
+
This sample demonstrates the use of a `group` in Glimmer (not to be confused with the logical radio group custom widget, this is just an alternative to `composite` that provides a border around content).
|
3743
|
+
|
3744
|
+
Code:
|
3745
|
+
|
3746
|
+
[samples/hello/hello_group.rb](https://github.com/AndyObtiva/glimmer-dsl-swt/blob/master/samples/hello/hello_group.rb)
|
3747
|
+
|
3748
|
+
Hello, Group!
|
3749
|
+
|
3750
|
+
![Hello Group](images/glimmer-hello-group.png)
|
3751
|
+
|
3752
|
+
#### Hello, Checkbox!
|
3753
|
+
|
3754
|
+
This sample demonstrates the use of a `checkbox` (aka `check` or `button(:check)`) in Glimmer.
|
3755
|
+
|
3756
|
+
Code:
|
3757
|
+
|
3758
|
+
[samples/hello/hello_checkbox.rb](https://github.com/AndyObtiva/glimmer-dsl-swt/blob/master/samples/hello/hello_checkbox.rb)
|
3759
|
+
|
3683
3760
|
Hello, Checkbox!
|
3684
3761
|
|
3685
3762
|
![Hello Checkbox](images/glimmer-hello-checkbox.png)
|
3686
3763
|
|
3764
|
+
#### Hello, Checkbox Group!
|
3765
|
+
|
3766
|
+
This sample demonstrates the use of a `checkbox_group` (aka `check_group`) in Glimmer, which provides terser syntax for representing multiple checkbox buttons (`button(:check)`) by relying on data-binding to automatically spawn the `checkbox` widgets (`button(:check)`) based on available options on the model.
|
3767
|
+
|
3768
|
+
Code:
|
3769
|
+
|
3770
|
+
[samples/hello/hello_checkbox_group.rb](https://github.com/AndyObtiva/glimmer-dsl-swt/blob/master/samples/hello/hello_checkbox_group.rb)
|
3771
|
+
|
3772
|
+
Hello, Checkbox Group!
|
3773
|
+
|
3774
|
+
![Hello Checkbox Group](images/glimmer-hello-checkbox-group.png)
|
3775
|
+
|
3776
|
+
#### Hello, Directory Dialog!
|
3777
|
+
|
3778
|
+
This sample demonstrates the use of a `directory_dialog` in Glimmer.
|
3779
|
+
|
3780
|
+
Code:
|
3781
|
+
|
3782
|
+
[samples/hello/hello_directory_dialog.rb](https://github.com/AndyObtiva/glimmer-dsl-swt/blob/master/samples/hello/hello_directory_dialog.rb)
|
3783
|
+
|
3784
|
+
Hello, Directory Dialog!
|
3785
|
+
|
3786
|
+
![Hello Directory Dialog](images/glimmer-hello-directory-dialog.png)
|
3787
|
+
|
3788
|
+
Hello, Directory Dialog! Browse...
|
3789
|
+
|
3790
|
+
![Hello Directory Dialog](images/glimmer-hello-directory-dialog-browse.png)
|
3791
|
+
|
3792
|
+
Hello, Directory Dialog! Selected Directory
|
3793
|
+
|
3794
|
+
![Hello Directory Dialog](images/glimmer-hello-directory-dialog-selected-directory.png)
|
3795
|
+
|
3796
|
+
#### Hello, File Dialog!
|
3797
|
+
|
3798
|
+
This sample demonstrates the use of a `file_dialog` in Glimmer.
|
3799
|
+
|
3800
|
+
Code:
|
3801
|
+
|
3802
|
+
[samples/hello/hello_file_dialog.rb](https://github.com/AndyObtiva/glimmer-dsl-swt/blob/master/samples/hello/hello_file_dialog.rb)
|
3803
|
+
|
3804
|
+
Hello, File Dialog!
|
3805
|
+
|
3806
|
+
![Hello File Dialog](images/glimmer-hello-file-dialog.png)
|
3807
|
+
|
3808
|
+
Hello, File Dialog! Browse...
|
3809
|
+
|
3810
|
+
![Hello File Dialog](images/glimmer-hello-file-dialog-browse.png)
|
3811
|
+
|
3812
|
+
Hello, File Dialog! Selected File
|
3813
|
+
|
3814
|
+
![Hello File Dialog](images/glimmer-hello-file-dialog-selected-file.png)
|
3815
|
+
|
3687
3816
|
### Elaborate Samples
|
3688
3817
|
|
3689
3818
|
For more elaborate samples, check the following:
|
@@ -3789,7 +3918,7 @@ Gladiator is a good demonstration of:
|
|
3789
3918
|
|
3790
3919
|
The following production apps have been built with Glimmer.
|
3791
3920
|
|
3792
|
-
If you have a Glimmer app you would like referenced here, please mention in a Pull Request.
|
3921
|
+
If you have a Glimmer app you would like referenced here, please mention in a Pull Request.
|
3793
3922
|
|
3794
3923
|
### Math Bowling
|
3795
3924
|
|
@@ -3837,11 +3966,11 @@ The Glimmer packaging process done in the `glimmer package` command consists of
|
|
3837
3966
|
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
|
3838
3967
|
1. Generate native executable using [javapackager](https://docs.oracle.com/javase/8/docs/technotes/tools/unix/javapackager.html) (`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 `javapackager` manually afterwards if needed).
|
3839
3968
|
|
3840
|
-
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 `javapackager`.
|
3969
|
+
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 `javapackager`.
|
3841
3970
|
The JAR file name will match your application local directory name (e.g. `MathBowling.jar` for `~/code/MathBowling`)
|
3842
3971
|
The DMG file name will match the humanized local directory name + dash + application version (e.g. `Math Bowling-1.0.dmg` for `~/code/MathBowling` with version 1.0 or unspecified)
|
3843
3972
|
|
3844
|
-
The `glimmer package` command will automatically set "mac.CFBundleIdentifier" to ="org.#{project_name}.application.#{project_name}".
|
3973
|
+
The `glimmer package` command will automatically set "mac.CFBundleIdentifier" to ="org.#{project_name}.application.#{project_name}".
|
3845
3974
|
You may override by configuring as an extra argument for javapackger (e.g. Glimmer::RakeTask::Package.javapackager_extra_args = " -Bmac.CFBundleIdentifier=org.andymaleh.application.MathBowling")
|
3846
3975
|
|
3847
3976
|
### Packaging Defaults
|
@@ -3893,9 +4022,9 @@ require 'glimmer/rake_task'
|
|
3893
4022
|
Glimmer::RakeTask::Package.javapackager_extra_args = '-BlicenseType="MIT" -Bmac.category="public.app-category.business" -Bmac.signing-key-developer-id-app="Andy Maleh"'
|
3894
4023
|
```
|
3895
4024
|
|
3896
|
-
Note that `mac.category` defaults to "public.app-category.business", but can be overridden with one of the category UTI values mentioned here:
|
4025
|
+
Note that `mac.category` defaults to "public.app-category.business", but can be overridden with one of the category UTI values mentioned here:
|
3897
4026
|
|
3898
|
-
https://developer.apple.com/library/archive/releasenotes/General/SubmittingToMacAppStore/index.html#//apple_ref/doc/uid/TP40010572-CH16-SW8
|
4027
|
+
https://developer.apple.com/library/archive/releasenotes/General/SubmittingToMacAppStore/index.html#//apple_ref/doc/uid/TP40010572-CH16-SW8
|
3899
4028
|
|
3900
4029
|
Example (env var):
|
3901
4030
|
|
@@ -3911,7 +4040,7 @@ Pass `-v` to javapackager in `Glimmer::RakeTask::Package.javapackager_extra_args
|
|
3911
4040
|
|
3912
4041
|
### Windows Application Packaging
|
3913
4042
|
|
3914
|
-
Windows offers two options for setup packaging:
|
4043
|
+
Windows offers two options for setup packaging:
|
3915
4044
|
- `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)).
|
3916
4045
|
- `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.
|
3917
4046
|
|
@@ -3963,7 +4092,7 @@ Now, when you run `glimmer package`, it builds a self-signed DMG file. When you
|
|
3963
4092
|
|
3964
4093
|
1. Specifying License File
|
3965
4094
|
|
3966
|
-
The javapackager documentation states that a license file may be specified with "-BlicenseFile" javapackager option. However, in order for that to work, one must specify as a source file via "-srcfiles" javapackager option.
|
4095
|
+
The javapackager documentation states that a license file may be specified with "-BlicenseFile" javapackager option. However, in order for that to work, one must specify as a source file via "-srcfiles" javapackager option.
|
3967
4096
|
Keep that in mind if you are not going to rely on the default `LICENSE.txt` support.
|
3968
4097
|
|
3969
4098
|
Example:
|
@@ -3976,7 +4105,7 @@ Glimmer::RakeTask::Package.javapackager_extra_args = '-srcfiles "ACME.txt" -Blic
|
|
3976
4105
|
|
3977
4106
|
If you run `glimmer package` multiple times, sometimes it leaves a mounted DMG project in your finder. Unmount before you run the command again or it might fail with an error saying: "Error: Bundler "DMG Installer" (dmg) failed to produce a bundle."
|
3978
4107
|
|
3979
|
-
By the way, keep in mind that during normal operation, it does also indicate a false-negative while completing successfully similar to the following (please ignore):
|
4108
|
+
By the way, keep in mind that during normal operation, it does also indicate a false-negative while completing successfully similar to the following (please ignore):
|
3980
4109
|
|
3981
4110
|
```
|
3982
4111
|
Exec failed with code 2 command [[/usr/bin/SetFile, -c, icnC, /var/folders/4_/g1sw__tx6mjdgyh3mky7vydc0000gp/T/fxbundler4076750801763032201/images/MathBowling/.VolumeIcon.icns] in unspecified directory
|
@@ -4003,7 +4132,7 @@ Here is a list of notable 3rd party gems used by Glimmer:
|
|
4003
4132
|
|
4004
4133
|
## Glimmer Process
|
4005
4134
|
|
4006
|
-
[Glimmer Process](https://github.com/AndyObtiva/glimmer/blob/master/PROCESS.md) is the lightweight software development process used for building Glimmer libraries and Glimmer apps, which goes beyond Agile, rendering all Agile processes obsolete. [Glimmer Process](PROCESS.md) is simply made up of 7 guidelines to pick and choose as necessary until software development needs are satisfied.
|
4135
|
+
[Glimmer Process](https://github.com/AndyObtiva/glimmer/blob/master/PROCESS.md) is the lightweight software development process used for building Glimmer libraries and Glimmer apps, which goes beyond Agile, rendering all Agile processes obsolete. [Glimmer Process](PROCESS.md) is simply made up of 7 guidelines to pick and choose as necessary until software development needs are satisfied.
|
4007
4136
|
|
4008
4137
|
Learn more by reading the [GPG](https://github.com/AndyObtiva/glimmer/blob/master/PROCESS.md) (Glimmer Process Guidelines)
|
4009
4138
|
|
@@ -4026,7 +4155,7 @@ You may submit [issues](https://github.com/AndyObtiva/glimmer-dsl-swt/issues) on
|
|
4026
4155
|
|
4027
4156
|
### Chat
|
4028
4157
|
|
4029
|
-
If you need live help, try to [![Join the chat at https://gitter.im/AndyObtiva/glimmer](https://badges.gitter.im/AndyObtiva/glimmer.svg)](https://gitter.im/AndyObtiva/glimmer?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
4158
|
+
If you need live help, try to [![Join the chat at https://gitter.im/AndyObtiva/glimmer](https://badges.gitter.im/AndyObtiva/glimmer.svg)](https://gitter.im/AndyObtiva/glimmer?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
4030
4159
|
|
4031
4160
|
## Feature Suggestions
|
4032
4161
|
|
@@ -4073,7 +4202,7 @@ If your company would like to invest fulltime in further development of the Glim
|
|
4073
4202
|
|
4074
4203
|
[MIT](LICENSE.txt)
|
4075
4204
|
|
4076
|
-
Copyright (c) 2007-2020 - Andy Maleh.
|
4205
|
+
Copyright (c) 2007-2020 - Andy Maleh.
|
4077
4206
|
|
4078
4207
|
--
|
4079
4208
|
|