glimmer-dsl-swt 4.18.4.0 → 4.18.4.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (167) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +46 -0
  3. data/LICENSE.txt +20 -20
  4. data/README.md +84 -5078
  5. data/RUBY_VERSION +1 -1
  6. data/VERSION +1 -1
  7. data/bin/girb +31 -31
  8. data/bin/girb_runner.rb +34 -34
  9. data/bin/glimmer +26 -26
  10. data/docs/reference/GLIMMER_COMMAND.md +591 -0
  11. data/docs/reference/GLIMMER_CONFIGURATION.md +183 -0
  12. data/docs/reference/GLIMMER_GIRB.md +30 -0
  13. data/docs/reference/GLIMMER_GUI_DSL_SYNTAX.md +3251 -0
  14. data/docs/reference/GLIMMER_PACKAGING_AND_DISTRIBUTION.md +202 -0
  15. data/docs/reference/GLIMMER_SAMPLES.md +676 -0
  16. data/docs/reference/GLIMMER_STYLE_GUIDE.md +14 -0
  17. data/glimmer-dsl-swt.gemspec +16 -8
  18. data/lib/ext/glimmer.rb +41 -41
  19. data/lib/ext/glimmer/config.rb +167 -167
  20. data/lib/ext/rouge/themes/glimmer.rb +29 -29
  21. data/lib/glimmer-dsl-swt.rb +44 -44
  22. data/lib/glimmer/Rakefile +26 -26
  23. data/lib/glimmer/data_binding/list_selection_binding.rb +72 -72
  24. data/lib/glimmer/data_binding/observable_widget.rb +38 -38
  25. data/lib/glimmer/data_binding/shine.rb +44 -44
  26. data/lib/glimmer/data_binding/table_items_binding.rb +89 -89
  27. data/lib/glimmer/data_binding/tree_items_binding.rb +108 -108
  28. data/lib/glimmer/data_binding/widget_binding.rb +73 -73
  29. data/lib/glimmer/dsl/swt/animation_expression.rb +43 -43
  30. data/lib/glimmer/dsl/swt/async_exec_expression.rb +35 -35
  31. data/lib/glimmer/dsl/swt/bind_expression.rb +58 -58
  32. data/lib/glimmer/dsl/swt/block_property_expression.rb +41 -41
  33. data/lib/glimmer/dsl/swt/checkbox_group_selection_data_binding_expression.rb +61 -61
  34. data/lib/glimmer/dsl/swt/color_expression.rb +40 -40
  35. data/lib/glimmer/dsl/swt/column_properties_expression.rb +45 -45
  36. data/lib/glimmer/dsl/swt/combo_selection_data_binding_expression.rb +67 -67
  37. data/lib/glimmer/dsl/swt/cursor_expression.rb +44 -44
  38. data/lib/glimmer/dsl/swt/custom_widget_expression.rb +3 -3
  39. data/lib/glimmer/dsl/swt/data_binding_expression.rb +55 -55
  40. data/lib/glimmer/dsl/swt/dialog_expression.rb +48 -48
  41. data/lib/glimmer/dsl/swt/directory_dialog_expression.rb +48 -48
  42. data/lib/glimmer/dsl/swt/display_expression.rb +40 -40
  43. data/lib/glimmer/dsl/swt/dnd_expression.rb +46 -46
  44. data/lib/glimmer/dsl/swt/dsl.rb +63 -63
  45. data/lib/glimmer/dsl/swt/exec_expression.rb +1 -1
  46. data/lib/glimmer/dsl/swt/expand_item_expression.rb +60 -60
  47. data/lib/glimmer/dsl/swt/file_dialog_expression.rb +48 -48
  48. data/lib/glimmer/dsl/swt/font_expression.rb +49 -49
  49. data/lib/glimmer/dsl/swt/image_expression.rb +50 -50
  50. data/lib/glimmer/dsl/swt/layout_data_expression.rb +46 -46
  51. data/lib/glimmer/dsl/swt/layout_expression.rb +50 -50
  52. data/lib/glimmer/dsl/swt/list_selection_data_binding_expression.rb +65 -65
  53. data/lib/glimmer/dsl/swt/menu_bar_expression.rb +54 -54
  54. data/lib/glimmer/dsl/swt/menu_expression.rb +53 -53
  55. data/lib/glimmer/dsl/swt/message_box_expression.rb +54 -54
  56. data/lib/glimmer/dsl/swt/multiply_expression.rb +53 -53
  57. data/lib/glimmer/dsl/swt/observe_expression.rb +8 -5
  58. data/lib/glimmer/dsl/swt/property_expression.rb +46 -46
  59. data/lib/glimmer/dsl/swt/radio_group_selection_data_binding_expression.rb +61 -61
  60. data/lib/glimmer/dsl/swt/rgb_expression.rb +33 -33
  61. data/lib/glimmer/dsl/swt/rgba_expression.rb +33 -33
  62. data/lib/glimmer/dsl/swt/shape_expression.rb +54 -54
  63. data/lib/glimmer/dsl/swt/shell_expression.rb +46 -46
  64. data/lib/glimmer/dsl/swt/swt_expression.rb +46 -46
  65. data/lib/glimmer/dsl/swt/sync_exec_expression.rb +36 -36
  66. data/lib/glimmer/dsl/swt/tab_item_expression.rb +54 -54
  67. data/lib/glimmer/dsl/swt/table_items_data_binding_expression.rb +52 -52
  68. data/lib/glimmer/dsl/swt/timer_exec_expression.rb +35 -0
  69. data/lib/glimmer/dsl/swt/transform_expression.rb +55 -55
  70. data/lib/glimmer/dsl/swt/tree_items_data_binding_expression.rb +52 -52
  71. data/lib/glimmer/dsl/swt/tree_properties_expression.rb +47 -47
  72. data/lib/glimmer/dsl/swt/widget_expression.rb +66 -66
  73. data/lib/glimmer/dsl/swt/widget_listener_expression.rb +53 -53
  74. data/lib/glimmer/rake_task.rb +220 -220
  75. data/lib/glimmer/rake_task/list.rb +97 -97
  76. data/lib/glimmer/rake_task/package.rb +139 -139
  77. data/lib/glimmer/rake_task/scaffold.rb +765 -765
  78. data/lib/glimmer/swt/color_proxy.rb +107 -107
  79. data/lib/glimmer/swt/cursor_proxy.rb +66 -66
  80. data/lib/glimmer/swt/custom/animation.rb +12 -8
  81. data/lib/glimmer/swt/custom/checkbox_group.rb +181 -181
  82. data/lib/glimmer/swt/custom/code_text.rb +62 -28
  83. data/lib/glimmer/swt/custom/drawable.rb +49 -49
  84. data/lib/glimmer/swt/custom/radio_group.rb +176 -176
  85. data/lib/glimmer/swt/custom/shape.rb +5 -3
  86. data/lib/glimmer/swt/date_time_proxy.rb +85 -85
  87. data/lib/glimmer/swt/directory_dialog_proxy.rb +65 -65
  88. data/lib/glimmer/swt/display_proxy.rb +11 -10
  89. data/lib/glimmer/swt/dnd_proxy.rb +51 -51
  90. data/lib/glimmer/swt/expand_item_proxy.rb +97 -97
  91. data/lib/glimmer/swt/file_dialog_proxy.rb +66 -66
  92. data/lib/glimmer/swt/font_proxy.rb +94 -94
  93. data/lib/glimmer/swt/image_proxy.rb +184 -184
  94. data/lib/glimmer/swt/layout_data_proxy.rb +105 -105
  95. data/lib/glimmer/swt/layout_proxy.rb +112 -109
  96. data/lib/glimmer/swt/menu_proxy.rb +126 -126
  97. data/lib/glimmer/swt/message_box_proxy.rb +89 -89
  98. data/lib/glimmer/swt/packages.rb +37 -37
  99. data/lib/glimmer/swt/properties.rb +49 -49
  100. data/lib/glimmer/swt/sash_form_proxy.rb +53 -53
  101. data/lib/glimmer/swt/scrolled_composite_proxy.rb +37 -37
  102. data/lib/glimmer/swt/shell_proxy.rb +1 -1
  103. data/lib/glimmer/swt/style_constantizable.rb +157 -157
  104. data/lib/glimmer/swt/styled_text_proxy.rb +38 -38
  105. data/lib/glimmer/swt/swt_proxy.rb +59 -59
  106. data/lib/glimmer/swt/tab_item_proxy.rb +91 -91
  107. data/lib/glimmer/swt/table_column_proxy.rb +57 -57
  108. data/lib/glimmer/swt/table_proxy.rb +2 -2
  109. data/lib/glimmer/swt/transform_proxy.rb +109 -109
  110. data/lib/glimmer/swt/tree_proxy.rb +145 -145
  111. data/lib/glimmer/swt/widget_listener_proxy.rb +64 -64
  112. data/lib/glimmer/swt/widget_proxy.rb +14 -4
  113. data/lib/glimmer/ui/custom_shell.rb +82 -82
  114. data/lib/glimmer/ui/custom_widget.rb +17 -0
  115. data/lib/glimmer/util/proc_tracker.rb +39 -39
  116. data/samples/elaborate/contact_manager.rb +142 -142
  117. data/samples/elaborate/contact_manager/contact.rb +32 -32
  118. data/samples/elaborate/contact_manager/contact_manager_presenter.rb +47 -47
  119. data/samples/elaborate/contact_manager/contact_repository.rb +169 -169
  120. data/samples/elaborate/login.rb +123 -123
  121. data/samples/elaborate/meta_sample.rb +15 -4
  122. data/samples/elaborate/tetris.rb +14 -17
  123. data/samples/elaborate/tetris/model/block.rb +48 -48
  124. data/samples/elaborate/tetris/model/game.rb +1 -2
  125. data/samples/elaborate/tetris/model/past_game.rb +39 -39
  126. data/samples/elaborate/tetris/view/high_score_dialog.rb +0 -7
  127. data/samples/elaborate/tetris/view/playfield.rb +1 -1
  128. data/samples/elaborate/tetris/view/tetris_menu_bar.rb +13 -11
  129. data/samples/elaborate/tic_tac_toe.rb +76 -76
  130. data/samples/elaborate/tic_tac_toe/board.rb +145 -145
  131. data/samples/elaborate/tic_tac_toe/cell.rb +48 -48
  132. data/samples/elaborate/user_profile.rb +76 -76
  133. data/samples/hello/hello_browser.rb +31 -31
  134. data/samples/hello/hello_button.rb +46 -46
  135. data/samples/hello/hello_canvas.rb +64 -64
  136. data/samples/hello/hello_canvas_transform.rb +1 -1
  137. data/samples/hello/hello_checkbox.rb +85 -85
  138. data/samples/hello/hello_checkbox_group.rb +71 -71
  139. data/samples/hello/hello_code_text.rb +104 -92
  140. data/samples/hello/hello_combo.rb +63 -63
  141. data/samples/hello/hello_computed.rb +96 -96
  142. data/samples/hello/hello_computed/contact.rb +42 -42
  143. data/samples/hello/hello_custom_shell.rb +155 -155
  144. data/samples/hello/hello_custom_widget.rb +86 -86
  145. data/samples/hello/hello_date_time.rb +63 -63
  146. data/samples/hello/hello_dialog.rb +78 -78
  147. data/samples/hello/hello_directory_dialog.rb +60 -60
  148. data/samples/hello/hello_drag_and_drop.rb +50 -50
  149. data/samples/hello/hello_expand_bar.rb +110 -110
  150. data/samples/hello/hello_file_dialog.rb +60 -60
  151. data/samples/hello/hello_group.rb +104 -104
  152. data/samples/hello/hello_link.rb +80 -80
  153. data/samples/hello/hello_list_multi_selection.rb +74 -74
  154. data/samples/hello/hello_list_single_selection.rb +59 -59
  155. data/samples/hello/hello_menu_bar.rb +241 -241
  156. data/samples/hello/hello_message_box.rb +37 -37
  157. data/samples/hello/hello_pop_up_context_menu.rb +84 -84
  158. data/samples/hello/hello_radio.rb +108 -108
  159. data/samples/hello/hello_radio_group.rb +87 -87
  160. data/samples/hello/hello_sash_form.rb +137 -137
  161. data/samples/hello/hello_spinner.rb +69 -69
  162. data/samples/hello/hello_styled_text.rb +138 -138
  163. data/samples/hello/hello_tab.rb +50 -50
  164. data/samples/hello/hello_table.rb +1 -0
  165. data/samples/hello/hello_world.rb +29 -29
  166. metadata +13 -5
  167. data/samples/elaborate/meta_sample/meta_sample_logo.png +0 -0
