glimmer-dsl-swt 0.6.1 → 0.6.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (50) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +3 -2
  3. data/VERSION +1 -1
  4. data/bin/girb +1 -1
  5. data/bin/glimmer +5 -1
  6. data/icons/scaffold_app.png +0 -0
  7. data/lib/ext/glimmer/config.rb +13 -1
  8. data/lib/glimmer-dsl-swt.rb +5 -9
  9. data/lib/glimmer/Rakefile +5 -0
  10. data/lib/glimmer/data_binding/table_items_binding.rb +4 -1
  11. data/lib/glimmer/dsl/swt/cursor_expression.rb +1 -4
  12. data/lib/glimmer/dsl/swt/dsl.rb +1 -0
  13. data/lib/glimmer/dsl/swt/font_expression.rb +3 -1
  14. data/lib/glimmer/dsl/swt/image_expression.rb +21 -0
  15. data/lib/glimmer/dsl/swt/message_box_expression.rb +9 -1
  16. data/lib/glimmer/dsl/swt/widget_expression.rb +7 -7
  17. data/lib/glimmer/launcher.rb +59 -20
  18. data/lib/glimmer/package.rb +26 -9
  19. data/lib/glimmer/rake_task.rb +115 -5
  20. data/lib/glimmer/scaffold.rb +65 -32
  21. data/lib/glimmer/swt/display_proxy.rb +13 -2
  22. data/lib/glimmer/swt/image_proxy.rb +16 -23
  23. data/lib/glimmer/swt/layout_proxy.rb +2 -0
  24. data/lib/glimmer/swt/message_box_proxy.rb +23 -5
  25. data/lib/glimmer/swt/scrolled_composite_proxy.rb +6 -11
  26. data/lib/glimmer/swt/shell_proxy.rb +0 -1
  27. data/lib/glimmer/swt/table_proxy.rb +60 -2
  28. data/lib/glimmer/swt/widget_proxy.rb +72 -18
  29. data/samples/elaborate/contact_manager.rb +121 -0
  30. data/samples/elaborate/contact_manager/contact.rb +11 -0
  31. data/samples/elaborate/contact_manager/contact_manager_presenter.rb +26 -0
  32. data/samples/elaborate/contact_manager/contact_repository.rb +244 -0
  33. data/samples/elaborate/login.rb +108 -0
  34. data/samples/elaborate/tic_tac_toe.rb +55 -0
  35. data/samples/elaborate/tic_tac_toe/board.rb +124 -0
  36. data/samples/elaborate/tic_tac_toe/cell.rb +27 -0
  37. data/samples/elaborate/user_profile.rb +55 -0
  38. data/samples/hello/hello_browser.rb +8 -0
  39. data/samples/hello/hello_combo.rb +38 -0
  40. data/samples/hello/hello_computed.rb +69 -0
  41. data/samples/hello/hello_computed/contact.rb +21 -0
  42. data/samples/hello/hello_drag_and_drop.rb +29 -0
  43. data/samples/hello/hello_list_multi_selection.rb +48 -0
  44. data/samples/hello/hello_list_single_selection.rb +37 -0
  45. data/samples/hello/hello_menu_bar.rb +64 -0
  46. data/samples/hello/hello_message_box.rb +15 -0
  47. data/samples/hello/hello_pop_up_context_menu.rb +36 -0
  48. data/samples/hello/hello_tab.rb +24 -0
  49. data/samples/hello/hello_world.rb +8 -0
  50. metadata +66 -8
