glimmer-dsl-swt 4.17.4.2 → 4.17.8.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +38 -2
- data/README.md +307 -105
- data/VERSION +1 -1
- data/glimmer-dsl-swt.gemspec +23 -5
- 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 +2 -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 +2 -0
- data/lib/glimmer/dsl/swt/expand_item_expression.rb +60 -0
- data/lib/glimmer/dsl/swt/file_dialog_expression.rb +48 -0
- data/lib/glimmer/dsl/swt/radio_group_selection_data_binding_expression.rb +61 -0
- 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 +160 -0
- data/lib/glimmer/swt/custom/code_text.rb +39 -31
- data/lib/glimmer/swt/custom/radio_group.rb +155 -0
- data/lib/glimmer/swt/directory_dialog_proxy.rb +65 -0
- data/lib/glimmer/swt/expand_item_proxy.rb +97 -0
- data/lib/glimmer/swt/file_dialog_proxy.rb +66 -0
- data/lib/glimmer/swt/image_proxy.rb +2 -0
- data/lib/glimmer/swt/menu_proxy.rb +4 -4
- data/lib/glimmer/swt/shell_proxy.rb +5 -5
- data/lib/glimmer/swt/tab_item_proxy.rb +1 -1
- data/lib/glimmer/swt/widget_proxy.rb +27 -26
- data/lib/glimmer/ui/custom_shell.rb +3 -3
- data/lib/glimmer/ui/custom_widget.rb +3 -0
- data/samples/elaborate/meta_sample.rb +36 -31
- data/samples/hello/hello_checkbox.rb +85 -0
- 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 +110 -0
- data/samples/hello/hello_file_dialog.rb +60 -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_radio.rb +108 -0
- data/samples/hello/hello_radio_group.rb +84 -0
- data/samples/hello/hello_styled_text.rb +138 -0
- data/samples/hello/hello_world.rb +3 -3
- metadata +22 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cfdd8588cde714f33759f86c2141471c31271fa89e2cf859faabd160117f4b0a
|
4
|
+
data.tar.gz: 20bd807fc37fa19ef0c2fd37d8c1f84af6119258084a5167fbb6758cd3d69a39
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c74a0ef3615ee39a387505afe13e5fddecb49ff1ec9fc46384ddd19323f58116f30239efe66a0ec49774aa1d7a8b880173609169dd3052b62798d34c5015657b
|
7
|
+
data.tar.gz: 138dd0a89bf23c998a590c10f81ff2f463ebefe307361bfcade21b6681d40c8869e495fde66cc72e66d6ed0051c5dccf61eacc76c7853d6f4d737dea7c9044ee
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,41 @@
|
|
1
1
|
# Change Log
|
2
2
|
|
3
|
+
### 4.17.8.1
|
4
|
+
|
5
|
+
- Fixed an issue in Windows with code_text
|
6
|
+
|
7
|
+
### 4.17.8.0
|
8
|
+
|
9
|
+
- Officially Support SWT FileDialog with the `file_dialog` keyword (was unofficially supported before via standard SWT)
|
10
|
+
- Officially Support SWT DirectoryDialog with the `directory_dialog` keyword (was unofficially supported before via standard SWT)
|
11
|
+
- Hello, File Dialog! Sample
|
12
|
+
- Hello, Directory Dialog! Sample
|
13
|
+
- Prevent tree items data-binding from updating if no tree data change occurred
|
14
|
+
- Performance optimization for `code_text` syntax highlighting through caching
|
15
|
+
|
16
|
+
### 4.17.7.0
|
17
|
+
|
18
|
+
- `checkbox_group` built-in custom widget
|
19
|
+
- Hello, Checkbox Group! Sample
|
20
|
+
- Refactor `radio_group` to render labels instead of relying on radio button text since they are better stylable
|
21
|
+
- Refactor Glimmer Meta-Sample to use `radio_group` instead of `radio`
|
22
|
+
- Fix issue with ExpandBar fill_layout with the extra element at the end (remove it)
|
23
|
+
|
24
|
+
### 4.17.6.0
|
25
|
+
|
26
|
+
- New `radio_group` built-in Glimmer custom widget
|
27
|
+
- Hello, Radio! Sample
|
28
|
+
- Hello, Radio Group! Sample
|
29
|
+
- Hello, Checkbox! Sample
|
30
|
+
|
31
|
+
### 4.17.5.0
|
32
|
+
|
33
|
+
- Support auto-scaling by aspect ratio of width and height (write specs)
|
34
|
+
- Support SWT ExpandBar via expand_bar keyword
|
35
|
+
- Hello, Expand Bar! Sample
|
36
|
+
- Hello, Styled Text! Sample
|
37
|
+
- Use expand_bar in Glimmer Meta-Sample
|
38
|
+
|
3
39
|
### 4.17.4.2
|
4
40
|
|
5
41
|
- Support StyledText data-binding of caret_offset, selection_count, selection, top_index, and top_pixel, useful for code_text
|
@@ -115,7 +151,7 @@
|
|
115
151
|
|
116
152
|
- Add User Profile sample from DZone article
|
117
153
|
- Colored Ruby syntax highlighting for sample:code and sample:run tasks courtesy of tty-markdown
|
118
|
-
- Support `check` as alias to `checkbox` DSL keyword for Button widget with :check style.
|
154
|
+
- Support `check` as alias to `checkbox` DSL keyword for Button widget with :check style.
|
119
155
|
- Validate scaffolded custom shell gem name to ensure it doesn't clash with a built in Ruby method
|
120
156
|
- GLIMMER_LOGGER_ASYNC env var for disabling async logging when needed for immediate troubleshooting purposes
|
121
157
|
- 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)
|
@@ -314,7 +350,7 @@
|
|
314
350
|
## 0.1.3
|
315
351
|
|
316
352
|
- Added 'org.eclipse.swt.dnd' to glimmer auto-included Java packages
|
317
|
-
- Updated Tic Tac Toe sample to use new `message_box` keyword
|
353
|
+
- Updated Tic Tac Toe sample to use new `message_box` keyword
|
318
354
|
- 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
|
319
355
|
- Set default style DND::DROP_COPY in DragSource and DropTarget widgets
|
320
356
|
- Support Glimmer::SWT::DNDProxy for handling Drop & Drop styles
|
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.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.1
|
2
2
|
## JRuby Desktop Development GUI Library
|
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)
|
@@ -14,7 +14,11 @@
|
|
14
14
|
|
15
15
|
[Glimmer receives two updates per month](https://rubygems.org/gems/glimmer-dsl-swt/versions). You can trust [Glimmer](https://rubygems.org/gems/glimmer) with your Ruby desktop GUI development needs. Please make [Glimmer](https://rubygems.org/gems/glimmer) even better by providing feedback and [contributing](#contributing) when possible.
|
16
16
|
|
17
|
-
|
17
|
+
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.
|
18
|
+
|
19
|
+
[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
|
+
[<img src="https://covers.oreillystatic.com/images/9780596519650/lrg.jpg" width=105 /><br />
|
18
22
|
Featured in<br />JRuby Cookbook](http://shop.oreilly.com/product/9780596519650.do)
|
19
23
|
|
20
24
|
Glimmer DSL gems:
|
@@ -249,7 +253,7 @@ Glimmer App:
|
|
249
253
|
- [Glimmer Command](#glimmer-command)
|
250
254
|
- [Basic Usage](#basic-usage)
|
251
255
|
- [Advanced Usage](#advanced-usage)
|
252
|
-
- [Samples](#samples)
|
256
|
+
- [Glimmer Samples](#glimmer-samples)
|
253
257
|
- [Scaffolding](#scaffolding)
|
254
258
|
- [App](#app)
|
255
259
|
- [Desktopify](#desktopify)
|
@@ -282,6 +286,7 @@ Glimmer App:
|
|
282
286
|
- [Color](#color)
|
283
287
|
- [Font](#font)
|
284
288
|
- [Image](#image)
|
289
|
+
- [Image Options](#image-options)
|
285
290
|
- [Cursor](#cursor)
|
286
291
|
- [Layouts](#layouts)
|
287
292
|
- [Layout Data](#layout-data)
|
@@ -340,6 +345,14 @@ Glimmer App:
|
|
340
345
|
- [Hello, Custom Widget!](#hello-custom-widget)
|
341
346
|
- [Hello, Custom Shell!](#hello-custom-shell)
|
342
347
|
- [Hello, Sash Form!](#hello-sash-form)
|
348
|
+
- [Hello, Styled Text!](#hello-styled-text)
|
349
|
+
- [Hello, Expand Bar!](#hello-expand-bar)
|
350
|
+
- [Hello, Radio!](#hello-radio)
|
351
|
+
- [Hello, Radio Group!](#hello-radio-group)
|
352
|
+
- [Hello, Checkbox!](#hello-checkbox)
|
353
|
+
- [Hello, Checkbox Group!](#hello-checkbox-group)
|
354
|
+
- [Hello, Directory Dialog!](#hello-directory-dialog)
|
355
|
+
- [Hello, File Dialog!](#hello-file-dialog)
|
343
356
|
- [Elaborate Samples](#elaborate-samples)
|
344
357
|
- [User Profile](#user-profile)
|
345
358
|
- [Login](#login)
|
@@ -423,7 +436,7 @@ Otherwise, Option 2 ([Bundler](#option-2-bundler)) can be followed in rare cases
|
|
423
436
|
|
424
437
|
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).
|
425
438
|
|
426
|
-
### Option 1: Direct Install
|
439
|
+
### Option 1: Direct Install
|
427
440
|
(Use for [Scaffolding](#scaffolding))
|
428
441
|
|
429
442
|
Run this command to install directly:
|
@@ -433,12 +446,10 @@ jgem install glimmer-dsl-swt
|
|
433
446
|
|
434
447
|
Or this command if you want a specific version:
|
435
448
|
```
|
436
|
-
jgem install glimmer-dsl-swt -v 4.17.
|
449
|
+
jgem install glimmer-dsl-swt -v 4.17.8.1
|
437
450
|
```
|
438
451
|
|
439
|
-
|
440
|
-
|
441
|
-
`jgem` is JRuby's version of `gem` command.
|
452
|
+
`jgem` is JRuby's version of `gem` command.
|
442
453
|
RVM allows running `gem install` directly as an alias.
|
443
454
|
Otherwise, you may also run `jruby -S gem install ...`
|
444
455
|
|
@@ -448,7 +459,7 @@ Otherwise, if you are ready to build a Glimmer app, you can jump to the [Glimmer
|
|
448
459
|
|
449
460
|
Note: if you're using activerecord or activesupport, keep in mind that Glimmer unhooks ActiveSupport::Dependencies as it does not rely on it.
|
450
461
|
|
451
|
-
### Option 2: Bundler
|
462
|
+
### Option 2: Bundler
|
452
463
|
(Use for Manual App Creation)
|
453
464
|
|
454
465
|
Add the following to `Gemfile`:
|
@@ -475,7 +486,7 @@ You can bring up usage instructions by running the `glimmer` command without arg
|
|
475
486
|
glimmer
|
476
487
|
```
|
477
488
|
|
478
|
-
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)).
|
489
|
+
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)).
|
479
490
|
|
480
491
|
On Windows, it simply lists the available Glimmer tasks at the end (courtsey of [rake](https://github.com/ruby/rake)).
|
481
492
|
|
@@ -511,13 +522,13 @@ bin/glimmer samples
|
|
511
522
|
Below are the full usage instructions that come up when running `glimmer` without args.
|
512
523
|
|
513
524
|
```
|
514
|
-
Glimmer (Ruby Desktop Development GUI Library) - JRuby Gem: glimmer-dsl-swt v4.17.
|
525
|
+
Glimmer (Ruby Desktop Development GUI Library) - JRuby Gem: glimmer-dsl-swt v4.17.8.1
|
515
526
|
|
516
527
|
Usage: glimmer [--bundler] [--pd] [--quiet] [--debug] [--log-level=VALUE] [[ENV_VAR=VALUE]...] [[-jruby-option]...] (application.rb or task[task_args]) [[application2.rb]...]
|
517
528
|
|
518
|
-
Runs Glimmer applications and tasks.
|
529
|
+
Runs Glimmer applications and tasks.
|
519
530
|
|
520
|
-
When applications are specified, they are run using JRuby,
|
531
|
+
When applications are specified, they are run using JRuby,
|
521
532
|
automatically preloading the glimmer Ruby gem and SWT jar dependency.
|
522
533
|
|
523
534
|
Optionally, extra Glimmer options, JRuby options, and/or environment variables may be passed in.
|
@@ -540,11 +551,11 @@ Select a Glimmer task to run: (Press ↑/↓ arrow to move, Enter to select and
|
|
540
551
|
glimmer package[type] # Package app for distribution (generating config, jar, and native files) (type is optional)
|
541
552
|
glimmer package:clean # Clean by removing "dist" and "packages" directories
|
542
553
|
glimmer package:config # Generate JAR config file
|
543
|
-
glimmer package:gemspec # Generate gemspec
|
554
|
+
glimmer package:gemspec # Generate gemspec
|
544
555
|
glimmer package:jar # Generate JAR file
|
545
556
|
glimmer package:lock_jars # Lock JARs
|
546
557
|
glimmer package:native[type] # Generate Native files
|
547
|
-
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)
|
558
|
+
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)
|
548
559
|
glimmer samples # Brings up the Glimmer Meta-Sample app to allow browsing, running, and viewing code of Glimmer samples
|
549
560
|
glimmer scaffold[app_name] # Scaffold Glimmer application directory structure to build a new app
|
550
561
|
glimmer scaffold:customshell[name,namespace] # Scaffold Glimmer::UI::CustomShell subclass (full window view) under app/views (namespace is optional) [alt: scaffold:cs]
|
@@ -584,10 +595,10 @@ This brings up the [Glimmer Meta-Sample (The Sample of Samples)](#samples):
|
|
584
595
|
Glimmer borrows from Rails the idea of Scaffolding, that is generating a structure for your app files that
|
585
596
|
helps you get started just like true building scaffolding helps construction workers, civil engineers, and architects.
|
586
597
|
|
587
|
-
Glimmer scaffolding goes beyond just scaffolding the app files that Rails does. It also packages it and launches it,
|
598
|
+
Glimmer scaffolding goes beyond just scaffolding the app files that Rails does. It also packages it and launches it,
|
588
599
|
getting you to a running and delivered state of an advanced "Hello, World!" Glimmer application right off the bat.
|
589
600
|
|
590
|
-
This should greatly facilitate building a new Glimmer app by helping you be productive and focus on app details while
|
601
|
+
This should greatly facilitate building a new Glimmer app by helping you be productive and focus on app details while
|
591
602
|
letting Glimmer scaffolding take care of initial app file structure concerns, such as adding:
|
592
603
|
- Main application class that includes Glimmer (`app/{app_name}.rb`)
|
593
604
|
- Main application view that houses main window content, menu, about dialog, and preferences dialog
|
@@ -602,7 +613,7 @@ You need to have your Git `user.name` and `github.user` configured before scaffo
|
|
602
613
|
|
603
614
|
#### App
|
604
615
|
|
605
|
-
Before you start, make sure you are in a JRuby environment with Glimmer gem installed as per "Direct Install" pre-requisites.
|
616
|
+
Before you start, make sure you are in a JRuby environment with Glimmer gem installed as per "Direct Install" pre-requisites.
|
606
617
|
|
607
618
|
To scaffold a Glimmer app from scratch, run the following command:
|
608
619
|
|
@@ -622,18 +633,18 @@ You should see output like the following:
|
|
622
633
|
|
623
634
|
```
|
624
635
|
$ glimmer scaffold[greeter]
|
625
|
-
|
626
|
-
|
627
|
-
|
628
|
-
|
629
|
-
|
630
|
-
|
631
|
-
|
632
|
-
|
633
|
-
|
634
|
-
|
635
|
-
|
636
|
-
|
636
|
+
create .gitignore
|
637
|
+
create Rakefile
|
638
|
+
create Gemfile
|
639
|
+
create LICENSE.txt
|
640
|
+
create README.rdoc
|
641
|
+
create .document
|
642
|
+
create lib
|
643
|
+
create lib/greeter.rb
|
644
|
+
create spec
|
645
|
+
create spec/spec_helper.rb
|
646
|
+
create spec/greeter_spec.rb
|
647
|
+
create .rspec
|
637
648
|
Juwelier has prepared your gem in ./greeter
|
638
649
|
Created greeter/.gitignore
|
639
650
|
Created greeter/.ruby-version
|
@@ -696,7 +707,7 @@ The app even remembers your cookies if you log into the website, close the app,
|
|
696
707
|
|
697
708
|
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)`
|
698
709
|
|
699
|
-
Before you start, make sure you are in a JRuby environment with Glimmer gem installed as per "Direct Install" pre-requisites.
|
710
|
+
Before you start, make sure you are in a JRuby environment with Glimmer gem installed as per "Direct Install" pre-requisites.
|
700
711
|
|
701
712
|
To scaffold a Glimmer desktopify app from scratch, run the following command:
|
702
713
|
|
@@ -731,15 +742,15 @@ Successfully installed github_api-0.19.0
|
|
731
742
|
Successfully installed nokogiri-1.10.10-java
|
732
743
|
Successfully installed juwelier-2.4.9
|
733
744
|
7 gems installed
|
734
|
-
|
735
|
-
|
736
|
-
|
737
|
-
|
738
|
-
|
739
|
-
|
740
|
-
|
741
|
-
|
742
|
-
|
745
|
+
create .gitignore
|
746
|
+
create Rakefile
|
747
|
+
create Gemfile
|
748
|
+
create LICENSE.txt
|
749
|
+
create README.markdown
|
750
|
+
create .document
|
751
|
+
create lib
|
752
|
+
create lib/snowboard_utah.rb
|
753
|
+
create .rspec
|
743
754
|
Juwelier has prepared your gem in ./snowboard_utah
|
744
755
|
Created snowboard_utah/.gitignore
|
745
756
|
Created snowboard_utah/.ruby-version
|
@@ -811,8 +822,8 @@ glimmer scaffold:cw[name]
|
|
811
822
|
|
812
823
|
#### Custom Shell Gem
|
813
824
|
|
814
|
-
Custom shell gems are self-contained Glimmer apps as well as reusable custom shells.
|
815
|
-
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.
|
825
|
+
Custom shell gems are self-contained Glimmer apps as well as reusable custom shells.
|
826
|
+
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.
|
816
827
|
Unlike scaffolded Glimmer apps, custom shell gem content lives under the `lib` directory (not `app`).
|
817
828
|
They can be packaged as both a native executable (e.g. Mac DMG/PKG/APP) and a Ruby gem.
|
818
829
|
Of course, you can just build a Ruby gem and disregard native executable packaging if you do not need it.
|
@@ -839,7 +850,7 @@ Since custom shell gems are both an app and a gem, they provide two ways to run:
|
|
839
850
|
- 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`)
|
840
851
|
- 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.
|
841
852
|
|
842
|
-
Examples:
|
853
|
+
Examples:
|
843
854
|
|
844
855
|
- [glimmer-cs-gladiator](https://github.com/AndyObtiva/glimmer-cs-gladiator): Gladiator (Glimmer Editor)
|
845
856
|
- [glimmer-cs-calculator](https://github.com/AndyObtiva/glimmer-cs-calculator): Glimmer Calculator
|
@@ -865,7 +876,7 @@ The Ruby gem name will follow the convention "glimmer-cw-customwidgetname-namesp
|
|
865
876
|
|
866
877
|
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)
|
867
878
|
|
868
|
-
Examples:
|
879
|
+
Examples:
|
869
880
|
|
870
881
|
- [glimmer-cw-video](https://github.com/AndyObtiva/glimmer-cw-video): Video Widget
|
871
882
|
- [glimmer-cw-cdatetime-nebula](https://github.com/AndyObtiva/glimmer-cw-cdatetime-nebula): Nebula CDateTime Widget
|
@@ -900,11 +911,11 @@ Output:
|
|
900
911
|
|
901
912
|
Glimmer Custom Shell Gems at rubygems.org:
|
902
913
|
|
903
|
-
Name Gem Version Author Description
|
914
|
+
Name Gem Version Author Description
|
904
915
|
|
905
|
-
Calculator glimmer-cs-calculator 1.0.2 Andy Maleh Calculator - Glimmer Custom Shell
|
906
|
-
Gladiator glimmer-cs-gladiator 0.2.4 Andy Maleh Gladiator (Glimmer Editor) - Glimmer Custom Shell
|
907
|
-
Timer glimmer-cs-timer 1.0.0 Andy Maleh Timer - Glimmer Custom Shell
|
916
|
+
Calculator glimmer-cs-calculator 1.0.2 Andy Maleh Calculator - Glimmer Custom Shell
|
917
|
+
Gladiator glimmer-cs-gladiator 0.2.4 Andy Maleh Gladiator (Glimmer Editor) - Glimmer Custom Shell
|
918
|
+
Timer glimmer-cs-timer 1.0.0 Andy Maleh Timer - Glimmer Custom Shell
|
908
919
|
|
909
920
|
```
|
910
921
|
|
@@ -936,9 +947,9 @@ Output:
|
|
936
947
|
|
937
948
|
Glimmer Custom Widget Gems matching [video] at rubygems.org:
|
938
949
|
|
939
|
-
Name Gem Version Author Description
|
950
|
+
Name Gem Version Author Description
|
940
951
|
|
941
|
-
Video glimmer-cw-video 1.0.0 Andy Maleh Glimmer Custom Widget - Video
|
952
|
+
Video glimmer-cw-video 1.0.0 Andy Maleh Glimmer Custom Widget - Video
|
942
953
|
|
943
954
|
```
|
944
955
|
|
@@ -956,11 +967,11 @@ Output:
|
|
956
967
|
|
957
968
|
Glimmer Custom Widget Gems at rubygems.org:
|
958
969
|
|
959
|
-
Name Gem Version Author Description
|
970
|
+
Name Gem Version Author Description
|
960
971
|
|
961
|
-
Browser (Chromium) glimmer-cw-browser-chromium 1.0.0 Andy Maleh Chromium Browser - Glimmer Custom Widget
|
962
|
-
Cdatetime (Nebula) glimmer-cw-cdatetime-nebula 1.5.0.0.1 Andy Maleh Nebula CDateTime Widget - Glimmer Custom Widget
|
963
|
-
Video glimmer-cw-video 1.0.0 Andy Maleh Glimmer Custom Widget - Video
|
972
|
+
Browser (Chromium) glimmer-cw-browser-chromium 1.0.0 Andy Maleh Chromium Browser - Glimmer Custom Widget
|
973
|
+
Cdatetime (Nebula) glimmer-cw-cdatetime-nebula 1.5.0.0.1 Andy Maleh Nebula CDateTime Widget - Glimmer Custom Widget
|
974
|
+
Video glimmer-cw-video 1.0.0 Andy Maleh Glimmer Custom Widget - Video
|
964
975
|
|
965
976
|
```
|
966
977
|
|
@@ -984,13 +995,13 @@ Output:
|
|
984
995
|
|
985
996
|
Glimmer DSL Gems at rubygems.org:
|
986
997
|
|
987
|
-
Name Gem Version Author Description
|
998
|
+
Name Gem Version Author Description
|
988
999
|
|
989
|
-
Css glimmer-dsl-css 1.1.0 AndyMaleh Glimmer DSL for CSS
|
990
|
-
Opal glimmer-dsl-opal 0.4.0 AndyMaleh Glimmer DSL for Opal
|
991
|
-
Swt glimmer-dsl-swt 4.17.
|
992
|
-
Tk glimmer-dsl-tk 0.0.6 AndyMaleh Glimmer DSL for Tk
|
993
|
-
Xml glimmer-dsl-xml 1.1.0 AndyMaleh Glimmer DSL for XML
|
1000
|
+
Css glimmer-dsl-css 1.1.0 AndyMaleh Glimmer DSL for CSS
|
1001
|
+
Opal glimmer-dsl-opal 0.4.0 AndyMaleh Glimmer DSL for Opal
|
1002
|
+
Swt glimmer-dsl-swt 4.17.8.1 AndyMaleh Glimmer DSL for SWT
|
1003
|
+
Tk glimmer-dsl-tk 0.0.6 AndyMaleh Glimmer DSL for Tk
|
1004
|
+
Xml glimmer-dsl-xml 1.1.0 AndyMaleh Glimmer DSL for XML
|
994
1005
|
```
|
995
1006
|
|
996
1007
|
### Packaging
|
@@ -1133,7 +1144,7 @@ Static keywords are pre-identified keywords in the Glimmer DSL, such as `shell`,
|
|
1133
1144
|
|
1134
1145
|
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.
|
1135
1146
|
|
1136
|
-
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.
|
1147
|
+
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.
|
1137
1148
|
|
1138
1149
|
For example, if a project adds this custom Java SWT library from the [Nebula Project](https://www.eclipse.org/nebula/):
|
1139
1150
|
|
@@ -1385,10 +1396,10 @@ message_box {
|
|
1385
1396
|
|
1386
1397
|
#### Display
|
1387
1398
|
|
1388
|
-
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
|
1399
|
+
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
|
1389
1400
|
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.
|
1390
1401
|
|
1391
|
-
`Display` is automatically instantiated upon first instantiation of a `shell` widget.
|
1402
|
+
`Display` is automatically instantiated upon first instantiation of a `shell` widget.
|
1392
1403
|
|
1393
1404
|
Alternatively, for advanced use cases, a `Display` can be created explicitly with the Glimmer `display` keyword. When a `shell` is later declared, it
|
1394
1405
|
automatically uses the `display` created earlier without having to explicitly hook it.
|
@@ -1404,7 +1415,7 @@ automatically uses the `display` created earlier without having to explicitly ho
|
|
1404
1415
|
@shell = shell { # uses display created above
|
1405
1416
|
}
|
1406
1417
|
```
|
1407
|
-
The benefit of instantiating an SWT Display explicitly is to set [Properties](#widget-properties) or [Observers](#observer).
|
1418
|
+
The benefit of instantiating an SWT Display explicitly is to set [Properties](#widget-properties) or [Observers](#observer).
|
1408
1419
|
Although SWT Display is not technically a widget, it has similar APIs and DSL support.
|
1409
1420
|
|
1410
1421
|
#### Multi-Threading
|
@@ -1626,8 +1637,8 @@ https://help.eclipse.org/2019-12/nftopic/org.eclipse.platform.doc.isv/reference/
|
|
1626
1637
|
|
1627
1638
|
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`.
|
1628
1639
|
|
1629
|
-
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.
|
1630
|
-
Example:
|
1640
|
+
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.
|
1641
|
+
Example:
|
1631
1642
|
|
1632
1643
|
```ruby
|
1633
1644
|
style = swt(:border, :v_scroll)
|
@@ -1635,7 +1646,7 @@ style = swt(:border, :v_scroll)
|
|
1635
1646
|
|
1636
1647
|
#### Negative SWT Style Bits
|
1637
1648
|
|
1638
|
-
In rare occasions, you might need to apply & with a negative (not) style bit to negate it from another style bit that includes it.
|
1649
|
+
In rare occasions, you might need to apply & with a negative (not) style bit to negate it from another style bit that includes it.
|
1639
1650
|
Glimmer facilitates that by declaring the negative style bit via postfixing a symbol with `!`.
|
1640
1651
|
|
1641
1652
|
Example:
|
@@ -1644,13 +1655,13 @@ Example:
|
|
1644
1655
|
style = swt(:shell_trim, :max!) # creates a shell trim style without the maximize button (negated)
|
1645
1656
|
```
|
1646
1657
|
|
1647
|
-
#### Extra SWT Styles
|
1658
|
+
#### Extra SWT Styles
|
1648
1659
|
|
1649
1660
|
##### Non-resizable Window
|
1650
1661
|
|
1651
1662
|
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!)`.
|
1652
1663
|
|
1653
|
-
Glimmer makes this easier by alternatively offering a `:no_resize` extra SWT style, added for convenience.
|
1664
|
+
Glimmer makes this easier by alternatively offering a `:no_resize` extra SWT style, added for convenience.
|
1654
1665
|
This makes declaring a non-resizable window as easy as:
|
1655
1666
|
|
1656
1667
|
```ruby
|
@@ -1784,6 +1795,23 @@ Glimmer recently included **EXPERIMENTAL** gif animation support for the `backgr
|
|
1784
1795
|
|
1785
1796
|
Learn more about images in general at this SWT Image guide: https://www.eclipse.org/articles/Article-SWT-images/graphics-resources.html
|
1786
1797
|
|
1798
|
+
#### Image Options
|
1799
|
+
|
1800
|
+
Options may be passed in a hash at the end of `image` arguments:
|
1801
|
+
|
1802
|
+
- `width`: width of image
|
1803
|
+
- `height`: height of image
|
1804
|
+
|
1805
|
+
If only the width or height alone are specified, the other is calculated while maintaining the image aspect ratio.
|
1806
|
+
|
1807
|
+
Example:
|
1808
|
+
|
1809
|
+
```
|
1810
|
+
label {
|
1811
|
+
image 'someimage.png', width: 400, height: 300
|
1812
|
+
}
|
1813
|
+
```
|
1814
|
+
|
1787
1815
|
### Cursor
|
1788
1816
|
|
1789
1817
|
SWT widget `cursor` property represents the mouse cursor you see on the screen when you hover over that widget.
|
@@ -1796,7 +1824,7 @@ Example:
|
|
1796
1824
|
|
1797
1825
|
```ruby
|
1798
1826
|
shell {
|
1799
|
-
minimum_size 128, 128
|
1827
|
+
minimum_size 128, 128
|
1800
1828
|
cursor :appstarting
|
1801
1829
|
}
|
1802
1830
|
```
|
@@ -2185,7 +2213,7 @@ It assumes you have defined the table columns via `table_column` widget.
|
|
2185
2213
|
Example:
|
2186
2214
|
|
2187
2215
|
```ruby
|
2188
|
-
shell {
|
2216
|
+
shell {
|
2189
2217
|
@table = table {
|
2190
2218
|
table_column {
|
2191
2219
|
text "Name"
|
@@ -2203,13 +2231,13 @@ shell {
|
|
2203
2231
|
selection bind(group, :selected_person)
|
2204
2232
|
on_mouse_up { |event|
|
2205
2233
|
@table.edit_table_item(event.table_item, event.column_index)
|
2206
|
-
}
|
2234
|
+
}
|
2207
2235
|
}
|
2208
2236
|
}
|
2209
2237
|
```
|
2210
2238
|
|
2211
2239
|
The code above includes two data-bindings:
|
2212
|
-
- 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.
|
2240
|
+
- 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.
|
2213
2241
|
- 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)
|
2214
2242
|
- 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.)
|
2215
2243
|
|
@@ -2226,16 +2254,16 @@ found_array = @table.search { |table_item| table_item.getData == company.owner }
|
|
2226
2254
|
|
2227
2255
|
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.
|
2228
2256
|
|
2229
|
-
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)`.
|
2230
|
-
This automatically leverages the SWT TableEditor custom class behind the scenes, displaying a text widget to the user to change the selected or
|
2231
|
-
passed table item text into something else.
|
2257
|
+
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)`.
|
2258
|
+
This automatically leverages the SWT TableEditor custom class behind the scenes, displaying a text widget to the user to change the selected or
|
2259
|
+
passed table item text into something else.
|
2232
2260
|
It automatically persists the change to `items` data-bound model on ENTER/FOCUS-OUT or cancels on ESC/NO-CHANGE.
|
2233
2261
|
|
2234
2262
|
##### Table Sorting
|
2235
2263
|
|
2236
|
-
Glimmer automatically adds sorting support to the SWT `Table` widget.
|
2264
|
+
Glimmer automatically adds sorting support to the SWT `Table` widget.
|
2237
2265
|
|
2238
|
-
Check out the [Contact Manager](#contact-manager) sample for an example.
|
2266
|
+
Check out the [Contact Manager](#contact-manager) sample for an example.
|
2239
2267
|
You may click on any column and it will sort by ascending order first and descending if you click again.
|
2240
2268
|
|
2241
2269
|
Glimmer automatic table sorting supports `String`, `Integer`, and `Float` columns out of the box as well as any column data that is comparable.
|
@@ -2243,7 +2271,7 @@ Glimmer automatic table sorting supports `String`, `Integer`, and `Float` column
|
|
2243
2271
|
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`.
|
2244
2272
|
|
2245
2273
|
Should you have a special data type that could not be compared automatically, Glimmer offers the following 3 alternatives for custom sorting:
|
2246
|
-
- `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`).
|
2274
|
+
- `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`).
|
2247
2275
|
- `sort_by(&block)`: this works just like Ruby `Enumerable` `sort_by`. The block receives the table column data as argument.
|
2248
2276
|
- `sort(&comparator)`: this works just like Ruby `Enumerable` `sort`. The comparator block receives two objects from the table column data.
|
2249
2277
|
|
@@ -2303,7 +2331,7 @@ This involves using the `bind` keyword mentioned above in addition to a special
|
|
2303
2331
|
Example:
|
2304
2332
|
|
2305
2333
|
```ruby
|
2306
|
-
shell {
|
2334
|
+
shell {
|
2307
2335
|
@tree = tree {
|
2308
2336
|
items bind(company, :owner), tree_properties(children: :coworkers, text: :name)
|
2309
2337
|
selection bind(company, :selected_coworker)
|
@@ -2312,7 +2340,7 @@ shell {
|
|
2312
2340
|
```
|
2313
2341
|
|
2314
2342
|
The code above includes two data-bindings:
|
2315
|
-
- 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.
|
2343
|
+
- 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.
|
2316
2344
|
- Tree `selection`, which binds the single tree item selected by the user to the attribute denoted by the `bind` keyword
|
2317
2345
|
|
2318
2346
|
Additionally, Tree `items` data-binding automatically stores each node model unto the SWT TreeItem object via `setData` method. This enables things like searchability.
|
@@ -2366,7 +2394,7 @@ Let's revisit the Tic Tac Toe example shown near the beginning of the page:
|
|
2366
2394
|
shell {
|
2367
2395
|
text "Tic-Tac-Toe"
|
2368
2396
|
minimum_size 150, 178
|
2369
|
-
composite {
|
2397
|
+
composite {
|
2370
2398
|
grid_layout 3, true
|
2371
2399
|
(1..3).each { |row|
|
2372
2400
|
(1..3).each { |column|
|
@@ -2416,7 +2444,7 @@ shell {
|
|
2416
2444
|
@button1.swt_widget.setVisible(false)
|
2417
2445
|
}
|
2418
2446
|
on_widget_selected {
|
2419
|
-
@button1.swt_widget.setVisible(true)
|
2447
|
+
@button1.swt_widget.setVisible(true)
|
2420
2448
|
}
|
2421
2449
|
}
|
2422
2450
|
}.open
|
@@ -2438,7 +2466,7 @@ Example (you may copy/paste in [`girb`](#girb-glimmer-irb-command)):
|
|
2438
2466
|
}
|
2439
2467
|
@shell.on_shell_iconified {
|
2440
2468
|
@shell.close
|
2441
|
-
}
|
2469
|
+
}
|
2442
2470
|
@shell.open
|
2443
2471
|
```
|
2444
2472
|
|
@@ -2560,7 +2588,7 @@ Usage:
|
|
2560
2588
|
```ruby
|
2561
2589
|
shell {
|
2562
2590
|
red_label(:center) {
|
2563
|
-
text 'Red Label'
|
2591
|
+
text 'Red Label'
|
2564
2592
|
foreground :green
|
2565
2593
|
}
|
2566
2594
|
}.open
|
@@ -2627,7 +2655,7 @@ Additionally, custom widgets can call the following class methods:
|
|
2627
2655
|
- `::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)
|
2628
2656
|
- `::option(option_name, default: nil)`: declares a single option taking option name and default value as arguments (also generates attribute accessors just like `::options`)
|
2629
2657
|
|
2630
|
-
#### Content/Options Example
|
2658
|
+
#### Content/Options Example
|
2631
2659
|
|
2632
2660
|
(you may copy/paste in [`girb`](#girb-glimmer-irb-command))
|
2633
2661
|
|
@@ -2759,7 +2787,7 @@ shell { |app_shell|
|
|
2759
2787
|
app_shell.hide
|
2760
2788
|
@wizard_steps[@current_step_number - 1].open
|
2761
2789
|
end
|
2762
|
-
}
|
2790
|
+
}
|
2763
2791
|
}
|
2764
2792
|
}
|
2765
2793
|
button {
|
@@ -3053,6 +3081,55 @@ shell(:no_resize) {
|
|
3053
3081
|
|
3054
3082
|
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.
|
3055
3083
|
|
3084
|
+
#### Checkbox Group Widget
|
3085
|
+
|
3086
|
+
`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.
|
3087
|
+
|
3088
|
+
`checkbox_group` consists of a root `composite` (with `grid_layout 1, false` by default) that holds nested `checkbox` (`button(:check)`) widgets.
|
3089
|
+
|
3090
|
+
The `selection` property determines which `checkbox` buttons are checked. It expects an `Array` of `String` objects
|
3091
|
+
The `selection_indices` property determines which `checkbox` button indices are checked. It expects an `Array` of index `Integer` objects that are zero-based.
|
3092
|
+
The `checkboxes` property returns the list of nested `checkbox` widgets.
|
3093
|
+
|
3094
|
+
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.
|
3095
|
+
|
3096
|
+
You may see an example at the [Hello, Checkbox Group!](#hello-checkbox-group) sample.
|
3097
|
+
|
3098
|
+
![Hello Checkbox Group](images/glimmer-hello-checkbox-group.png)
|
3099
|
+
|
3100
|
+
#### Radio Group Widget
|
3101
|
+
|
3102
|
+
`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.
|
3103
|
+
|
3104
|
+
`radio_group` consists of a root `composite` (with `grid_layout 1, false` by default) that holds nested `radio` widgets.
|
3105
|
+
|
3106
|
+
The `selection` property determines which `radio` button is selected. It expects a `String`
|
3107
|
+
The `selection_index` property determines which `radio` button index is selected. It expects an index integer that is zero-based.
|
3108
|
+
The `radios` property returns the list of nested `radio` widgets.
|
3109
|
+
|
3110
|
+
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.
|
3111
|
+
|
3112
|
+
This custom widget is used in the [Glimmer Meta-Sample (The Sample of Samples)](#samples):
|
3113
|
+
|
3114
|
+
![Glimmer Meta-Sample](images/glimmer-meta-sample.png)
|
3115
|
+
|
3116
|
+
Glimmer Meta-Sample Code Example:
|
3117
|
+
|
3118
|
+
```ruby
|
3119
|
+
# ...
|
3120
|
+
radio_group { |radio_group_proxy|
|
3121
|
+
row_layout(:vertical) {
|
3122
|
+
fill true
|
3123
|
+
}
|
3124
|
+
selection bind(sample_directory, :selected_sample_name)
|
3125
|
+
font height: 24
|
3126
|
+
}
|
3127
|
+
|
3128
|
+
# ...
|
3129
|
+
```
|
3130
|
+
|
3131
|
+
You may see another example at the [Hello, Radio Group!](#hello-radio-group) sample.
|
3132
|
+
|
3056
3133
|
#### Code Text Widget
|
3057
3134
|
|
3058
3135
|
`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.
|
@@ -3079,7 +3156,7 @@ To use, simply use `code_text` in place of `text` or `styled_text` widget. If yo
|
|
3079
3156
|
|
3080
3157
|
[![Video Widget](images/glimmer-video-widget.png)](https://github.com/AndyObtiva/glimmer-cw-video)
|
3081
3158
|
|
3082
|
-
Glimmer supports a [video custom widget](https://github.com/AndyObtiva/glimmer-cw-video) not in SWT.
|
3159
|
+
Glimmer supports a [video custom widget](https://github.com/AndyObtiva/glimmer-cw-video) not in SWT.
|
3083
3160
|
|
3084
3161
|
You may obtain via `glimmer-cw-video` gem.
|
3085
3162
|
|
@@ -3182,7 +3259,7 @@ Glimmer configuration may be done via the `Glimmer::Config` module.
|
|
3182
3259
|
### logger
|
3183
3260
|
|
3184
3261
|
The Glimmer DSL engine supports logging via a standard `STDOUT` Ruby `Logger` configured in the `Glimmer::Config.logger` config option.
|
3185
|
-
It is set to level Logger::ERROR by default.
|
3262
|
+
It is set to level Logger::ERROR by default.
|
3186
3263
|
Log level may be adjusted via `Glimmer::Config.logger.level` just like any other Ruby Logger.
|
3187
3264
|
|
3188
3265
|
Example:
|
@@ -3224,13 +3301,13 @@ This is an array of these possible values: `:stdout` (default), `:stderr`, `:fil
|
|
3224
3301
|
|
3225
3302
|
It defaults to `[:stdout, :syslog]`
|
3226
3303
|
|
3227
|
-
When `:file` is included, Glimmer creates a 'log' directory directly below the Glimmer app local directory.
|
3304
|
+
When `:file` is included, Glimmer creates a 'log' directory directly below the Glimmer app local directory.
|
3228
3305
|
It may also be customized further via the `logging_device_file_options` option.
|
3229
3306
|
This is useful on Windows as an alternative to `syslog`, which is not available on Windows by default.
|
3230
3307
|
|
3231
3308
|
#### logging_device_file_options
|
3232
3309
|
|
3233
|
-
This is a hash of [`logging`](https://github.com/TwP/logging) gem options for the `:file` logging device.
|
3310
|
+
This is a hash of [`logging`](https://github.com/TwP/logging) gem options for the `:file` logging device.
|
3234
3311
|
|
3235
3312
|
Default: `{size: 1_000_000, age: 'daily', roll_by: 'number'}`
|
3236
3313
|
|
@@ -3248,7 +3325,7 @@ That ensures asynchronous buffered logging that is flushed every 500 messages an
|
|
3248
3325
|
|
3249
3326
|
This is a [`logging`](https://github.com/TwP/logging) gem layout that formats the logging output.
|
3250
3327
|
|
3251
|
-
Default:
|
3328
|
+
Default:
|
3252
3329
|
|
3253
3330
|
```
|
3254
3331
|
Logging.layouts.pattern(
|
@@ -3308,8 +3385,8 @@ https://github.com/jruby/jruby/wiki/CallingJavaFromJRuby
|
|
3308
3385
|
|
3309
3386
|
### loop_max_count
|
3310
3387
|
|
3311
|
-
Glimmer has infinite loop detection support.
|
3312
|
-
It can detect when an infinite loop is about to occur in method_missing and stops it.
|
3388
|
+
Glimmer has infinite loop detection support.
|
3389
|
+
It can detect when an infinite loop is about to occur in method_missing and stops it.
|
3313
3390
|
It detects potential infinite loops when the same keyword and args repeat more than 100 times, which is unusual in a GUI app.
|
3314
3391
|
|
3315
3392
|
The max limit can be changed via the `Glimmer::Config::loop_max_count=(count)` config option.
|
@@ -3587,6 +3664,130 @@ Hello, Sash Form! Red Label Maximized
|
|
3587
3664
|
|
3588
3665
|
![Hello Sash Form Red Maximized](images/glimmer-hello-sash-form-red-maximized.png)
|
3589
3666
|
|
3667
|
+
#### Hello, Styled Text!
|
3668
|
+
|
3669
|
+
This sample demonstrates the use of a `styled_text` in Glimmer.
|
3670
|
+
|
3671
|
+
Code:
|
3672
|
+
|
3673
|
+
[samples/hello/hello_styled_text.rb](https://github.com/AndyObtiva/glimmer-dsl-swt/blob/master/samples/hello/hello_styled_text.rb)
|
3674
|
+
|
3675
|
+
Hello, Styled Text!
|
3676
|
+
|
3677
|
+
![Hello Styled Text](images/glimmer-hello-styled-text.png)
|
3678
|
+
|
3679
|
+
#### Hello, Expand Bar!
|
3680
|
+
|
3681
|
+
This sample demonstrates the use of a `expand_bar` and `expand_item` in Glimmer.
|
3682
|
+
|
3683
|
+
Code:
|
3684
|
+
|
3685
|
+
[samples/hello/hello_expand_bar.rb](https://github.com/AndyObtiva/glimmer-dsl-swt/blob/master/samples/hello/hello_expand_bar.rb)
|
3686
|
+
|
3687
|
+
Hello, Expand Bar! All Expanded
|
3688
|
+
|
3689
|
+
![Hello Expand Bar All Expanded](images/glimmer-hello-expand-bar-all-expanded.png)
|
3690
|
+
|
3691
|
+
Hello, Expand Bar! Productivity Expanded
|
3692
|
+
|
3693
|
+
![Hello Expand Bar Productivity Expanded](images/glimmer-hello-expand-bar-productivity-expanded.png)
|
3694
|
+
|
3695
|
+
Hello, Expand Bar! Tools Expanded
|
3696
|
+
|
3697
|
+
![Hello Expand Bar Tools Expanded](images/glimmer-hello-expand-bar-tools-expanded.png)
|
3698
|
+
|
3699
|
+
Hello, Expand Bar! Reading Expanded
|
3700
|
+
|
3701
|
+
![Hello Expand Bar Reading Expanded](images/glimmer-hello-expand-bar-reading-expanded.png)
|
3702
|
+
|
3703
|
+
#### Hello, Radio!
|
3704
|
+
|
3705
|
+
This sample demonstrates the use of a `radio` (aka `button(:radio)`) in Glimmer.
|
3706
|
+
|
3707
|
+
Code:
|
3708
|
+
|
3709
|
+
[samples/hello/hello_radio.rb](https://github.com/AndyObtiva/glimmer-dsl-swt/blob/master/samples/hello/hello_radio.rb)
|
3710
|
+
|
3711
|
+
Hello, Radio!
|
3712
|
+
|
3713
|
+
![Hello Radio](images/glimmer-hello-radio.png)
|
3714
|
+
|
3715
|
+
#### Hello, Radio Group!
|
3716
|
+
|
3717
|
+
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.
|
3718
|
+
|
3719
|
+
Code:
|
3720
|
+
|
3721
|
+
[samples/hello/hello_radio_group.rb](https://github.com/AndyObtiva/glimmer-dsl-swt/blob/master/samples/hello/hello_radio_group.rb)
|
3722
|
+
|
3723
|
+
Hello, Radio Group!
|
3724
|
+
|
3725
|
+
![Hello Radio Group](images/glimmer-hello-radio-group.png)
|
3726
|
+
|
3727
|
+
#### Hello, Checkbox!
|
3728
|
+
|
3729
|
+
This sample demonstrates the use of a `checkbox` (aka `check` or `button(:check)`) in Glimmer.
|
3730
|
+
|
3731
|
+
Code:
|
3732
|
+
|
3733
|
+
[samples/hello/hello_checkbox.rb](https://github.com/AndyObtiva/glimmer-dsl-swt/blob/master/samples/hello/hello_checkbox.rb)
|
3734
|
+
|
3735
|
+
Hello, Checkbox!
|
3736
|
+
|
3737
|
+
![Hello Checkbox](images/glimmer-hello-checkbox.png)
|
3738
|
+
|
3739
|
+
#### Hello, Checkbox Group!
|
3740
|
+
|
3741
|
+
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.
|
3742
|
+
|
3743
|
+
Code:
|
3744
|
+
|
3745
|
+
[samples/hello/hello_checkbox_group.rb](https://github.com/AndyObtiva/glimmer-dsl-swt/blob/master/samples/hello/hello_checkbox_group.rb)
|
3746
|
+
|
3747
|
+
Hello, Checkbox Group!
|
3748
|
+
|
3749
|
+
![Hello Checkbox Group](images/glimmer-hello-checkbox-group.png)
|
3750
|
+
|
3751
|
+
#### Hello, Directory Dialog!
|
3752
|
+
|
3753
|
+
This sample demonstrates the use of a `directory_dialog` in Glimmer.
|
3754
|
+
|
3755
|
+
Code:
|
3756
|
+
|
3757
|
+
[samples/hello/hello_directory_dialog.rb](https://github.com/AndyObtiva/glimmer-dsl-swt/blob/master/samples/hello/hello_directory_dialog.rb)
|
3758
|
+
|
3759
|
+
Hello, Directory Dialog!
|
3760
|
+
|
3761
|
+
![Hello Directory Dialog](images/glimmer-hello-directory-dialog.png)
|
3762
|
+
|
3763
|
+
Hello, Directory Dialog! Browse...
|
3764
|
+
|
3765
|
+
![Hello Directory Dialog](images/glimmer-hello-directory-dialog-browse.png)
|
3766
|
+
|
3767
|
+
Hello, Directory Dialog! Selected Directory
|
3768
|
+
|
3769
|
+
![Hello Directory Dialog](images/glimmer-hello-directory-dialog-selected-directory.png)
|
3770
|
+
|
3771
|
+
#### Hello, File Dialog!
|
3772
|
+
|
3773
|
+
This sample demonstrates the use of a `file_dialog` in Glimmer.
|
3774
|
+
|
3775
|
+
Code:
|
3776
|
+
|
3777
|
+
[samples/hello/hello_file_dialog.rb](https://github.com/AndyObtiva/glimmer-dsl-swt/blob/master/samples/hello/hello_file_dialog.rb)
|
3778
|
+
|
3779
|
+
Hello, File Dialog!
|
3780
|
+
|
3781
|
+
![Hello File Dialog](images/glimmer-hello-file-dialog.png)
|
3782
|
+
|
3783
|
+
Hello, File Dialog! Browse...
|
3784
|
+
|
3785
|
+
![Hello File Dialog](images/glimmer-hello-file-dialog-browse.png)
|
3786
|
+
|
3787
|
+
Hello, File Dialog! Selected File
|
3788
|
+
|
3789
|
+
![Hello File Dialog](images/glimmer-hello-file-dialog-selected-file.png)
|
3790
|
+
|
3590
3791
|
### Elaborate Samples
|
3591
3792
|
|
3592
3793
|
For more elaborate samples, check the following:
|
@@ -3692,7 +3893,7 @@ Gladiator is a good demonstration of:
|
|
3692
3893
|
|
3693
3894
|
The following production apps have been built with Glimmer.
|
3694
3895
|
|
3695
|
-
If you have a Glimmer app you would like referenced here, please mention in a Pull Request.
|
3896
|
+
If you have a Glimmer app you would like referenced here, please mention in a Pull Request.
|
3696
3897
|
|
3697
3898
|
### Math Bowling
|
3698
3899
|
|
@@ -3740,11 +3941,11 @@ The Glimmer packaging process done in the `glimmer package` command consists of
|
|
3740
3941
|
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
|
3741
3942
|
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).
|
3742
3943
|
|
3743
|
-
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`.
|
3944
|
+
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`.
|
3744
3945
|
The JAR file name will match your application local directory name (e.g. `MathBowling.jar` for `~/code/MathBowling`)
|
3745
3946
|
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)
|
3746
3947
|
|
3747
|
-
The `glimmer package` command will automatically set "mac.CFBundleIdentifier" to ="org.#{project_name}.application.#{project_name}".
|
3948
|
+
The `glimmer package` command will automatically set "mac.CFBundleIdentifier" to ="org.#{project_name}.application.#{project_name}".
|
3748
3949
|
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")
|
3749
3950
|
|
3750
3951
|
### Packaging Defaults
|
@@ -3796,9 +3997,9 @@ require 'glimmer/rake_task'
|
|
3796
3997
|
Glimmer::RakeTask::Package.javapackager_extra_args = '-BlicenseType="MIT" -Bmac.category="public.app-category.business" -Bmac.signing-key-developer-id-app="Andy Maleh"'
|
3797
3998
|
```
|
3798
3999
|
|
3799
|
-
Note that `mac.category` defaults to "public.app-category.business", but can be overridden with one of the category UTI values mentioned here:
|
4000
|
+
Note that `mac.category` defaults to "public.app-category.business", but can be overridden with one of the category UTI values mentioned here:
|
3800
4001
|
|
3801
|
-
https://developer.apple.com/library/archive/releasenotes/General/SubmittingToMacAppStore/index.html#//apple_ref/doc/uid/TP40010572-CH16-SW8
|
4002
|
+
https://developer.apple.com/library/archive/releasenotes/General/SubmittingToMacAppStore/index.html#//apple_ref/doc/uid/TP40010572-CH16-SW8
|
3802
4003
|
|
3803
4004
|
Example (env var):
|
3804
4005
|
|
@@ -3814,7 +4015,7 @@ Pass `-v` to javapackager in `Glimmer::RakeTask::Package.javapackager_extra_args
|
|
3814
4015
|
|
3815
4016
|
### Windows Application Packaging
|
3816
4017
|
|
3817
|
-
Windows offers two options for setup packaging:
|
4018
|
+
Windows offers two options for setup packaging:
|
3818
4019
|
- `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)).
|
3819
4020
|
- `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.
|
3820
4021
|
|
@@ -3866,7 +4067,7 @@ Now, when you run `glimmer package`, it builds a self-signed DMG file. When you
|
|
3866
4067
|
|
3867
4068
|
1. Specifying License File
|
3868
4069
|
|
3869
|
-
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.
|
4070
|
+
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.
|
3870
4071
|
Keep that in mind if you are not going to rely on the default `LICENSE.txt` support.
|
3871
4072
|
|
3872
4073
|
Example:
|
@@ -3879,7 +4080,7 @@ Glimmer::RakeTask::Package.javapackager_extra_args = '-srcfiles "ACME.txt" -Blic
|
|
3879
4080
|
|
3880
4081
|
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."
|
3881
4082
|
|
3882
|
-
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):
|
4083
|
+
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):
|
3883
4084
|
|
3884
4085
|
```
|
3885
4086
|
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
|
@@ -3899,13 +4100,14 @@ Here is a list of notable 3rd party gems used by Glimmer:
|
|
3899
4100
|
- [puts_debuggerer](https://github.com/AndyObtiva/puts_debuggerer): helps in troubleshooting when adding `require 'pd'` and using the `pd` command instead of `puts` or `p` (also `#pd_inspect` or `#pdi` instead of `#inspect`)
|
3900
4101
|
- [rake](https://github.com/ruby/rake): used to implement and execute `glimmer` commands
|
3901
4102
|
- [rake-tui](https://github.com/AndyObtiva/rake-tui): Rake Text-based User Interface. Allows navigating rake tasks with arrow keys and filtering task list by typing to quickly find an run a rake task.
|
4103
|
+
- [rouge](https://github.com/rouge-ruby/rouge): Ruby syntax highlighter used in the `code_text` [Glimmer DSL for SWT custom widget](#custom-widgets) leveraged by the [Glimmer Meta-Sample](#samples)
|
3902
4104
|
- [super_module](https://github.com/AndyObtiva/super_module): used to cleanly write the Glimmer::UI:CustomWidget and Glimmer::UI::CustomShell modules
|
3903
4105
|
- [text-table](https://github.com/aptinio/text-table): renders textual data in a textual table for the command-line interface of Glimmer
|
3904
4106
|
- [warbler](https://github.com/jruby/warbler): converts a Glimmer app into a Java JAR file during packaging
|
3905
4107
|
|
3906
4108
|
## Glimmer Process
|
3907
4109
|
|
3908
|
-
[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.
|
4110
|
+
[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.
|
3909
4111
|
|
3910
4112
|
Learn more by reading the [GPG](https://github.com/AndyObtiva/glimmer/blob/master/PROCESS.md) (Glimmer Process Guidelines)
|
3911
4113
|
|
@@ -3928,7 +4130,7 @@ You may submit [issues](https://github.com/AndyObtiva/glimmer-dsl-swt/issues) on
|
|
3928
4130
|
|
3929
4131
|
### Chat
|
3930
4132
|
|
3931
|
-
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)
|
4133
|
+
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)
|
3932
4134
|
|
3933
4135
|
## Feature Suggestions
|
3934
4136
|
|
@@ -3975,7 +4177,7 @@ If your company would like to invest fulltime in further development of the Glim
|
|
3975
4177
|
|
3976
4178
|
[MIT](LICENSE.txt)
|
3977
4179
|
|
3978
|
-
Copyright (c) 2007-2020 - Andy Maleh.
|
4180
|
+
Copyright (c) 2007-2020 - Andy Maleh.
|
3979
4181
|
|
3980
4182
|
--
|
3981
4183
|
|