glimmer-dsl-swt 4.18.4.10 → 4.18.5.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (121) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +71 -0
  3. data/README.md +14 -5
  4. data/VERSION +1 -1
  5. data/bin/glimmer +3 -3
  6. data/docs/reference/GLIMMER_CONFIGURATION.md +7 -3
  7. data/docs/reference/GLIMMER_GUI_DSL_SYNTAX.md +451 -112
  8. data/docs/reference/GLIMMER_SAMPLES.md +76 -3
  9. data/glimmer-dsl-swt.gemspec +23 -13
  10. data/lib/ext/glimmer/config.rb +3 -7
  11. data/lib/glimmer/data_binding/list_selection_binding.rb +13 -7
  12. data/lib/glimmer/data_binding/table_items_binding.rb +22 -17
  13. data/lib/glimmer/data_binding/tree_items_binding.rb +19 -15
  14. data/lib/glimmer/data_binding/widget_binding.rb +12 -27
  15. data/lib/glimmer/dsl/swt/{file_dialog_expression.rb → auto_exec_expression.rb} +6 -18
  16. data/lib/glimmer/dsl/swt/checkbox_group_selection_data_binding_expression.rb +9 -6
  17. data/lib/glimmer/dsl/swt/color_expression.rb +1 -1
  18. data/lib/glimmer/dsl/swt/combo_selection_data_binding_expression.rb +16 -14
  19. data/lib/glimmer/dsl/swt/custom_widget_expression.rb +4 -1
  20. data/lib/glimmer/dsl/swt/data_binding_expression.rb +1 -2
  21. data/lib/glimmer/dsl/swt/dialog_expression.rb +18 -9
  22. data/lib/glimmer/dsl/swt/dsl.rb +1 -0
  23. data/lib/glimmer/dsl/swt/exec_expression.rb +1 -1
  24. data/lib/glimmer/dsl/swt/font_expression.rb +1 -1
  25. data/lib/glimmer/dsl/swt/image_expression.rb +16 -2
  26. data/lib/glimmer/dsl/swt/list_selection_data_binding_expression.rb +11 -8
  27. data/lib/glimmer/dsl/swt/pixel_expression.rb +1 -1
  28. data/lib/glimmer/dsl/swt/radio_group_selection_data_binding_expression.rb +8 -5
  29. data/lib/glimmer/dsl/swt/shape_expression.rb +2 -2
  30. data/lib/glimmer/dsl/swt/shell_expression.rb +1 -1
  31. data/lib/glimmer/dsl/swt/widget_expression.rb +8 -4
  32. data/lib/glimmer/launcher.rb +3 -0
  33. data/lib/glimmer/rake_task/scaffold.rb +3 -0
  34. data/lib/glimmer/swt/color_proxy.rb +1 -1
  35. data/lib/glimmer/swt/custom/code_text.rb +33 -11
  36. data/lib/glimmer/swt/custom/drawable.rb +57 -1
  37. data/lib/glimmer/swt/custom/shape.rb +332 -48
  38. data/lib/glimmer/swt/custom/shape/arc.rb +60 -0
  39. data/lib/glimmer/{dsl/swt/directory_dialog_expression.rb → swt/custom/shape/focus.rb} +15 -20
  40. data/lib/glimmer/swt/custom/shape/image.rb +112 -0
  41. data/lib/glimmer/swt/custom/shape/line.rb +111 -0
  42. data/lib/glimmer/swt/custom/shape/oval.rb +61 -0
  43. data/lib/glimmer/swt/custom/shape/point.rb +49 -0
  44. data/lib/glimmer/swt/custom/shape/polygon.rb +114 -0
  45. data/lib/glimmer/swt/custom/shape/polyline.rb +115 -0
  46. data/lib/glimmer/swt/custom/shape/rectangle.rb +105 -0
  47. data/lib/glimmer/swt/custom/shape/text.rb +85 -0
  48. data/lib/glimmer/swt/date_time_proxy.rb +9 -3
  49. data/lib/glimmer/swt/dialog_proxy.rb +92 -0
  50. data/lib/glimmer/swt/display_proxy.rb +62 -2
  51. data/lib/glimmer/swt/expand_item_proxy.rb +18 -12
  52. data/lib/glimmer/swt/font_proxy.rb +13 -7
  53. data/lib/glimmer/swt/image_proxy.rb +15 -4
  54. data/lib/glimmer/swt/layout_data_proxy.rb +21 -15
  55. data/lib/glimmer/swt/layout_proxy.rb +19 -15
  56. data/lib/glimmer/swt/menu_proxy.rb +2 -2
  57. data/lib/glimmer/swt/message_box_proxy.rb +21 -7
  58. data/lib/glimmer/swt/properties.rb +3 -0
  59. data/lib/glimmer/swt/proxy_properties.rb +145 -0
  60. data/lib/glimmer/swt/scrolled_composite_proxy.rb +6 -2
  61. data/lib/glimmer/swt/shell_proxy.rb +94 -80
  62. data/lib/glimmer/swt/swt_proxy.rb +16 -0
  63. data/lib/glimmer/swt/tab_item_proxy.rb +5 -3
  64. data/lib/glimmer/swt/table_proxy.rb +32 -11
  65. data/lib/glimmer/swt/transform_proxy.rb +39 -35
  66. data/lib/glimmer/swt/tree_proxy.rb +11 -16
  67. data/lib/glimmer/swt/widget_listener_proxy.rb +6 -2
  68. data/lib/glimmer/swt/widget_proxy.rb +193 -138
  69. data/lib/glimmer/ui.rb +5 -0
  70. data/lib/glimmer/ui/custom_shell.rb +11 -5
  71. data/lib/glimmer/ui/custom_widget.rb +4 -5
  72. data/samples/elaborate/contact_manager.rb +9 -7
  73. data/samples/elaborate/login.rb +27 -21
  74. data/samples/elaborate/mandelbrot_fractal.rb +20 -25
  75. data/samples/elaborate/meta_sample.rb +2 -1
  76. data/samples/elaborate/tetris.rb +3 -1
  77. data/samples/elaborate/tic_tac_toe.rb +18 -14
  78. data/samples/elaborate/tic_tac_toe/board.rb +5 -5
  79. data/samples/elaborate/tic_tac_toe/cell.rb +5 -5
  80. data/samples/elaborate/user_profile.rb +10 -8
  81. data/samples/hello/hello_browser.rb +2 -0
  82. data/samples/hello/hello_button.rb +9 -7
  83. data/samples/hello/hello_canvas.rb +144 -40
  84. data/samples/hello/hello_canvas_animation.rb +2 -0
  85. data/samples/hello/hello_canvas_transform.rb +2 -0
  86. data/samples/hello/hello_checkbox.rb +18 -14
  87. data/samples/hello/hello_checkbox_group.rb +13 -9
  88. data/samples/hello/hello_code_text.rb +2 -0
  89. data/samples/hello/hello_color_dialog.rb +68 -0
  90. data/samples/hello/hello_combo.rb +16 -12
  91. data/samples/hello/hello_computed.rb +9 -7
  92. data/samples/hello/hello_cursor.rb +4 -1
  93. data/samples/hello/hello_custom_shell.rb +18 -21
  94. data/samples/hello/hello_custom_widget.rb +6 -6
  95. data/samples/hello/hello_date_time.rb +16 -12
  96. data/samples/hello/hello_dialog.rb +2 -0
  97. data/samples/hello/hello_directory_dialog.rb +9 -7
  98. data/samples/hello/hello_drag_and_drop.rb +5 -3
  99. data/samples/hello/hello_expand_bar.rb +10 -8
  100. data/samples/hello/hello_file_dialog.rb +9 -7
  101. data/samples/hello/hello_font_dialog.rb +84 -0
  102. data/samples/hello/hello_group.rb +20 -16
  103. data/samples/hello/hello_link.rb +2 -0
  104. data/samples/hello/hello_list_multi_selection.rb +15 -11
  105. data/samples/hello/hello_list_single_selection.rb +15 -11
  106. data/samples/hello/hello_menu_bar.rb +2 -0
  107. data/samples/hello/hello_message_box.rb +2 -0
  108. data/samples/hello/hello_pop_up_context_menu.rb +2 -0
  109. data/samples/hello/hello_progress_bar.rb +5 -5
  110. data/samples/hello/hello_radio.rb +20 -16
  111. data/samples/hello/hello_radio_group.rb +16 -12
  112. data/samples/hello/hello_sash_form.rb +2 -0
  113. data/samples/hello/hello_spinner.rb +9 -7
  114. data/samples/hello/hello_styled_text.rb +19 -17
  115. data/samples/hello/hello_tab.rb +7 -5
  116. data/samples/hello/hello_table.rb +12 -5
  117. data/samples/hello/hello_tree.rb +485 -0
  118. data/samples/hello/hello_world.rb +2 -0
  119. metadata +21 -22
  120. data/lib/glimmer/swt/directory_dialog_proxy.rb +0 -65
  121. data/lib/glimmer/swt/file_dialog_proxy.rb +0 -66
