glimmer-dsl-swt 4.18.0.0 → 4.18.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (147) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +52 -0
  3. data/LICENSE.txt +1 -1
  4. data/README.md +571 -55
  5. data/RUBY_VERSION +1 -1
  6. data/VERSION +1 -1
  7. data/bin/girb +1 -1
  8. data/bin/girb_runner.rb +1 -1
  9. data/bin/glimmer +1 -1
  10. data/glimmer-dsl-swt.gemspec +26 -17
  11. data/lib/ext/glimmer.rb +1 -1
  12. data/lib/ext/glimmer/config.rb +7 -7
  13. data/lib/glimmer-dsl-swt.rb +2 -1
  14. data/lib/glimmer/Rakefile +1 -1
  15. data/lib/glimmer/data_binding/list_selection_binding.rb +1 -1
  16. data/lib/glimmer/data_binding/observable_widget.rb +1 -1
  17. data/lib/glimmer/data_binding/shine.rb +1 -1
  18. data/lib/glimmer/data_binding/table_items_binding.rb +1 -1
  19. data/lib/glimmer/data_binding/tree_items_binding.rb +1 -1
  20. data/lib/glimmer/data_binding/widget_binding.rb +1 -1
  21. data/lib/glimmer/dsl/swt/animation_expression.rb +43 -0
  22. data/lib/glimmer/dsl/swt/async_exec_expression.rb +1 -1
  23. data/lib/glimmer/dsl/swt/bind_expression.rb +1 -1
  24. data/lib/glimmer/dsl/swt/block_property_expression.rb +1 -1
  25. data/lib/glimmer/dsl/swt/checkbox_group_selection_data_binding_expression.rb +1 -1
  26. data/lib/glimmer/dsl/swt/color_expression.rb +1 -1
  27. data/lib/glimmer/dsl/swt/column_properties_expression.rb +1 -1
  28. data/lib/glimmer/dsl/swt/combo_selection_data_binding_expression.rb +1 -1
  29. data/lib/glimmer/dsl/swt/cursor_expression.rb +1 -1
  30. data/lib/glimmer/dsl/swt/custom_widget_expression.rb +1 -1
  31. data/lib/glimmer/dsl/swt/data_binding_expression.rb +1 -1
  32. data/lib/glimmer/dsl/swt/dialog_expression.rb +1 -1
  33. data/lib/glimmer/dsl/swt/directory_dialog_expression.rb +1 -1
  34. data/lib/glimmer/dsl/swt/display_expression.rb +1 -1
  35. data/lib/glimmer/dsl/swt/dnd_expression.rb +1 -1
  36. data/lib/glimmer/dsl/swt/dsl.rb +5 -4
  37. data/lib/glimmer/dsl/swt/exec_expression.rb +5 -5
  38. data/lib/glimmer/dsl/swt/expand_item_expression.rb +1 -1
  39. data/lib/glimmer/dsl/swt/file_dialog_expression.rb +1 -1
  40. data/lib/glimmer/dsl/swt/font_expression.rb +8 -6
  41. data/lib/glimmer/dsl/swt/image_expression.rb +1 -1
  42. data/lib/glimmer/dsl/swt/layout_data_expression.rb +1 -1
  43. data/lib/glimmer/dsl/swt/layout_expression.rb +1 -1
  44. data/lib/glimmer/dsl/swt/list_selection_data_binding_expression.rb +1 -1
  45. data/lib/glimmer/dsl/swt/menu_bar_expression.rb +1 -1
  46. data/lib/glimmer/dsl/swt/menu_expression.rb +1 -1
  47. data/lib/glimmer/dsl/swt/message_box_expression.rb +1 -1
  48. data/lib/glimmer/dsl/swt/observe_expression.rb +1 -1
  49. data/lib/glimmer/dsl/swt/property_expression.rb +4 -4
  50. data/lib/glimmer/dsl/swt/radio_group_selection_data_binding_expression.rb +1 -1
  51. data/lib/glimmer/dsl/swt/rgb_expression.rb +1 -1
  52. data/lib/glimmer/dsl/swt/rgba_expression.rb +1 -1
  53. data/lib/glimmer/dsl/swt/shape_expression.rb +56 -0
  54. data/lib/glimmer/dsl/swt/shell_expression.rb +1 -1
  55. data/lib/glimmer/dsl/swt/swt_expression.rb +1 -1
  56. data/lib/glimmer/dsl/swt/sync_exec_expression.rb +1 -1
  57. data/lib/glimmer/dsl/swt/tab_item_expression.rb +1 -1
  58. data/lib/glimmer/dsl/swt/table_items_data_binding_expression.rb +1 -1
  59. data/lib/glimmer/dsl/swt/tree_items_data_binding_expression.rb +1 -1
  60. data/lib/glimmer/dsl/swt/tree_properties_expression.rb +1 -1
  61. data/lib/glimmer/dsl/swt/widget_expression.rb +7 -3
  62. data/lib/glimmer/dsl/swt/widget_listener_expression.rb +1 -1
  63. data/lib/glimmer/launcher.rb +1 -1
  64. data/lib/glimmer/rake_task.rb +1 -1
  65. data/lib/glimmer/rake_task/list.rb +6 -6
  66. data/lib/glimmer/rake_task/package.rb +1 -1
  67. data/lib/glimmer/rake_task/scaffold.rb +33 -34
  68. data/lib/glimmer/swt/color_proxy.rb +1 -1
  69. data/lib/glimmer/swt/cursor_proxy.rb +1 -1
  70. data/lib/glimmer/swt/custom/animation.rb +243 -0
  71. data/lib/glimmer/swt/custom/checkbox_group.rb +1 -1
  72. data/lib/glimmer/swt/custom/code_text.rb +2 -1
  73. data/lib/glimmer/swt/custom/drawable.rb +43 -0
  74. data/lib/glimmer/swt/custom/radio_group.rb +1 -1
  75. data/lib/glimmer/swt/custom/shape.rb +193 -0
  76. data/lib/glimmer/swt/date_time_proxy.rb +1 -1
  77. data/lib/glimmer/swt/directory_dialog_proxy.rb +1 -1
  78. data/lib/glimmer/swt/display_proxy.rb +17 -1
  79. data/lib/glimmer/swt/dnd_proxy.rb +1 -1
  80. data/lib/glimmer/swt/expand_item_proxy.rb +1 -1
  81. data/lib/glimmer/swt/file_dialog_proxy.rb +1 -1
  82. data/lib/glimmer/swt/font_proxy.rb +4 -4
  83. data/lib/glimmer/swt/image_proxy.rb +1 -1
  84. data/lib/glimmer/swt/layout_data_proxy.rb +1 -1
  85. data/lib/glimmer/swt/layout_proxy.rb +1 -1
  86. data/lib/glimmer/swt/menu_proxy.rb +1 -1
  87. data/lib/glimmer/swt/message_box_proxy.rb +1 -1
  88. data/lib/glimmer/swt/packages.rb +1 -1
  89. data/lib/glimmer/swt/properties.rb +49 -0
  90. data/lib/glimmer/swt/sash_form_proxy.rb +1 -1
  91. data/lib/glimmer/swt/scrolled_composite_proxy.rb +1 -1
  92. data/lib/glimmer/swt/shell_proxy.rb +3 -2
  93. data/lib/glimmer/swt/style_constantizable.rb +1 -1
  94. data/lib/glimmer/swt/styled_text_proxy.rb +1 -1
  95. data/lib/glimmer/swt/swt_proxy.rb +1 -1
  96. data/lib/glimmer/swt/tab_item_proxy.rb +1 -1
  97. data/lib/glimmer/swt/table_column_proxy.rb +1 -1
  98. data/lib/glimmer/swt/table_proxy.rb +1 -1
  99. data/lib/glimmer/swt/tree_proxy.rb +26 -22
  100. data/lib/glimmer/swt/widget_listener_proxy.rb +1 -1
  101. data/lib/glimmer/swt/widget_proxy.rb +5 -23
  102. data/lib/glimmer/ui/custom_shell.rb +1 -1
  103. data/lib/glimmer/ui/custom_widget.rb +1 -1
  104. data/lib/glimmer/util/proc_tracker.rb +1 -1
  105. data/samples/elaborate/contact_manager.rb +1 -1
  106. data/samples/elaborate/contact_manager/contact.rb +1 -1
  107. data/samples/elaborate/contact_manager/contact_manager_presenter.rb +1 -1
  108. data/samples/elaborate/contact_manager/contact_repository.rb +1 -1
  109. data/samples/elaborate/login.rb +1 -1
  110. data/samples/elaborate/meta_sample.rb +3 -1
  111. data/samples/elaborate/tic_tac_toe.rb +2 -2
  112. data/samples/elaborate/tic_tac_toe/board.rb +1 -1
  113. data/samples/elaborate/tic_tac_toe/cell.rb +1 -1
  114. data/samples/elaborate/user_profile.rb +1 -1
  115. data/samples/hello/hello_browser.rb +1 -1
  116. data/samples/hello/hello_button.rb +1 -1
  117. data/samples/hello/hello_canvas.rb +63 -0
  118. data/samples/hello/hello_canvas_animation.rb +66 -0
  119. data/samples/hello/hello_checkbox.rb +1 -1
  120. data/samples/hello/hello_checkbox_group.rb +1 -1
  121. data/samples/hello/hello_combo.rb +1 -1
  122. data/samples/hello/hello_computed.rb +1 -1
  123. data/samples/hello/hello_computed/contact.rb +1 -1
  124. data/samples/hello/hello_custom_shell.rb +1 -1
  125. data/samples/hello/hello_custom_widget.rb +1 -1
  126. data/samples/hello/hello_date_time.rb +1 -1
  127. data/samples/hello/hello_dialog.rb +78 -0
  128. data/samples/hello/hello_directory_dialog.rb +1 -1
  129. data/samples/hello/hello_drag_and_drop.rb +1 -1
  130. data/samples/hello/hello_expand_bar.rb +1 -1
  131. data/samples/hello/hello_file_dialog.rb +1 -1
  132. data/samples/hello/hello_group.rb +1 -1
  133. data/samples/hello/hello_link.rb +1 -1
  134. data/samples/hello/hello_list_multi_selection.rb +1 -1
  135. data/samples/hello/hello_list_single_selection.rb +1 -1
  136. data/samples/hello/hello_menu_bar.rb +1 -1
  137. data/samples/hello/hello_message_box.rb +1 -1
  138. data/samples/hello/hello_pop_up_context_menu.rb +1 -1
  139. data/samples/hello/hello_radio.rb +1 -1
  140. data/samples/hello/hello_radio_group.rb +1 -1
  141. data/samples/hello/hello_sash_form.rb +1 -1
  142. data/samples/hello/hello_spinner.rb +1 -1
  143. data/samples/hello/hello_styled_text.rb +1 -1
  144. data/samples/hello/hello_tab.rb +1 -1
  145. data/samples/hello/hello_table.rb +1 -1
  146. data/samples/hello/hello_world.rb +1 -1
  147. metadata +37 -13
