glimmer-dsl-swt 4.17.7.0 → 4.17.9.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +37 -2
- data/README.md +188 -81
- data/VERSION +1 -1
- data/glimmer-dsl-swt.gemspec +13 -3
- data/lib/glimmer-dsl-swt.rb +4 -3
- data/lib/glimmer/data_binding/tree_items_binding.rb +20 -2
- data/lib/glimmer/dsl/swt/checkbox_group_selection_data_binding_expression.rb +3 -3
- 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/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 +9 -8
- data/lib/glimmer/swt/custom/checkbox_group.rb +29 -8
- data/lib/glimmer/swt/custom/code_text.rb +43 -33
- data/lib/glimmer/swt/custom/radio_group.rb +27 -6
- data/lib/glimmer/swt/date_time_proxy.rb +87 -0
- data/lib/glimmer/swt/directory_dialog_proxy.rb +65 -0
- data/lib/glimmer/swt/display_proxy.rb +6 -6
- data/lib/glimmer/swt/dnd_proxy.rb +6 -10
- data/lib/glimmer/swt/file_dialog_proxy.rb +66 -0
- data/lib/glimmer/swt/menu_proxy.rb +3 -3
- data/lib/glimmer/swt/message_box_proxy.rb +7 -7
- data/lib/glimmer/swt/sash_form_proxy.rb +3 -3
- data/lib/glimmer/swt/shell_proxy.rb +5 -5
- data/lib/glimmer/swt/style_constantizable.rb +5 -5
- data/lib/glimmer/swt/swt_proxy.rb +7 -8
- data/lib/glimmer/swt/tab_item_proxy.rb +3 -3
- data/lib/glimmer/swt/table_column_proxy.rb +6 -4
- data/lib/glimmer/swt/table_proxy.rb +62 -26
- data/lib/glimmer/swt/widget_listener_proxy.rb +4 -4
- data/lib/glimmer/swt/widget_proxy.rb +57 -27
- data/lib/glimmer/ui/custom_shell.rb +3 -3
- data/samples/elaborate/contact_manager.rb +3 -3
- data/samples/hello/hello_browser.rb +3 -3
- data/samples/hello/hello_checkbox.rb +4 -4
- data/samples/hello/hello_checkbox_group.rb +3 -3
- data/samples/hello/hello_date_time.rb +63 -0
- data/samples/hello/hello_directory_dialog.rb +60 -0
- data/samples/hello/hello_file_dialog.rb +60 -0
- data/samples/hello/hello_group.rb +104 -0
- data/samples/hello/hello_list_single_selection.rb +5 -5
- 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 +6 -6
- data/samples/hello/hello_radio_group.rb +6 -6
- data/samples/hello/hello_table.rb +138 -0
- data/samples/hello/hello_world.rb +3 -3
- metadata +12 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3915e615b5248813ee6a9ca415c1be065f9d0ff9192e87a4a410146e0aae6f52
|
4
|
+
data.tar.gz: 98c2fa055457d36b53c840de96bad374dfeaec9fd21e36782090378d4439fffe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 31978beac188701c12a27dd742452cb62c52b913dd7fd485dc1c4bd19ab52d9dea9a30a84b867691b81ac7ff23adc2cf7874bcb8718ca058526c143158d9f16f
|
7
|
+
data.tar.gz: 2c1e46b47851006dbbf0187e9ba215db83c3e603d058e9fd3e8a1c2476f944c66deae8391b714e918632e7bcf0c59556edccfcc28c726698850d57e331cd0423
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,40 @@
|
|
1
1
|
# Change Log
|
2
2
|
|
3
|
+
### 4.17.9.0
|
4
|
+
|
5
|
+
- Add table style :editable to hook editing listener on mouse click automatically (instead of manually via on_widget_selected)
|
6
|
+
- Support table editing via `spinner` for integer values
|
7
|
+
- date_time widget official data-binding support of date_time, date, time, year, month, day, hours, minutes, and seconds
|
8
|
+
- date widget alias for date_time(:date)
|
9
|
+
- time widget alias for date_time(:time)
|
10
|
+
- calendar widget alias for date_time(:calendar)
|
11
|
+
- date_drop_down widget alias for date_time(:date, :drop_down)
|
12
|
+
- Hello, Date Time! Sample
|
13
|
+
|
14
|
+
### 4.17.8.3
|
15
|
+
|
16
|
+
- Hello, Table! Sample
|
17
|
+
- Disable editing on a column with `editor :none`
|
18
|
+
- Improve `code_text` performance immensely by only styling the lines being shown upon editing
|
19
|
+
- Fix dead spots with syntax highlighting in some files in Gladiator like file.rb
|
20
|
+
|
21
|
+
### 4.17.8.2
|
22
|
+
|
23
|
+
- Hello, Group! Sample
|
24
|
+
|
25
|
+
### 4.17.8.1
|
26
|
+
|
27
|
+
- Fixed an issue in Windows with code_text
|
28
|
+
|
29
|
+
### 4.17.8.0
|
30
|
+
|
31
|
+
- Officially Support SWT FileDialog with the `file_dialog` keyword (was unofficially supported before via standard SWT)
|
32
|
+
- Officially Support SWT DirectoryDialog with the `directory_dialog` keyword (was unofficially supported before via standard SWT)
|
33
|
+
- Hello, File Dialog! Sample
|
34
|
+
- Hello, Directory Dialog! Sample
|
35
|
+
- Prevent tree items data-binding from updating if no tree data change occurred
|
36
|
+
- Performance optimization for `code_text` syntax highlighting through caching
|
37
|
+
|
3
38
|
### 4.17.7.0
|
4
39
|
|
5
40
|
- `checkbox_group` built-in custom widget
|
@@ -138,7 +173,7 @@
|
|
138
173
|
|
139
174
|
- Add User Profile sample from DZone article
|
140
175
|
- Colored Ruby syntax highlighting for sample:code and sample:run tasks courtesy of tty-markdown
|
141
|
-
- Support `check` as alias to `checkbox` DSL keyword for Button widget with :check style.
|
176
|
+
- Support `check` as alias to `checkbox` DSL keyword for Button widget with :check style.
|
142
177
|
- Validate scaffolded custom shell gem name to ensure it doesn't clash with a built in Ruby method
|
143
178
|
- GLIMMER_LOGGER_ASYNC env var for disabling async logging when needed for immediate troubleshooting purposes
|
144
179
|
- 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)
|
@@ -337,7 +372,7 @@
|
|
337
372
|
## 0.1.3
|
338
373
|
|
339
374
|
- Added 'org.eclipse.swt.dnd' to glimmer auto-included Java packages
|
340
|
-
- Updated Tic Tac Toe sample to use new `message_box` keyword
|
375
|
+
- Updated Tic Tac Toe sample to use new `message_box` keyword
|
341
376
|
- 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
|
342
377
|
- Set default style DND::DROP_COPY in DragSource and DropTarget widgets
|
343
378
|
- 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.9.0
|
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:
|
@@ -296,6 +297,7 @@ Glimmer App:
|
|
296
297
|
- [List](#list)
|
297
298
|
- [Table](#table)
|
298
299
|
- [Tree](#tree)
|
300
|
+
- [DateTime](#datetime)
|
299
301
|
- [Observer](#observer)
|
300
302
|
- [Observing Widgets](#observing-widgets)
|
301
303
|
- [Observing Models](#observing-models)
|
@@ -313,6 +315,8 @@ Glimmer App:
|
|
313
315
|
- [Multi-DSL Support](#multi-dsl-support)
|
314
316
|
- [Application Menu Items (About/Preferences)](#application-menu-items-aboutpreferences)
|
315
317
|
- [App Name and Version](#app-name-and-version)
|
318
|
+
- [Checkbox Group Widget](#checkbox-group-widget)
|
319
|
+
- [Radio Group Widget](#radio-group-widget)
|
316
320
|
- [Code Text Widget](#code-text-widget)
|
317
321
|
- [Video Widget](#video-widget)
|
318
322
|
- [Sash Form Widget](#sash-form-widget)
|
@@ -350,7 +354,12 @@ Glimmer App:
|
|
350
354
|
- [Hello, Radio!](#hello-radio)
|
351
355
|
- [Hello, Radio Group!](#hello-radio-group)
|
352
356
|
- [Hello, Checkbox!](#hello-checkbox)
|
357
|
+
- [Hello, Group!](#hello-group)
|
358
|
+
- [Hello, Checkbox!](#hello-checkbox)
|
353
359
|
- [Hello, Checkbox Group!](#hello-checkbox-group)
|
360
|
+
- [Hello, Directory Dialog!](#hello-directory-dialog)
|
361
|
+
- [Hello, File Dialog!](#hello-file-dialog)
|
362
|
+
- [Hello, Date Time!](#hello-date-time)
|
354
363
|
- [Elaborate Samples](#elaborate-samples)
|
355
364
|
- [User Profile](#user-profile)
|
356
365
|
- [Login](#login)
|
@@ -434,7 +443,7 @@ Otherwise, Option 2 ([Bundler](#option-2-bundler)) can be followed in rare cases
|
|
434
443
|
|
435
444
|
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).
|
436
445
|
|
437
|
-
### Option 1: Direct Install
|
446
|
+
### Option 1: Direct Install
|
438
447
|
(Use for [Scaffolding](#scaffolding))
|
439
448
|
|
440
449
|
Run this command to install directly:
|
@@ -444,10 +453,11 @@ jgem install glimmer-dsl-swt
|
|
444
453
|
|
445
454
|
Or this command if you want a specific version:
|
446
455
|
```
|
447
|
-
jgem install glimmer-dsl-swt -v 4.17.
|
456
|
+
jgem install glimmer-dsl-swt -v 4.17.9.0
|
457
|
+
|
448
458
|
```
|
449
459
|
|
450
|
-
`jgem` is JRuby's version of `gem` command.
|
460
|
+
`jgem` is JRuby's version of `gem` command.
|
451
461
|
RVM allows running `gem install` directly as an alias.
|
452
462
|
Otherwise, you may also run `jruby -S gem install ...`
|
453
463
|
|
@@ -457,7 +467,7 @@ Otherwise, if you are ready to build a Glimmer app, you can jump to the [Glimmer
|
|
457
467
|
|
458
468
|
Note: if you're using activerecord or activesupport, keep in mind that Glimmer unhooks ActiveSupport::Dependencies as it does not rely on it.
|
459
469
|
|
460
|
-
### Option 2: Bundler
|
470
|
+
### Option 2: Bundler
|
461
471
|
(Use for Manual App Creation)
|
462
472
|
|
463
473
|
Add the following to `Gemfile`:
|
@@ -484,7 +494,7 @@ You can bring up usage instructions by running the `glimmer` command without arg
|
|
484
494
|
glimmer
|
485
495
|
```
|
486
496
|
|
487
|
-
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)).
|
497
|
+
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)).
|
488
498
|
|
489
499
|
On Windows, it simply lists the available Glimmer tasks at the end (courtsey of [rake](https://github.com/ruby/rake)).
|
490
500
|
|
@@ -520,13 +530,14 @@ bin/glimmer samples
|
|
520
530
|
Below are the full usage instructions that come up when running `glimmer` without args.
|
521
531
|
|
522
532
|
```
|
523
|
-
Glimmer (Ruby Desktop Development GUI Library) - JRuby Gem: glimmer-dsl-swt v4.17.
|
533
|
+
Glimmer (Ruby Desktop Development GUI Library) - JRuby Gem: glimmer-dsl-swt v4.17.9.0
|
534
|
+
|
524
535
|
|
525
536
|
Usage: glimmer [--bundler] [--pd] [--quiet] [--debug] [--log-level=VALUE] [[ENV_VAR=VALUE]...] [[-jruby-option]...] (application.rb or task[task_args]) [[application2.rb]...]
|
526
537
|
|
527
|
-
Runs Glimmer applications and tasks.
|
538
|
+
Runs Glimmer applications and tasks.
|
528
539
|
|
529
|
-
When applications are specified, they are run using JRuby,
|
540
|
+
When applications are specified, they are run using JRuby,
|
530
541
|
automatically preloading the glimmer Ruby gem and SWT jar dependency.
|
531
542
|
|
532
543
|
Optionally, extra Glimmer options, JRuby options, and/or environment variables may be passed in.
|
@@ -549,11 +560,11 @@ Select a Glimmer task to run: (Press ↑/↓ arrow to move, Enter to select and
|
|
549
560
|
glimmer package[type] # Package app for distribution (generating config, jar, and native files) (type is optional)
|
550
561
|
glimmer package:clean # Clean by removing "dist" and "packages" directories
|
551
562
|
glimmer package:config # Generate JAR config file
|
552
|
-
glimmer package:gemspec # Generate gemspec
|
563
|
+
glimmer package:gemspec # Generate gemspec
|
553
564
|
glimmer package:jar # Generate JAR file
|
554
565
|
glimmer package:lock_jars # Lock JARs
|
555
566
|
glimmer package:native[type] # Generate Native files
|
556
|
-
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)
|
567
|
+
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)
|
557
568
|
glimmer samples # Brings up the Glimmer Meta-Sample app to allow browsing, running, and viewing code of Glimmer samples
|
558
569
|
glimmer scaffold[app_name] # Scaffold Glimmer application directory structure to build a new app
|
559
570
|
glimmer scaffold:customshell[name,namespace] # Scaffold Glimmer::UI::CustomShell subclass (full window view) under app/views (namespace is optional) [alt: scaffold:cs]
|
@@ -593,10 +604,10 @@ This brings up the [Glimmer Meta-Sample (The Sample of Samples)](#samples):
|
|
593
604
|
Glimmer borrows from Rails the idea of Scaffolding, that is generating a structure for your app files that
|
594
605
|
helps you get started just like true building scaffolding helps construction workers, civil engineers, and architects.
|
595
606
|
|
596
|
-
Glimmer scaffolding goes beyond just scaffolding the app files that Rails does. It also packages it and launches it,
|
607
|
+
Glimmer scaffolding goes beyond just scaffolding the app files that Rails does. It also packages it and launches it,
|
597
608
|
getting you to a running and delivered state of an advanced "Hello, World!" Glimmer application right off the bat.
|
598
609
|
|
599
|
-
This should greatly facilitate building a new Glimmer app by helping you be productive and focus on app details while
|
610
|
+
This should greatly facilitate building a new Glimmer app by helping you be productive and focus on app details while
|
600
611
|
letting Glimmer scaffolding take care of initial app file structure concerns, such as adding:
|
601
612
|
- Main application class that includes Glimmer (`app/{app_name}.rb`)
|
602
613
|
- Main application view that houses main window content, menu, about dialog, and preferences dialog
|
@@ -611,7 +622,7 @@ You need to have your Git `user.name` and `github.user` configured before scaffo
|
|
611
622
|
|
612
623
|
#### App
|
613
624
|
|
614
|
-
Before you start, make sure you are in a JRuby environment with Glimmer gem installed as per "Direct Install" pre-requisites.
|
625
|
+
Before you start, make sure you are in a JRuby environment with Glimmer gem installed as per "Direct Install" pre-requisites.
|
615
626
|
|
616
627
|
To scaffold a Glimmer app from scratch, run the following command:
|
617
628
|
|
@@ -705,7 +716,7 @@ The app even remembers your cookies if you log into the website, close the app,
|
|
705
716
|
|
706
717
|
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)`
|
707
718
|
|
708
|
-
Before you start, make sure you are in a JRuby environment with Glimmer gem installed as per "Direct Install" pre-requisites.
|
719
|
+
Before you start, make sure you are in a JRuby environment with Glimmer gem installed as per "Direct Install" pre-requisites.
|
709
720
|
|
710
721
|
To scaffold a Glimmer desktopify app from scratch, run the following command:
|
711
722
|
|
@@ -820,8 +831,8 @@ glimmer scaffold:cw[name]
|
|
820
831
|
|
821
832
|
#### Custom Shell Gem
|
822
833
|
|
823
|
-
Custom shell gems are self-contained Glimmer apps as well as reusable custom shells.
|
824
|
-
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.
|
834
|
+
Custom shell gems are self-contained Glimmer apps as well as reusable custom shells.
|
835
|
+
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
836
|
Unlike scaffolded Glimmer apps, custom shell gem content lives under the `lib` directory (not `app`).
|
826
837
|
They can be packaged as both a native executable (e.g. Mac DMG/PKG/APP) and a Ruby gem.
|
827
838
|
Of course, you can just build a Ruby gem and disregard native executable packaging if you do not need it.
|
@@ -848,7 +859,7 @@ Since custom shell gems are both an app and a gem, they provide two ways to run:
|
|
848
859
|
- 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`)
|
849
860
|
- 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.
|
850
861
|
|
851
|
-
Examples:
|
862
|
+
Examples:
|
852
863
|
|
853
864
|
- [glimmer-cs-gladiator](https://github.com/AndyObtiva/glimmer-cs-gladiator): Gladiator (Glimmer Editor)
|
854
865
|
- [glimmer-cs-calculator](https://github.com/AndyObtiva/glimmer-cs-calculator): Glimmer Calculator
|
@@ -874,7 +885,7 @@ The Ruby gem name will follow the convention "glimmer-cw-customwidgetname-namesp
|
|
874
885
|
|
875
886
|
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)
|
876
887
|
|
877
|
-
Examples:
|
888
|
+
Examples:
|
878
889
|
|
879
890
|
- [glimmer-cw-video](https://github.com/AndyObtiva/glimmer-cw-video): Video Widget
|
880
891
|
- [glimmer-cw-cdatetime-nebula](https://github.com/AndyObtiva/glimmer-cw-cdatetime-nebula): Nebula CDateTime Widget
|
@@ -909,11 +920,11 @@ Output:
|
|
909
920
|
|
910
921
|
Glimmer Custom Shell Gems at rubygems.org:
|
911
922
|
|
912
|
-
Name Gem Version Author Description
|
923
|
+
Name Gem Version Author Description
|
913
924
|
|
914
|
-
Calculator glimmer-cs-calculator 1.0.2 Andy Maleh Calculator - Glimmer Custom Shell
|
915
|
-
Gladiator glimmer-cs-gladiator 0.2.4 Andy Maleh Gladiator (Glimmer Editor) - Glimmer Custom Shell
|
916
|
-
Timer glimmer-cs-timer 1.0.0 Andy Maleh Timer - Glimmer Custom Shell
|
925
|
+
Calculator glimmer-cs-calculator 1.0.2 Andy Maleh Calculator - Glimmer Custom Shell
|
926
|
+
Gladiator glimmer-cs-gladiator 0.2.4 Andy Maleh Gladiator (Glimmer Editor) - Glimmer Custom Shell
|
927
|
+
Timer glimmer-cs-timer 1.0.0 Andy Maleh Timer - Glimmer Custom Shell
|
917
928
|
|
918
929
|
```
|
919
930
|
|
@@ -945,9 +956,9 @@ Output:
|
|
945
956
|
|
946
957
|
Glimmer Custom Widget Gems matching [video] at rubygems.org:
|
947
958
|
|
948
|
-
Name Gem Version Author Description
|
959
|
+
Name Gem Version Author Description
|
949
960
|
|
950
|
-
Video glimmer-cw-video 1.0.0 Andy Maleh Glimmer Custom Widget - Video
|
961
|
+
Video glimmer-cw-video 1.0.0 Andy Maleh Glimmer Custom Widget - Video
|
951
962
|
|
952
963
|
```
|
953
964
|
|
@@ -965,11 +976,11 @@ Output:
|
|
965
976
|
|
966
977
|
Glimmer Custom Widget Gems at rubygems.org:
|
967
978
|
|
968
|
-
Name Gem Version Author Description
|
979
|
+
Name Gem Version Author Description
|
969
980
|
|
970
|
-
Browser (Chromium) glimmer-cw-browser-chromium 1.0.0 Andy Maleh Chromium Browser - Glimmer Custom Widget
|
971
|
-
Cdatetime (Nebula) glimmer-cw-cdatetime-nebula 1.5.0.0.1 Andy Maleh Nebula CDateTime Widget - Glimmer Custom Widget
|
972
|
-
Video glimmer-cw-video 1.0.0 Andy Maleh Glimmer Custom Widget - Video
|
981
|
+
Browser (Chromium) glimmer-cw-browser-chromium 1.0.0 Andy Maleh Chromium Browser - Glimmer Custom Widget
|
982
|
+
Cdatetime (Nebula) glimmer-cw-cdatetime-nebula 1.5.0.0.1 Andy Maleh Nebula CDateTime Widget - Glimmer Custom Widget
|
983
|
+
Video glimmer-cw-video 1.0.0 Andy Maleh Glimmer Custom Widget - Video
|
973
984
|
|
974
985
|
```
|
975
986
|
|
@@ -993,13 +1004,14 @@ Output:
|
|
993
1004
|
|
994
1005
|
Glimmer DSL Gems at rubygems.org:
|
995
1006
|
|
996
|
-
Name Gem Version Author Description
|
1007
|
+
Name Gem Version Author Description
|
997
1008
|
|
998
|
-
Css glimmer-dsl-css 1.1.0 AndyMaleh Glimmer DSL for CSS
|
999
|
-
Opal glimmer-dsl-opal 0.4.0 AndyMaleh Glimmer DSL for Opal
|
1000
|
-
Swt glimmer-dsl-swt 4.17.
|
1001
|
-
|
1002
|
-
|
1009
|
+
Css glimmer-dsl-css 1.1.0 AndyMaleh Glimmer DSL for CSS
|
1010
|
+
Opal glimmer-dsl-opal 0.4.0 AndyMaleh Glimmer DSL for Opal
|
1011
|
+
Swt glimmer-dsl-swt 4.17.9.0
|
1012
|
+
AndyMaleh Glimmer DSL for SWT
|
1013
|
+
Tk glimmer-dsl-tk 0.0.6 AndyMaleh Glimmer DSL for Tk
|
1014
|
+
Xml glimmer-dsl-xml 1.1.0 AndyMaleh Glimmer DSL for XML
|
1003
1015
|
```
|
1004
1016
|
|
1005
1017
|
### Packaging
|
@@ -1142,7 +1154,7 @@ Static keywords are pre-identified keywords in the Glimmer DSL, such as `shell`,
|
|
1142
1154
|
|
1143
1155
|
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.
|
1144
1156
|
|
1145
|
-
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.
|
1157
|
+
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.
|
1146
1158
|
|
1147
1159
|
For example, if a project adds this custom Java SWT library from the [Nebula Project](https://www.eclipse.org/nebula/):
|
1148
1160
|
|
@@ -1394,10 +1406,10 @@ message_box {
|
|
1394
1406
|
|
1395
1407
|
#### Display
|
1396
1408
|
|
1397
|
-
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
|
1409
|
+
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
|
1398
1410
|
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.
|
1399
1411
|
|
1400
|
-
`Display` is automatically instantiated upon first instantiation of a `shell` widget.
|
1412
|
+
`Display` is automatically instantiated upon first instantiation of a `shell` widget.
|
1401
1413
|
|
1402
1414
|
Alternatively, for advanced use cases, a `Display` can be created explicitly with the Glimmer `display` keyword. When a `shell` is later declared, it
|
1403
1415
|
automatically uses the `display` created earlier without having to explicitly hook it.
|
@@ -1413,7 +1425,7 @@ automatically uses the `display` created earlier without having to explicitly ho
|
|
1413
1425
|
@shell = shell { # uses display created above
|
1414
1426
|
}
|
1415
1427
|
```
|
1416
|
-
The benefit of instantiating an SWT Display explicitly is to set [Properties](#widget-properties) or [Observers](#observer).
|
1428
|
+
The benefit of instantiating an SWT Display explicitly is to set [Properties](#widget-properties) or [Observers](#observer).
|
1417
1429
|
Although SWT Display is not technically a widget, it has similar APIs and DSL support.
|
1418
1430
|
|
1419
1431
|
#### Multi-Threading
|
@@ -1635,8 +1647,8 @@ https://help.eclipse.org/2019-12/nftopic/org.eclipse.platform.doc.isv/reference/
|
|
1635
1647
|
|
1636
1648
|
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`.
|
1637
1649
|
|
1638
|
-
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.
|
1639
|
-
Example:
|
1650
|
+
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.
|
1651
|
+
Example:
|
1640
1652
|
|
1641
1653
|
```ruby
|
1642
1654
|
style = swt(:border, :v_scroll)
|
@@ -1644,7 +1656,7 @@ style = swt(:border, :v_scroll)
|
|
1644
1656
|
|
1645
1657
|
#### Negative SWT Style Bits
|
1646
1658
|
|
1647
|
-
In rare occasions, you might need to apply & with a negative (not) style bit to negate it from another style bit that includes it.
|
1659
|
+
In rare occasions, you might need to apply & with a negative (not) style bit to negate it from another style bit that includes it.
|
1648
1660
|
Glimmer facilitates that by declaring the negative style bit via postfixing a symbol with `!`.
|
1649
1661
|
|
1650
1662
|
Example:
|
@@ -1653,13 +1665,13 @@ Example:
|
|
1653
1665
|
style = swt(:shell_trim, :max!) # creates a shell trim style without the maximize button (negated)
|
1654
1666
|
```
|
1655
1667
|
|
1656
|
-
#### Extra SWT Styles
|
1668
|
+
#### Extra SWT Styles
|
1657
1669
|
|
1658
1670
|
##### Non-resizable Window
|
1659
1671
|
|
1660
1672
|
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!)`.
|
1661
1673
|
|
1662
|
-
Glimmer makes this easier by alternatively offering a `:no_resize` extra SWT style, added for convenience.
|
1674
|
+
Glimmer makes this easier by alternatively offering a `:no_resize` extra SWT style, added for convenience.
|
1663
1675
|
This makes declaring a non-resizable window as easy as:
|
1664
1676
|
|
1665
1677
|
```ruby
|
@@ -1822,7 +1834,7 @@ Example:
|
|
1822
1834
|
|
1823
1835
|
```ruby
|
1824
1836
|
shell {
|
1825
|
-
minimum_size 128, 128
|
1837
|
+
minimum_size 128, 128
|
1826
1838
|
cursor :appstarting
|
1827
1839
|
}
|
1828
1840
|
```
|
@@ -2211,7 +2223,7 @@ It assumes you have defined the table columns via `table_column` widget.
|
|
2211
2223
|
Example:
|
2212
2224
|
|
2213
2225
|
```ruby
|
2214
|
-
shell {
|
2226
|
+
shell {
|
2215
2227
|
@table = table {
|
2216
2228
|
table_column {
|
2217
2229
|
text "Name"
|
@@ -2229,13 +2241,13 @@ shell {
|
|
2229
2241
|
selection bind(group, :selected_person)
|
2230
2242
|
on_mouse_up { |event|
|
2231
2243
|
@table.edit_table_item(event.table_item, event.column_index)
|
2232
|
-
}
|
2244
|
+
}
|
2233
2245
|
}
|
2234
2246
|
}
|
2235
2247
|
```
|
2236
2248
|
|
2237
2249
|
The code above includes two data-bindings:
|
2238
|
-
- 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.
|
2250
|
+
- 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.
|
2239
2251
|
- 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)
|
2240
2252
|
- 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.)
|
2241
2253
|
|
@@ -2252,16 +2264,16 @@ found_array = @table.search { |table_item| table_item.getData == company.owner }
|
|
2252
2264
|
|
2253
2265
|
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.
|
2254
2266
|
|
2255
|
-
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)`.
|
2256
|
-
This automatically leverages the SWT TableEditor custom class behind the scenes, displaying a text widget to the user to change the selected or
|
2257
|
-
passed table item text into something else.
|
2267
|
+
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)`.
|
2268
|
+
This automatically leverages the SWT TableEditor custom class behind the scenes, displaying a text widget to the user to change the selected or
|
2269
|
+
passed table item text into something else.
|
2258
2270
|
It automatically persists the change to `items` data-bound model on ENTER/FOCUS-OUT or cancels on ESC/NO-CHANGE.
|
2259
2271
|
|
2260
2272
|
##### Table Sorting
|
2261
2273
|
|
2262
|
-
Glimmer automatically adds sorting support to the SWT `Table` widget.
|
2274
|
+
Glimmer automatically adds sorting support to the SWT `Table` widget.
|
2263
2275
|
|
2264
|
-
Check out the [Contact Manager](#contact-manager) sample for an example.
|
2276
|
+
Check out the [Contact Manager](#contact-manager) sample for an example.
|
2265
2277
|
You may click on any column and it will sort by ascending order first and descending if you click again.
|
2266
2278
|
|
2267
2279
|
Glimmer automatic table sorting supports `String`, `Integer`, and `Float` columns out of the box as well as any column data that is comparable.
|
@@ -2269,7 +2281,7 @@ Glimmer automatic table sorting supports `String`, `Integer`, and `Float` column
|
|
2269
2281
|
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`.
|
2270
2282
|
|
2271
2283
|
Should you have a special data type that could not be compared automatically, Glimmer offers the following 3 alternatives for custom sorting:
|
2272
|
-
- `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`).
|
2284
|
+
- `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`).
|
2273
2285
|
- `sort_by(&block)`: this works just like Ruby `Enumerable` `sort_by`. The block receives the table column data as argument.
|
2274
2286
|
- `sort(&comparator)`: this works just like Ruby `Enumerable` `sort`. The comparator block receives two objects from the table column data.
|
2275
2287
|
|
@@ -2329,7 +2341,7 @@ This involves using the `bind` keyword mentioned above in addition to a special
|
|
2329
2341
|
Example:
|
2330
2342
|
|
2331
2343
|
```ruby
|
2332
|
-
shell {
|
2344
|
+
shell {
|
2333
2345
|
@tree = tree {
|
2334
2346
|
items bind(company, :owner), tree_properties(children: :coworkers, text: :name)
|
2335
2347
|
selection bind(company, :selected_coworker)
|
@@ -2338,7 +2350,7 @@ shell {
|
|
2338
2350
|
```
|
2339
2351
|
|
2340
2352
|
The code above includes two data-bindings:
|
2341
|
-
- 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.
|
2353
|
+
- 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.
|
2342
2354
|
- Tree `selection`, which binds the single tree item selected by the user to the attribute denoted by the `bind` keyword
|
2343
2355
|
|
2344
2356
|
Additionally, Tree `items` data-binding automatically stores each node model unto the SWT TreeItem object via `setData` method. This enables things like searchability.
|
@@ -2357,6 +2369,29 @@ This finds the root node. The array is a Java array. This enables easy passing o
|
|
2357
2369
|
To edit a tree, you must invoke `TreeProxy#edit_selected_tree_item` or `TreeProxy#edit_tree_item`. This automatically leverages the SWT TreeEditor custom class behind the scenes, displaying
|
2358
2370
|
a text widget to the user to change the selected or passed tree item text into something else. It automatically persists the change to `items` data-bound model on ENTER/FOCUS-OUT or cancels on ESC/NO-CHANGE.
|
2359
2371
|
|
2372
|
+
#### DateTime
|
2373
|
+
|
2374
|
+
`date_time` represents the SWT DateTime widget.
|
2375
|
+
|
2376
|
+
Glimmer offers the following alias keywords for it for convenience:
|
2377
|
+
- `date`: `date_time(:date)`
|
2378
|
+
- `date_drop_down`: `date_time(:date, :drop_down)`
|
2379
|
+
- `time`: `date_time(:time)`
|
2380
|
+
- `calendar`: `date_time(:calendar)`
|
2381
|
+
|
2382
|
+
You can data-bind any of these properties:
|
2383
|
+
- `date_time bind(model, :property)`: produces a Ruby DateTime object
|
2384
|
+
- `date bind(model, :property)`: produces a Ruby Date object
|
2385
|
+
- `time bind(model, :property)`: produces a Ruby Time object
|
2386
|
+
- `year bind(model, :property)`: produces an integer
|
2387
|
+
- `month bind(model, :property)`: produces an integer
|
2388
|
+
- `day bind(model, :property)`: produces an integer
|
2389
|
+
- `hours bind(model, :property)`: produces an integer
|
2390
|
+
- `minutes bind(model, :property)`: produces an integer
|
2391
|
+
- `seconds bind(model, :property)`: produces an integer
|
2392
|
+
|
2393
|
+
Learn more at the [Hello, Date Time!](#hello-date-time) sample.
|
2394
|
+
|
2360
2395
|
### Observer
|
2361
2396
|
|
2362
2397
|
Glimmer comes with `Observer` module, which is used internally for data-binding, but can also be used externally for custom use of the Observer Pattern. It is hidden when observing widgets, and used explicitly when observing models.
|
@@ -2392,7 +2427,7 @@ Let's revisit the Tic Tac Toe example shown near the beginning of the page:
|
|
2392
2427
|
shell {
|
2393
2428
|
text "Tic-Tac-Toe"
|
2394
2429
|
minimum_size 150, 178
|
2395
|
-
composite {
|
2430
|
+
composite {
|
2396
2431
|
grid_layout 3, true
|
2397
2432
|
(1..3).each { |row|
|
2398
2433
|
(1..3).each { |column|
|
@@ -2442,7 +2477,7 @@ shell {
|
|
2442
2477
|
@button1.swt_widget.setVisible(false)
|
2443
2478
|
}
|
2444
2479
|
on_widget_selected {
|
2445
|
-
@button1.swt_widget.setVisible(true)
|
2480
|
+
@button1.swt_widget.setVisible(true)
|
2446
2481
|
}
|
2447
2482
|
}
|
2448
2483
|
}.open
|
@@ -2464,7 +2499,7 @@ Example (you may copy/paste in [`girb`](#girb-glimmer-irb-command)):
|
|
2464
2499
|
}
|
2465
2500
|
@shell.on_shell_iconified {
|
2466
2501
|
@shell.close
|
2467
|
-
}
|
2502
|
+
}
|
2468
2503
|
@shell.open
|
2469
2504
|
```
|
2470
2505
|
|
@@ -2586,7 +2621,7 @@ Usage:
|
|
2586
2621
|
```ruby
|
2587
2622
|
shell {
|
2588
2623
|
red_label(:center) {
|
2589
|
-
text 'Red Label'
|
2624
|
+
text 'Red Label'
|
2590
2625
|
foreground :green
|
2591
2626
|
}
|
2592
2627
|
}.open
|
@@ -2653,7 +2688,7 @@ Additionally, custom widgets can call the following class methods:
|
|
2653
2688
|
- `::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)
|
2654
2689
|
- `::option(option_name, default: nil)`: declares a single option taking option name and default value as arguments (also generates attribute accessors just like `::options`)
|
2655
2690
|
|
2656
|
-
#### Content/Options Example
|
2691
|
+
#### Content/Options Example
|
2657
2692
|
|
2658
2693
|
(you may copy/paste in [`girb`](#girb-glimmer-irb-command))
|
2659
2694
|
|
@@ -2785,7 +2820,7 @@ shell { |app_shell|
|
|
2785
2820
|
app_shell.hide
|
2786
2821
|
@wizard_steps[@current_step_number - 1].open
|
2787
2822
|
end
|
2788
|
-
}
|
2823
|
+
}
|
2789
2824
|
}
|
2790
2825
|
}
|
2791
2826
|
button {
|
@@ -3154,7 +3189,7 @@ To use, simply use `code_text` in place of `text` or `styled_text` widget. If yo
|
|
3154
3189
|
|
3155
3190
|
[![Video Widget](images/glimmer-video-widget.png)](https://github.com/AndyObtiva/glimmer-cw-video)
|
3156
3191
|
|
3157
|
-
Glimmer supports a [video custom widget](https://github.com/AndyObtiva/glimmer-cw-video) not in SWT.
|
3192
|
+
Glimmer supports a [video custom widget](https://github.com/AndyObtiva/glimmer-cw-video) not in SWT.
|
3158
3193
|
|
3159
3194
|
You may obtain via `glimmer-cw-video` gem.
|
3160
3195
|
|
@@ -3257,7 +3292,7 @@ Glimmer configuration may be done via the `Glimmer::Config` module.
|
|
3257
3292
|
### logger
|
3258
3293
|
|
3259
3294
|
The Glimmer DSL engine supports logging via a standard `STDOUT` Ruby `Logger` configured in the `Glimmer::Config.logger` config option.
|
3260
|
-
It is set to level Logger::ERROR by default.
|
3295
|
+
It is set to level Logger::ERROR by default.
|
3261
3296
|
Log level may be adjusted via `Glimmer::Config.logger.level` just like any other Ruby Logger.
|
3262
3297
|
|
3263
3298
|
Example:
|
@@ -3299,13 +3334,13 @@ This is an array of these possible values: `:stdout` (default), `:stderr`, `:fil
|
|
3299
3334
|
|
3300
3335
|
It defaults to `[:stdout, :syslog]`
|
3301
3336
|
|
3302
|
-
When `:file` is included, Glimmer creates a 'log' directory directly below the Glimmer app local directory.
|
3337
|
+
When `:file` is included, Glimmer creates a 'log' directory directly below the Glimmer app local directory.
|
3303
3338
|
It may also be customized further via the `logging_device_file_options` option.
|
3304
3339
|
This is useful on Windows as an alternative to `syslog`, which is not available on Windows by default.
|
3305
3340
|
|
3306
3341
|
#### logging_device_file_options
|
3307
3342
|
|
3308
|
-
This is a hash of [`logging`](https://github.com/TwP/logging) gem options for the `:file` logging device.
|
3343
|
+
This is a hash of [`logging`](https://github.com/TwP/logging) gem options for the `:file` logging device.
|
3309
3344
|
|
3310
3345
|
Default: `{size: 1_000_000, age: 'daily', roll_by: 'number'}`
|
3311
3346
|
|
@@ -3323,7 +3358,7 @@ That ensures asynchronous buffered logging that is flushed every 500 messages an
|
|
3323
3358
|
|
3324
3359
|
This is a [`logging`](https://github.com/TwP/logging) gem layout that formats the logging output.
|
3325
3360
|
|
3326
|
-
Default:
|
3361
|
+
Default:
|
3327
3362
|
|
3328
3363
|
```
|
3329
3364
|
Logging.layouts.pattern(
|
@@ -3383,8 +3418,8 @@ https://github.com/jruby/jruby/wiki/CallingJavaFromJRuby
|
|
3383
3418
|
|
3384
3419
|
### loop_max_count
|
3385
3420
|
|
3386
|
-
Glimmer has infinite loop detection support.
|
3387
|
-
It can detect when an infinite loop is about to occur in method_missing and stops it.
|
3421
|
+
Glimmer has infinite loop detection support.
|
3422
|
+
It can detect when an infinite loop is about to occur in method_missing and stops it.
|
3388
3423
|
It detects potential infinite loops when the same keyword and args repeat more than 100 times, which is unusual in a GUI app.
|
3389
3424
|
|
3390
3425
|
The max limit can be changed via the `Glimmer::Config::loop_max_count=(count)` config option.
|
@@ -3730,6 +3765,26 @@ Code:
|
|
3730
3765
|
|
3731
3766
|
[samples/hello/hello_checkbox.rb](https://github.com/AndyObtiva/glimmer-dsl-swt/blob/master/samples/hello/hello_checkbox.rb)
|
3732
3767
|
|
3768
|
+
#### Hello, Group!
|
3769
|
+
|
3770
|
+
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).
|
3771
|
+
|
3772
|
+
Code:
|
3773
|
+
|
3774
|
+
[samples/hello/hello_group.rb](https://github.com/AndyObtiva/glimmer-dsl-swt/blob/master/samples/hello/hello_group.rb)
|
3775
|
+
|
3776
|
+
Hello, Group!
|
3777
|
+
|
3778
|
+
![Hello Group](images/glimmer-hello-group.png)
|
3779
|
+
|
3780
|
+
#### Hello, Checkbox!
|
3781
|
+
|
3782
|
+
This sample demonstrates the use of a `checkbox` (aka `check` or `button(:check)`) in Glimmer.
|
3783
|
+
|
3784
|
+
Code:
|
3785
|
+
|
3786
|
+
[samples/hello/hello_checkbox.rb](https://github.com/AndyObtiva/glimmer-dsl-swt/blob/master/samples/hello/hello_checkbox.rb)
|
3787
|
+
|
3733
3788
|
Hello, Checkbox!
|
3734
3789
|
|
3735
3790
|
![Hello Checkbox](images/glimmer-hello-checkbox.png)
|
@@ -3746,6 +3801,58 @@ Hello, Checkbox Group!
|
|
3746
3801
|
|
3747
3802
|
![Hello Checkbox Group](images/glimmer-hello-checkbox-group.png)
|
3748
3803
|
|
3804
|
+
#### Hello, Directory Dialog!
|
3805
|
+
|
3806
|
+
This sample demonstrates the use of a `directory_dialog` in Glimmer.
|
3807
|
+
|
3808
|
+
Code:
|
3809
|
+
|
3810
|
+
[samples/hello/hello_directory_dialog.rb](https://github.com/AndyObtiva/glimmer-dsl-swt/blob/master/samples/hello/hello_directory_dialog.rb)
|
3811
|
+
|
3812
|
+
Hello, Directory Dialog!
|
3813
|
+
|
3814
|
+
![Hello Directory Dialog](images/glimmer-hello-directory-dialog.png)
|
3815
|
+
|
3816
|
+
Hello, Directory Dialog! Browse...
|
3817
|
+
|
3818
|
+
![Hello Directory Dialog](images/glimmer-hello-directory-dialog-browse.png)
|
3819
|
+
|
3820
|
+
Hello, Directory Dialog! Selected Directory
|
3821
|
+
|
3822
|
+
![Hello Directory Dialog](images/glimmer-hello-directory-dialog-selected-directory.png)
|
3823
|
+
|
3824
|
+
#### Hello, File Dialog!
|
3825
|
+
|
3826
|
+
This sample demonstrates the use of a `file_dialog` in Glimmer.
|
3827
|
+
|
3828
|
+
Code:
|
3829
|
+
|
3830
|
+
[samples/hello/hello_file_dialog.rb](https://github.com/AndyObtiva/glimmer-dsl-swt/blob/master/samples/hello/hello_file_dialog.rb)
|
3831
|
+
|
3832
|
+
Hello, File Dialog!
|
3833
|
+
|
3834
|
+
![Hello File Dialog](images/glimmer-hello-file-dialog.png)
|
3835
|
+
|
3836
|
+
Hello, File Dialog! Browse...
|
3837
|
+
|
3838
|
+
![Hello File Dialog](images/glimmer-hello-file-dialog-browse.png)
|
3839
|
+
|
3840
|
+
Hello, File Dialog! Selected File
|
3841
|
+
|
3842
|
+
![Hello File Dialog](images/glimmer-hello-file-dialog-selected-file.png)
|
3843
|
+
|
3844
|
+
#### Hello, Date Time!
|
3845
|
+
|
3846
|
+
This sample demonstrates the use of [date_time](#datetime) widget keywords in Glimmer: `date`, `date_drop_down`, `time`, and `calendar`
|
3847
|
+
|
3848
|
+
Code:
|
3849
|
+
|
3850
|
+
[samples/hello/hello_date_time.rb](https://github.com/AndyObtiva/glimmer-dsl-swt/blob/master/samples/hello/hello_date_time.rb)
|
3851
|
+
|
3852
|
+
Hello, Date Time!
|
3853
|
+
|
3854
|
+
![Hello Date Time](images/glimmer-hello-date-time.png)
|
3855
|
+
|
3749
3856
|
### Elaborate Samples
|
3750
3857
|
|
3751
3858
|
For more elaborate samples, check the following:
|
@@ -3851,7 +3958,7 @@ Gladiator is a good demonstration of:
|
|
3851
3958
|
|
3852
3959
|
The following production apps have been built with Glimmer.
|
3853
3960
|
|
3854
|
-
If you have a Glimmer app you would like referenced here, please mention in a Pull Request.
|
3961
|
+
If you have a Glimmer app you would like referenced here, please mention in a Pull Request.
|
3855
3962
|
|
3856
3963
|
### Math Bowling
|
3857
3964
|
|
@@ -3899,11 +4006,11 @@ The Glimmer packaging process done in the `glimmer package` command consists of
|
|
3899
4006
|
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
|
3900
4007
|
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).
|
3901
4008
|
|
3902
|
-
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`.
|
4009
|
+
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`.
|
3903
4010
|
The JAR file name will match your application local directory name (e.g. `MathBowling.jar` for `~/code/MathBowling`)
|
3904
4011
|
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)
|
3905
4012
|
|
3906
|
-
The `glimmer package` command will automatically set "mac.CFBundleIdentifier" to ="org.#{project_name}.application.#{project_name}".
|
4013
|
+
The `glimmer package` command will automatically set "mac.CFBundleIdentifier" to ="org.#{project_name}.application.#{project_name}".
|
3907
4014
|
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")
|
3908
4015
|
|
3909
4016
|
### Packaging Defaults
|
@@ -3955,9 +4062,9 @@ require 'glimmer/rake_task'
|
|
3955
4062
|
Glimmer::RakeTask::Package.javapackager_extra_args = '-BlicenseType="MIT" -Bmac.category="public.app-category.business" -Bmac.signing-key-developer-id-app="Andy Maleh"'
|
3956
4063
|
```
|
3957
4064
|
|
3958
|
-
Note that `mac.category` defaults to "public.app-category.business", but can be overridden with one of the category UTI values mentioned here:
|
4065
|
+
Note that `mac.category` defaults to "public.app-category.business", but can be overridden with one of the category UTI values mentioned here:
|
3959
4066
|
|
3960
|
-
https://developer.apple.com/library/archive/releasenotes/General/SubmittingToMacAppStore/index.html#//apple_ref/doc/uid/TP40010572-CH16-SW8
|
4067
|
+
https://developer.apple.com/library/archive/releasenotes/General/SubmittingToMacAppStore/index.html#//apple_ref/doc/uid/TP40010572-CH16-SW8
|
3961
4068
|
|
3962
4069
|
Example (env var):
|
3963
4070
|
|
@@ -3973,7 +4080,7 @@ Pass `-v` to javapackager in `Glimmer::RakeTask::Package.javapackager_extra_args
|
|
3973
4080
|
|
3974
4081
|
### Windows Application Packaging
|
3975
4082
|
|
3976
|
-
Windows offers two options for setup packaging:
|
4083
|
+
Windows offers two options for setup packaging:
|
3977
4084
|
- `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)).
|
3978
4085
|
- `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.
|
3979
4086
|
|
@@ -4025,7 +4132,7 @@ Now, when you run `glimmer package`, it builds a self-signed DMG file. When you
|
|
4025
4132
|
|
4026
4133
|
1. Specifying License File
|
4027
4134
|
|
4028
|
-
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.
|
4135
|
+
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.
|
4029
4136
|
Keep that in mind if you are not going to rely on the default `LICENSE.txt` support.
|
4030
4137
|
|
4031
4138
|
Example:
|
@@ -4038,7 +4145,7 @@ Glimmer::RakeTask::Package.javapackager_extra_args = '-srcfiles "ACME.txt" -Blic
|
|
4038
4145
|
|
4039
4146
|
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."
|
4040
4147
|
|
4041
|
-
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):
|
4148
|
+
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):
|
4042
4149
|
|
4043
4150
|
```
|
4044
4151
|
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
|
@@ -4065,7 +4172,7 @@ Here is a list of notable 3rd party gems used by Glimmer:
|
|
4065
4172
|
|
4066
4173
|
## Glimmer Process
|
4067
4174
|
|
4068
|
-
[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.
|
4175
|
+
[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.
|
4069
4176
|
|
4070
4177
|
Learn more by reading the [GPG](https://github.com/AndyObtiva/glimmer/blob/master/PROCESS.md) (Glimmer Process Guidelines)
|
4071
4178
|
|
@@ -4088,7 +4195,7 @@ You may submit [issues](https://github.com/AndyObtiva/glimmer-dsl-swt/issues) on
|
|
4088
4195
|
|
4089
4196
|
### Chat
|
4090
4197
|
|
4091
|
-
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)
|
4198
|
+
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)
|
4092
4199
|
|
4093
4200
|
## Feature Suggestions
|
4094
4201
|
|
@@ -4135,7 +4242,7 @@ If your company would like to invest fulltime in further development of the Glim
|
|
4135
4242
|
|
4136
4243
|
[MIT](LICENSE.txt)
|
4137
4244
|
|
4138
|
-
Copyright (c) 2007-2020 - Andy Maleh.
|
4245
|
+
Copyright (c) 2007-2020 - Andy Maleh.
|
4139
4246
|
|
4140
4247
|
--
|
4141
4248
|
|