@@ -19,6 +19,8 @@
19
19
  # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
20
  # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21
21
 
22
+ require 'glimmer-dsl-swt'
23
+
22
24
  include Glimmer
23
25
 
24
26
  shell {
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: 4.18.4.10
4
+ version: 4.18.5.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - AndyMaleh
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-02-16 00:00:00.000000000 Z
11
+ date: 2021-02-25 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: 1.1.1
18
+ version: 1.1.2
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: 1.1.1
26
+ version: 1.1.2
27
27
  - !ruby/object:Gem::Dependency
28
28
  requirement: !ruby/object:Gem::Requirement
29
29
  requirements:
@@ -104,20 +104,6 @@ dependencies:
104
104
  - - "<"
105
105
  - !ruby/object:Gem::Version
106
106
  version: 2.0.0
107
- - !ruby/object:Gem::Dependency
108
- requirement: !ruby/object:Gem::Requirement
109
- requirements:
110
- - - '='
111
- - !ruby/object:Gem::Version
112
- version: 1.8.1
113
- name: git
114
- type: :runtime
115
- prerelease: false
116
- version_requirements: !ruby/object:Gem::Requirement
117
- requirements:
118
- - - '='
119
- - !ruby/object:Gem::Version
120
- version: 1.8.1
121
107
  - !ruby/object:Gem::Dependency
122
108
  requirement: !ruby/object:Gem::Requirement
123
109
  requirements:
@@ -391,6 +377,7 @@ files:
391
377
  - lib/glimmer/data_binding/widget_binding.rb
392
378
  - lib/glimmer/dsl/swt/animation_expression.rb
393
379
  - lib/glimmer/dsl/swt/async_exec_expression.rb
380
+ - lib/glimmer/dsl/swt/auto_exec_expression.rb
394
381
  - lib/glimmer/dsl/swt/bind_expression.rb
395
382
  - lib/glimmer/dsl/swt/block_property_expression.rb
396
383
  - lib/glimmer/dsl/swt/checkbox_group_selection_data_binding_expression.rb
@@ -401,13 +388,11 @@ files:
401
388
  - lib/glimmer/dsl/swt/custom_widget_expression.rb
402
389
  - lib/glimmer/dsl/swt/data_binding_expression.rb
403
390
  - lib/glimmer/dsl/swt/dialog_expression.rb
404
- - lib/glimmer/dsl/swt/directory_dialog_expression.rb
405
391
  - lib/glimmer/dsl/swt/display_expression.rb
406
392
  - lib/glimmer/dsl/swt/dnd_expression.rb
407
393
  - lib/glimmer/dsl/swt/dsl.rb
408
394
  - lib/glimmer/dsl/swt/exec_expression.rb
409
395
  - lib/glimmer/dsl/swt/expand_item_expression.rb
410
- - lib/glimmer/dsl/swt/file_dialog_expression.rb
411
396
  - lib/glimmer/dsl/swt/font_expression.rb
412
397
  - lib/glimmer/dsl/swt/image_expression.rb
413
398
  - lib/glimmer/dsl/swt/layout_data_expression.rb
@@ -448,12 +433,21 @@ files:
448
433
  - lib/glimmer/swt/custom/drawable.rb
449
434
  - lib/glimmer/swt/custom/radio_group.rb
450
435
  - lib/glimmer/swt/custom/shape.rb
436
+ - lib/glimmer/swt/custom/shape/arc.rb
437
+ - lib/glimmer/swt/custom/shape/focus.rb
438
+ - lib/glimmer/swt/custom/shape/image.rb
439
+ - lib/glimmer/swt/custom/shape/line.rb
440
+ - lib/glimmer/swt/custom/shape/oval.rb
441
+ - lib/glimmer/swt/custom/shape/point.rb
442
+ - lib/glimmer/swt/custom/shape/polygon.rb
443
+ - lib/glimmer/swt/custom/shape/polyline.rb
444
+ - lib/glimmer/swt/custom/shape/rectangle.rb
445
+ - lib/glimmer/swt/custom/shape/text.rb
451
446
  - lib/glimmer/swt/date_time_proxy.rb
452
- - lib/glimmer/swt/directory_dialog_proxy.rb
447
+ - lib/glimmer/swt/dialog_proxy.rb
453
448
  - lib/glimmer/swt/display_proxy.rb
454
449
  - lib/glimmer/swt/dnd_proxy.rb
455
450
  - lib/glimmer/swt/expand_item_proxy.rb
456
- - lib/glimmer/swt/file_dialog_proxy.rb
457
451
  - lib/glimmer/swt/font_proxy.rb
458
452
  - lib/glimmer/swt/image_proxy.rb
459
453
  - lib/glimmer/swt/layout_data_proxy.rb
@@ -462,6 +456,7 @@ files:
462
456
  - lib/glimmer/swt/message_box_proxy.rb
463
457
  - lib/glimmer/swt/packages.rb
464
458
  - lib/glimmer/swt/properties.rb
459
+ - lib/glimmer/swt/proxy_properties.rb
465
460
  - lib/glimmer/swt/sash_form_proxy.rb
466
461
  - lib/glimmer/swt/scrolled_composite_proxy.rb
467
462
  - lib/glimmer/swt/shell_proxy.rb
@@ -475,6 +470,7 @@ files:
475
470
  - lib/glimmer/swt/tree_proxy.rb
476
471
  - lib/glimmer/swt/widget_listener_proxy.rb
477
472
  - lib/glimmer/swt/widget_proxy.rb
473
+ - lib/glimmer/ui.rb
478
474
  - lib/glimmer/ui/custom_shell.rb
479
475
  - lib/glimmer/ui/custom_widget.rb
480
476
  - lib/glimmer/util/proc_tracker.rb
@@ -507,6 +503,7 @@ files:
507
503
  - samples/hello/hello_checkbox.rb
508
504
  - samples/hello/hello_checkbox_group.rb
509
505
  - samples/hello/hello_code_text.rb
506
+ - samples/hello/hello_color_dialog.rb
510
507
  - samples/hello/hello_combo.rb
511
508
  - samples/hello/hello_computed.rb
512
509
  - samples/hello/hello_computed/contact.rb
@@ -519,6 +516,7 @@ files:
519
516
  - samples/hello/hello_drag_and_drop.rb
520
517
  - samples/hello/hello_expand_bar.rb
521
518
  - samples/hello/hello_file_dialog.rb
519
+ - samples/hello/hello_font_dialog.rb
522
520
  - samples/hello/hello_group.rb
523
521
  - samples/hello/hello_link.rb
524
522
  - samples/hello/hello_list_multi_selection.rb
@@ -535,6 +533,7 @@ files:
535
533
  - samples/hello/hello_tab.rb
536
534
  - samples/hello/hello_table.rb
537
535
  - samples/hello/hello_table/baseball_park.png
536
+ - samples/hello/hello_tree.rb
538
537
  - samples/hello/hello_world.rb
539
538
  - vendor/swt/linux/swt.jar
540
539
  - vendor/swt/mac/swt.jar
@@ -1,65 +0,0 @@
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 'glimmer/swt/swt_proxy'
23
- require 'glimmer/swt/widget_proxy'
24
- require 'glimmer/swt/display_proxy'
25
-
26
- module Glimmer
27
- module SWT
28
- # Proxy for org.eclipse.swt.widgets.DirectoryDialog
29
- #
30
- # Automatically uses the current shell if one is open.
31
- # Otherwise, it instantiates a new shell parent
32
- #
33
- # Optionally takes a shell as an argument
34
- #
35
- # Follows the Proxy Design Pattern
36
- class DirectoryDialogProxy < WidgetProxy
37
- # TODO write rspec tests
38
- include_package 'org.eclipse.swt.widgets'
39
-
40
- def initialize(*args, swt_widget: nil)
41
- if swt_widget
42
- @swt_widget = swt_widget
43
- else
44
- style_args = args.select {|arg| arg.is_a?(Symbol) || arg.is_a?(String)}
45
- if style_args.any?
46
- style_arg_start_index = args.index(style_args.first)
47
- style_arg_last_index = args.index(style_args.last)
48
- args[style_arg_start_index..style_arg_last_index] = SWTProxy[style_args]
49
- end
50
- if args.first.respond_to?(:swt_widget) && args.first.swt_widget.is_a?(Shell)
51
- args[0] = args[0].swt_widget
52
- end
53
- if !args.first.is_a?(Shell)
54
- current_shell = DisplayProxy.instance.swt_display.shells.first
55
- args.unshift(current_shell.nil? ? ShellProxy.new : current_shell)
56
- end
57
- parent = args[0]
58
- @parent_proxy = parent.is_a?(Shell) ? ShellProxy.new(swt_widget: parent) : parent
59
- @swt_widget = DirectoryDialog.new(*args)
60
- end
61
- end
62
-
63
- end
64
- end
65
- end
@@ -1,66 +0,0 @@
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 'glimmer/swt/swt_proxy'
23
- require 'glimmer/swt/widget_proxy'
24
- require 'glimmer/swt/display_proxy'
25
-
26
- module Glimmer
27
- module SWT
28
- # Proxy for org.eclipse.swt.widgets.FileDialog
29
- #
30
- # Automatically uses the current shell if one is open.
31
- # Otherwise, it instantiates a new shell parent
32
- #
33
- # Optionally takes a shell as an argument
34
- #
35
- # Follows the Proxy Design Pattern
36
- class FileDialogProxy < WidgetProxy
37
- # TODO write rspec tests
38
- # TODO consider refactoring and sharing code with DirectoryDialogProxy (and do the same with their expressions)
39
- include_package 'org.eclipse.swt.widgets'
40
-
41
- def initialize(*args, swt_widget: nil)
42
- if swt_widget
43
- @swt_widget = swt_widget
44
- else
45
- style_args = args.select {|arg| arg.is_a?(Symbol) || arg.is_a?(String)}
46
- if style_args.any?
47
- style_arg_start_index = args.index(style_args.first)
48
- style_arg_last_index = args.index(style_args.last)
49
- args[style_arg_start_index..style_arg_last_index] = SWTProxy[style_args]
50
- end
51
- if args.first.respond_to?(:swt_widget) && args.first.swt_widget.is_a?(Shell)
52
- args[0] = args[0].swt_widget
53
- end
54
- if !args.first.is_a?(Shell)
55
- current_shell = DisplayProxy.instance.swt_display.shells.first
56
- args.unshift(current_shell.nil? ? ShellProxy.new : current_shell)
57
- end
58
- parent = args[0]
59
- @parent_proxy = parent.is_a?(Shell) ? ShellProxy.new(swt_widget: parent) : parent
60
- @swt_widget = FileDialog.new(*args)
61
- end
62
- end
63
-
64
- end
65
- end
66
- end