@@ -1,5 +1,5 @@
1
- # Copyright (c) 2007-2020 Andy Maleh
2
- #
1
+ # Copyright (c) 2007-2021 Andy Maleh
2
+ #
3
3
  # Permission is hereby granted, free of charge, to any person obtaining
4
4
  # a copy of this software and associated documentation files (the
5
5
  # "Software"), to deal in the Software without restriction, including
@@ -7,10 +7,10 @@
7
7
  # distribute, sublicense, and/or sell copies of the Software, and to
8
8
  # permit persons to whom the Software is furnished to do so, subject to
9
9
  # the following conditions:
10
- #
10
+ #
11
11
  # The above copyright notice and this permission notice shall be
12
12
  # included in all copies or substantial portions of the Software.
13
- #
13
+ #
14
14
  # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
15
  # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
16
  # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
@@ -45,7 +45,7 @@ module Glimmer
45
45
  begin
46
46
  block.call(*args)
47
47
  rescue => e
48
- Glimmer::Config.logger.error e.full_message
48
+ Glimmer::Config.logger.error {e.full_message}
49
49
  end
50
50
  end
51
51
  end
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2007-2020 Andy Maleh
1
+ # Copyright (c) 2007-2021 Andy Maleh
2
2
  #
3
3
  # Permission is hereby granted, free of charge, to any person obtaining