@@ -0,0 +1,21 @@
1
+ class HelloComputed
2
+ class Contact
3
+ attr_accessor :first_name, :last_name, :year_of_birth
4
+
5
+ def initialize(attribute_map)
6
+ @first_name = attribute_map[:first_name]
7
+ @last_name = attribute_map[:last_name]
8
+ @year_of_birth = attribute_map[:year_of_birth]
9
+ end
10
+
11
+ def name
12
+ "#{last_name}, #{first_name}"
13
+ end
14
+
15
+ def age
16
+ Time.now.year - year_of_birth.to_i
17
+ rescue
18
+ 0
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,29 @@
1
+ class Location
2
+ attr_accessor :country
3
+
4
+ def country_options
5
+ %w[USA Canada Mexico Columbia UK Australia Germany Italy Spain]
6
+ end
7
+ end
8
+
9
+ @location = Location.new
10
+
11
+ include Glimmer
12
+
13
+ shell {
14
+ text 'Hello, Drag and Drop!'
15
+ list {
16
+ selection bind(@location, :country)
17
+ on_drag_set_data { |event|
18
+ list = event.widget.getControl
19
+ event.data = list.getSelection.first
20
+ }
21
+ }
22
+ label(:center) {
23
+ text 'Drag a country here!'
24
+ font height: 20
25
+ on_drop { |event|
26
+ event.widget.getControl.setText(event.data)
27
+ }
28
+ }
29
+ }.open
@@ -0,0 +1,48 @@
1
+ class Person
2
+ attr_accessor :provinces, :provinces_options
3
+
4
+ def initialize
5
+ self.provinces_options=[
6
+ "",
7
+ "Quebec",
8
+ "Ontario",
9
+ "Manitoba",
10
+ "Saskatchewan",
11
+ "Alberta",
12
+ "British Columbia",
13
+ "Nova Skotia",
14
+ "Newfoundland"
15
+ ]
16
+ self.provinces = ["Quebec", "Manitoba", "Alberta"]
17
+ end
18
+
19
+ def reset_provinces
20
+ self.provinces = ["Quebec", "Manitoba", "Alberta"]
21
+ end
22
+ end
23
+
24
+ class HelloListMultiSelection
25
+ include Glimmer
26
+
27
+ def launch
28
+ person = Person.new
29
+
30
+ shell {
31
+ grid_layout
32
+
33
+ text 'Hello, List Multi Selection!'
34
+
35
+ list(:multi) {
36
+ selection bind(person, :provinces)
37
+ }
38
+
39
+ button {
40
+ text "Reset Selection To Defaults"
41
+
42
+ on_widget_selected { person.reset_provinces }
43
+ }
44
+ }.open
45
+ end
46
+ end
47
+
48
+ HelloListMultiSelection.new.launch
@@ -0,0 +1,37 @@
1
+ class Person
2
+ attr_accessor :country, :country_options
3
+
4
+ def initialize
5
+ self.country_options=["", "Canada", "US", "Mexico"]
6
+ self.country = "Canada"
7
+ end
8
+
9
+ def reset_country
10
+ self.country = "Canada"
11
+ end
12
+ end
13
+
14
+ class HelloListSingleSelection
15
+ include Glimmer
16
+ def launch
17
+ person = Person.new
18
+
19
+ shell {
20
+ grid_layout
21
+
22
+ text 'Hello, List Single Selection!'
23
+
24
+ list {
25
+ selection bind(person, :country)
26
+ }
27
+
28
+ button {
29
+ text "Reset Selection To Default Value"
30
+
31
+ on_widget_selected { person.reset_country }
32
+ }
33
+ }.open
34
+ end
35
+ end
36
+
37
+ HelloListSingleSelection.new.launch
@@ -0,0 +1,64 @@
1
+ include Glimmer
2
+
3
+ shell { |shell_proxy|
4
+ text 'Hello, Menu Bar!'
5
+ grid_layout
6
+ label(:center) {
7
+ font height: 16
8
+ text 'Check Out The File Menu and History Menu in The Menu Bar Above!'
9
+ }
10
+ menu_bar {
11
+ menu {
12
+ text '&File'
13
+ menu_item {
14
+ text 'E&xit'
15
+ on_widget_selected {
16
+ exit(0)
17
+ }
18
+ }
19
+ menu_item(0) {
20
+ text '&New'
21
+ on_widget_selected {
22
+ message_box(shell_proxy) {
23
+ text 'New File'
24
+ message 'New File Contents'
25
+ }.open
26
+ }
27
+ }
28
+ menu(1) {
29
+ text '&Options'
30
+ menu_item(:radio) {
31
+ text 'Option 1'
32
+ }
33
+ menu_item(:separator)
34
+ menu_item(:check) {
35
+ text 'Option 3'
36
+ }
37
+ }
38
+ }
39
+ menu {
40
+ text '&History'
41
+ menu {
42
+ text '&Recent'
43
+ menu_item {
44
+ text 'File 1'
45
+ on_widget_selected {
46
+ message_box(shell_proxy) {
47
+ text 'File 1'
48
+ message 'File 1 Contents'
49
+ }.open
50
+ }
51
+ }
52
+ menu_item {
53
+ text 'File 2'
54
+ on_widget_selected {
55
+ message_box(shell_proxy) {
56
+ text 'File 2'
57
+ message 'File 2 Contents'
58
+ }.open
59
+ }
60
+ }
61
+ }
62
+ }
63
+ }
64
+ }.open
@@ -0,0 +1,15 @@
1
+ include Glimmer
2
+
3
+ @shell = shell {
4
+ text 'Hello, Message Box!'
5
+ button {
6
+ text 'Please Click To Win a Surprise'
7
+ on_widget_selected {
8
+ message_box(@shell) {
9
+ text 'Surprise'
10
+ message "Congratulations!\n\nYou have won $1,000,000!"
11
+ }.open
12
+ }
13
+ }
14
+ }
15
+ @shell.open
@@ -0,0 +1,36 @@
1
+ include Glimmer
2
+
3
+ shell { |shell_proxy|
4
+ text 'Hello, Pop Up Context Menu!'
5
+ grid_layout
6
+ label {
7
+ font height: 16
8
+ text 'Right-Click To Pop Up a Context Menu'
9
+ menu {
10
+ menu {
11
+ text '&History'
12
+ menu {
13
+ text '&Recent'
14
+ menu_item {
15
+ text 'File 1'
16
+ on_widget_selected {
17
+ message_box(shell_proxy) {
18
+ text 'File 1'
19
+ message 'File 1 Contents'
20
+ }.open
21
+ }
22
+ }
23
+ menu_item {
24
+ text 'File 2'
25
+ on_widget_selected {
26
+ message_box(shell_proxy) {
27
+ text 'File 2'
28
+ message 'File 2 Contents'
29
+ }.open
30
+ }
31
+ }
32
+ }
33
+ }
34
+ }
35
+ }
36
+ }.open
@@ -0,0 +1,24 @@
1
+ class HelloTab
2
+ include Glimmer
3
+ def launch
4
+ shell {
5
+ text "Hello, Tab!"
6
+ tab_folder {
7
+ tab_item {
8
+ text "English"
9
+ label {
10
+ text "Hello, World!"
11
+ }
12
+ }
13
+ tab_item {
14
+ text "French"
15
+ label {
16
+ text "Bonjour, Univers!"
17
+ }
18
+ }
19
+ }
20
+ }.open
21
+ end
22
+ end
23
+
24
+ HelloTab.new.launch
@@ -0,0 +1,8 @@
1
+ include Glimmer
2
+
3
+ shell {
4
+ text "Glimmer"
5
+ label {
6
+ text "Hello, World!"
7
+ }
8
+ }.open
metadata CHANGED
@@ -1,21 +1,21 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: glimmer-dsl-swt
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.1
4
+ version: 0.6.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - AndyMaleh
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-08-06 00:00:00.000000000 Z
11
+ date: 2020-09-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement
15
15
  requirements:
