glimmer 0.8.1 → 0.9.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/LICENSE.txt +1 -1
- data/README.md +327 -127
- data/VERSION +1 -1
- data/lib/glimmer.rb +35 -21
- data/lib/glimmer/config.rb +7 -12
- data/lib/glimmer/data_binding/observable_array.rb +32 -53
- data/lib/glimmer/data_binding/observable_model.rb +10 -14
- data/lib/glimmer/data_binding/observer.rb +3 -0
- data/lib/glimmer/dsl/engine.rb +58 -27
- data/lib/glimmer/dsl/expression.rb +0 -7
- data/lib/glimmer/dsl/static_expression.rb +2 -2
- data/lib/glimmer/excluded_keyword_error.rb +5 -0
- metadata +60 -136
- data/RUBY_VERSION +0 -1
- data/bin/girb +0 -10
- data/bin/girb_runner.rb +0 -13
- data/bin/glimmer +0 -5
- data/icons/scaffold_app.icns +0 -0
- data/lib/glimmer/css/rule.rb +0 -25
- data/lib/glimmer/css/style_sheet.rb +0 -19
- data/lib/glimmer/data_binding/list_selection_binding.rb +0 -52
- data/lib/glimmer/data_binding/observable_widget.rb +0 -17
- data/lib/glimmer/data_binding/shine.rb +0 -23
- data/lib/glimmer/data_binding/table_items_binding.rb +0 -47
- data/lib/glimmer/data_binding/tree_items_binding.rb +0 -71
- data/lib/glimmer/data_binding/widget_binding.rb +0 -33
- data/lib/glimmer/dsl/css/css_expression.rb +0 -21
- data/lib/glimmer/dsl/css/dsl.rb +0 -10
- data/lib/glimmer/dsl/css/dynamic_property_expression.rb +0 -12
- data/lib/glimmer/dsl/css/property_expression.rb +0 -22
- data/lib/glimmer/dsl/css/pv_expression.rb +0 -17
- data/lib/glimmer/dsl/css/rule_expression.rb +0 -25
- data/lib/glimmer/dsl/css/s_expression.rb +0 -26
- data/lib/glimmer/dsl/swt/async_exec_expression.rb +0 -14
- data/lib/glimmer/dsl/swt/bind_expression.rb +0 -37
- data/lib/glimmer/dsl/swt/color_expression.rb +0 -19
- data/lib/glimmer/dsl/swt/column_properties_expression.rb +0 -24
- data/lib/glimmer/dsl/swt/combo_selection_data_binding_expression.rb +0 -42
- data/lib/glimmer/dsl/swt/custom_widget_expression.rb +0 -36
- data/lib/glimmer/dsl/swt/data_binding_expression.rb +0 -34
- data/lib/glimmer/dsl/swt/dialog_expression.rb +0 -26
- data/lib/glimmer/dsl/swt/display_expression.rb +0 -19
- data/lib/glimmer/dsl/swt/dsl.rb +0 -28
- data/lib/glimmer/dsl/swt/exec_expression.rb +0 -28
- data/lib/glimmer/dsl/swt/layout_data_expression.rb +0 -25
- data/lib/glimmer/dsl/swt/layout_expression.rb +0 -27
- data/lib/glimmer/dsl/swt/list_selection_data_binding_expression.rb +0 -44
- data/lib/glimmer/dsl/swt/menu_bar_expression.rb +0 -33
- data/lib/glimmer/dsl/swt/menu_expression.rb +0 -32
- data/lib/glimmer/dsl/swt/observe_expression.rb +0 -32
- data/lib/glimmer/dsl/swt/property_expression.rb +0 -22
- data/lib/glimmer/dsl/swt/rgb_expression.rb +0 -12
- data/lib/glimmer/dsl/swt/rgba_expression.rb +0 -12
- data/lib/glimmer/dsl/swt/shell_expression.rb +0 -25
- data/lib/glimmer/dsl/swt/swt_expression.rb +0 -25
- data/lib/glimmer/dsl/swt/sync_exec_expression.rb +0 -15
- data/lib/glimmer/dsl/swt/tab_item_expression.rb +0 -33
- data/lib/glimmer/dsl/swt/table_items_data_binding_expression.rb +0 -31
- data/lib/glimmer/dsl/swt/tree_items_data_binding_expression.rb +0 -31
- data/lib/glimmer/dsl/swt/tree_properties_expression.rb +0 -26
- data/lib/glimmer/dsl/swt/widget_expression.rb +0 -34
- data/lib/glimmer/dsl/swt/widget_listener_expression.rb +0 -32
- data/lib/glimmer/dsl/xml/dsl.rb +0 -11
- data/lib/glimmer/dsl/xml/html_expression.rb +0 -25
- data/lib/glimmer/dsl/xml/meta_expression.rb +0 -23
- data/lib/glimmer/dsl/xml/name_space_expression.rb +0 -37
- data/lib/glimmer/dsl/xml/node_parent_expression.rb +0 -33
- data/lib/glimmer/dsl/xml/tag_expression.rb +0 -29
- data/lib/glimmer/dsl/xml/text_expression.rb +0 -22
- data/lib/glimmer/dsl/xml/xml_expression.rb +0 -21
- data/lib/glimmer/launcher.rb +0 -199
- data/lib/glimmer/package.rb +0 -7
- data/lib/glimmer/rake_task.rb +0 -89
- data/lib/glimmer/scaffold.rb +0 -582
- data/lib/glimmer/swt/color_proxy.rb +0 -53
- data/lib/glimmer/swt/display_proxy.rb +0 -88
- data/lib/glimmer/swt/font_proxy.rb +0 -72
- data/lib/glimmer/swt/layout_data_proxy.rb +0 -84
- data/lib/glimmer/swt/layout_proxy.rb +0 -82
- data/lib/glimmer/swt/menu_proxy.rb +0 -101
- data/lib/glimmer/swt/packages.rb +0 -13
- data/lib/glimmer/swt/shell_proxy.rb +0 -157
- data/lib/glimmer/swt/swt_proxy.rb +0 -106
- data/lib/glimmer/swt/tab_item_proxy.rb +0 -65
- data/lib/glimmer/swt/tree_proxy.rb +0 -120
- data/lib/glimmer/swt/widget_listener_proxy.rb +0 -34
- data/lib/glimmer/swt/widget_proxy.rb +0 -489
- data/lib/glimmer/ui/custom_shell.rb +0 -45
- data/lib/glimmer/ui/custom_widget.rb +0 -244
- data/lib/glimmer/util/proc_tracker.rb +0 -16
- data/lib/glimmer/xml/depth_first_search_iterator.rb +0 -22
- data/lib/glimmer/xml/name_space_visitor.rb +0 -21
- data/lib/glimmer/xml/node.rb +0 -75
- data/lib/glimmer/xml/node_visitor.rb +0 -13
- data/lib/glimmer/xml/xml_visitor.rb +0 -65
- data/vendor/swt/linux/swt.jar +0 -0
- data/vendor/swt/mac/swt.jar +0 -0
- data/vendor/swt/windows/swt.jar +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6255c2aed0be3512fb9e8e1892232ee9f8ad35efb308ea2dc814f5ff86e69265
|
4
|
+
data.tar.gz: 1c6a024b3ddfed3e296644ec54ce57f38816feb2656a05f2c6daf557cde22b16
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f39bf5895a97510fe0e40b463b0e77224b7ff09bd695686cf1f38fecdf0e01c1ff86a23ab25a4dbcc3b297906b905be1ad6eb5e8e9fb3fe8e985b39fbda0f80e
|
7
|
+
data.tar.gz: 44068213c246dacc1763868175aba950a9bf78dc803dcb4b0269d3dd9b1ad76c9efd373cb35977b60d7bfcfbe03e8bd07b46ac32595cb89a796e6c9444ff6b0e
|
data/LICENSE.txt
CHANGED
data/README.md
CHANGED
@@ -1,14 +1,23 @@
|
|
1
|
-
#
|
1
|
+
# <img src="https://raw.githubusercontent.com/AndyObtiva/glimmer/master/images/glimmer-logo-hi-res.png" height=85 /> Glimmer (Ruby Desktop Development GUI Library)
|
2
2
|
[![Gem Version](https://badge.fury.io/rb/glimmer.svg)](http://badge.fury.io/rb/glimmer)
|
3
|
-
[![Travis CI](https://travis-ci.com/AndyObtiva/glimmer.svg?branch=master)](https://travis-ci.com/github/AndyObtiva/glimmer)
|
4
|
-
[![
|
5
|
-
|
3
|
+
[![Travis CI](https://travis-ci.com/AndyObtiva/glimmer.svg?branch=master)](https://travis-ci.com/github/AndyObtiva/glimmer)
|
4
|
+
[![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)
|
5
|
+
|
6
|
+
**[Contributors Wanted!](#contributing)**
|
7
|
+
|
8
|
+
(The Original Glimmer Library Since 2007. Beware of Imitators!)
|
6
9
|
|
7
10
|
Glimmer is a native-GUI cross-platform desktop development library written in Ruby. Glimmer's main innovation is a JRuby DSL that enables productive and efficient authoring of desktop application user-interfaces while relying on the robust Eclipse SWT library. Glimmer additionally innovates by having built-in data-binding support to greatly facilitate synchronizing the GUI with domain models. As a result, that achieves true decoupling of object oriented components, enabling developers to solve business problems without worrying about GUI concerns, or alternatively drive development GUI-first, and then write clean business models test-first afterwards.
|
8
11
|
|
9
12
|
[<img src="https://covers.oreillystatic.com/images/9780596519650/lrg.jpg" width=105 /><br />
|
10
13
|
Featured in<br />JRuby Cookbook](http://shop.oreilly.com/product/9780596519650.do)
|
11
14
|
|
15
|
+
Glimmer DSL gems:
|
16
|
+
- [glimmer-dsl-swt](https://github.com/AndyObtiva/glimmer-dsl-swt): Glimmer DSL for SWT (Desktop GUI)
|
17
|
+
- [glimmer-dsl-opal](https://github.com/AndyObtiva/glimmer-dsl-opal): Glimmer DSL for Opal (Web GUI Adapter for Desktop Apps)
|
18
|
+
- [glimmer-dsl-xml](https://github.com/AndyObtiva/glimmer-dsl-xml): Glimmer DSL for XML (& HTML)
|
19
|
+
- [glimmer-dsl-css](https://github.com/AndyObtiva/glimmer-dsl-css): Glimmer DSL for CSS (Cascading Style Sheets)
|
20
|
+
|
12
21
|
## Examples
|
13
22
|
|
14
23
|
### Hello, World!
|
@@ -69,13 +78,13 @@ glimmer samples/elaborate/tic_tac_toe.rb
|
|
69
78
|
|
70
79
|
Glimmer app:
|
71
80
|
|
72
|
-
![Tic Tac Toe](images/glimmer-tic-tac-toe.png)
|
81
|
+
![Tic Tac Toe](images/glimmer-tic-tac-toe-in-progress.png)
|
73
82
|
|
74
|
-
NOTE: Glimmer is in beta mode. Please help make better by adopting for small or low risk projects and providing feedback.
|
83
|
+
NOTE: Glimmer is in beta mode. Please help make better by [contributing](#contributing), adopting for small or low risk projects, and providing feedback.
|
75
84
|
|
76
85
|
## Table of contents
|
77
86
|
|
78
|
-
- [Glimmer
|
87
|
+
- [Glimmer - Ruby Desktop Development GUI Library](#-glimmer---ruby-desktop-development-gui-library)
|
79
88
|
- [Examples](#examples)
|
80
89
|
- [Hello, World!](#hello-world)
|
81
90
|
- [Tic Tac Toe](#tic-tac-toe)
|
@@ -89,23 +98,57 @@ NOTE: Glimmer is in beta mode. Please help make better by adopting for small or
|
|
89
98
|
- [Basic Usage](#basic-usage)
|
90
99
|
- [Advanced Usage](#advanced-usage)
|
91
100
|
- [Scaffolding](#scaffolding)
|
101
|
+
- [App](#app)
|
102
|
+
- [Custom Shell](#custom-shell)
|
103
|
+
- [Custom Widget](#custom-widget)
|
104
|
+
- [Custom Shell Gem](#custom-shell-gem)
|
105
|
+
- [Custom Widget Gem](#custom-widget-gem)
|
92
106
|
- [Girb (Glimmer irb) Command](#girb-glimmer-irb-command)
|
93
107
|
- [Glimmer DSL Syntax](#glimmer-dsl-syntax)
|
94
108
|
- [Widgets](#widgets)
|
109
|
+
- [Display](#display)
|
110
|
+
- [SWT Proxies](#swt-proxies)
|
111
|
+
- [Dialog](#dialog)
|
112
|
+
- [Menus](#menus)
|
95
113
|
- [Widget Styles](#widget-styles)
|
114
|
+
- [Explicit SWT Style Bit](#explicit-swt-style-bit)
|
115
|
+
- [Negative SWT Style Bits](#negative-swt-style-bits)
|
116
|
+
- [Extra SWT Styles](#extra-swt-styles)
|
96
117
|
- [Widget Properties](#widget-properties)
|
118
|
+
- [Colors](#colors)
|
119
|
+
- [Fonts](#fonts)
|
97
120
|
- [Layouts](#layouts)
|
98
121
|
- [Layout Data](#layout-data)
|
99
122
|
- [Data-Binding](#data-binding)
|
123
|
+
- [General Examples](#general-examples)
|
124
|
+
- [Combo](#combo)
|
125
|
+
- [List](#list)
|
126
|
+
- [Table](#table)
|
127
|
+
- [Tree](#tree)
|
100
128
|
- [Observer](#observer)
|
129
|
+
- [Observing Widgets](#observing-widgets)
|
130
|
+
- [Observing Models](#observing-models)
|
101
131
|
- [Custom Widgets](#custom-widgets)
|
132
|
+
- [Simple Example](#simple-example)
|
133
|
+
- [Lifecycle Hook Example](#lifecycle-hook-example)
|
134
|
+
- [Custom Widget API](#custom-widget-api)
|
135
|
+
- [Content/Options Example](#contentoptions-example)
|
136
|
+
- [Custom Widget Lifecycle Hooks](#custom-widget-lifecycle-hooks)
|
137
|
+
- [Gotcha](#gotcha)
|
102
138
|
- [Custom Shells](#custom-shells)
|
103
139
|
- [Miscellaneous](#miscellaneous)
|
140
|
+
- [Multi-DSL Support](#multi-dsl-support)
|
141
|
+
- [Application Menu Items (About/Preferences)](#application-menu-items-aboutpreferences)
|
142
|
+
- [App Name and Version](#app-name-and-version)
|
143
|
+
- [Video Widget](#video-widget)
|
144
|
+
- [Browser Widget](#browser-widget)
|
104
145
|
- [Glimmer Style Guide](#glimmer-style-guide)
|
105
146
|
- [Samples](#samples)
|
106
147
|
- [Hello Samples](#hello-samples)
|
107
148
|
- [Elaborate Samples](#elaborate-samples)
|
108
149
|
- [External Samples](#external-samples)
|
150
|
+
- [Glimmer Calculator](#glimmer-calculator)
|
151
|
+
- [Gladiator](#gladiator)
|
109
152
|
- [In Production](#in-production)
|
110
153
|
- [SWT Reference](#swt-reference)
|
111
154
|
- [SWT Packages](#swt-packages)
|
@@ -122,7 +165,7 @@ NOTE: Glimmer is in beta mode. Please help make better by adopting for small or
|
|
122
165
|
- [Resources](#resources)
|
123
166
|
- [Help](#help)
|
124
167
|
- [Issues](#issues)
|
125
|
-
- [
|
168
|
+
- [Chat](#chat)
|
126
169
|
- [Feature Suggestions](#feature-suggestions)
|
127
170
|
- [Change Log](#change-log)
|
128
171
|
- [Contributing](#contributing)
|
@@ -154,7 +197,7 @@ https://www.eclipse.org/swt/faq.php
|
|
154
197
|
|
155
198
|
- SWT 4.15 (comes included in Glimmer gem)
|
156
199
|
- JRuby 9.2.11.1 (supporting Ruby 2.5.x syntax) (find at [https://www.jruby.org/download](https://www.jruby.org/download))
|
157
|
-
-
|
200
|
+
- JDK 8 - 10 (find at [https://www.oracle.com/java/technologies/javase-downloads.html](https://www.oracle.com/java/technologies/javase-downloads.html))
|
158
201
|
- (Optional) RVM is needed for [Scaffolding](#scaffolding) only (find at [https://rvm.io/](https://rvm.io/))
|
159
202
|
|
160
203
|
On **Mac** and **Linux**, an easy way to obtain JRuby is through [RVM](http://rvm.io) by running:
|
@@ -167,13 +210,13 @@ Glimmer might still work on lower versions of Java, JRuby and SWT, but there are
|
|
167
210
|
|
168
211
|
## Setup
|
169
212
|
|
170
|
-
Please follow these instructions to make the `glimmer` command available on your system.
|
213
|
+
Please follow these instructions to make the `glimmer` command available on your system via the [`glimmer-dsl-swt`](https://github.com/AndyObtiva/glimmer-dsl-swt) gem.
|
171
214
|
|
172
215
|
### Option 1: Direct Install
|
173
216
|
|
174
217
|
Run this command to install directly:
|
175
218
|
```
|
176
|
-
jgem install glimmer -v 0.
|
219
|
+
jgem install glimmer-dsl-swt -v 0.1.3
|
177
220
|
```
|
178
221
|
|
179
222
|
`jgem` is JRuby's version of `gem` command.
|
@@ -184,7 +227,7 @@ Otherwise, you may also run `jruby -S gem install ...`
|
|
184
227
|
|
185
228
|
Add the following to `Gemfile`:
|
186
229
|
```
|
187
|
-
gem 'glimmer', '~> 0.
|
230
|
+
gem 'glimmer-dsl-swt', '~> 0.1.3'
|
188
231
|
```
|
189
232
|
|
190
233
|
And, then run:
|
@@ -192,6 +235,8 @@ And, then run:
|
|
192
235
|
jruby -S bundle install
|
193
236
|
```
|
194
237
|
|
238
|
+
You may learn more about other Glimmer related gems ([`glimmer-dsl-opal`](https://github.com/AndyObtiva/glimmer-dsl-opal), [`glimmer-dsl-xml`](https://github.com/AndyObtiva/glimmer-dsl-xml), and [`glimmer-dsl-css`](https://github.com/AndyObtiva/glimmer-dsl-css)) at [Multi-DSL Support](#multi-dsl-support)
|
239
|
+
|
195
240
|
## Glimmer Command
|
196
241
|
|
197
242
|
### Basic Usage
|
@@ -387,13 +432,13 @@ Example: [https://github.com/AndyObtiva/glimmer-cw-video](https://github.com/And
|
|
387
432
|
|
388
433
|
## Girb (Glimmer irb) Command
|
389
434
|
|
390
|
-
With
|
435
|
+
With `glimmer-dsl-swt` installed, you may want to run `girb` instead of standard `irb` to have SWT preloaded and the Glimmer library required and included for quick Glimmer coding/testing.
|
391
436
|
|
392
437
|
```
|
393
438
|
girb
|
394
439
|
```
|
395
440
|
|
396
|
-
If you cloned
|
441
|
+
If you cloned [glimmer-dsl-swt](https://github.com/AndyObtiva/glimmer-dsl-swt) project locally, you may run `bin/girb` instead.
|
397
442
|
|
398
443
|
```
|
399
444
|
bin/girb
|
@@ -401,6 +446,8 @@ bin/girb
|
|
401
446
|
|
402
447
|
Watch out for hands-on examples in this README indicated by "you may copy/paste in [`girb`](#girb-glimmer-irb-command)"
|
403
448
|
|
449
|
+
Keep in mind that all samples live under [https://github.com/AndyObtiva/glimmer-dsl-swt](https://github.com/AndyObtiva/glimmer-dsl-swt)
|
450
|
+
|
404
451
|
## Glimmer DSL Syntax
|
405
452
|
|
406
453
|
Glimmer DSL syntax consists of static keywords and dynamic keywords to build and bind user-interface objects.
|
@@ -504,22 +551,22 @@ Check out the [samples](samples) directory for more examples.
|
|
504
551
|
|
505
552
|
Example from [hello_tab.rb](samples/hello/hello_tab.rb) sample (you may copy/paste in [`girb`](#girb-glimmer-irb-command)):
|
506
553
|
|
507
|
-
![Hello Tab
|
554
|
+
![Hello Tab English](images/glimmer-hello-tab-english.png)
|
508
555
|
|
509
|
-
![Hello Tab
|
556
|
+
![Hello Tab French](images/glimmer-hello-tab-french.png)
|
510
557
|
|
511
558
|
```ruby
|
512
559
|
shell {
|
513
|
-
text "
|
560
|
+
text "Hello, Tab!"
|
514
561
|
tab_folder {
|
515
562
|
tab_item {
|
516
|
-
text "
|
563
|
+
text "English"
|
517
564
|
label {
|
518
565
|
text "Hello, World!"
|
519
566
|
}
|
520
567
|
}
|
521
568
|
tab_item {
|
522
|
-
text "
|
569
|
+
text "French"
|
523
570
|
label {
|
524
571
|
text "Bonjour Univers!"
|
525
572
|
}
|
@@ -956,6 +1003,9 @@ composite {
|
|
956
1003
|
```
|
957
1004
|
|
958
1005
|
Here is a more sophisticated example taken from [hello_computed.rb](samples/hello/hello_computed.rb) sample:
|
1006
|
+
|
1007
|
+
![Hello Computed](images/glimmer-hello-computed.png)
|
1008
|
+
|
959
1009
|
```ruby
|
960
1010
|
shell {
|
961
1011
|
text "Hello Computed"
|
@@ -1099,7 +1149,7 @@ https://help.eclipse.org/2019-12/nftopic/org.eclipse.platform.doc.isv/reference/
|
|
1099
1149
|
|
1100
1150
|
Data-binding is done with `bind` command following widget property to bind and taking model and bindable attribute as arguments.
|
1101
1151
|
|
1102
|
-
#### General
|
1152
|
+
#### General Examples
|
1103
1153
|
|
1104
1154
|
`text bind(contact, :first_name)`
|
1105
1155
|
|
@@ -1270,7 +1320,62 @@ The Glimmer code is not much different from above except for passing the `:multi
|
|
1270
1320
|
|
1271
1321
|
Note that in all the data-binding examples above, there was also an observer attached to the `button` widget to trigger an action on the model, which in turn triggers a data-binding update on the `list` or `combo`. Observers will be discussed in more details in the [next section](#observer).
|
1272
1322
|
|
1273
|
-
You may learn more about Glimmer's data-binding syntax by reading the
|
1323
|
+
You may learn more about Glimmer's data-binding syntax by reading the code under the [samples](samples) directory.
|
1324
|
+
|
1325
|
+
#### Table
|
1326
|
+
|
1327
|
+
The SWT Tree widget renders a multi-column data table, such as a contact listing or a sales report.
|
1328
|
+
|
1329
|
+
To data-bind a Table, you need the main model, the collection property, and the text display attribute for each table column.
|
1330
|
+
|
1331
|
+
This involves using the `bind` keyword mentioned above in addition to a special `column_properties` keyword that takes the table column text attribute methods.
|
1332
|
+
|
1333
|
+
It assumes you have defined the table columns via `table_column` widget.
|
1334
|
+
|
1335
|
+
Example:
|
1336
|
+
|
1337
|
+
```ruby
|
1338
|
+
shell {
|
1339
|
+
@table = table {
|
1340
|
+
table_column {
|
1341
|
+
text "Name"
|
1342
|
+
width 120
|
1343
|
+
}
|
1344
|
+
table_column {
|
1345
|
+
text "Age"
|
1346
|
+
width 120
|
1347
|
+
}
|
1348
|
+
table_column {
|
1349
|
+
text "Adult"
|
1350
|
+
width 120
|
1351
|
+
}
|
1352
|
+
items bind(group, :people), column_properties(:name, :age, :adult)
|
1353
|
+
selection bind(group, :selected_person)
|
1354
|
+
}
|
1355
|
+
}
|
1356
|
+
```
|
1357
|
+
|
1358
|
+
The code above includes two data-bindings:
|
1359
|
+
- 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.
|
1360
|
+
- 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)
|
1361
|
+
|
1362
|
+
Additionally, Table `items` data-binding automatically stores each node model unto the SWT TableItem object via `setData` method. This enables things like searchability.
|
1363
|
+
|
1364
|
+
The table widget in Glimmer is represented by a subclass of `WidgetProxy` called `TableProxy`.
|
1365
|
+
TableProxy includes a `search` method that takes a block to look for a table item.
|
1366
|
+
|
1367
|
+
Example:
|
1368
|
+
|
1369
|
+
```ruby
|
1370
|
+
found_array = @table.search { |table_item| table_item.getData == company.owner }
|
1371
|
+
```
|
1372
|
+
|
1373
|
+
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.
|
1374
|
+
|
1375
|
+
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)`.
|
1376
|
+
This automatically leverages the SWT TableEditor custom class behind the scenes, displaying a text widget to the user to change the selected or
|
1377
|
+
passed table item text into something else.
|
1378
|
+
It automatically persists the change to `items` data-bound model on ENTER/FOCUS-OUT or cancels on ESC/NO-CHANGE.
|
1274
1379
|
|
1275
1380
|
#### Tree
|
1276
1381
|
|
@@ -1486,7 +1591,9 @@ Glimmer supports creating custom widgets with minimal code, which automatically
|
|
1486
1591
|
|
1487
1592
|
Simply create a new class that includes `Glimmer::UI::CustomWidget` and put Glimmer DSL code in its `#body` block (its return value is stored in `#body_root` attribute). Glimmer will then automatically recognize this class by convention when it encounters a keyword matching the class name converted to underscored lowercase (and namespace double-colons `::` replaced with double-underscores `__`)
|
1488
1593
|
|
1489
|
-
#### Example
|
1594
|
+
#### Simple Example
|
1595
|
+
|
1596
|
+
(you may copy/paste in [`girb`](#girb-glimmer-irb-command))
|
1490
1597
|
|
1491
1598
|
Definition:
|
1492
1599
|
```ruby
|
@@ -1512,7 +1619,9 @@ shell {
|
|
1512
1619
|
|
1513
1620
|
As you can see, `RedLabel` became Glimmer DSL keyword: `red_label`
|
1514
1621
|
|
1515
|
-
####
|
1622
|
+
#### Lifecycle Hook Example
|
1623
|
+
|
1624
|
+
(you may copy/paste in [`girb`](#girb-glimmer-irb-command))
|
1516
1625
|
|
1517
1626
|
Definition:
|
1518
1627
|
```ruby
|
@@ -1545,10 +1654,12 @@ shell {
|
|
1545
1654
|
}.open
|
1546
1655
|
```
|
1547
1656
|
|
1548
|
-
Notice how `Red::Composite` became `red__composite` with double-underscore, which is how Glimmer Custom Widgets signify namespaces by convention. Additionally, `before_body` hook was utilized to set a `@color` variable and use inside the `body`.
|
1657
|
+
Notice how `Red::Composite` became `red__composite` with double-underscore, which is how Glimmer Custom Widgets signify namespaces by convention. Additionally, the `before_body` lifecycle hook was utilized to set a `@color` variable and use inside the `body`.
|
1549
1658
|
|
1550
1659
|
Keep in mind that namespaces are not needed to be specified if the Custom Widget class has a unique name, not clashing with a basic SWT widget or another custom widget name.
|
1551
1660
|
|
1661
|
+
#### Custom Widget API
|
1662
|
+
|
1552
1663
|
Custom Widgets have the following attributes available to call from inside the `#body` method:
|
1553
1664
|
- `#parent`: Glimmer object parenting custom widget
|
1554
1665
|
- `#swt_style`: SWT style integer. Can be useful if you want to allow consumers to customize a widget inside the custom widget body
|
@@ -1561,7 +1672,9 @@ Additionally, custom widgets can call the following class methods:
|
|
1561
1672
|
- `::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)
|
1562
1673
|
- `::option(option_name, default: nil)`: declares a single option taking option name and default value as arguments (also generates attribute accessors just like `::options`)
|
1563
1674
|
|
1564
|
-
#### Content/Options Example
|
1675
|
+
#### Content/Options Example
|
1676
|
+
|
1677
|
+
(you may copy/paste in [`girb`](#girb-glimmer-irb-command))
|
1565
1678
|
|
1566
1679
|
Definition:
|
1567
1680
|
```ruby
|
@@ -1601,7 +1714,9 @@ shell {
|
|
1601
1714
|
|
1602
1715
|
Notice how `:no_focus` was the `swt_style` value, followed by the `options` hash `{orientation: :horizontal, bg_color: :white}`, and finally the `content` block containing the label with `'SANDWICH CONTENT'`
|
1603
1716
|
|
1604
|
-
|
1717
|
+
#### Custom Widget Lifecycle Hooks
|
1718
|
+
|
1719
|
+
Last but not least, these are the available lifecycle hooks:
|
1605
1720
|
- `before_body`: takes a block that executes in the custom widget instance scope before calling `body`. Useful for initializing variables to later use in `body`
|
1606
1721
|
- `after_body`: takes a block that executes in the custom widget instance scope after calling `body`. Useful for setting up observers on widgets built in `body` (set in instance variables) and linking to other shells.
|
1607
1722
|
|
@@ -1702,92 +1817,19 @@ shell { |app_shell|
|
|
1702
1817
|
|
1703
1818
|
### Miscellaneous
|
1704
1819
|
|
1705
|
-
####
|
1706
|
-
|
1707
|
-
Mac applications always have About and Preferences menu items. Glimmer provides widget observer hooks for them on the `display`:
|
1708
|
-
- `on_about`: executes code when user selects App Name -> About
|
1709
|
-
- `on_preferences`: executes code when user selects App Name -> Preferences or hits 'CMD+,' on the Mac
|
1710
|
-
|
1711
|
-
Example (you may copy/paste in [`girb`](#girb-glimmer-irb-command)):
|
1712
|
-
|
1713
|
-
```ruby
|
1714
|
-
class Example
|
1715
|
-
def initialize
|
1716
|
-
display {
|
1717
|
-
on_about {
|
1718
|
-
message_box = MessageBox.new(@shell_proxy.swt_widget)
|
1719
|
-
message_box.setText("About")
|
1720
|
-
message_box.setMessage("About Application")
|
1721
|
-
message_box.open
|
1722
|
-
}
|
1723
|
-
on_preferences {
|
1724
|
-
preferences_dialog = dialog {
|
1725
|
-
text 'Preferences'
|
1726
|
-
row_layout {
|
1727
|
-
type :vertical
|
1728
|
-
margin_left 15
|
1729
|
-
margin_top 15
|
1730
|
-
margin_right 15
|
1731
|
-
margin_bottom 15
|
1732
|
-
}
|
1733
|
-
label {
|
1734
|
-
text 'Check one of these options:'
|
1735
|
-
}
|
1736
|
-
button(:radio) {
|
1737
|
-
text 'Option 1'
|
1738
|
-
}
|
1739
|
-
button(:radio) {
|
1740
|
-
text 'Option 2'
|
1741
|
-
}
|
1742
|
-
}
|
1743
|
-
preferences_dialog.open
|
1744
|
-
}
|
1745
|
-
}
|
1746
|
-
@shell_proxy = shell {
|
1747
|
-
text 'Application Menu Items'
|
1748
|
-
fill_layout {
|
1749
|
-
margin_width 15
|
1750
|
-
margin_height 15
|
1751
|
-
}
|
1752
|
-
label {
|
1753
|
-
text 'Application Menu Items'
|
1754
|
-
font height: 30
|
1755
|
-
}
|
1756
|
-
}
|
1757
|
-
@shell_proxy.open
|
1758
|
-
end
|
1759
|
-
end
|
1760
|
-
|
1761
|
-
Example.new
|
1762
|
-
```
|
1763
|
-
|
1764
|
-
#### App Name and Version
|
1765
|
-
|
1766
|
-
Application name (shows up on the Mac in top menu bar) and version may be specified upon [packaging](#packaging--distribution) by specifying "-Bmac.CFBundleName" and "-Bmac.CFBundleVersion" options.
|
1767
|
-
|
1768
|
-
Still, if you would like proper application name to show up on the Mac top menu bar during development, you may do so by invoking the SWT Display.setAppName method before any Display object has been instantiated (i.e. before any Glimmer widget like shell has been declared).
|
1769
|
-
|
1770
|
-
Example (you may copy/paste in [`girb`](#girb-glimmer-irb-command)):
|
1771
|
-
|
1772
|
-
```ruby
|
1773
|
-
Display.setAppName('Glimmer Demo')
|
1774
|
-
|
1775
|
-
shell(:no_resize) {
|
1776
|
-
text "Glimmer"
|
1777
|
-
label {
|
1778
|
-
text "Hello, World!"
|
1779
|
-
}
|
1780
|
-
}.open
|
1781
|
-
```
|
1820
|
+
#### Multi-DSL Support
|
1782
1821
|
|
1783
|
-
|
1822
|
+
Glimmer is a DSL engine that supports multiple DSLs (Domain Specific Languages):
|
1823
|
+
- [SWT](https://github.com/AndyObtiva/glimmer-dsl-swt): Glimmer DSL for SWT (Desktop GUI)
|
1824
|
+
- [Opal](https://github.com/AndyObtiva/glimmer-dsl-opal): Glimmer DSL for Opal (Web GUI Adapter for Desktop Apps)
|
1825
|
+
- [XML](https://github.com/AndyObtiva/glimmer-dsl-xml): Glimmer DSL for XML (& HTML) - Useful with [SWT Browser Widget](#browser-widget)
|
1826
|
+
- [CSS](https://github.com/AndyObtiva/glimmer-dsl-css): Glimmer DSL for CSS (Cascading Style Sheets) - Useful with [SWT Browser Widget](#browser-widget)
|
1784
1827
|
|
1785
|
-
|
1828
|
+
Glimmer automatically recognizes top-level keywords in each DSL and activates DSL accordingly. Glimmer allows mixing DSLs, which comes in handy when doing things like using the SWT Browser widget with XML and CSS. Once done processing a nested DSL top-level keyword, Glimmer switches back to the prior DSL automatically.
|
1786
1829
|
|
1787
|
-
|
1788
|
-
and switches DSLs accordingly. Once done processing a top-level keyword, it switches back to the prior DSL automatically.
|
1830
|
+
##### SWT
|
1789
1831
|
|
1790
|
-
|
1832
|
+
The SWT DSL was already covered in detail. However, for the sake of mixing DSLs, you need to know that the SWT DSL has the following top-level keywords:
|
1791
1833
|
- `shell`
|
1792
1834
|
- `display`
|
1793
1835
|
- `color`
|
@@ -1795,7 +1837,13 @@ For example, the SWT DSL has the following top-level keywords:
|
|
1795
1837
|
- `async_exec`
|
1796
1838
|
- `sync_exec`
|
1797
1839
|
|
1798
|
-
#####
|
1840
|
+
##### Opal
|
1841
|
+
|
1842
|
+
Full instructions are found in the [Opal](https://github.com/AndyObtiva/glimmer-dsl-opal) DSL page.
|
1843
|
+
|
1844
|
+
The [Opal](https://github.com/AndyObtiva/glimmer-dsl-opal) DSL is simply a web GUI adapter for desktop apps written in Glimmer. As such, it supports all the DSL keywords of the SWT DSL and shares the same top-level keywords.
|
1845
|
+
|
1846
|
+
##### XML
|
1799
1847
|
|
1800
1848
|
Simply start with `html` keyword and add HTML inside its block using Glimmer DSL syntax.
|
1801
1849
|
Once done, you may call `to_s`, `to_xml`, or `to_html` to get the formatted HTML output.
|
@@ -1873,8 +1921,7 @@ Output:
|
|
1873
1921
|
<DOCUMENT><document:body document:id="main"></document:body></DOCUMENT>
|
1874
1922
|
```
|
1875
1923
|
|
1876
|
-
|
1877
|
-
##### CSS DSL
|
1924
|
+
##### CSS
|
1878
1925
|
|
1879
1926
|
Simply start with `css` keyword and add stylesheet rule sets inside its block using Glimmer DSL syntax.
|
1880
1927
|
Once done, you may call `to_s` or `to_css` to get the formatted CSS output.
|
@@ -1910,6 +1957,86 @@ Glimmer provides a number of methods on Glimmer::DSL::Engine to configure DSL su
|
|
1910
1957
|
- `Glimmer::DSL::Engine.enable_dsl(dsl_name)`: Re-enables disabled DSL
|
1911
1958
|
- `Glimmer::DSL::Engine.enabled_dsls=(dsl_names)`: Disables all DSLs except the ones specified.
|
1912
1959
|
|
1960
|
+
#### Application Menu Items (About/Preferences)
|
1961
|
+
|
1962
|
+
Mac applications always have About and Preferences menu items. Glimmer provides widget observer hooks for them on the `display`:
|
1963
|
+
- `on_about`: executes code when user selects App Name -> About
|
1964
|
+
- `on_preferences`: executes code when user selects App Name -> Preferences or hits 'CMD+,' on the Mac
|
1965
|
+
|
1966
|
+
Example (you may copy/paste in [`girb`](#girb-glimmer-irb-command)):
|
1967
|
+
|
1968
|
+
```ruby
|
1969
|
+
class Example
|
1970
|
+
def initialize
|
1971
|
+
display {
|
1972
|
+
on_about {
|
1973
|
+
message_box = MessageBox.new(@shell_proxy.swt_widget)
|
1974
|
+
message_box.setText("About")
|
1975
|
+
message_box.setMessage("About Application")
|
1976
|
+
message_box.open
|
1977
|
+
}
|
1978
|
+
on_preferences {
|
1979
|
+
preferences_dialog = dialog {
|
1980
|
+
text 'Preferences'
|
1981
|
+
row_layout {
|
1982
|
+
type :vertical
|
1983
|
+
margin_left 15
|
1984
|
+
margin_top 15
|
1985
|
+
margin_right 15
|
1986
|
+
margin_bottom 15
|
1987
|
+
}
|
1988
|
+
label {
|
1989
|
+
text 'Check one of these options:'
|
1990
|
+
}
|
1991
|
+
button(:radio) {
|
1992
|
+
text 'Option 1'
|
1993
|
+
}
|
1994
|
+
button(:radio) {
|
1995
|
+
text 'Option 2'
|
1996
|
+
}
|
1997
|
+
}
|
1998
|
+
preferences_dialog.open
|
1999
|
+
}
|
2000
|
+
}
|
2001
|
+
@shell_proxy = shell {
|
2002
|
+
text 'Application Menu Items'
|
2003
|
+
fill_layout {
|
2004
|
+
margin_width 15
|
2005
|
+
margin_height 15
|
2006
|
+
}
|
2007
|
+
label {
|
2008
|
+
text 'Application Menu Items'
|
2009
|
+
font height: 30
|
2010
|
+
}
|
2011
|
+
}
|
2012
|
+
@shell_proxy.open
|
2013
|
+
end
|
2014
|
+
end
|
2015
|
+
|
2016
|
+
Example.new
|
2017
|
+
```
|
2018
|
+
|
2019
|
+
#### App Name and Version
|
2020
|
+
|
2021
|
+
Application name (shows up on the Mac in top menu bar) and version may be specified upon [packaging](#packaging--distribution) by specifying "-Bmac.CFBundleName" and "-Bmac.CFBundleVersion" options.
|
2022
|
+
|
2023
|
+
Still, if you would like proper application name to show up on the Mac top menu bar during development, you may do so by invoking the SWT Display.setAppName method before any Display object has been instantiated (i.e. before any Glimmer widget like shell has been declared).
|
2024
|
+
|
2025
|
+
Example (you may copy/paste in [`girb`](#girb-glimmer-irb-command)):
|
2026
|
+
|
2027
|
+
```ruby
|
2028
|
+
Display.setAppName('Glimmer Demo')
|
2029
|
+
|
2030
|
+
shell(:no_resize) {
|
2031
|
+
text "Glimmer"
|
2032
|
+
label {
|
2033
|
+
text "Hello, World!"
|
2034
|
+
}
|
2035
|
+
}.open
|
2036
|
+
```
|
2037
|
+
|
2038
|
+
Also, you may invoke `Display.setAppVersion('1.0.0')` if needed for OS app version identification reasons during development, replacing `'1.0.0'` with your application version.
|
2039
|
+
|
1913
2040
|
#### Video Widget
|
1914
2041
|
|
1915
2042
|
![Video Widget](images/glimmer-video-widget.png)
|
@@ -1920,6 +2047,8 @@ You may obtain via `glimmer-cw-video` gem.
|
|
1920
2047
|
|
1921
2048
|
#### Browser Widget
|
1922
2049
|
|
2050
|
+
![Hello Browser](images/glimmer-hello-browser.png)
|
2051
|
+
|
1923
2052
|
Glimmer supports SWT Browser widget, which can load URLs or render HTML. It can even be instrumented with JavaScript when needed (though highly discouraged in Glimmer except for rare cases when leveraging a pre-existing web codebase in a desktop app).
|
1924
2053
|
|
1925
2054
|
Example loading a URL (you may copy/paste in [`girb`](#girb-glimmer-irb-command)):
|
@@ -1933,7 +2062,7 @@ shell {
|
|
1933
2062
|
}.open
|
1934
2063
|
```
|
1935
2064
|
|
1936
|
-
Example rendering HTML with JavaScript on document ready (you may copy/paste in [`girb`](#girb-glimmer-irb-command)):
|
2065
|
+
Example rendering HTML with JavaScript on document ready (you may copy/paste in [`girb`](#girb-glimmer-irb-command) provided you install and require [glimmer-dsl-xml gem](https://github.com/AndyObtiva/glimmer-dsl-xml)):
|
1937
2066
|
|
1938
2067
|
```ruby
|
1939
2068
|
shell {
|
@@ -1954,7 +2083,7 @@ shell {
|
|
1954
2083
|
}.open
|
1955
2084
|
```
|
1956
2085
|
|
1957
|
-
This relies on Glimmer's [Multi-DSL Support](
|
2086
|
+
This relies on Glimmer's [Multi-DSL Support](#multi-dsl-support) for building the HTML text using [Glimmer XML DSL](https://github.com/AndyObtiva/glimmer-dsl-xml).
|
1958
2087
|
|
1959
2088
|
## Glimmer Style Guide
|
1960
2089
|
|
@@ -1973,9 +2102,9 @@ This relies on Glimmer's [Multi-DSL Support](https://github.com/AndyObtiva/glimm
|
|
1973
2102
|
|
1974
2103
|
## Samples
|
1975
2104
|
|
1976
|
-
Check the [samples](samples) directory for examples on how to write Glimmer applications. To run a sample, make sure to install the `glimmer` gem first and then use the `glimmer` 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`).
|
2105
|
+
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` gem first and then use the `glimmer` 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`).
|
1977
2106
|
|
1978
|
-
If you cloned the project and followed [CONTRIBUTING.md](CONTRIBUTING.md) instructions, you may run all samples at once via `samples/launch` command:
|
2107
|
+
If you cloned the project and followed [CONTRIBUTING.md](CONTRIBUTING.md) instructions, you may run all samples in [glimmer-dsl-swt](https://github.com/AndyObtiva/glimmer-dsl-swt) at once via `samples/launch` command:
|
1979
2108
|
|
1980
2109
|
```
|
1981
2110
|
samples/launch
|
@@ -1999,33 +2128,85 @@ glimmer samples/hello/hello_computed.rb # demonstrates computed data-binding
|
|
1999
2128
|
|
2000
2129
|
For more elaborate samples, check the following:
|
2001
2130
|
|
2131
|
+
#### Login
|
2132
|
+
|
2002
2133
|
```
|
2003
2134
|
glimmer samples/elaborate/login.rb # demonstrates basic data-binding
|
2004
|
-
|
2135
|
+
```
|
2136
|
+
|
2137
|
+
![Login](images/glimmer-login.png)
|
2138
|
+
![Login Filled In](images/glimmer-login-filled-in.png)
|
2139
|
+
![Login Logged In](images/glimmer-login-logged-in.png)
|
2140
|
+
|
2141
|
+
#### Tic Tac Toe
|
2142
|
+
|
2143
|
+
```
|
2005
2144
|
glimmer samples/elaborate/tic_tac_toe.rb # demonstrates a full MVC application
|
2006
2145
|
```
|
2007
2146
|
|
2147
|
+
![Tic Tac Toe](images/glimmer-tic-tac-toe.png)
|
2148
|
+
![Tic Tac Toe In Progress](images/glimmer-tic-tac-toe-in-progress.png)
|
2149
|
+
![Tic Tac Toe Game Over](images/glimmer-tic-tac-toe-game-over.png)
|
2150
|
+
|
2151
|
+
#### Contact Manager
|
2152
|
+
|
2153
|
+
```
|
2154
|
+
glimmer samples/elaborate/contact_manager.rb # demonstrates table data-binding
|
2155
|
+
```
|
2156
|
+
|
2157
|
+
Contact Manager
|
2158
|
+
|
2159
|
+
![Contact Manager](images/glimmer-contact-manager.png)
|
2160
|
+
|
2161
|
+
Contact Manager - Find
|
2162
|
+
|
2163
|
+
![Contact Manager](images/glimmer-contact-manager-find.png)
|
2164
|
+
|
2165
|
+
Contact Manager - Edit Started
|
2166
|
+
|
2167
|
+
![Contact Manager](images/glimmer-contact-manager-edit-started.png)
|
2168
|
+
|
2169
|
+
Contact Manager - Edit In Progress
|
2170
|
+
|
2171
|
+
![Contact Manager](images/glimmer-contact-manager-edit-in-progress.png)
|
2172
|
+
|
2173
|
+
Contact Manager - Edit Done
|
2174
|
+
|
2175
|
+
![Contact Manager](images/glimmer-contact-manager-edit-done.png)
|
2176
|
+
|
2008
2177
|
### External Samples
|
2009
2178
|
|
2010
|
-
####
|
2179
|
+
#### Glimmer Calculator
|
2011
2180
|
|
2012
|
-
|
2181
|
+
[<img src="https://raw.githubusercontent.com/AndyObtiva/glimmer-cs-calculator/v1.0.0/glimmer-cs-calculator-screenshot.png" />](https://github.com/AndyObtiva/glimmer-cs-calculator)
|
2013
2182
|
|
2014
2183
|
[Glimmer Calculator](https://github.com/AndyObtiva/glimmer-cs-calculator) is a basic calculator sample project demonstrating data-binding and TDD (test-driven-development) with Glimmer following the MVP pattern (Model-View-Presenter).
|
2015
2184
|
|
2016
|
-
####
|
2185
|
+
#### Gladiator
|
2017
2186
|
|
2018
|
-
|
2187
|
+
[<img src="https://raw.githubusercontent.com/AndyObtiva/glimmer-cs-gladiator/v0.1.5/images/glimmer-gladiator.png" />](https://github.com/AndyObtiva/glimmer-cs-gladiator)
|
2019
2188
|
|
2020
2189
|
[Gladiator](https://github.com/AndyObtiva/glimmer-cs-gladiator) (short for Glimmer Editor) is a Glimmer sample project under on-going development.
|
2021
2190
|
You may check it out to learn how to build a Glimmer Custom Shell gem.
|
2022
2191
|
|
2192
|
+
Gladiator is a good demonstration of:
|
2193
|
+
- MVP Pattern
|
2194
|
+
- Tree data-binding
|
2195
|
+
- List data-binding
|
2196
|
+
- Text selection data-binding
|
2197
|
+
- Tabs
|
2198
|
+
- Context menus
|
2199
|
+
- Custom Shell
|
2200
|
+
- Custom widget
|
2201
|
+
|
2023
2202
|
## In Production
|
2024
2203
|
|
2025
2204
|
The following production apps have been built with Glimmer:
|
2026
2205
|
|
2027
2206
|
[<img alt="Math Bowling Logo" src="https://raw.githubusercontent.com/AndyObtiva/MathBowling/master/images/math-bowling-logo.png" width="40" />Math Bowling](https://github.com/AndyObtiva/MathBowling): an educational math game for elementary level kids
|
2028
2207
|
|
2208
|
+
If you have a Glimmer app you would like referenced here, please mention in a Pull Request.
|
2209
|
+
|
2029
2210
|
## SWT Reference
|
2030
2211
|
|
2031
2212
|
https://www.eclipse.org/swt/docs.php
|
@@ -2086,6 +2267,14 @@ You can learn more about importing Java packages into Ruby code at this JRuby WI
|
|
2086
2267
|
|
2087
2268
|
https://github.com/jruby/jruby/wiki/CallingJavaFromJRuby
|
2088
2269
|
|
2270
|
+
## Infinite Loop Detection
|
2271
|
+
|
2272
|
+
Glimmer can detect if an infinite loop occurs with method_missing by ensuring it does not loop with the same keyword and args more than 100 times.
|
2273
|
+
|
2274
|
+
The max limit can be changed via the `Glimmer::Config::loop_max_count=(count)` method.
|
2275
|
+
|
2276
|
+
Infinite loop detection may be disabled by setting `Glimmer::Config::loop_max_count` to `-1`
|
2277
|
+
|
2089
2278
|
## Logging
|
2090
2279
|
|
2091
2280
|
Glimmer comes with a Ruby Logger accessible via `Glimmer::Config.logger`
|
@@ -2200,6 +2389,8 @@ The Glimmer rake task allows passing extra options to javapackager via:
|
|
2200
2389
|
Example (Rakefile):
|
2201
2390
|
|
2202
2391
|
```ruby
|
2392
|
+
require 'glimmer/rake_task'
|
2393
|
+
|
2203
2394
|
Glimmer::Package.javapackager_extra_args = '-BlicenseType="MIT" -Bmac.category="public.app-category.business" -Bmac.signing-key-developer-id-app="Andy Maleh"'
|
2204
2395
|
```
|
2205
2396
|
|
@@ -2283,10 +2474,11 @@ Exec failed with code 2 command [[/usr/bin/SetFile, -c, icnC, /var/folders/4_/g1
|
|
2283
2474
|
## Resources
|
2284
2475
|
|
2285
2476
|
* [Code Master Blog](http://andymaleh.blogspot.com/search/label/Glimmer)
|
2286
|
-
* [Eclipse Zone Tutorial](http://eclipse.dzone.com/articles/an-introduction-glimmer)
|
2287
|
-
* [InfoQ Article](http://www.infoq.com/news/2008/02/glimmer-jruby-swt)
|
2288
|
-
* [RubyConf 2008 Video](https://confreaks.tv/videos/rubyconf2008-desktop-development-with-glimmer)
|
2289
2477
|
* [JRuby Cookbook by Justin Edelson & Henry Liu](http://shop.oreilly.com/product/9780596519650.do)
|
2478
|
+
* [MountainWest RubyConf 2011 Video](https://confreaks.tv/videos/mwrc2011-whatever-happened-to-desktop-development-in-ruby)
|
2479
|
+
* [RubyConf 2008 Video](https://confreaks.tv/videos/rubyconf2008-desktop-development-with-glimmer)
|
2480
|
+
* [InfoQ Article](http://www.infoq.com/news/2008/02/glimmer-jruby-swt)
|
2481
|
+
* [DZone Tutorial](https://dzone.com/articles/an-introduction-glimmer)
|
2290
2482
|
|
2291
2483
|
## Help
|
2292
2484
|
|
@@ -2296,16 +2488,18 @@ You may submit [issues](https://github.com/AndyObtiva/glimmer/issues) on [GitHub
|
|
2296
2488
|
|
2297
2489
|
[Click here to submit an issue.](https://github.com/AndyObtiva/glimmer/issues)
|
2298
2490
|
|
2299
|
-
###
|
2300
|
-
|
2301
|
-
If you need live help, try the [#glimmer](http://widget.mibbit.com/?settings=7514b8a196f8f1de939a351245db7aa8&server=irc.mibbit.net&channel=%23glimmer) IRC channel on [irc.mibbit.net](http://widget.mibbit.com/?settings=7514b8a196f8f1de939a351245db7aa8&server=irc.mibbit.net&channel=%23glimmer). If no one was available, you may [leave a GitHub issue](https://github.com/AndyObtiva/glimmer/issues) to schedule a meetup on IRC.
|
2491
|
+
### Chat
|
2302
2492
|
|
2303
|
-
|
2493
|
+
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)
|
2304
2494
|
|
2305
2495
|
## Feature Suggestions
|
2306
2496
|
|
2307
2497
|
These features have been suggested. You might see them in a future version of Glimmer. You are welcome to contribute more feature suggestions.
|
2308
2498
|
|
2499
|
+
[glimmer-dsl-swt/TODO.md](https://github.com/AndyObtiva/glimmer-dsl-swt/blob/master/TODO.md)
|
2500
|
+
|
2501
|
+
Glimmer DSL Engine specific tasks are at:
|
2502
|
+
|
2309
2503
|
[TODO.md](TODO.md)
|
2310
2504
|
|
2311
2505
|
## Change Log
|
@@ -2314,6 +2508,10 @@ These features have been suggested. You might see them in a future version of Gl
|
|
2314
2508
|
|
2315
2509
|
## Contributing
|
2316
2510
|
|
2511
|
+
**Contributors Wanted!**
|
2512
|
+
|
2513
|
+
If you would like to contribute to Glimmer, please study up on Glimmer and [SWT](#swt-reference), run all Glimmer [samples](#samples), and build a small sample app to add to [glimmer-dsl-swt](https://github.com/AndyObtiva/glimmer-dsl-swt) Hello or Elaborate samples via a Pull Request. Once done, contact me on [Chat](#chat).
|
2514
|
+
|
2317
2515
|
[CONTRIBUTING.md](CONTRIBUTING.md)
|
2318
2516
|
|
2319
2517
|
## Contributors
|
@@ -2327,3 +2525,5 @@ These features have been suggested. You might see them in a future version of Gl
|
|
2327
2525
|
|
2328
2526
|
Copyright (c) 2007-2020 Andy Maleh.
|
2329
2527
|
See LICENSE.txt for further details.
|
2528
|
+
|
2529
|
+
Glimmer logo was made by <a href="https://www.flaticon.com/authors/freepik" title="Freepik">Freepik</a> from <a href="https://www.flaticon.com/" title="Flaticon"> www.flaticon.com</a>
|