4
4
  # a copy of this software and associated documentation files (the
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2007-2020 Andy Maleh
1
+ # Copyright (c) 2007-2021 Andy Maleh
2
2
  #
3
3
  # Permission is hereby granted, free of charge, to any person obtaining
4
4
  # a copy of this software and associated documentation files (the
@@ -1,5 +1,5 @@
1
- # Copyright (c) 2007-2020 Andy Maleh
2
- #
1
+ # Copyright (c) 2007-2021 Andy Maleh
2
+ #
3
3
  # Permission is hereby granted, free of charge, to any person obtaining
4
4
  # a copy of this software and associated documentation files (the
5
5
  # "Software"), to deal in the Software without restriction, including
@@ -7,10 +7,10 @@
7
7
  # distribute, sublicense, and/or sell copies of the Software, and to
8
8
  # permit persons to whom the Software is furnished to do so, subject to
9
9
  # the following conditions:
10
- #
10
+ #
11
11
  # The above copyright notice and this permission notice shall be
12
12
  # included in all copies or substantial portions of the Software.
13
- #
13
+ #
14
14
  # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
15
  # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
16
  # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
@@ -22,6 +22,7 @@
22
22
  require 'glimmer/dsl/expression'
23
23
  require 'glimmer/dsl/top_level_expression'
24
24
  require 'glimmer/swt/font_proxy'
25
+ require 'glimmer/swt/custom/shape'
25
26
 
26
27
  module Glimmer
27
28
  module DSL
