glimmer-dsl-swt 4.18.4.9 → 4.18.5.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +73 -0
- data/README.md +14 -5
- data/VERSION +1 -1
- data/bin/glimmer +3 -3
- data/docs/reference/GLIMMER_CONFIGURATION.md +7 -3
- data/docs/reference/GLIMMER_GUI_DSL_SYNTAX.md +464 -149
- data/docs/reference/GLIMMER_SAMPLES.md +91 -4
- data/glimmer-dsl-swt.gemspec +24 -13
- data/lib/ext/glimmer/config.rb +3 -7
- data/lib/glimmer/data_binding/list_selection_binding.rb +13 -7
- data/lib/glimmer/data_binding/table_items_binding.rb +22 -17
- data/lib/glimmer/data_binding/tree_items_binding.rb +19 -15
- data/lib/glimmer/data_binding/widget_binding.rb +13 -15
- data/lib/glimmer/dsl/swt/{file_dialog_expression.rb → auto_exec_expression.rb} +6 -18
- data/lib/glimmer/dsl/swt/checkbox_group_selection_data_binding_expression.rb +9 -6
- data/lib/glimmer/dsl/swt/color_expression.rb +1 -1
- data/lib/glimmer/dsl/swt/combo_selection_data_binding_expression.rb +16 -14
- data/lib/glimmer/dsl/swt/custom_widget_expression.rb +4 -1
- data/lib/glimmer/dsl/swt/data_binding_expression.rb +2 -2
- data/lib/glimmer/dsl/swt/dialog_expression.rb +18 -9
- data/lib/glimmer/dsl/swt/dsl.rb +1 -0
- data/lib/glimmer/dsl/swt/exec_expression.rb +1 -1
- data/lib/glimmer/dsl/swt/font_expression.rb +1 -1
- data/lib/glimmer/dsl/swt/image_expression.rb +16 -2
- data/lib/glimmer/dsl/swt/list_selection_data_binding_expression.rb +11 -8
- data/lib/glimmer/dsl/swt/pixel_expression.rb +1 -1
- data/lib/glimmer/dsl/swt/radio_group_selection_data_binding_expression.rb +8 -5
- data/lib/glimmer/dsl/swt/shape_expression.rb +2 -2
- data/lib/glimmer/dsl/swt/shell_expression.rb +5 -2
- data/lib/glimmer/dsl/swt/widget_expression.rb +8 -4
- data/lib/glimmer/launcher.rb +3 -0
- data/lib/glimmer/rake_task/scaffold.rb +3 -0
- data/lib/glimmer/swt/color_proxy.rb +1 -1
- data/lib/glimmer/swt/custom/code_text.rb +33 -11
- data/lib/glimmer/swt/custom/drawable.rb +55 -0
- data/lib/glimmer/swt/custom/shape.rb +187 -43
- data/lib/glimmer/swt/custom/shape/arc.rb +60 -0
- data/lib/glimmer/{dsl/swt/directory_dialog_expression.rb → swt/custom/shape/focus.rb} +15 -20
- data/lib/glimmer/swt/custom/shape/image.rb +99 -0
- data/lib/glimmer/swt/custom/shape/line.rb +65 -0
- data/lib/glimmer/swt/custom/shape/oval.rb +61 -0
- data/lib/glimmer/swt/custom/shape/point.rb +54 -0
- data/lib/glimmer/swt/custom/shape/polygon.rb +73 -0
- data/lib/glimmer/swt/custom/shape/polyline.rb +74 -0
- data/lib/glimmer/swt/custom/shape/rectangle.rb +101 -0
- data/lib/glimmer/swt/custom/shape/text.rb +85 -0
- data/lib/glimmer/swt/date_time_proxy.rb +9 -3
- data/lib/glimmer/swt/dialog_proxy.rb +92 -0
- data/lib/glimmer/swt/display_proxy.rb +62 -2
- data/lib/glimmer/swt/expand_item_proxy.rb +18 -12
- data/lib/glimmer/swt/font_proxy.rb +13 -7
- data/lib/glimmer/swt/image_proxy.rb +15 -4
- data/lib/glimmer/swt/layout_data_proxy.rb +21 -15
- data/lib/glimmer/swt/layout_proxy.rb +19 -15
- data/lib/glimmer/swt/menu_proxy.rb +2 -2
- data/lib/glimmer/swt/message_box_proxy.rb +21 -7
- data/lib/glimmer/swt/properties.rb +3 -0
- data/lib/glimmer/swt/proxy_properties.rb +145 -0
- data/lib/glimmer/swt/scrolled_composite_proxy.rb +6 -2
- data/lib/glimmer/swt/shell_proxy.rb +96 -80
- data/lib/glimmer/swt/swt_proxy.rb +17 -0
- data/lib/glimmer/swt/tab_item_proxy.rb +5 -3
- data/lib/glimmer/swt/table_proxy.rb +32 -11
- data/lib/glimmer/swt/transform_proxy.rb +39 -35
- data/lib/glimmer/swt/tree_proxy.rb +11 -16
- data/lib/glimmer/swt/widget_listener_proxy.rb +6 -2
- data/lib/glimmer/swt/widget_proxy.rb +192 -141
- data/lib/glimmer/ui.rb +5 -0
- data/lib/glimmer/ui/custom_shell.rb +13 -7
- data/lib/glimmer/ui/custom_widget.rb +4 -5
- data/samples/elaborate/contact_manager.rb +7 -7
- data/samples/elaborate/login.rb +25 -21
- data/samples/elaborate/mandelbrot_fractal.rb +87 -31
- data/samples/elaborate/meta_sample.rb +1 -1
- data/samples/elaborate/tetris.rb +1 -0
- data/samples/elaborate/tic_tac_toe.rb +16 -14
- data/samples/elaborate/tic_tac_toe/board.rb +5 -5
- data/samples/elaborate/tic_tac_toe/cell.rb +5 -5
- data/samples/hello/hello_button.rb +7 -7
- data/samples/hello/hello_canvas.rb +143 -41
- data/samples/hello/hello_checkbox.rb +16 -14
- data/samples/hello/hello_checkbox_group.rb +11 -9
- data/samples/hello/hello_color_dialog.rb +66 -0
- data/samples/hello/hello_combo.rb +14 -12
- data/samples/hello/hello_computed.rb +7 -7
- data/samples/hello/hello_cursor.rb +2 -1
- data/samples/hello/hello_custom_shell.rb +17 -21
- data/samples/hello/hello_custom_widget.rb +4 -6
- data/samples/hello/hello_date_time.rb +14 -12
- data/samples/hello/hello_directory_dialog.rb +7 -7
- data/samples/hello/hello_expand_bar.rb +8 -8
- data/samples/hello/hello_file_dialog.rb +7 -7
- data/samples/hello/hello_font_dialog.rb +82 -0
- data/samples/hello/hello_group.rb +18 -16
- data/samples/hello/hello_list_multi_selection.rb +13 -11
- data/samples/hello/hello_list_single_selection.rb +13 -11
- data/samples/hello/hello_progress_bar.rb +125 -0
- data/samples/hello/hello_radio.rb +18 -16
- data/samples/hello/hello_radio_group.rb +14 -12
- data/samples/hello/hello_spinner.rb +7 -7
- data/samples/hello/hello_tab.rb +5 -5
- data/samples/hello/hello_table.rb +10 -5
- data/samples/hello/hello_tree.rb +485 -0
- metadata +22 -22
- data/lib/glimmer/swt/directory_dialog_proxy.rb +0 -65
- data/lib/glimmer/swt/file_dialog_proxy.rb +0 -66
@@ -1,5 +1,3 @@
|
|
1
|
-
## Samples
|
2
|
-
|
3
1
|
- [Samples](#samples)
|
4
2
|
- [Hello Samples](#hello-samples)
|
5
3
|
- [Hello, World!](#hello-world)
|
@@ -36,6 +34,10 @@
|
|
36
34
|
- [Hello, Canvas Animation!](#hello-canvas-animation)
|
37
35
|
- [Hello, Canvas Transform!](#hello-canvas-transform)
|
38
36
|
- [Hello, Cursor!](#hello-cursor)
|
37
|
+
- [Hello, Progress Bar!](#hello-progress-bar)
|
38
|
+
- [Hello, Tree!](#hello-tree)
|
39
|
+
- [Hello, Color Dialog!](#hello-color-dialog)
|
40
|
+
- [Hello, Font Dialog!](#hello-font-dialog)
|
39
41
|
- [Elaborate Samples](#elaborate-samples)
|
40
42
|
- [User Profile](#user-profile)
|
41
43
|
- [Login](#login)
|
@@ -49,7 +51,9 @@
|
|
49
51
|
- [Timer](#timer)
|
50
52
|
- [License](#license)
|
51
53
|
|
52
|
-
|
54
|
+
## Samples
|
55
|
+
|
56
|
+
Check the [samples](/samples) directory in [glimmer-dsl-swt](https://github.com/AndyObtiva/glimmer-dsl-swt) for examples on how to write Glimmer applications. To run a sample, make sure to install the `glimmer-dsl-swt` gem first and then use the `glimmer samples` command to run it (alternatively, you may clone the repo, follow [CONTRIBUTING.md](CONTRIBUTING.md) instructions, and run samples locally with development glimmer command: `bin/glimmer`).
|
53
57
|
|
54
58
|
You may run any sample via this command:
|
55
59
|
|
@@ -560,6 +564,22 @@ Hello, Canvas!
|
|
560
564
|
|
561
565
|
![Hello Canvas](/images/glimmer-hello-canvas.png)
|
562
566
|
|
567
|
+
Hello, Canvas! with Moved Shapes (via Drag'n'Drop)
|
568
|
+
|
569
|
+
![Hello Canvas Moved Shapes](/images/glimmer-hello-canvas-moved-shapes.png)
|
570
|
+
|
571
|
+
Hello, Canvas! Menu (for background/foreground color changes)
|
572
|
+
|
573
|
+
![Hello Canvas Menu](/images/glimmer-hello-canvas-menu.png)
|
574
|
+
|
575
|
+
Hello, Canvas! Color Dialog
|
576
|
+
|
577
|
+
![Hello Canvas Color Dialog](/images/glimmer-hello-canvas-color-dialog.png)
|
578
|
+
|
579
|
+
Hello, Canvas! Colors Changed
|
580
|
+
|
581
|
+
![Hello Canvas Colors Changed](/images/glimmer-hello-canvas-colors-changed.png)
|
582
|
+
|
563
583
|
#### Hello, Canvas Animation!
|
564
584
|
|
565
585
|
This sample demonstrates the use of the `canvas` widget and [Animation DSL](#canvas-animation-dsl) in Glimmer.
|
@@ -600,6 +620,65 @@ Hello, Cursor!
|
|
600
620
|
|
601
621
|
![Hello Cursor](/images/glimmer-hello-cursor.gif)
|
602
622
|
|
623
|
+
#### Hello, Progress Bar!
|
624
|
+
|
625
|
+
This sample demonstrates the use of the `progress_bar` widget keyword.
|
626
|
+
|
627
|
+
It includes an `:indeterminate` progress bar on top, for cases when you could not calculate progress, but still want to inform the user there is an operation happening in the background.
|
628
|
+
|
629
|
+
Below it, there are a determinate `:horizontal` (default) progress bar and a `:vertical` progress bar.
|
630
|
+
|
631
|
+
Code:
|
632
|
+
|
633
|
+
[samples/hello/hello_progress_bar.rb](/samples/hello/hello_progress_bar.rb)
|
634
|
+
|
635
|
+
Hello, Progress Bar!
|
636
|
+
|
637
|
+
![Hello Progress Bar](/images/glimmer-hello-progress-bar.gif)
|
638
|
+
|
639
|
+
#### Hello, Tree!
|
640
|
+
|
641
|
+
This sample demonstrates the use of the `tree` widget along with tree data-binding.
|
642
|
+
|
643
|
+
Code:
|
644
|
+
|
645
|
+
[samples/hello/hello_tree.rb](/samples/hello/hello_tree.rb)
|
646
|
+
|
647
|
+
Hello, Tree!
|
648
|
+
|
649
|
+
![Hello Tree](/images/glimmer-hello-tree.png)
|
650
|
+
|
651
|
+
#### Hello, Color Dialog!
|
652
|
+
|
653
|
+
This sample demonstrates the use of the `color_dialog` keyword.
|
654
|
+
|
655
|
+
Code:
|
656
|
+
|
657
|
+
[samples/hello/hello_color_dialog.rb](/samples/hello/hello_color_dialog.rb)
|
658
|
+
|
659
|
+
Hello, Color Dialog!
|
660
|
+
|
661
|
+
![Hello Color Dialog](/images/glimmer-hello-color-dialog.png)
|
662
|
+
|
663
|
+
![Hello Color Dialog Choose Color](/images/glimmer-hello-color-dialog-choose-color.png)
|
664
|
+
|
665
|
+
![Hello Color Dialog Color Changed](/images/glimmer-hello-color-dialog-color-changed.png)
|
666
|
+
|
667
|
+
#### Hello, Font Dialog!
|
668
|
+
|
669
|
+
This sample demonstrates the use of the `font_dialog` keyword.
|
670
|
+
|
671
|
+
Code:
|
672
|
+
|
673
|
+
[samples/hello/hello_font_dialog.rb](/samples/hello/hello_font_dialog.rb)
|
674
|
+
|
675
|
+
Hello, Font Dialog!
|
676
|
+
|
677
|
+
![Hello Font Dialog](/images/glimmer-hello-font-dialog.png)
|
678
|
+
|
679
|
+
![Hello Font Dialog Choose Font](/images/glimmer-hello-font-dialog-choose-font.png)
|
680
|
+
|
681
|
+
![Hello Font Dialog Font Changed](/images/glimmer-hello-font-dialog-font-changed.png)
|
603
682
|
|
604
683
|
### Elaborate Samples
|
605
684
|
|
@@ -705,7 +784,9 @@ This sample demonstrates how to render canvas graphics with multi-threaded proce
|
|
705
784
|
|
706
785
|
It renders the famous Mandelbrot Fractal, enabling zooming and panning (go to Help -> Instructions for more details)
|
707
786
|
|
708
|
-
The Mandelbrot Fractal is known to take a long time to render, but thanks to multi-core processing, the app starts in about 10 seconds (runs faster the more cores you have)
|
787
|
+
The Mandelbrot Fractal is known to take a long time to render, but thanks to multi-core processing, the app starts in about 10 seconds with 4 CPU cores (runs faster the more cores you have)
|
788
|
+
|
789
|
+
Lower the cores in the menu to get more responsive interaction (e.g. zooming/panning). Once you change the cores, the change will not take effect till the next zoom calculation cycle.
|
709
790
|
|
710
791
|
Code:
|
711
792
|
|
@@ -717,6 +798,12 @@ Code:
|
|
717
798
|
|
718
799
|
![Mandelbrot Fractal Zoom 5](/images/glimmer-mandelbrot-zoom5.png)
|
719
800
|
|
801
|
+
![Mandelbrot Fractal View Menu](/images/glimmer-mandelbrot-menu-view.png)
|
802
|
+
|
803
|
+
![Mandelbrot Fractal Cores Menu](/images/glimmer-mandelbrot-menu-cores.png)
|
804
|
+
|
805
|
+
![Mandelbrot Fractal Help Menu](/images/glimmer-mandelbrot-menu-help.png)
|
806
|
+
|
720
807
|
### External Samples
|
721
808
|
|
722
809
|
#### Glimmer Calculator
|
data/glimmer-dsl-swt.gemspec
CHANGED
@@ -2,16 +2,16 @@
|
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
3
|
# Instead, edit Juwelier::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
|
-
# stub: glimmer-dsl-swt 4.18.
|
5
|
+
# stub: glimmer-dsl-swt 4.18.5.2 ruby lib
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
8
|
s.name = "glimmer-dsl-swt".freeze
|
9
|
-
s.version = "4.18.
|
9
|
+
s.version = "4.18.5.2"
|
10
10
|
|
11
11
|
s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
|
12
12
|
s.require_paths = ["lib".freeze]
|
13
13
|
s.authors = ["AndyMaleh".freeze]
|
14
|
-
s.date = "2021-02-
|
14
|
+
s.date = "2021-02-24"
|
15
15
|
s.description = "Glimmer DSL for SWT (JRuby Desktop Development GUI Framework) is a native-GUI cross-platform desktop development library written in JRuby, an OS-threaded faster JVM version of Ruby. Glimmer's main innovation is a declarative Ruby DSL that enables productive and efficient authoring of desktop application user-interfaces by relying on the robust Eclipse SWT library. Glimmer additionally innovates by having built-in data-binding support, which greatly facilitates synchronizing the GUI with domain models, thus achieving true decoupling of object oriented components and enabling developers to solve business problems (test-first) without worrying about GUI concerns, or alternatively drive development GUI-first, and then write clean business models (test-first) afterwards. Not only does Glimmer provide a large set of GUI widgets, but it also supports drawing Canvas Graphics like Shapes and Animations. To get started quickly, Glimmer offers scaffolding options for Apps, Gems, and Custom Widgets. Glimmer also includes native-executable packaging support, sorely lacking in other libraries, thus enabling the delivery of desktop apps written in Ruby as truly native DMG/PKG/APP files on the Mac + App Store, MSI/EXE files on Windows, and Gem Packaged Shell Scripts on Linux.".freeze
|
16
16
|
s.email = "andy.am@gmail.com".freeze
|
17
17
|
s.executables = ["glimmer".freeze, "girb".freeze]
|
@@ -58,6 +58,7 @@ Gem::Specification.new do |s|
|
|
58
58
|
"lib/glimmer/data_binding/widget_binding.rb",
|
59
59
|
"lib/glimmer/dsl/swt/animation_expression.rb",
|
60
60
|
"lib/glimmer/dsl/swt/async_exec_expression.rb",
|
61
|
+
"lib/glimmer/dsl/swt/auto_exec_expression.rb",
|
61
62
|
"lib/glimmer/dsl/swt/bind_expression.rb",
|
62
63
|
"lib/glimmer/dsl/swt/block_property_expression.rb",
|
63
64
|
"lib/glimmer/dsl/swt/checkbox_group_selection_data_binding_expression.rb",
|
@@ -68,13 +69,11 @@ Gem::Specification.new do |s|
|
|
68
69
|
"lib/glimmer/dsl/swt/custom_widget_expression.rb",
|
69
70
|
"lib/glimmer/dsl/swt/data_binding_expression.rb",
|
70
71
|
"lib/glimmer/dsl/swt/dialog_expression.rb",
|
71
|
-
"lib/glimmer/dsl/swt/directory_dialog_expression.rb",
|
72
72
|
"lib/glimmer/dsl/swt/display_expression.rb",
|
73
73
|
"lib/glimmer/dsl/swt/dnd_expression.rb",
|
74
74
|
"lib/glimmer/dsl/swt/dsl.rb",
|
75
75
|
"lib/glimmer/dsl/swt/exec_expression.rb",
|
76
76
|
"lib/glimmer/dsl/swt/expand_item_expression.rb",
|
77
|
-
"lib/glimmer/dsl/swt/file_dialog_expression.rb",
|
78
77
|
"lib/glimmer/dsl/swt/font_expression.rb",
|
79
78
|
"lib/glimmer/dsl/swt/image_expression.rb",
|
80
79
|
"lib/glimmer/dsl/swt/layout_data_expression.rb",
|
@@ -115,12 +114,21 @@ Gem::Specification.new do |s|
|
|
115
114
|
"lib/glimmer/swt/custom/drawable.rb",
|
116
115
|
"lib/glimmer/swt/custom/radio_group.rb",
|
117
116
|
"lib/glimmer/swt/custom/shape.rb",
|
117
|
+
"lib/glimmer/swt/custom/shape/arc.rb",
|
118
|
+
"lib/glimmer/swt/custom/shape/focus.rb",
|
119
|
+
"lib/glimmer/swt/custom/shape/image.rb",
|
120
|
+
"lib/glimmer/swt/custom/shape/line.rb",
|
121
|
+
"lib/glimmer/swt/custom/shape/oval.rb",
|
122
|
+
"lib/glimmer/swt/custom/shape/point.rb",
|
123
|
+
"lib/glimmer/swt/custom/shape/polygon.rb",
|
124
|
+
"lib/glimmer/swt/custom/shape/polyline.rb",
|
125
|
+
"lib/glimmer/swt/custom/shape/rectangle.rb",
|
126
|
+
"lib/glimmer/swt/custom/shape/text.rb",
|
118
127
|
"lib/glimmer/swt/date_time_proxy.rb",
|
119
|
-
"lib/glimmer/swt/
|
128
|
+
"lib/glimmer/swt/dialog_proxy.rb",
|
120
129
|
"lib/glimmer/swt/display_proxy.rb",
|
121
130
|
"lib/glimmer/swt/dnd_proxy.rb",
|
122
131
|
"lib/glimmer/swt/expand_item_proxy.rb",
|
123
|
-
"lib/glimmer/swt/file_dialog_proxy.rb",
|
124
132
|
"lib/glimmer/swt/font_proxy.rb",
|
125
133
|
"lib/glimmer/swt/image_proxy.rb",
|
126
134
|
"lib/glimmer/swt/layout_data_proxy.rb",
|
@@ -129,6 +137,7 @@ Gem::Specification.new do |s|
|
|
129
137
|
"lib/glimmer/swt/message_box_proxy.rb",
|
130
138
|
"lib/glimmer/swt/packages.rb",
|
131
139
|
"lib/glimmer/swt/properties.rb",
|
140
|
+
"lib/glimmer/swt/proxy_properties.rb",
|
132
141
|
"lib/glimmer/swt/sash_form_proxy.rb",
|
133
142
|
"lib/glimmer/swt/scrolled_composite_proxy.rb",
|
134
143
|
"lib/glimmer/swt/shell_proxy.rb",
|
@@ -142,6 +151,7 @@ Gem::Specification.new do |s|
|
|
142
151
|
"lib/glimmer/swt/tree_proxy.rb",
|
143
152
|
"lib/glimmer/swt/widget_listener_proxy.rb",
|
144
153
|
"lib/glimmer/swt/widget_proxy.rb",
|
154
|
+
"lib/glimmer/ui.rb",
|
145
155
|
"lib/glimmer/ui/custom_shell.rb",
|
146
156
|
"lib/glimmer/ui/custom_widget.rb",
|
147
157
|
"lib/glimmer/util/proc_tracker.rb",
|
@@ -174,6 +184,7 @@ Gem::Specification.new do |s|
|
|
174
184
|
"samples/hello/hello_checkbox.rb",
|
175
185
|
"samples/hello/hello_checkbox_group.rb",
|
176
186
|
"samples/hello/hello_code_text.rb",
|
187
|
+
"samples/hello/hello_color_dialog.rb",
|
177
188
|
"samples/hello/hello_combo.rb",
|
178
189
|
"samples/hello/hello_computed.rb",
|
179
190
|
"samples/hello/hello_computed/contact.rb",
|
@@ -186,6 +197,7 @@ Gem::Specification.new do |s|
|
|
186
197
|
"samples/hello/hello_drag_and_drop.rb",
|
187
198
|
"samples/hello/hello_expand_bar.rb",
|
188
199
|
"samples/hello/hello_file_dialog.rb",
|
200
|
+
"samples/hello/hello_font_dialog.rb",
|
189
201
|
"samples/hello/hello_group.rb",
|
190
202
|
"samples/hello/hello_link.rb",
|
191
203
|
"samples/hello/hello_list_multi_selection.rb",
|
@@ -193,6 +205,7 @@ Gem::Specification.new do |s|
|
|
193
205
|
"samples/hello/hello_menu_bar.rb",
|
194
206
|
"samples/hello/hello_message_box.rb",
|
195
207
|
"samples/hello/hello_pop_up_context_menu.rb",
|
208
|
+
"samples/hello/hello_progress_bar.rb",
|
196
209
|
"samples/hello/hello_radio.rb",
|
197
210
|
"samples/hello/hello_radio_group.rb",
|
198
211
|
"samples/hello/hello_sash_form.rb",
|
@@ -201,6 +214,7 @@ Gem::Specification.new do |s|
|
|
201
214
|
"samples/hello/hello_tab.rb",
|
202
215
|
"samples/hello/hello_table.rb",
|
203
216
|
"samples/hello/hello_table/baseball_park.png",
|
217
|
+
"samples/hello/hello_tree.rb",
|
204
218
|
"samples/hello/hello_world.rb",
|
205
219
|
"vendor/swt/linux/swt.jar",
|
206
220
|
"vendor/swt/mac/swt.jar",
|
@@ -216,12 +230,11 @@ Gem::Specification.new do |s|
|
|
216
230
|
s.specification_version = 4
|
217
231
|
|
218
232
|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
219
|
-
s.add_runtime_dependency(%q<glimmer>.freeze, ["~> 1.1.
|
233
|
+
s.add_runtime_dependency(%q<glimmer>.freeze, ["~> 1.1.2"])
|
220
234
|
s.add_runtime_dependency(%q<super_module>.freeze, [">= 1.4.1", "< 2.0.0"])
|
221
235
|
s.add_runtime_dependency(%q<nested_inherited_jruby_include_package>.freeze, [">= 0.3.0", "< 2.0.0"])
|
222
236
|
s.add_runtime_dependency(%q<puts_debuggerer>.freeze, [">= 0.11.0", "< 2.0.0"])
|
223
237
|
s.add_runtime_dependency(%q<rake-tui>.freeze, [">= 0.2.3", "< 2.0.0"])
|
224
|
-
s.add_runtime_dependency(%q<git>.freeze, ["= 1.8.1"])
|
225
238
|
s.add_runtime_dependency(%q<logging>.freeze, [">= 2.3.0", "< 3.0.0"])
|
226
239
|
s.add_runtime_dependency(%q<os>.freeze, [">= 1.0.0", "< 2.0.0"])
|
227
240
|
s.add_runtime_dependency(%q<rake>.freeze, [">= 10.1.0", "< 14.0.0"])
|
@@ -235,12 +248,11 @@ Gem::Specification.new do |s|
|
|
235
248
|
s.add_development_dependency(%q<simplecov>.freeze, ["~> 0.16.1"])
|
236
249
|
s.add_development_dependency(%q<simplecov-lcov>.freeze, ["~> 0.7.0"])
|
237
250
|
else
|
238
|
-
s.add_dependency(%q<glimmer>.freeze, ["~> 1.1.
|
251
|
+
s.add_dependency(%q<glimmer>.freeze, ["~> 1.1.2"])
|
239
252
|
s.add_dependency(%q<super_module>.freeze, [">= 1.4.1", "< 2.0.0"])
|
240
253
|
s.add_dependency(%q<nested_inherited_jruby_include_package>.freeze, [">= 0.3.0", "< 2.0.0"])
|
241
254
|
s.add_dependency(%q<puts_debuggerer>.freeze, [">= 0.11.0", "< 2.0.0"])
|
242
255
|
s.add_dependency(%q<rake-tui>.freeze, [">= 0.2.3", "< 2.0.0"])
|
243
|
-
s.add_dependency(%q<git>.freeze, ["= 1.8.1"])
|
244
256
|
s.add_dependency(%q<logging>.freeze, [">= 2.3.0", "< 3.0.0"])
|
245
257
|
s.add_dependency(%q<os>.freeze, [">= 1.0.0", "< 2.0.0"])
|
246
258
|
s.add_dependency(%q<rake>.freeze, [">= 10.1.0", "< 14.0.0"])
|
@@ -255,12 +267,11 @@ Gem::Specification.new do |s|
|
|
255
267
|
s.add_dependency(%q<simplecov-lcov>.freeze, ["~> 0.7.0"])
|
256
268
|
end
|
257
269
|
else
|
258
|
-
s.add_dependency(%q<glimmer>.freeze, ["~> 1.1.
|
270
|
+
s.add_dependency(%q<glimmer>.freeze, ["~> 1.1.2"])
|
259
271
|
s.add_dependency(%q<super_module>.freeze, [">= 1.4.1", "< 2.0.0"])
|
260
272
|
s.add_dependency(%q<nested_inherited_jruby_include_package>.freeze, [">= 0.3.0", "< 2.0.0"])
|
261
273
|
s.add_dependency(%q<puts_debuggerer>.freeze, [">= 0.11.0", "< 2.0.0"])
|
262
274
|
s.add_dependency(%q<rake-tui>.freeze, [">= 0.2.3", "< 2.0.0"])
|
263
|
-
s.add_dependency(%q<git>.freeze, ["= 1.8.1"])
|
264
275
|
s.add_dependency(%q<logging>.freeze, [">= 2.3.0", "< 3.0.0"])
|
265
276
|
s.add_dependency(%q<os>.freeze, [">= 1.0.0", "< 2.0.0"])
|
266
277
|
s.add_dependency(%q<rake>.freeze, [">= 10.1.0", "< 14.0.0"])
|
data/lib/ext/glimmer/config.rb
CHANGED
@@ -32,8 +32,7 @@ module Glimmer
|
|
32
32
|
'org.eclipse.swt.custom',
|
33
33
|
'org.eclipse.swt.dnd',
|
34
34
|
]
|
35
|
-
DEFAULT_AUTO_SYNC_EXEC =
|
36
|
-
GUI_THREAD = Thread.current
|
35
|
+
DEFAULT_AUTO_SYNC_EXEC = true
|
37
36
|
|
38
37
|
class << self
|
39
38
|
# Tells Glimmer to import SWT packages into including class (default: true)
|
@@ -59,10 +58,6 @@ module Glimmer
|
|
59
58
|
end
|
60
59
|
alias auto_sync_exec? auto_sync_exec
|
61
60
|
|
62
|
-
def require_sync_exec?
|
63
|
-
Thread.current != GUI_THREAD
|
64
|
-
end
|
65
|
-
|
66
61
|
# Returns Logging Devices. Default is [:stdout, :syslog]
|
67
62
|
def logging_devices
|
68
63
|
unless defined? @@logging_devices
|
@@ -147,9 +142,10 @@ end
|
|
147
142
|
Glimmer::Config.reset_logger! unless ENV['GLIMMER_LOGGER_ENABLED'].to_s.downcase == 'false'
|
148
143
|
if ENV['GLIMMER_LOGGER_LEVEL']
|
149
144
|
# if glimmer log level is being overridden for debugging purposes, then disable async logging making logging immediate
|
150
|
-
Glimmer::Config.logging_appender_options = Glimmer::Config.logging_appender_options.merge(async: false, auto_flushing: 1)
|
145
|
+
Glimmer::Config.logging_appender_options = Glimmer::Config.logging_appender_options.merge(async: false, auto_flushing: 1, immediate_at: [:unknown, :debug, :info, :error, :fatal])
|
151
146
|
Glimmer::Config.logging_devices = [:stdout]
|
152
147
|
begin
|
148
|
+
puts "Adjusting Glimmer logging level to #{ENV['GLIMMER_LOGGER_LEVEL']}"
|
153
149
|
Glimmer::Config.logger.level = ENV['GLIMMER_LOGGER_LEVEL'].strip
|
154
150
|
rescue => e
|
155
151
|
puts e.message
|
@@ -1,5 +1,5 @@
|
|
1
1
|
# Copyright (c) 2007-2021 Andy Maleh
|
2
|
-
#
|
2
|
+
#
|
3
3
|
# Permission is hereby granted, free of charge, to any person obtaining
|
4
4
|
# a copy of this software and associated documentation files (the
|
5
5
|
# "Software"), to deal in the Software without restriction, including
|
@@ -7,10 +7,10 @@
|
|
7
7
|
# distribute, sublicense, and/or sell copies of the Software, and to
|
8
8
|
# permit persons to whom the Software is furnished to do so, subject to
|
9
9
|
# the following conditions:
|
10
|
-
#
|
10
|
+
#
|
11
11
|
# The above copyright notice and this permission notice shall be
|
12
12
|
# included in all copies or substantial portions of the Software.
|
13
|
-
#
|
13
|
+
#
|
14
14
|
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
15
|
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
16
|
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
@@ -50,17 +50,23 @@ module Glimmer
|
|
50
50
|
# Initialize with list widget and property_type
|
51
51
|
# property_type :string represents default list single selection
|
52
52
|
# property_type :array represents list multi selection
|
53
|
-
def initialize(widget_proxy, property_type)
|
53
|
+
def initialize(widget_proxy, property_type, sync_exec: false, async_exec: false)
|
54
54
|
property_type = :string if property_type.nil? or property_type == :undefined
|
55
55
|
@widget_proxy = widget_proxy
|
56
56
|
@property_type = property_type
|
57
|
-
@
|
58
|
-
|
57
|
+
@sync_exec = sync_exec
|
58
|
+
@async_exec = async_exec
|
59
|
+
Glimmer::SWT::DisplayProxy.instance.auto_exec(override_sync_exec: @sync_exec, override_async_exec: @async_exec) do
|
60
|
+
@widget_proxy.on_widget_disposed do |dispose_event|
|
61
|
+
unregister_all_observables
|
62
|
+
end
|
59
63
|
end
|
60
64
|
end
|
61
65
|
|
62
66
|
def call(value)
|
63
|
-
|
67
|
+
Glimmer::SWT::DisplayProxy.instance.auto_exec(override_sync_exec: @sync_exec, override_async_exec: @async_exec) do
|
68
|
+
PROPERTY_TYPE_UPDATERS[@property_type].call(@widget_proxy, value) unless evaluate_property == value
|
69
|
+
end
|
64
70
|
end
|
65
71
|
|
66
72
|
def evaluate_property
|
@@ -24,6 +24,7 @@ require 'glimmer/data_binding/observable_model'
|
|
24
24
|
require 'glimmer/data_binding/observable'
|
25
25
|
require 'glimmer/data_binding/observer'
|
26
26
|
require 'glimmer/swt/swt_proxy'
|
27
|
+
require 'glimmer/swt/display_proxy'
|
27
28
|
|
28
29
|
module Glimmer
|
29
30
|
module DataBinding
|
@@ -37,33 +38,37 @@ module Glimmer
|
|
37
38
|
@table = parent
|
38
39
|
@model_binding = model_binding
|
39
40
|
@read_only_sort = @model_binding.binding_options[:read_only_sort]
|
40
|
-
@table.swt_widget.data = @model_binding
|
41
|
-
@table.swt_widget.set_data('table_items_binding', self)
|
42
41
|
@column_properties = column_properties
|
43
|
-
@table.on_widget_disposed do |dispose_event|
|
44
|
-
unregister_all_observables
|
45
|
-
end
|
46
42
|
if @table.respond_to?(:column_properties=)
|
47
43
|
@table.column_properties = @column_properties
|
48
44
|
else # assume custom widget
|
49
45
|
@table.body_root.column_properties = @column_properties
|
50
46
|
end
|
51
|
-
@
|
52
|
-
|
47
|
+
Glimmer::SWT::DisplayProxy.instance.auto_exec(override_sync_exec: @model_binding.binding_options[:sync_exec], override_async_exec: @model_binding.binding_options[:async_exec]) do
|
48
|
+
@table.swt_widget.data = @model_binding
|
49
|
+
@table.swt_widget.set_data('table_items_binding', self)
|
50
|
+
@table.on_widget_disposed do |dispose_event|
|
51
|
+
unregister_all_observables
|
52
|
+
end
|
53
|
+
@table_observer_registration = observe(model_binding)
|
54
|
+
call
|
55
|
+
end
|
53
56
|
end
|
54
57
|
|
55
58
|
def call(new_model_collection=nil, internal_sort: false)
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
59
|
+
Glimmer::SWT::DisplayProxy.instance.auto_exec(override_sync_exec: @model_binding.binding_options[:sync_exec], override_async_exec: @model_binding.binding_options[:async_exec]) do
|
60
|
+
new_model_collection = model_binding_evaluated_property = @model_binding.evaluate_property unless internal_sort # this ensures applying converters (e.g. :on_read)
|
61
|
+
table_cells = @table.swt_widget.items.map {|item| @table.column_properties.size.times.map {|i| item.get_text(i)} }
|
62
|
+
model_cells = new_model_collection.to_a.map {|m| @table.cells_for(m)}
|
63
|
+
return if table_cells == model_cells
|
64
|
+
if new_model_collection and new_model_collection.is_a?(Array)
|
65
|
+
@table_items_observer_registration&.unobserve
|
66
|
+
@table_items_observer_registration = observe(new_model_collection, @column_properties)
|
67
|
+
add_dependent(@table_observer_registration => @table_items_observer_registration)
|
68
|
+
@model_collection = new_model_collection
|
69
|
+
end
|
70
|
+
populate_table(@model_collection, @table, @column_properties, internal_sort: internal_sort)
|
65
71
|
end
|
66
|
-
populate_table(@model_collection, @table, @column_properties, internal_sort: internal_sort)
|
67
72
|
end
|
68
73
|
|
69
74
|
def populate_table(model_collection, parent, column_properties, internal_sort: false)
|
@@ -43,29 +43,33 @@ module Glimmer
|
|
43
43
|
else # assume custom widget
|
44
44
|
@tree.body_root.tree_properties = @tree_properties
|
45
45
|
end
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
46
|
+
Glimmer::SWT::DisplayProxy.instance.auto_exec(override_sync_exec: @model_binding.binding_options[:sync_exec], override_async_exec: @model_binding.binding_options[:async_exec]) do
|
47
|
+
call
|
48
|
+
model = model_binding.base_model
|
49
|
+
observe(model, model_binding.property_name_expression)
|
50
|
+
@tree.on_widget_disposed do |dispose_event|
|
51
|
+
unregister_all_observables
|
52
|
+
end
|
51
53
|
end
|
52
54
|
end
|
53
55
|
|
54
56
|
def call(new_value=nil)
|
55
|
-
@
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
57
|
+
Glimmer::SWT::DisplayProxy.instance.auto_exec(override_sync_exec: @model_binding.binding_options[:sync_exec], override_async_exec: @model_binding.binding_options[:async_exec]) do
|
58
|
+
@model_tree_root_node = @model_binding.evaluate_property
|
59
|
+
old_tree_items = @tree.all_tree_items
|
60
|
+
old_model_tree_nodes = old_tree_items.map(&:get_data)
|
61
|
+
new_model_tree_nodes = []
|
62
|
+
recursive_depth_first_search(@model_tree_root_node, @tree_properties, new_model_tree_nodes)
|
63
|
+
return if old_model_tree_nodes == new_model_tree_nodes && old_tree_items.map(&:text) == new_model_tree_nodes.map {|model_tree_node| model_tree_node.send(@tree_properties[:text])}
|
64
|
+
populate_tree(@model_tree_root_node, @tree, @tree_properties)
|
65
|
+
end
|
62
66
|
end
|
63
67
|
|
64
68
|
def populate_tree(model_tree_root_node, parent, tree_properties)
|
65
69
|
# TODO get rid of model_tree_root_node, parent, tree_properties as an argument given it is stored as an instance variable
|
66
70
|
# TODO make it change things by delta instead of removing all
|
67
71
|
old_tree_items = parent.all_tree_items
|
68
|
-
|
72
|
+
selected_tree_item_models = parent.swt_widget.getSelection.map(&:get_data)
|
69
73
|
old_tree_item_expansion_by_data = old_tree_items.reduce({}) {|hash, ti| hash.merge(ti.getData => ti.getExpanded)}
|
70
74
|
old_tree_items.each do |tree_item|
|
71
75
|
tree_item.getData('observer_registrations').each(&:unregister)
|
@@ -74,8 +78,8 @@ module Glimmer
|
|
74
78
|
parent.swt_widget.removeAll
|
75
79
|
populate_tree_node(model_tree_root_node, parent.swt_widget, tree_properties)
|
76
80
|
parent.all_tree_items.each { |ti| ti.setExpanded(!!old_tree_item_expansion_by_data[ti.getData]) }
|
77
|
-
|
78
|
-
parent.swt_widget.setSelection(
|
81
|
+
selected_tree_items = parent.depth_first_search {|item| selected_tree_item_models.include?(item.get_data) }
|
82
|
+
parent.swt_widget.setSelection(selected_tree_items)
|
79
83
|
end
|
80
84
|
|
81
85
|
def populate_tree_node(model_tree_node, parent, tree_properties)
|