16
16
  - - "~>"
17
17
  - !ruby/object:Gem::Version
18
- version: 0.10.1
18
+ version: 0.10.4
19
19
  name: glimmer
20
20
  type: :runtime
21
21
  prerelease: false
@@ -23,7 +23,7 @@ dependencies:
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 0.10.1
26
+ version: 0.10.4
27
27
  - !ruby/object:Gem::Dependency
28
28
  requirement: !ruby/object:Gem::Requirement
29
29
  requirements:
@@ -57,7 +57,7 @@ dependencies:
57
57
  requirements:
58
58
  - - "~>"
59
59
  - !ruby/object:Gem::Version
60
- version: 0.9.0
60
+ version: 0.10.1
61
61
  name: puts_debuggerer
62
62
  type: :runtime
63
63
  prerelease: false
@@ -65,7 +65,21 @@ dependencies:
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: 0.9.0
68
+ version: 0.10.1
69
+ - !ruby/object:Gem::Dependency
70
+ requirement: !ruby/object:Gem::Requirement
71
+ requirements:
72
+ - - ">="
73
+ - !ruby/object:Gem::Version
74
+ version: 0.2.1
75
+ name: rake-tui
76
+ type: :runtime
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: 0.2.1
69
83
  - !ruby/object:Gem::Dependency
70
84
  requirement: !ruby/object:Gem::Requirement
71
85
  requirements:
@@ -200,6 +214,26 @@ dependencies:
200
214
  - - "<"
201
215
  - !ruby/object:Gem::Version
202
216
  version: 2.0.0