@@ -32,9 +33,10 @@ module Glimmer
32
33
  include TopLevelExpression
33
34
 
34
35
  def can_interpret?(parent, keyword, *args, &block)
35
- keyword.to_s == 'font' and
36
+ keyword.to_s == 'font' and
36
37
  (parent.nil? || !parent.respond_to?('font')) and
37
- args.size == 1 and
38
+ !parent.is_a?(Glimmer::SWT::Custom::Shape) and
39
+ args.size == 1 and
38
40
  args.first.is_a?(Hash)
39
41
  end
40
42
 
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2007-2020 Andy Maleh
1
+ # Copyright (c) 2007-2021 Andy Maleh
2
2
  #
3
3
  # Permission is hereby granted, free of charge, to any person obtaining
4
4
  # a copy of this software and associated documentation files (the
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2007-2020 Andy Maleh
1
+ # Copyright (c) 2007-2021 Andy Maleh
2
2
  #
3
3
  # Permission is hereby granted, free of charge, to any person obtaining
4
4
  # a copy of this software and associated documentation files (the
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2007-2020 Andy Maleh
1
+ # Copyright (c) 2007-2021 Andy Maleh
2
2
  #
3
3
  # Permission is hereby granted, free of charge, to any person obtaining
4
4
  # a copy of this software and associated documentation files (the
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2007-2020 Andy Maleh
1
+ # Copyright (c) 2007-2021 Andy Maleh
2
2
  #
3
3
  # Permission is hereby granted, free of charge, to any person obtaining
4
4
  # a copy of this software and associated documentation files (the
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2007-2020 Andy Maleh
1
+ # Copyright (c) 2007-2021 Andy Maleh
2
2
  #
3
3
  # Permission is hereby granted, free of charge, to any person obtaining
4
4
  # a copy of this software and associated documentation files (the
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2007-2020 Andy Maleh
1
+ # Copyright (c) 2007-2021 Andy Maleh
2
2
  #
3
3
  # Permission is hereby granted, free of charge, to any person obtaining
4
4
  # a copy of this software and associated documentation files (the
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2007-2020 Andy Maleh
1
+ # Copyright (c) 2007-2021 Andy Maleh
2
2
  #
3
3
  # Permission is hereby granted, free of charge, to any person obtaining
4
4
  # a copy of this software and associated documentation files (the
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2007-2020 Andy Maleh
1
+ # Copyright (c) 2007-2021 Andy Maleh
2
2
  #
3
3
  # Permission is hereby granted, free of charge, to any person obtaining
4
4
  # a copy of this software and associated documentation files (the
@@ -1,5 +1,5 @@
1
- # Copyright (c) 2007-2020 Andy Maleh
2
- #
1
+ # Copyright (c) 2007-2021 Andy Maleh
2
+ #
3
3
  # Permission is hereby granted, free of charge, to any person obtaining
4
4
  # a copy of this software and associated documentation files (the
5
5
  # "Software"), to deal in the Software without restriction, including
@@ -7,10 +7,10 @@
7
7
  # distribute, sublicense, and/or sell copies of the Software, and to
8
8
  # permit persons to whom the Software is furnished to do so, subject to
9
9
  # the following conditions:
10
- #
10
+ #
11
11
  # The above copyright notice and this permission notice shall be
12
12
  # included in all copies or substantial portions of the Software.
13
- #
13
+ #
14
14
  # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
15
  # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
16
  # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2007-2020 Andy Maleh
1
+ # Copyright (c) 2007-2021 Andy Maleh
2
2
  #
3
3
  # Permission is hereby granted, free of charge, to any person obtaining
4
4
  # a copy of this software and associated documentation files (the
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2007-2020 Andy Maleh
1
+ # Copyright (c) 2007-2021 Andy Maleh
2
2
  #
3
3
  # Permission is hereby granted, free of charge, to any person obtaining
4
4
  # a copy of this software and associated documentation files (the
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2007-2020 Andy Maleh
1
+ # Copyright (c) 2007-2021 Andy Maleh
2
2
  #
3
3
  # Permission is hereby granted, free of charge, to any person obtaining
4
4
  # a copy of this software and associated documentation files (the