data/RUBY_VERSION CHANGED
@@ -1 +1 @@
1
- jruby-9.2.14.0
1
+ jruby-9.2.14.0
data/VERSION CHANGED
@@ -1 +1 @@
1
- 4.18.4.0
1
+ 4.18.4.5
data/bin/girb CHANGED
@@ -1,31 +1,31 @@
1
- #!/usr/bin/env jruby
2
-
3
- # Copyright (c) 2007-2021 Andy Maleh
4
- #
5
- # Permission is hereby granted, free of charge, to any person obtaining
6
- # a copy of this software and associated documentation files (the
7
- # "Software"), to deal in the Software without restriction, including
8
- # without limitation the rights to use, copy, modify, merge, publish,
9
- # distribute, sublicense, and/or sell copies of the Software, and to
10
- # permit persons to whom the Software is furnished to do so, subject to
11
- # the following conditions:
12
- #
13
- # The above copyright notice and this permission notice shall be
14
- # included in all copies or substantial portions of the Software.
15
- #
16
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
- # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
- # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
- # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
- # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
- # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
- # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23
-
24
- trap "SIGINT" do
25
- # No Op for irb
26
- end
27
-
28
- require_relative '../lib/glimmer/launcher'
29
-
30
- girb_runner = File.expand_path('../girb_runner.rb', __FILE__)
31
- Glimmer::Launcher.new(["irb -r #{girb_runner}"] + ARGV).launch
1
+ #!/usr/bin/env jruby
2
+
3
+ # Copyright (c) 2007-2021 Andy Maleh
4
+ #
5
+ # Permission is hereby granted, free of charge, to any person obtaining
6
+ # a copy of this software and associated documentation files (the
7
+ # "Software"), to deal in the Software without restriction, including
8
+ # without limitation the rights to use, copy, modify, merge, publish,
9
+ # distribute, sublicense, and/or sell copies of the Software, and to
10
+ # permit persons to whom the Software is furnished to do so, subject to
11
+ # the following conditions:
12
+ #
13
+ # The above copyright notice and this permission notice shall be
14
+ # included in all copies or substantial portions of the Software.
15
+ #
16
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23
+
24
+ trap "SIGINT" do
25
+ # No Op for irb
26
+ end
27
+
28
+ require_relative '../lib/glimmer/launcher'
29
+
30
+ girb_runner = File.expand_path('../girb_runner.rb', __FILE__)
31
+ Glimmer::Launcher.new(["irb -r #{girb_runner}"] + ARGV).launch
data/bin/girb_runner.rb CHANGED
@@ -1,34 +1,34 @@
1
- # Copyright (c) 2007-2021 Andy Maleh
2
- #
3
- # Permission is hereby granted, free of charge, to any person obtaining
4
- # a copy of this software and associated documentation files (the
5
- # "Software"), to deal in the Software without restriction, including
6
- # without limitation the rights to use, copy, modify, merge, publish,
7
- # distribute, sublicense, and/or sell copies of the Software, and to
8
- # permit persons to whom the Software is furnished to do so, subject to
9
- # the following conditions:
10
- #
11
- # The above copyright notice and this permission notice shall be
12
- # included in all copies or substantial portions of the Software.
13
- #
14
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
- # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
- # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
- # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
- # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
- # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
- # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21
-
22
- require 'puts_debuggerer'
23
-
24
- include Glimmer
25
-
26
- # Hijack Shell#start_event_loop default behavior to ensure disposing a display upon closing a shell inside girb
27
-
28
- Glimmer::SWT::ShellProxy.class_eval do
29
- alias start_event_loop_original start_event_loop
30
- def start_event_loop
31
- start_event_loop_original
32
- Glimmer::SWT::DisplayProxy.instance.dispose
33
- end
34
- end
1
+ # Copyright (c) 2007-2021 Andy Maleh
2
+ #
3
+ # Permission is hereby granted, free of charge, to any person obtaining
4
+ # a copy of this software and associated documentation files (the
5
+ # "Software"), to deal in the Software without restriction, including
6
+ # without limitation the rights to use, copy, modify, merge, publish,
7
+ # distribute, sublicense, and/or sell copies of the Software, and to
8
+ # permit persons to whom the Software is furnished to do so, subject to
9
+ # the following conditions:
10
+ #
11
+ # The above copyright notice and this permission notice shall be
12
+ # included in all copies or substantial portions of the Software.
13
+ #
14
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21
+
22
+ require 'puts_debuggerer'
23
+
24
+ include Glimmer
25
+
26
+ # Hijack Shell#start_event_loop default behavior to ensure disposing a display upon closing a shell inside girb
27
+
28
+ Glimmer::SWT::ShellProxy.class_eval do
29
+ alias start_event_loop_original start_event_loop
30
+ def start_event_loop
31
+ start_event_loop_original
32
+ Glimmer::SWT::DisplayProxy.instance.dispose
33
+ end
34
+ end
data/bin/glimmer CHANGED
@@ -1,26 +1,26 @@
1
- #!/usr/bin/env jruby
2
-
3
- # Copyright (c) 2007-2021 Andy Maleh
4
- #
5
- # Permission is hereby granted, free of charge, to any person obtaining
6
- # a copy of this software and associated documentation files (the
7
- # "Software"), to deal in the Software without restriction, including
8
- # without limitation the rights to use, copy, modify, merge, publish,
9
- # distribute, sublicense, and/or sell copies of the Software, and to
10
- # permit persons to whom the Software is furnished to do so, subject to
11
- # the following conditions:
12
- #
13
- # The above copyright notice and this permission notice shall be
14
- # included in all copies or substantial portions of the Software.
15
- #
16
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
- # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
- # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
- # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
- # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
- # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
- # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23
-
24
- require_relative '../lib/glimmer/launcher'
25
-
26
- Glimmer::Launcher.new(ARGV).launch
1
+ #!/usr/bin/env jruby
2
+
3
+ # Copyright (c) 2007-2021 Andy Maleh
4
+ #
5
+ # Permission is hereby granted, free of charge, to any person obtaining
6
+ # a copy of this software and associated documentation files (the
7
+ # "Software"), to deal in the Software without restriction, including
8
+ # without limitation the rights to use, copy, modify, merge, publish,
9
+ # distribute, sublicense, and/or sell copies of the Software, and to
10
+ # permit persons to whom the Software is furnished to do so, subject to
11
+ # the following conditions:
12
+ #
13
+ # The above copyright notice and this permission notice shall be
14
+ # included in all copies or substantial portions of the Software.
15
+ #
16
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23
+
24
+ require_relative '../lib/glimmer/launcher'
25
+
26
+ Glimmer::Launcher.new(ARGV).launch
@@ -0,0 +1,591 @@
1
+ ## Glimmer Command
2
+
3
+ The `glimmer` command allows you to run, scaffold, package, and list Glimmer applications/gems.
4
+
5
+ You can bring up usage instructions by running the `glimmer` command without arguments:
6
+
7
+ ```
8
+ glimmer
9
+ ```
10
+
11
+ 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)).
12
+
13
+ On Windows, it simply lists the available Glimmer tasks at the end (courtsey of [rake](https://github.com/ruby/rake)).
14
+
15
+ If you are new to Glimmer, you may read the Basic Usage section and skip the rest until you have gone through [Girb (Glimmer irb) Command](#girb-glimmer-irb-command), [Glimmer GUI DSL Syntax](#glimmer-gui-dsl-syntax), and [Samples](#samples).
16
+
17
+ Note: If you encounter an issue running the `glimmer` command, run `bundle exec glimmer` instead.
18
+
19
+ ### Basic Usage
20
+
21
+ ```
22
+ glimmer application.rb
23
+ ```
24
+
25
+ Runs a Glimmer application using JRuby, automatically preloading
26
+ the glimmer ruby gem and SWT jar dependency.
27
+
28
+ Run Glimmer samples with:
29
+
30
+ ```
31
+ glimmer samples
32
+ ```
33
+ This brings up the [Glimmer Meta-Sample (The Sample of Samples)](#samples)
34
+
35
+ If you cloned this project locally instead of installing the gem, run `bin/glimmer` instead.
36
+
37
+ Example:
38
+ ```
39
+ bin/glimmer samples
40
+ ```
41
+
42
+ ### Advanced Usage
43
+
44
+ Below are the full usage instructions that come up when running `glimmer` without args.
45
+
46
+ ```
47
+ Glimmer (JRuby Desktop Development GUI Framework) - JRuby Gem: glimmer-dsl-swt v4.18.4.4
48
+
49
+ Usage: glimmer [--bundler] [--pd] [--quiet] [--debug] [--log-level=VALUE] [[ENV_VAR=VALUE]...] [[-jruby-option]...] (application.rb or task[task_args]) [[application2.rb]...]
50
+
51
+ Runs Glimmer applications and tasks.
52
+
53
+ When applications are specified, they are run using JRuby,
54
+ automatically preloading the glimmer Ruby gem and SWT jar dependency.
55
+
56
+ Optionally, extra Glimmer options, JRuby options, and/or environment variables may be passed in.
57
+
58
+ Glimmer options:
59
+ - "--bundler=GROUP" : Activates gems in Bundler default group in Gemfile
60
+ - "--pd=BOOLEAN" : Requires puts_debuggerer to enable pd method
61
+ - "--quiet=BOOLEAN" : Does not announce file path of Glimmer application being launched
62
+ - "--debug" : Displays extra debugging information, passes "--debug" to JRuby, and enables debug logging
63
+ - "--log-level=VALUE" : Sets Glimmer's Ruby logger level ("ERROR" / "WARN" / "INFO" / "DEBUG"; default is none)
64
+
65
+ Tasks are run via rake. Some tasks take arguments in square brackets.
66
+
67
+ Available tasks are below (if you do not see any, please add `require 'glimmer/rake_task'` to Rakefile and rerun or run rake -T):
68
+
69
+ Select a Glimmer task to run: (Press ↑/↓ arrow to move, Enter to select and letters to filter)
70
+ ‣ glimmer list:gems:customshell[query] # List Glimmer custom shell gems available at rubygems.org (query is optional) [alt: list:gems:cs]
71
+ glimmer list:gems:customwidget[query] # List Glimmer custom widget gems available at rubygems.org (query is optional) [alt: list:gems:cw]
72
+ glimmer list:gems:dsl[query] # List Glimmer DSL gems available at rubygems.org (query is optional)
73
+ glimmer package[type] # Package app for distribution (generating config, jar, and native files) (type is optional)
74
+ glimmer package:clean # Clean by removing "dist" and "packages" directories
75
+ glimmer package:config # Generate JAR config file
76
+ glimmer package:gem # Generate gem under pkg directory
77
+ glimmer package:gemspec # Generate gemspec
78
+ glimmer package:jar # Generate JAR file
79
+ glimmer package:lock_jars # Lock JARs
80
+ glimmer package:native[type] # Generate Native files
81
+ 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)
82
+ glimmer samples # Brings up the Glimmer Meta-Sample app to allow browsing, running, and viewing code of Glimmer samples
83
+ glimmer scaffold[app_name] # Scaffold Glimmer application directory structure to build a new app
84
+ glimmer scaffold:customshell[name,namespace] # Scaffold Glimmer::UI::CustomShell subclass (full window view) under app/views (namespace is optional) [alt: scaffold:cs]
85
+ glimmer scaffold:customwidget[name,namespace] # Scaffold Glimmer::UI::CustomWidget subclass (part of a view) under app/views (namespace is optional) [alt: scaffold:cw]
86
+ glimmer scaffold:gem:customshell[name,namespace] # Scaffold Glimmer::UI::CustomShell subclass (full window view) under its own Ruby gem + app project (namespace is required) [alt: scaffold:ge...
87
+ glimmer scaffold:gem:customwidget[name,namespace] # Scaffold Glimmer::UI::CustomWidget subclass (part of a view) under its own Ruby gem project (namespace is required) [alt: scaffold:gem:cw]
88
+ ```
89
+
90
+ Example (Glimmer/JRuby option specified):
91
+ ```
92
+ glimmer --debug samples/hello/hello_world.rb
93
+ ```
94
+
95
+ Runs Glimmer application with JRuby debug option to enable JRuby debugging.
96
+
97
+ Example (Multiple apps):
98
+ ```
99
+ glimmer samples/hello/hello_world.rb samples/hello/hello_tab.rb
100
+ ```
101
+
102
+ Launches samples/hello/hello_world.rb and samples/hello_tab.rb at the same time, each in a separate JRuby thread.
103
+
104
+ Note: under Zsh (Z Shell), glimmer can only be used in its advanced TUI mode (e.g. `glimmer` and then selecting a task) not the primitive rake task mode (e.g. `glimmer scaffold[app]`)
105
+
106
+ ### Glimmer Samples
107
+
108
+ You can list available Glimmer samples by running:
109
+
110
+ ```
111
+ glimmer samples
112
+ ```
113
+
114
+ This brings up the [Glimmer Meta-Sample (The Sample of Samples)](#samples):
115
+
116
+ ![Glimmer Meta-Sample](/images/glimmer-meta-sample.png)
117
+
118
+ ### Scaffolding
119
+
120
+ Glimmer borrows from Rails the idea of Scaffolding, that is generating a structure for your app files that
121
+ helps you get started just like true building scaffolding helps construction workers, civil engineers, and architects.
122
+
123
+ Glimmer scaffolding goes beyond just scaffolding the app files that Rails does. It also packages it and launches it,
124
+ getting you to a running and delivered state of an advanced "Hello, World!" Glimmer application right off the bat.
125
+
126
+ This should greatly facilitate building a new Glimmer app by helping you be productive and focus on app details while
127
+ letting Glimmer scaffolding take care of initial app file structure concerns, such as adding:
128
+ - Main application class that includes Glimmer (`app/{app_name}.rb`)
129
+ - Main application view that houses main window content, menu, about dialog, and preferences dialog
130
+ - View and Model directories (`app/views` and `app/models`)
131
+ - Rakefile including Glimmer tasks (`Rakefile`)
132
+ - Version (`VERSION`)
133
+ - License (`LICENSE.txt`)
134
+ - Icon (under `package/{platform}/{App Name}.{icon_extension}` for `macosx` .icns, `windows` .ico, and `linux` .png)
135
+ - Bin file for starting application (`bin/{app_name}.rb`)
136
+
137
+ You need to have your Git `user.name` and `github.user` configured before scaffolding since Glimmer uses Juwelier, which relies on them in creating a Git repo for your Glimmer app.
138
+
139
+ #### App
140
+
141
+ Before you start, make sure you are in a JRuby environment with Glimmer gem installed as per "Direct Install" pre-requisites.
142
+
143
+ To scaffold a Glimmer app from scratch, run the following command:
144
+
145
+ ```
146
+ glimmer scaffold[AppName]
147
+ ```
148
+
149
+ This will generate an advanced "Hello, World!" app, package it as a Mac DMG/PKG/APP, Windows APP, or Linux GEM, and launch it all in one fell swoop.
150
+
151
+ Suppose you run:
152
+
153
+ ```
154
+ glimmer scaffold[greeter]
155
+ ```
156
+
157
+ You should see output like the following:
158
+
159
+ ```
160
+ $ glimmer scaffold[greeter]
161
+ create .gitignore
162
+ create Rakefile
163
+ create Gemfile
164
+ create LICENSE.txt
165
+ create README.rdoc
166
+ create .document
167
+ create lib
168
+ create lib/greeter.rb
169
+ create spec
170
+ create spec/spec_helper.rb
171
+ create spec/greeter_spec.rb
172
+ create .rspec
173
+ Juwelier has prepared your gem in ./greeter
174
+ Created greeter/.gitignore
175
+ Created greeter/.ruby-version
176
+ Created greeter/.ruby-gemset
177
+ Created greeter/VERSION
178
+ Created greeter/LICENSE.txt
179
+ Created greeter/Gemfile
180
+ Created greeter/Rakefile
181
+ Created greeter/app/greeter.rb
182
+ Created greeter/app/views/greeter/app_view.rb
183
+ Created greeter/package/windows/Greeter.ico
184
+ Created greeter/package/macosx/Greeter.icns
185
+ Created greeter/package/linux/Greeter.png
186
+ Created greeter/bin/greeter
187
+ Created greeter/spec/spec_helper.rb
188
+ ...
189
+ ```
190
+
191
+ Eventually, it will launch an advanced "Hello, World!" app window having the title of your application ("Greeter").
192
+
193
+ ![Glimmer Scaffold App](/images/glimmer-scaffolding-app.png)
194
+
195
+ It also comes with a boilerplate Preferences dialog.
196
+
197
+ ![Glimmer Scaffold App Preferences](/images/glimmer-scaffolding-app-preferences.png)
198
+
199
+ Here is the Windows version of the scaffolded "Greeter" app:
200
+
201
+ ![Glimmer Scaffold App Windows](/images/glimmer-scaffolding-app-windows.png)
202
+
203
+ And, here is the Windows version of the boilerplate Preferences dialog.
204
+
205
+ ![Glimmer Scaffold App Windows Preferences](/images/glimmer-scaffolding-app-windows-preferences.png)
206
+
207
+ In order to run the app after making changes, you must run the `glimmer run`. It automatically detects the generated run script under the `bin` directory and uses it as an argument.
208
+
209
+ ```
210
+ glimmer run
211
+ ```
212
+
213
+ Alternatively, to mantually run the app, you may type:
214
+
215
+ ```
216
+ glimmer run[bin/greeter]
217
+ ```
218
+
219
+ or:
220
+
221
+ ```
222
+ glimmer bin/greeter
223
+ ```
224
+
225
+ #### Desktopify
226
+
227
+ Desktopify basically turns a website into a desktop application by wrapping the website within a [Browser Widget](#browser-widget).
228
+
229
+ The desktopify app is similar to the standard scaffolded app. It can be extended and the [browser may even be instrumented](https://help.eclipse.org/2020-09/topic/org.eclipse.platform.doc.isv/reference/api/org/eclipse/swt/browser/Browser.html).
230
+
231
+ The app even remembers your cookies if you log into the website, close the app, and reopen again.
232
+
233
+ 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)`
234
+
235
+ Before you start, make sure you are in a JRuby environment with Glimmer gem installed as per "Direct Install" pre-requisites.
236
+
237
+ To scaffold a Glimmer desktopify app from scratch, run the following command:
238
+
239
+ ```
240
+ glimmer scaffold:desktopify[app_name,website]
241
+ ```
242
+
243
+ This will generate a Glimmer app, package it as a Mac DMG/PKG/APP, Windows APP, or Linux GEM, and launch it all in one fell swoop.
244
+
245
+ Suppose you run:
246
+
247
+ ```
248
+ glimmer scaffold:desktopify[snowboard_utah,https://www.brightonresort.com]
249
+ ```
250
+
251
+ You should see output like the following:
252
+
253
+ ```
254
+ $ glimmer scaffold:desktopify[snowboard_utah,https://www.brightonresort.com]
255
+ Fetching kamelcase-0.0.2.gem
256
+ Fetching github_api-0.19.0.gem
257
+ Fetching highline-2.0.3.gem
258
+ Fetching juwelier-2.4.9.gem
259
+ Fetching hashie-3.6.0.gem
260
+ Fetching nokogiri-1.10.10-java.gem
261
+ Fetching semver2-3.4.2.gem
262
+ Successfully installed semver2-3.4.2
263
+ Successfully installed kamelcase-0.0.2
264
+ Successfully installed highline-2.0.3
265
+ Successfully installed hashie-3.6.0
266
+ Successfully installed github_api-0.19.0
267
+ Successfully installed nokogiri-1.10.10-java
268
+ Successfully installed juwelier-2.4.9
269
+ 7 gems installed
270
+ create .gitignore
271
+ create Rakefile
272
+ create Gemfile
273
+ create LICENSE.txt
274
+ create README.markdown
275
+ create .document
276
+ create lib
277
+ create lib/snowboard_utah.rb
278
+ create .rspec
279
+ Juwelier has prepared your gem in ./snowboard_utah
280
+ Created snowboard_utah/.gitignore
281
+ Created snowboard_utah/.ruby-version
282
+ Created snowboard_utah/.ruby-gemset
283
+ Created snowboard_utah/VERSION
284
+ Created snowboard_utah/LICENSE.txt
285
+ Created snowboard_utah/Gemfile
286
+ Created snowboard_utah/Rakefile
287
+ Created snowboard_utah/app/snowboard_utah.rb
288
+ Created snowboard_utah/app/views/snowboard_utah/app_view.rb
289
+ Created snowboard_utah/package/windows/Snowboard Utah.ico
290
+ Created snowboard_utah/package/macosx/Snowboard Utah.icns
291
+ Created snowboard_utah/package/linux/Snowboard Utah.png
292
+ Created snowboard_utah/bin/snowboard_utah
293
+ ...
294
+ ```
295
+
296
+ Eventually, it will launch a desktopified version of "https://www.brightonresort.com" having the title of ("Snowboard Utah").
297
+
298
+ Desktopified App on Mac
299
+
300
+ ![Glimmer Scaffold App](/images/glimmer-scaffolding-desktopify.png)
301
+
302
+ It also comes with a boilerplate About dialog.
303
+
304
+ ![Glimmer Scaffold App About](/images/glimmer-scaffolding-desktopify-about.png)
305
+
306
+ Desktopified App on Windows
307
+
308
+ ![Glimmer Scaffold App](/images/glimmer-scaffolding-desktopify-windows.png)
309
+
310
+ Desktopified App on Linux
311
+
312
+ ![Glimmer Scaffold App](/images/glimmer-scaffolding-desktopify-linux.png)
313
+
314
+ In order to run the app after making changes, you must run the `glimmer run`. It automatically detects the generated run script under the `bin` directory and uses it as an argument.
315
+
316
+ ```
317
+ glimmer run
318
+ ```
319
+
320
+ #### Custom Shell
321
+
322
+ To scaffold a Glimmer [custom shell](#custom-shells) (full window view) for an existing Glimmer app, run the following command:
323
+
324
+ ```
325
+ glimmer scaffold:customshell[name]
326
+ ```
327
+
328
+ Or the following alternative abbreviation:
329
+
330
+ ```
331
+ glimmer scaffold:cs[name]
332
+ ```
333
+
334
+ #### Custom Widget
335
+
336
+ To scaffold a Glimmer [custom widget](#custom-widgets) (part of a view) for an existing Glimmer app, run the following command:
337
+
338
+ ```
339
+ glimmer scaffold:customwidget[name]
340
+ ```
341
+
342
+ Or the following alternative abbreviation:
343
+
344
+ ```
345
+ glimmer scaffold:cw[name]
346
+ ```
347
+
348
+ #### Custom Shell Gem
349
+
350
+ Custom shell gems are self-contained Glimmer apps as well as reusable [custom shells](#custom-shells).
351
+ 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.
352
+ Unlike scaffolded Glimmer apps, custom shell gem content lives under the `lib` directory (not `app`).
353
+ They can be packaged as both a native executable (e.g. Mac DMG/PKG/APP) and a Ruby gem.
354
+ Of course, you can just build a Ruby gem and disregard native executable packaging if you do not need it.
355
+
356
+ To scaffold a Glimmer custom shell gem (full window view distributed as a Ruby gem), run the following command:
357
+
358
+ ```
359
+ glimmer scaffold:gem:customshell[name,namespace]
360
+ ```
361
+
362
+ Or the following alternative abbreviation:
363
+
364
+ ```
365
+ glimmer scaffold:gem:cs[name,namespace]
366
+ ```
367
+
368
+ It is important to specify a namespace to avoid having your gem clash with existing gems.
369
+
370
+ The Ruby gem name will follow the convention "glimmer-cs-customwidgetname-namespace" (the 'cs' is for Custom Shell).
371
+
372
+ Only official Glimmer gems created by the Glimmer project committers will have no namespace (e.g. [glimmer-cs-gladiator](https://rubygems.org/gems/glimmer-cs-gladiator) Ruby gem)
373
+
374
+ Since custom shell gems are both an app and a gem, they provide two ways to run:
375
+ - 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`)
376
+ - 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.
377
+
378
+ Examples:
379
+
380
+ - [glimmer-cs-gladiator](https://github.com/AndyObtiva/glimmer-cs-gladiator): Gladiator (Glimmer Editor)
381
+ - [glimmer-cs-calculator](https://github.com/AndyObtiva/glimmer-cs-calculator): Glimmer Calculator
382
+
383
+ #### Custom Widget Gem
384
+
385
+ To scaffold a Glimmer [custom widget](#custom-widgets) gem (part of a view distributed as a Ruby gem), run the following command:
386
+
387
+ ```
388
+ glimmer scaffold:gem:customwidget[name,namespace]
389
+ ```
390
+
391
+ Or the following alternative abbreviation:
392
+
393
+ ```
394
+ glimmer scaffold:gem:cw[name,namespace]
395
+ ```
396
+
397
+
398
+ It is important to specify a namespace to avoid having your gem clash with existing gems.
399
+
400
+ The Ruby gem name will follow the convention "glimmer-cw-customwidgetname-namespace" (the 'cw' is for Custom Widget)
401
+
402
+ 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)
403
+
404
+ Examples:
405
+
406
+ - [glimmer-cw-video](https://github.com/AndyObtiva/glimmer-cw-video): Video Widget
407
+ - [glimmer-cw-cdatetime-nebula](https://github.com/AndyObtiva/glimmer-cw-cdatetime-nebula): Nebula CDateTime Widget
408
+
409
+ ### Gem Listing
410
+
411
+ The `glimmer` command comes with tasks for listing Glimmer related gems to make it easy to find Glimmer [Custom Shells](#custom-shells), [Custom Widgets](#custom-widgets), and DSLs published by others in the Glimmer community on [rubygems.org](http://www.rubygems.org).
412
+
413
+ #### Listing Custom Shell Gems
414
+
415
+ The following command lists available Glimmer [Custom Shell Gems](#custom-shell-gem) (prefixed with "glimmer-cs-" by scaffolding convention) created by the the Glimmer community and published on [rubygems.org](http://www.rubygems.org):
416
+
417
+ ```
418
+ glimmer list:gems:customshell[query]
419
+ ```
420
+
421
+ Or the following alternative abbreviation:
422
+
423
+ ```
424
+ glimmer list:gems:cs[query]
425
+ ```
426
+
427
+ Example:
428
+
429
+ ```
430
+ glimmer list:gems:cs
431
+ ```
432
+
433
+ Output:
434
+
435
+ ```
436
+
437
+ Glimmer Custom Shell Gems at rubygems.org:
438
+
439
+ Name Gem Version Author Description
440
+
441
+ Calculator glimmer-cs-calculator 1.0.2 Andy Maleh Calculator - Glimmer Custom Shell
442
+ Gladiator glimmer-cs-gladiator 0.2.4 Andy Maleh Gladiator (Glimmer Editor) - Glimmer Custom Shell
443
+ Timer glimmer-cs-timer 1.0.0 Andy Maleh Timer - Glimmer Custom Shell
444
+
445
+ ```
446
+
447
+ #### Listing Custom Widget Gems
448
+
449
+ The following command lists available Glimmer [Custom Widget Gems](#custom-widget-gem) (prefixed with "glimmer-cw-" by scaffolding convention) created by the the Glimmer community and published on [rubygems.org](http://www.rubygems.org):
450
+
451
+ ```
452
+ glimmer list:gems:customwidget[query]
453
+ ```
454
+
455
+ Or the following alternative abbreviation:
456
+
457
+ ```
458
+ glimmer list:gems:cw[query]
459
+ ```
460
+
461
+ Example:
462
+
463
+ Check if there is a custom video widget for Glimmer.
464
+
465
+ ```
466
+ glimmer list:gems:cw[video]
467
+ ```
468
+
469
+ Output:
470
+
471
+ ```
472
+
473
+ Glimmer Custom Widget Gems matching [video] at rubygems.org:
474
+
475
+ Name Gem Version Author Description
476
+
477
+ Video glimmer-cw-video 1.0.0 Andy Maleh Glimmer Custom Widget - Video
478
+
479
+ ```
480
+
481
+ Example:
482
+
483
+ Check all custom widgets for Glimmer.
484
+
485
+ ```
486
+ glimmer list:gems:cw
487
+ ```
488
+
489
+ Output:
490
+
491
+ ```
492
+
493
+ Glimmer Custom Widget Gems at rubygems.org:
494
+
495
+ Name Gem Version Author Description
496
+
497
+ Browser (Chromium) glimmer-cw-browser-chromium 1.0.0 Andy Maleh Chromium Browser - Glimmer Custom Widget
498
+ Cdatetime (Nebula) glimmer-cw-cdatetime-nebula 1.5.0.0.1 Andy Maleh Nebula CDateTime Widget - Glimmer Custom Widget
499
+ Video glimmer-cw-video 1.0.0 Andy Maleh Glimmer Custom Widget - Video
500
+
501
+ ```
502
+
503
+ #### Listing DSL Gems
504
+
505
+ The following command lists available Glimmer [DSL Gems](#multi-dsl-support) (prefixed with "glimmer-dsl-" by convention) created by the the Glimmer community and published on [rubygems.org](http://www.rubygems.org):
506
+
507
+ ```
508
+ glimmer list:gems:dsl[query]
509
+ ```
510
+
511
+ Example:
512
+
513
+ ```
514
+ glimmer list:gems:dsl
515
+ ```
516
+
517
+ Output:
518
+
519
+ ```
520
+
521
+ Glimmer DSL Gems at rubygems.org:
522
+
523
+ Name Gem Version Author Description
524
+
525
+ Css glimmer-dsl-css 1.1.0 AndyMaleh Glimmer DSL for CSS
526
+ Opal glimmer-dsl-opal 0.10.2 AndyMaleh Glimmer DSL for Opal
527
+ Swt glimmer-dsl-swt 4.18.4.4 AndyMaleh Glimmer DSL for SWT
528
+ Tk glimmer-dsl-tk 0.0.6 AndyMaleh Glimmer DSL for Tk
529
+ Xml glimmer-dsl-xml 1.1.0 AndyMaleh Glimmer DSL for XML
530
+ ```
531
+
532
+ ### Packaging
533
+
534
+ Glimmer supports packaging applications as native files on Mac and Windows.
535
+
536
+ Glimmer packaging tasks are detailed under [Packaging & Distribution](/docs/reference/GLIMMER_PACKAGING_AND_DISTRIBUTION.md).
537
+
538
+ On Linux, the Glimmer [App](#app) and [Custom Shell Gem](#custom-shell-gem) scaffolding options provide a Gem Packaged Shell Script (e.g. `calculator` command becomes available after installing the [glimmer-cs-calculator](https://github.com/AndyObtiva/glimmer-cs-calculator) gem)
539
+
540
+ You may run `glimmer package:gem` to generate gem or just rely on the included [Juwelier](https://rubygems.org/gems/juwelier) `rake release` task to release the gem.
541
+
542
+ ### Raw JRuby Command
543
+
544
+ If there is a need to run Glimmer directly via the `jruby` command, you
545
+ may run the following on Windows/Linux:
546
+
547
+ ```
548
+ jruby -r glimmer-dsl-swt -S application.rb
549
+ ```
550
+
551
+ Or, the following on Mac:
552
+
553
+ ```
554
+ jruby -J-XstartOnFirstThread -r glimmer-dsl-swt -S application.rb
555
+ ```
556
+
557
+ If you want to use a specific custom version of SWT, run the following on Windows/Linux:
558
+
559
+ ```
560
+ jruby -J-classpath "path_to/swt.jar" -r glimmer-dsl-swt -S application.rb
561
+ ```
562
+
563
+ Or, the following on Mac:
564
+
565
+ ```
566
+ jruby -J-XstartOnFirstThread -J-classpath "path_to/swt.jar" -r glimmer-dsl-swt -S application.rb
567
+ ```
568
+
569
+ The `-J-classpath` option specifies the `swt.jar` file path, which can be a
570
+ manually downloaded version of SWT, or otherwise the one included in the gem. You can lookup the one included in the gem by running `jgem which glimmer` to find the gem path and then look through the `vendor` directory.
571
+
572
+ The `-r` option preloads (requires) the `glimmer` library in Ruby.
573
+
574
+ The `-S` option specifies a script to run.
575
+
576
+ #### Mac Support
577
+
578
+ The Mac is well supported with the `glimmer` command. The advice below is not needed if you are using it.
579
+
580
+ However, if there is a reason to use the raw `jruby` command directly instead of the `glimmer` command, you need to pass an extra option (`-J-XstartOnFirstThread`) to JRuby on the Mac (Glimmer automatically passes it for you when using the `glimmer` command).
581
+
582
+ Example:
583
+ ```
584
+ jruby -J-XstartOnFirstThread -J-classpath "path_to/swt.jar" -r glimmer-dsl-swt -S application.rb
585
+ ```
586
+
587
+ ## License
588
+
589
+ [MIT](LICENSE.txt)
590
+
591
+ Copyright (c) 2007-2021 - Andy Maleh.