217
+ - !ruby/object:Gem::Dependency
218
+ requirement: !ruby/object:Gem::Requirement
219
+ requirements:
220
+ - - ">="
221
+ - !ruby/object:Gem::Version
222
+ version: 0.7.0
223
+ - - "<"
224
+ - !ruby/object:Gem::Version
225
+ version: 2.0.0
226
+ name: tty-markdown
227
+ type: :runtime
228
+ prerelease: false
229
+ version_requirements: !ruby/object:Gem::Requirement
230
+ requirements:
231
+ - - ">="
232
+ - !ruby/object:Gem::Version
233
+ version: 0.7.0
234
+ - - "<"
235
+ - !ruby/object:Gem::Version
236
+ version: 2.0.0
203
237
  - !ruby/object:Gem::Dependency
204
238
  requirement: !ruby/object:Gem::Requirement
205
239
  requirements:
@@ -290,7 +324,7 @@ dependencies:
290
324
  - - "~>"
291
325
  - !ruby/object:Gem::Version
292
326
  version: 0.7.0
293
- description: Glimmer DSL for SWT (Desktop GUI) - JRuby on SWT
327
+ description: Glimmer DSL for SWT (JRuby Desktop GUI)
294
328
  email: andy.am@gmail.com
295
329
  executables:
296
330
  - glimmer
@@ -309,9 +343,11 @@ files:
309
343
  - bin/glimmer
310
344
  - icons/scaffold_app.icns
311
345
  - icons/scaffold_app.ico
346
+ - icons/scaffold_app.png
312
347
  - lib/ext/glimmer.rb
313
348
  - lib/ext/glimmer/config.rb
314
349
  - lib/glimmer-dsl-swt.rb
350
+ - lib/glimmer/Rakefile
315
351
  - lib/glimmer/data_binding/list_selection_binding.rb
316
352
  - lib/glimmer/data_binding/observable_widget.rb
317
353
  - lib/glimmer/data_binding/shine.rb
@@ -333,6 +369,7 @@ files:
333
369
  - lib/glimmer/dsl/swt/dsl.rb
334
370
  - lib/glimmer/dsl/swt/exec_expression.rb
335
371
  - lib/glimmer/dsl/swt/font_expression.rb
372
+ - lib/glimmer/dsl/swt/image_expression.rb
336
373
  - lib/glimmer/dsl/swt/layout_data_expression.rb
337
374
  - lib/glimmer/dsl/swt/layout_expression.rb
338
375
  - lib/glimmer/dsl/swt/list_selection_data_binding_expression.rb
@@ -381,6 +418,27 @@ files:
381
418
  - lib/glimmer/ui/custom_shell.rb
382
419
  - lib/glimmer/ui/custom_widget.rb
383
420
  - lib/glimmer/util/proc_tracker.rb
421
+ - samples/elaborate/contact_manager.rb
422
+ - samples/elaborate/contact_manager/contact.rb
423
+ - samples/elaborate/contact_manager/contact_manager_presenter.rb
424
+ - samples/elaborate/contact_manager/contact_repository.rb
425
+ - samples/elaborate/login.rb
426
+ - samples/elaborate/tic_tac_toe.rb
427
+ - samples/elaborate/tic_tac_toe/board.rb
428
+ - samples/elaborate/tic_tac_toe/cell.rb
429
+ - samples/elaborate/user_profile.rb
430
+ - samples/hello/hello_browser.rb
431
+ - samples/hello/hello_combo.rb
432
+ - samples/hello/hello_computed.rb
433
+ - samples/hello/hello_computed/contact.rb
434
+ - samples/hello/hello_drag_and_drop.rb
435
+ - samples/hello/hello_list_multi_selection.rb
436
+ - samples/hello/hello_list_single_selection.rb
437
+ - samples/hello/hello_menu_bar.rb
438
+ - samples/hello/hello_message_box.rb
439
+ - samples/hello/hello_pop_up_context_menu.rb
440
+ - samples/hello/hello_tab.rb
441
+ - samples/hello/hello_world.rb
384
442
  - vendor/swt/linux/swt.jar
385
443
  - vendor/swt/mac/swt.jar
386
444
  - vendor/swt/windows/swt.jar
@@ -396,7 +454,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
396
454
  requirements:
397
455
  - - ">="
398
456
  - !ruby/object:Gem::Version
399
- version: '0'
457
+ version: 2.5.3
400
458
  required_rubygems_version: !ruby/object:Gem::Requirement
401
459
  requirements:
402
460
  - - ">="