@@ -0,0 +1,56 @@
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/dsl/expression'
23
+ require 'glimmer/dsl/parent_expression'
24
+ require 'glimmer/swt/swt_proxy'
25
+ require 'glimmer/swt/custom/shape'
26
+
27
+ module Glimmer
28
+ module DSL
29
+ module SWT
30
+ class ShapeExpression < Expression
31
+ include ParentExpression
32
+
33
+ def can_interpret?(parent, keyword, *args, &block)
34
+ (
35
+ (parent.respond_to?(:swt_widget) and parent.swt_widget.is_a?(org.eclipse.swt.graphics.Drawable)) or
36
+ (parent.respond_to?(:swt_display) and parent.swt_display.is_a?(org.eclipse.swt.graphics.Drawable))
37
+ ) and
38
+ Glimmer::SWT::Custom::Shape.valid?(parent, keyword, *args, &block)
39
+ end
40
+
41
+ def interpret(parent, keyword, *args, &block)
42
+ Glimmer::SWT::Custom::Shape.new(parent, keyword, *args, &block)
43
+ end
44
+
45
+ def add_content(parent, &block)
46
+ super
47
+ parent.post_add_content
48
+ end
49
+
50
+ end
51
+
52
+ end
53
+
54
+ end
55
+
56
+ end
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2007-2020 Andy Maleh
1
+ # Copyright (c) 2007-2021 Andy Maleh
2
2
  #
3
3
  # Permission is hereby granted, free of charge, to any person obtaining
4
4
  # a copy of this software and associated documentation files (the
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2007-2020 Andy Maleh
1
+ # Copyright (c) 2007-2021 Andy Maleh
2
2
  #
3
3
  # Permission is hereby granted, free of charge, to any person obtaining
4
4
  # a copy of this software and associated documentation files (the
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2007-2020 Andy Maleh
1
+ # Copyright (c) 2007-2021 Andy Maleh
2
2
  #
3
3
  # Permission is hereby granted, free of charge, to any person obtaining
4
4
  # a copy of this software and associated documentation files (the
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2007-2020 Andy Maleh
1
+ # Copyright (c) 2007-2021 Andy Maleh
2
2
  #
3
3
  # Permission is hereby granted, free of charge, to any person obtaining
4
4
  # a copy of this software and associated documentation files (the
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2007-2020 Andy Maleh
1
+ # Copyright (c) 2007-2021 Andy Maleh
2
2
  #
3
3
  # Permission is hereby granted, free of charge, to any person obtaining
4
4
  # a copy of this software and associated documentation files (the
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2007-2020 Andy Maleh
1
+ # Copyright (c) 2007-2021 Andy Maleh
2
2
  #
3
3
  # Permission is hereby granted, free of charge, to any person obtaining
4
4
  # a copy of this software and associated documentation files (the
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2007-2020 Andy Maleh
1
+ # Copyright (c) 2007-2021 Andy Maleh
2
2
  #
3
3
  # Permission is hereby granted, free of charge, to any person obtaining
4
4
  # a copy of this software and associated documentation files (the
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2007-2020 Andy Maleh
1
+ # Copyright (c) 2007-2021 Andy Maleh
2
2
  #
3
3
  # Permission is hereby granted, free of charge, to any person obtaining
4
4
  # a copy of this software and associated documentation files (the
@@ -32,9 +32,10 @@ module Glimmer
32
32
  EXCLUDED_KEYWORDS = %w[shell display tab_item]
33
33
 
34
34
  def can_interpret?(parent, keyword, *args, &block)
35
- !EXCLUDED_KEYWORDS.include?(keyword) and
36
- parent.respond_to?(:swt_widget) and #TODO change to composite?(parent)
35
+ result = !EXCLUDED_KEYWORDS.include?(keyword) &&
36
+ parent.respond_to?(:swt_widget) && #TODO change to composite?(parent)
37
37
  Glimmer::SWT::WidgetProxy.widget_exists?(keyword)
38
+ (keyword.to_s == 'text' && args.first.is_a?(String)) ? false : result
38
39
  end
39
40
 
40
41
  def interpret(parent, keyword, *args, &block)
@@ -47,8 +48,11 @@ module Glimmer
47
48
  end
48
49
 
49
50
  end
51
+
50
52
  end
53
+
51
54
  end
55
+
52
56
  end
53
57
 
54
58
  require 'glimmer/swt/widget_proxy'
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2007-2020 Andy Maleh
1
+ # Copyright (c) 2007-2021 Andy Maleh
2
2
  #
3
3
  # Permission is hereby granted, free of charge, to any person obtaining
4
4
  # a copy of this software and associated documentation files (the
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2007-2020 Andy Maleh
1
+ # Copyright (c) 2007-2021 Andy Maleh
2
2
  #
3
3
  # Permission is hereby granted, free of charge, to any person obtaining
4
4
  # a copy of this software and associated documentation files (the
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2007-2020 Andy Maleh
1
+ # Copyright (c) 2007-2021 Andy Maleh
2
2
  #
3
3
  # Permission is hereby granted, free of charge, to any person obtaining
4
4
  # a copy of this software and associated documentation files (the
@@ -1,5 +1,5 @@
1
- # Copyright (c) 2007-2020 Andy Maleh
2
- #
1
+ # Copyright (c) 2007-2021 Andy Maleh
2
+ #
3
3
  # Permission is hereby granted, free of charge, to any person obtaining
4
4
  # a copy of this software and associated documentation files (the
5
5
  # "Software"), to deal in the Software without restriction, including
@@ -7,10 +7,10 @@
7
7
  # distribute, sublicense, and/or sell copies of the Software, and to
8
8
  # permit persons to whom the Software is furnished to do so, subject to
9
9
  # the following conditions:
10
- #
10
+ #
11
11
  # The above copyright notice and this permission notice shall be
12
12
  # included in all copies or substantial portions of the Software.
13
- #
13
+ #
14
14
  # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
15
  # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
16
  # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
@@ -57,11 +57,11 @@ module Glimmer
57
57
  lines = `gem search -d #{gem_prefix}`.split("\n")
58
58
  gems = lines.slice_before {|l| l.match(REGEX_GEM_LINE) }.to_a
59
59
  gems = gems.map do |gem|
60
- {
60
+ {
61
61
  name: gem[0].match(REGEX_GEM_LINE)[1],
62
62
  version: gem[0].match(REGEX_GEM_LINE)[2],
63
63
  author: gem[1].strip,
64
- description: gem[4..-1].map(&:strip).join(' ')
64
+ description: gem[4..-1]&.map(&:strip)&.join(' ').to_s
65
65
  }
66
66
  end.select do |gem|
67
67
  query.nil? || "#{gem[:name]} #{gem[:author]} #{gem[:description]}".downcase.include?(query.to_s.downcase)
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2007-2020 Andy Maleh
1
+ # Copyright (c) 2007-2021 Andy Maleh
2
2
  #
3
3
  # Permission is hereby granted, free of charge, to any person obtaining
4
4
  # a copy of this software and associated documentation files (the
@@ -1,5 +1,5 @@
1
- # Copyright (c) 2007-2020 Andy Maleh
2
- #
1
+ # Copyright (c) 2007-2021 Andy Maleh
2
+ #
3
3
  # Permission is hereby granted, free of charge, to any person obtaining
4
4
  # a copy of this software and associated documentation files (the
5
5
  # "Software"), to deal in the Software without restriction, including
@@ -7,10 +7,10 @@
7
7
  # distribute, sublicense, and/or sell copies of the Software, and to
8
8
  # permit persons to whom the Software is furnished to do so, subject to
9
9
  # the following conditions:
10
- #
10
+ #
11
11
  # The above copyright notice and this permission notice shall be
12
12
  # included in all copies or substantial portions of the Software.
13
- #
13
+ #
14
14
  # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
15
  # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
16
  # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
@@ -113,7 +113,6 @@ module Glimmer
113
113
 
114
114
  group :development do
115
115
  gem 'rspec', '~> 3.5.0'
116
- gem 'git-glimmer', '1.7.0'
117
116
  gem 'juwelier', '2.4.9'
118
117
  gem 'warbler', '2.0.5'
119
118
  gem 'simplecov', '>= 0'
@@ -133,12 +132,12 @@ module Glimmer
133
132
  gem_summary = human_name(app_name)
134
133
  return puts("The directory '#{gem_name}' already exists. Please either remove or pick a different name.") if Dir.exist?(gem_name)
135
134
  system "jruby -S gem install juwelier -v2.4.9 --no-document" unless juwelier_exists?
136
- system "jruby -r git-glimmer -S juwelier --markdown --rspec --summary '#{gem_summary}' --description '#{gem_summary}' #{gem_name}"
135
+ system "jruby -S juwelier --markdown --rspec --summary '#{gem_summary}' --description '#{gem_summary}' #{gem_name}"
137
136
  return puts('Your Git user.name and/or github.user are missing! Please add in for Juwelier to help Glimmer with Scaffolding.') if `git config --get github.user`.strip.empty? && `git config --get user.name`.strip.empty?
138
137
  cd gem_name
139
138
  rm_rf 'lib'
140
139
  write '.gitignore', GITIGNORE
141
- write '.ruby-version', RUBY_VERSION
140
+ write '.ruby-version', RUBY_VERSION
142
141
  write '.ruby-gemset', app_name
143
142
  write 'VERSION', '1.0.0'
144
143
  write 'LICENSE.txt', "Copyright (c) #{Time.now.year} #{app_name}"
@@ -178,7 +177,7 @@ module Glimmer
178
177
  system "bundle"
179
178
  system "rspec --init"
180
179
  else
181
- system "bash -c '#{RVM_FUNCTION}\n cd .\n bundle\n rspec --init\n'"
180
+ system "bash -c '#{RVM_FUNCTION}\n cd .\n bundle\n rspec --init\n'"
182
181
  end
183
182
  write 'spec/spec_helper.rb', spec_helper_file
184
183
  if OS.windows?
@@ -191,7 +190,7 @@ module Glimmer
191
190
  else
192
191
  system "glimmer run"
193
192
  end
194
- end
193
+ end
195
194
  end
196
195
 
197
196
  def custom_shell(custom_shell_name, namespace, shell_type = nil, shell_options = {})
@@ -231,11 +230,11 @@ module Glimmer
231
230
  end
232
231
  return puts("The directory '#{gem_name}' already exists. Please either remove or pick a different name.") if Dir.exist?(gem_name)
233
232
  system "jruby -S gem install juwelier -v2.4.9 --no-document" unless juwelier_exists?
234
- system "jruby -r git-glimmer -S juwelier --markdown --rspec --summary '#{gem_summary}' --description '#{gem_summary}' #{gem_name}"
233
+ system "jruby -S juwelier --markdown --rspec --summary '#{gem_summary}' --description '#{gem_summary}' #{gem_name}"
235
234
  return puts('Your Git user.name and/or github.user are missing! Please add in for Juwelier to help Glimmer with Scaffolding.') if `git config --get github.user`.strip.empty? && `git config --get user.name`.strip.empty?
236
235
  cd gem_name
237
236
  write '.gitignore', GITIGNORE
238
- write '.ruby-version', RUBY_VERSION
237
+ write '.ruby-version', RUBY_VERSION
239
238
  write '.ruby-gemset', gem_name
240
239
  write 'VERSION', '1.0.0'
241
240
  write 'Gemfile', GEMFILE
@@ -256,7 +255,7 @@ module Glimmer
256
255
  system "rspec --init"
257
256
  else
258
257
  system "bash -c '#{RVM_FUNCTION}\n cd .\n bundle\n rspec --init\n'"
259
- end
258
+ end
260
259
  write 'spec/spec_helper.rb', spec_helper_file
261
260
 
262
261
  mkdir_p 'package/windows'
@@ -283,7 +282,7 @@ module Glimmer
283
282
  system "open packages/bundles/#{human_name(custom_shell_name).gsub(' ', '\ ')}.app" if OS.mac?
284
283
  else
285
284
  system "glimmer run"
286
- end
285
+ end
287
286
  end
288
287
  puts "Finished creating #{gem_name} Ruby gem."
289
288
  puts 'Edit Rakefile to configure gem details.'
@@ -305,11 +304,11 @@ module Glimmer
305
304
 
306
305
  return puts("The directory '#{gem_name}' already exists. Please either remove or pick a different name.") if Dir.exist?(gem_name)
307
306
  system "jruby -S gem install juwelier -v2.4.9 --no-document" unless juwelier_exists?
308
- system "jruby -r git-glimmer -S juwelier --markdown --rspec --summary '#{gem_summary}' --description '#{gem_summary}' #{gem_name}"
307
+ system "jruby -S juwelier --markdown --rspec --summary '#{gem_summary}' --description '#{gem_summary}' #{gem_name}"
309
308
  return puts('Your Git user.name and/or github.user are missing! Please add in for Juwelier to help Glimmer with Scaffolding.') if `git config --get github.user`.strip.empty? && `git config --get user.name`.strip.empty?
310
309
  cd gem_name
311
310
  write '.gitignore', GITIGNORE
312
- write '.ruby-version', RUBY_VERSION
311
+ write '.ruby-version', RUBY_VERSION
313
312
  write '.ruby-gemset', gem_name
314
313
  write 'VERSION', '1.0.0'
315
314
  write 'Gemfile', GEMFILE
@@ -397,9 +396,9 @@ module Glimmer
397
396
  class #{class_name(app_name)}
398
397
  include Glimmer
399
398
 
400
- APP_ROOT = File.expand_path('../..', __FILE__)
399
+ APP_ROOT = File.expand_path('../..', __FILE__)
401
400
  VERSION = File.read(File.join(APP_ROOT, 'VERSION'))
402
- LICENSE = File.read(File.join(APP_ROOT, 'LICENSE.txt'))
401
+ LICENSE = File.read(File.join(APP_ROOT, 'LICENSE.txt'))
403
402
 
404
403
  def open
405
404
  app_view.open
@@ -443,7 +442,7 @@ module Glimmer
443
442
 
444
443
  launcher = Glimmer::Launcher.new([runner] + ARGV)
445
444
  launcher.launch
446
- end
445
+ end
447
446
  MULTI_LINE_STRING
448
447
  end
449
448
 
@@ -482,7 +481,7 @@ module Glimmer
482
481
 
483
482
  launcher = Glimmer::Launcher.new([runner] + ARGV)
484
483
  launcher.launch
485
- end
484
+ end
486
485
  MULTI_LINE_STRING
487
486
  end
488
487
 
@@ -502,15 +501,15 @@ module Glimmer
502
501
  end
503
502
  spec_pattern_line_index = lines.index(lines.detect {|l| l.include?('spec.pattern =') })
504
503
  lines.insert(spec_pattern_line_index+1, " spec.ruby_opts = [Glimmer::Launcher.jruby_os_specific_options]")
505
- lines << "\nrequire 'glimmer/rake_task'\n"
504
+ lines << "\nrequire 'glimmer/rake_task'\n"
506
505
  file_content = lines.join("\n")
507
506
  if custom_shell_name
508
- file_content << <<~MULTI_LINE_STRING
507
+ file_content << <<~MULTI_LINE_STRING
509
508
  Glimmer::RakeTask::Package.javapackager_extra_args =
510
509
  " -name '#{human_name(custom_shell_name)}'" +
511
510
  " -title '#{human_name(custom_shell_name)}'" +
512
511
  " -Bmac.CFBundleName='#{human_name(custom_shell_name)}'" +
513
- " -Bmac.CFBundleIdentifier='org.#{namespace ? compact_name(namespace) : compact_name(custom_shell_name)}.application.#{compact_name(custom_shell_name).camelcase(:upper)}'"
512
+ " -Bmac.CFBundleIdentifier='org.#{namespace ? compact_name(namespace) : compact_name(custom_shell_name)}.application.#{compact_name(custom_shell_name).camelcase(:upper)}'"
514
513
  # " -BlicenseType=" +
515
514
  # " -Bmac.category=" +
516
515
  # " -Bmac.signing-key-developer-id-app="
@@ -575,8 +574,8 @@ module Glimmer
575
574
  if %i[gem app desktopify].include?(shell_type)
576
575
  custom_shell_file_content += <<-MULTI_LINE_STRING
577
576
  before_body {
578
- Display.setAppName('#{shell_type == :gem ? human_name(custom_shell_name) : human_name(namespace)}')
579
- Display.setAppVersion(VERSION)
577
+ Display.app_name = '#{shell_type == :gem ? human_name(custom_shell_name) : human_name(namespace)}'
578
+ Display.app_version = VERSION
580
579
  @display = display {
581
580
  on_about {
582
581
  display_about_dialog
@@ -600,7 +599,7 @@ module Glimmer
600
599
  ## Use after_body block to setup observers for widgets in body
601
600
  #
602
601
  # after_body {
603
- #
602
+ #
604
603
  # }
605
604
 
606
605
  ## Add widget content inside custom shell body
@@ -616,10 +615,10 @@ module Glimmer
616
615
  MULTI_LINE_STRING
617
616
 
618
617
  if shell_type == :desktopify
619
- custom_shell_file_content += <<-MULTI_LINE_STRING
618
+ custom_shell_file_content += <<-MULTI_LINE_STRING
620
619
  browser {
621
- url "#{shell_options[:website]}"
622
- }
620
+ url "#{shell_options[:website]}"
621
+ }
623
622
  MULTI_LINE_STRING
624
623
  else
625
624
  custom_shell_file_content += <<-MULTI_LINE_STRING
@@ -628,7 +627,7 @@ module Glimmer
628
627
  text bind(self, :greeting)
629
628
  font height: 40
630
629
  layout_data :fill, :center, true, true
631
- }
630
+ }
632
631
  MULTI_LINE_STRING
633
632
  end
634
633
 
@@ -690,7 +689,7 @@ module Glimmer
690
689
  text 'Greeting'
691
690
  font style: :bold
692
691
  [
693
- 'Hello, World!',
692
+ 'Hello, World!',
694
693
  'Howdy, Partner!'
695
694
  ].each do |greeting_text|
696
695
  button(:radio) {
@@ -733,19 +732,19 @@ module Glimmer
733
732
  #
734
733
  #
735
734
  # before_body {
736
- #
735
+ #
737
736
  # }
738
737
 
739
738
  ## Use after_body block to setup observers for widgets in body
740
739
  #
741
740
  # after_body {
742
- #
741
+ #
743
742
  # }
744
743
 
745
744
  ## Add widget content under custom widget body
746
745
  ##
747
- ## If you want to add a shell as the top-most widget,
748
- ## consider creating a custom shell instead
746
+ ## If you want to add a shell as the top-most widget,
747
+ ## consider creating a custom shell instead
749
748
  ## (Glimmer::UI::CustomShell offers shell convenience methods, like show and hide)
750
749
  #
751
750
  body {