glimmer-dsl-opal 0.0.7 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (119) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +56 -0
  3. data/README.md +815 -76
  4. data/VERSION +1 -1
  5. data/lib/glimmer-dsl-opal.rb +45 -8
  6. data/lib/glimmer-dsl-opal/ext/date.rb +13 -0
  7. data/lib/glimmer-dsl-opal/ext/exception.rb +5 -0
  8. data/lib/glimmer-dsl-opal/missing/net/http.rb +17 -0
  9. data/lib/glimmer-dsl-opal/missing/uri.rb +64 -0
  10. data/lib/{samples → glimmer-dsl-opal/samples}/elaborate/contact_manager.rb +2 -3
  11. data/lib/{samples → glimmer-dsl-opal/samples}/elaborate/contact_manager/contact.rb +0 -0
  12. data/lib/{samples → glimmer-dsl-opal/samples}/elaborate/contact_manager/contact_manager_presenter.rb +0 -0
  13. data/lib/{samples → glimmer-dsl-opal/samples}/elaborate/contact_manager/contact_repository.rb +24 -99
  14. data/lib/{samples → glimmer-dsl-opal/samples}/elaborate/login.rb +0 -0
  15. data/lib/{samples → glimmer-dsl-opal/samples}/elaborate/tic_tac_toe.rb +0 -0
  16. data/lib/{samples → glimmer-dsl-opal/samples}/elaborate/tic_tac_toe/board.rb +0 -0
  17. data/lib/{samples → glimmer-dsl-opal/samples}/elaborate/tic_tac_toe/cell.rb +0 -0
  18. data/lib/{samples → glimmer-dsl-opal/samples}/hello/hello_browser.rb +0 -0
  19. data/lib/glimmer-dsl-opal/samples/hello/hello_combo.rb +63 -0
  20. data/lib/{samples → glimmer-dsl-opal/samples}/hello/hello_computed.rb +19 -19
  21. data/lib/{samples → glimmer-dsl-opal/samples}/hello/hello_computed/contact.rb +0 -0
  22. data/lib/glimmer-dsl-opal/samples/hello/hello_custom_shell.rb +155 -0
  23. data/lib/glimmer-dsl-opal/samples/hello/hello_custom_widget.rb +86 -0
  24. data/lib/{samples → glimmer-dsl-opal/samples}/hello/hello_list_multi_selection.rb +0 -0
  25. data/lib/{samples → glimmer-dsl-opal/samples}/hello/hello_list_single_selection.rb +0 -0
  26. data/lib/glimmer-dsl-opal/samples/hello/hello_tab.rb +50 -0
  27. data/lib/glimmer-dsl-opal/samples/hello/hello_world.rb +29 -0
  28. data/lib/glimmer-dsl-opal/vendor/jquery.js +2 -0
  29. data/lib/glimmer/data_binding/element_binding.rb +1 -1
  30. data/lib/glimmer/data_binding/ext/observable_model.rb +6 -6
  31. data/lib/glimmer/data_binding/list_selection_binding.rb +1 -1
  32. data/lib/glimmer/data_binding/table_items_binding.rb +70 -0
  33. data/lib/glimmer/dsl/opal/async_exec_expression.rb +2 -2
  34. data/lib/glimmer/dsl/opal/color_expression.rb +38 -0
  35. data/lib/glimmer/dsl/opal/column_properties_expression.rb +22 -0
  36. data/lib/glimmer/dsl/opal/combo_selection_data_binding_expression.rb +2 -2
  37. data/lib/glimmer/dsl/opal/custom_widget_expression.rb +77 -0
  38. data/lib/glimmer/dsl/opal/dsl.rb +15 -14
  39. data/lib/glimmer/dsl/opal/font_expression.rb +47 -0
  40. data/lib/glimmer/dsl/opal/layout_data_expression.rb +2 -2
  41. data/lib/glimmer/dsl/opal/layout_expression.rb +22 -0
  42. data/lib/glimmer/dsl/opal/list_selection_data_binding_expression.rb +2 -3
  43. data/lib/glimmer/dsl/opal/message_box_expression.rb +2 -2
  44. data/lib/glimmer/dsl/opal/property_expression.rb +5 -2
  45. data/lib/glimmer/dsl/opal/rgb_expression.rb +32 -0
  46. data/lib/glimmer/dsl/opal/rgba_expression.rb +32 -0
  47. data/lib/glimmer/dsl/opal/shell_expression.rb +18 -2
  48. data/lib/glimmer/dsl/opal/swt_expression.rb +46 -0
  49. data/lib/glimmer/dsl/opal/{composite_expression.rb → table_column_expression.rb} +3 -3
  50. data/lib/glimmer/dsl/opal/{list_expression.rb → table_expression.rb} +3 -3
  51. data/lib/glimmer/dsl/opal/table_items_data_binding_expression.rb +29 -0
  52. data/lib/glimmer/dsl/opal/widget_expression.rb +24 -0
  53. data/lib/glimmer/dsl/opal/widget_listener_expression.rb +16 -3
  54. data/lib/glimmer/swt.rb +499 -0
  55. data/lib/glimmer/swt/browser_proxy.rb +27 -0
  56. data/lib/glimmer/swt/button_proxy.rb +40 -0
  57. data/lib/glimmer/swt/color_proxy.rb +119 -0
  58. data/lib/glimmer/{opal/select_proxy.rb → swt/combo_proxy.rb} +24 -19
  59. data/lib/glimmer/swt/composite_proxy.rb +31 -0
  60. data/lib/glimmer/{opal → swt}/display_proxy.rb +6 -4
  61. data/lib/glimmer/{opal → swt}/event_listener_proxy.rb +1 -1
  62. data/lib/glimmer/swt/fill_layout_proxy.rb +84 -0
  63. data/lib/glimmer/swt/font_proxy.rb +79 -0
  64. data/lib/glimmer/swt/grid_layout_proxy.rb +71 -0
  65. data/lib/glimmer/swt/label_proxy.rb +34 -0
  66. data/lib/glimmer/swt/layout_data_proxy.rb +87 -0
  67. data/lib/glimmer/swt/layout_proxy.rb +63 -0
  68. data/lib/glimmer/{opal → swt}/list_proxy.rb +31 -23
  69. data/lib/glimmer/swt/message_box_proxy.rb +143 -0
  70. data/lib/glimmer/{opal → swt}/point.rb +1 -1
  71. data/lib/glimmer/{opal → swt}/property_owner.rb +1 -1
  72. data/lib/glimmer/swt/row_layout_proxy.rb +105 -0
  73. data/lib/glimmer/swt/shell_proxy.rb +246 -0
  74. data/lib/glimmer/swt/style_constantizable.rb +154 -0
  75. data/lib/glimmer/swt/swt_proxy.rb +53 -0
  76. data/lib/glimmer/{opal/tab_folder.rb → swt/tab_folder_proxy.rb} +21 -15
  77. data/lib/glimmer/swt/tab_item_proxy.rb +84 -0
  78. data/lib/glimmer/swt/table_column_proxy.rb +56 -0
  79. data/lib/glimmer/swt/table_item_proxy.rb +147 -0
  80. data/lib/glimmer/swt/table_proxy.rb +159 -0
  81. data/lib/glimmer/swt/text_proxy.rb +46 -0
  82. data/lib/glimmer/swt/widget_proxy.rb +490 -0
  83. data/lib/glimmer/ui/custom_shell.rb +91 -0
  84. data/lib/glimmer/ui/custom_widget.rb +291 -0
  85. data/lib/glimmer/util/proc_tracker.rb +39 -0
  86. metadata +131 -76
  87. data/lib/glimmer/config.rb +0 -22
  88. data/lib/glimmer/dsl/engine.rb +0 -193
  89. data/lib/glimmer/dsl/expression.rb +0 -42
  90. data/lib/glimmer/dsl/expression_handler.rb +0 -48
  91. data/lib/glimmer/dsl/opal/browser_expression.rb +0 -17
  92. data/lib/glimmer/dsl/opal/button_expression.rb +0 -18
  93. data/lib/glimmer/dsl/opal/combo_expression.rb +0 -17
  94. data/lib/glimmer/dsl/opal/grid_layout_expression.rb +0 -17
  95. data/lib/glimmer/dsl/opal/label_expression.rb +0 -17
  96. data/lib/glimmer/dsl/opal/tab_folder_expression.rb +0 -17
  97. data/lib/glimmer/dsl/opal/tab_item_expression.rb +0 -17
  98. data/lib/glimmer/dsl/opal/text_expression.rb +0 -22
  99. data/lib/glimmer/dsl/parent_expression.rb +0 -12
  100. data/lib/glimmer/dsl/static_expression.rb +0 -36
  101. data/lib/glimmer/dsl/top_level_expression.rb +0 -7
  102. data/lib/glimmer/error.rb +0 -6
  103. data/lib/glimmer/invalid_keyword_error.rb +0 -6
  104. data/lib/glimmer/opal/div_proxy.rb +0 -22
  105. data/lib/glimmer/opal/document_proxy.rb +0 -178
  106. data/lib/glimmer/opal/element_proxy.rb +0 -287
  107. data/lib/glimmer/opal/grid_layout_proxy.rb +0 -54
  108. data/lib/glimmer/opal/iframe_proxy.rb +0 -23
  109. data/lib/glimmer/opal/input_proxy.rb +0 -45
  110. data/lib/glimmer/opal/label_proxy.rb +0 -25
  111. data/lib/glimmer/opal/layout_data_proxy.rb +0 -31
  112. data/lib/glimmer/opal/modal.rb +0 -94
  113. data/lib/glimmer/opal/tab_item.rb +0 -98
  114. data/lib/samples/elaborate/launch +0 -6
  115. data/lib/samples/hello/hello_combo.rb +0 -34
  116. data/lib/samples/hello/hello_tab.rb +0 -24
  117. data/lib/samples/hello/hello_world.rb +0 -8
  118. data/lib/samples/hello/launch +0 -10
  119. data/lib/samples/launch +0 -4
@@ -1,6 +1,6 @@
1
1
  require 'glimmer/dsl/static_expression'
2
2
  require 'glimmer/dsl/top_level_expression'
3
- require 'glimmer/opal/display_proxy'
3
+ require 'glimmer/swt/display_proxy'
4
4
 
5
5
  module Glimmer
6
6
  module DSL
@@ -9,7 +9,7 @@ module Glimmer
9
9
  include TopLevelExpression
10
10
 
11
11
  def interpret(parent, keyword, *args, &block)
12
- Glimmer::Opal::DisplayProxy.instance.async_exec(&block)
12
+ Glimmer::SWT::DisplayProxy.instance.async_exec(&block)
13
13
  end
14
14
  end
15
15
  end
@@ -0,0 +1,38 @@
1
+ # Copyright (c) 2020 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/static_expression'
23
+ require 'glimmer/dsl/top_level_expression'
24
+ require 'glimmer/swt/color_proxy'
25
+
26
+ module Glimmer
27
+ module DSL
28
+ module Opal
29
+ class ColorExpression < StaticExpression
30
+ include TopLevelExpression
31
+
32
+ def interpret(parent, keyword, *args, &block)
33
+ Glimmer::SWT::ColorProxy.new(*args)
34
+ end
35
+ end
36
+ end
37
+ end
38
+ end
@@ -0,0 +1,22 @@
1
+ require 'glimmer/dsl/static_expression'
2
+ require 'glimmer/swt/table_proxy'
3
+
4
+ module Glimmer
5
+ module DSL
6
+ module Opal
7
+ # Responsible for providing a readable keyword (command symbol) to capture
8
+ # and return column properties for use in TreeItemsDataBindingCommandHandler
9
+ class ColumnPropertiesExpression < StaticExpression
10
+ def can_interpret?(parent, keyword, *args, &block)
11
+ keyword == 'column_properties' and
12
+ block.nil? and
13
+ parent.is_a?(Glimmer::SWT::TableProxy)
14
+ end
15
+
16
+ def interpret(parent, keyword, *args, &block)
17
+ args
18
+ end
19
+ end
20
+ end
21
+ end
22
+ end
@@ -1,7 +1,7 @@
1
1
  require 'glimmer/dsl/expression'
2
2
  require 'glimmer/data_binding/model_binding'
3
3
  require 'glimmer/data_binding/element_binding'
4
- require 'glimmer/opal/select_proxy'
4
+ require 'glimmer/swt/combo_proxy'
5
5
 
6
6
  module Glimmer
7
7
  module DSL
@@ -10,7 +10,7 @@ module Glimmer
10
10
  def can_interpret?(parent, keyword, *args, &block)
11
11
  keyword == 'selection' and
12
12
  block.nil? and
13
- parent.is_a?(Glimmer::Opal::SelectProxy) and
13
+ parent.is_a?(Glimmer::SWT::ComboProxy) and
14
14
  args.size == 1 and
15
15
  args[0].is_a?(DataBinding::ModelBinding) and
16
16
  args[0].evaluate_options_property.is_a?(Array)
@@ -0,0 +1,77 @@
1
+ # Copyright (c) 2020 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'
23
+ require 'glimmer/dsl/expression'
24
+ require 'glimmer/dsl/parent_expression'
25
+ require 'glimmer/dsl/top_level_expression'
26
+ require 'glimmer/ui/custom_widget'
27
+ require 'glimmer/ui/custom_shell'
28
+
29
+ module Glimmer
30
+ module DSL
31
+ module Opal
32
+ class CustomWidgetExpression < Expression
33
+ # TODO Make custom widgets automatically generate static expressions
34
+ include ParentExpression
35
+ include TopLevelExpression
36
+
37
+ def can_interpret?(parent, keyword, *args, &block)
38
+ !!UI::CustomWidget.for(keyword)
39
+ end
40
+
41
+ def interpret(parent, keyword, *args, &block)
42
+ custom_widget_class = UI::CustomWidget.for(keyword)
43
+ # TODO clean code by extracting methods into CustomShell
44
+ if !Glimmer::UI::CustomShell.requested? && custom_widget_class.ancestors.include?(Glimmer::UI::CustomShell)
45
+ options = args.last.is_a?(Hash) ? args.pop : {}
46
+ options = options.merge('swt_style' => args.join(',')) unless args.join(',').empty?
47
+ params = {
48
+ 'custom_shell' => keyword
49
+ }.merge(options)
50
+ param_string = params.to_a.map {|k, v| "#{k}=#{URI.encode_www_form_component(v)}"}.join('&')
51
+ url = "#{`document.location.href`}?#{param_string}"
52
+ `window.open(#{url})`
53
+ # just a placeholder that has an open method # TODO return an actual CustomShell in the future that does the work happening above in the #open method
54
+ Struct.new(:open).new(true)
55
+ else
56
+ custom_widget_class.new(parent, *args, options, &block)
57
+ end
58
+ end
59
+
60
+ def add_content(parent, &content)
61
+ content.call(parent) if parent.is_a?(Glimmer::SWT::ShellProxy) || parent.is_a?(Glimmer::UI::CustomShell)
62
+ end
63
+
64
+
65
+ def add_content(parent, &block)
66
+ return unless parent.is_a?(Glimmer::UI::CustomWidget)
67
+ # TODO consider avoiding source_location
68
+ if block.source_location == parent.content&.__getobj__.source_location
69
+ parent.content.call(parent) unless parent.content.called?
70
+ else
71
+ super
72
+ end
73
+ end
74
+ end
75
+ end
76
+ end
77
+ end
@@ -1,29 +1,26 @@
1
- require 'opal'
2
- require 'browser'
3
-
4
1
  require 'glimmer/dsl/engine'
5
2
  # Dir[File.expand_path('../*_expression.rb', __FILE__)].each {|f| require f}
6
3
  require 'glimmer/dsl/opal/shell_expression'
7
- require 'glimmer/dsl/opal/label_expression'
4
+ require 'glimmer/dsl/opal/widget_expression'
8
5
  require 'glimmer/dsl/opal/property_expression'
9
- require 'glimmer/dsl/opal/combo_expression'
10
- require 'glimmer/dsl/opal/composite_expression'
11
- require 'glimmer/dsl/opal/button_expression'
12
6
  require 'glimmer/dsl/opal/bind_expression'
13
7
  require 'glimmer/dsl/opal/data_binding_expression'
14
8
  require 'glimmer/dsl/opal/combo_selection_data_binding_expression'
15
9
  require 'glimmer/dsl/opal/widget_listener_expression'
16
- require 'glimmer/dsl/opal/grid_layout_expression'
17
- require 'glimmer/dsl/opal/text_expression'
18
- require 'glimmer/dsl/opal/list_expression'
19
- require 'glimmer/dsl/opal/browser_expression'
20
- require 'glimmer/dsl/opal/tab_folder_expression'
21
- require 'glimmer/dsl/opal/tab_item_expression'
22
10
  require 'glimmer/dsl/opal/message_box_expression'
23
11
  require 'glimmer/dsl/opal/async_exec_expression'
24
12
  require 'glimmer/dsl/opal/observe_expression'
13
+ require 'glimmer/dsl/opal/layout_expression'
25
14
  require 'glimmer/dsl/opal/layout_data_expression'
26
15
  require 'glimmer/dsl/opal/list_selection_data_binding_expression'
16
+ require 'glimmer/dsl/opal/table_items_data_binding_expression'
17
+ require 'glimmer/dsl/opal/column_properties_expression'
18
+ require 'glimmer/dsl/opal/font_expression'
19
+ require 'glimmer/dsl/opal/color_expression'
20
+ require 'glimmer/dsl/opal/rgb_expression'
21
+ require 'glimmer/dsl/opal/rgba_expression'
22
+ require 'glimmer/dsl/opal/custom_widget_expression'
23
+ require 'glimmer/dsl/opal/swt_expression'
27
24
 
28
25
  module Glimmer
29
26
  module DSL
@@ -31,12 +28,16 @@ module Glimmer
31
28
  Engine.add_dynamic_expressions(
32
29
  Opal,
33
30
  %w[
31
+ custom_widget
34
32
  widget_listener
33
+ table_items_data_binding
35
34
  combo_selection_data_binding
36
35
  list_selection_data_binding
37
36
  data_binding
38
- text
37
+ font
38
+ layout
39
39
  property
40
+ widget
40
41
  ]
41
42
  )
42
43
  end
@@ -0,0 +1,47 @@
1
+ # Copyright (c) 2020 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/top_level_expression'
24
+ require 'glimmer/swt/font_proxy'
25
+
26
+ module Glimmer
27
+ module DSL
28
+ module Opal
29
+ # font expression
30
+ # Note: Cannot be a static expression because it clashes with font property expression
31
+ class FontExpression < Expression
32
+ include TopLevelExpression
33
+
34
+ def can_interpret?(parent, keyword, *args, &block)
35
+ keyword.to_s == 'font' and
36
+ (parent.nil? || !parent.respond_to?('font')) and
37
+ args.size == 1 and
38
+ args.first.is_a?(Hash)
39
+ end
40
+
41
+ def interpret(parent, keyword, *args, &block)
42
+ Glimmer::SWT::FontProxy.new(*args)
43
+ end
44
+ end
45
+ end
46
+ end
47
+ end
@@ -1,6 +1,6 @@
1
1
  require 'glimmer/dsl/static_expression'
2
2
  require 'glimmer/dsl/parent_expression'
3
- require 'glimmer/opal/layout_data_proxy'
3
+ require 'glimmer/swt/layout_data_proxy'
4
4
 
5
5
  module Glimmer
6
6
  module DSL
@@ -9,7 +9,7 @@ module Glimmer
9
9
  include ParentExpression
10
10
 
11
11
  def interpret(parent, keyword, *args, &block)
12
- Glimmer::Opal::LayoutDataProxy.new(parent, args)
12
+ Glimmer::SWT::LayoutDataProxy.new(parent, args)
13
13
  end
14
14
  end
15
15
  end
@@ -0,0 +1,22 @@
1
+ require 'glimmer/dsl/expression'
2
+ require 'glimmer/dsl/parent_expression'
3
+ require 'glimmer/swt/layout_proxy'
4
+
5
+ module Glimmer
6
+ module DSL
7
+ module Opal
8
+ class LayoutExpression < Expression
9
+ include ParentExpression
10
+
11
+ def can_interpret?(parent, keyword, *args, &block)
12
+ (parent.is_a?(Glimmer::SWT::CompositeProxy) or (parent.is_a?(Glimmer::UI::CustomWidget) and parent.body_root.is_a?(Glimmer::SWT::CompositeProxy))) and
13
+ Glimmer::SWT::LayoutProxy.layout_exists?(keyword)
14
+ end
15
+
16
+ def interpret(parent, keyword, *args, &block)
17
+ Glimmer::SWT::LayoutProxy.for(keyword, parent, args)
18
+ end
19
+ end
20
+ end
21
+ end
22
+ end
@@ -2,7 +2,7 @@ require 'glimmer/dsl/expression'
2
2
  require 'glimmer/data_binding/model_binding'
3
3
  require 'glimmer/data_binding/element_binding'
4
4
  require 'glimmer/data_binding/list_selection_binding'
5
- require 'glimmer/opal/list_proxy'
5
+ require 'glimmer/swt/list_proxy'
6
6
 
7
7
  module Glimmer
8
8
  module DSL
@@ -11,7 +11,7 @@ module Glimmer
11
11
  def can_interpret?(parent, keyword, *args, &block)
12
12
  keyword == 'selection' and
13
13
  block.nil? and
14
- parent.is_a?(Glimmer::Opal::ListProxy) and
14
+ parent.is_a?(Glimmer::SWT::ListProxy) and
15
15
  args.size == 1 and
16
16
  args[0].is_a?(DataBinding::ModelBinding) and
17
17
  args[0].evaluate_options_property.is_a?(Array)
@@ -31,7 +31,6 @@ module Glimmer
31
31
  list_selection_binding.call(model_binding.evaluate_property)
32
32
  #TODO check if nested data binding works for list widget and other widgets that need custom data binding
33
33
  list_selection_binding.observe(model, model_binding.property_name_expression)
34
-
35
34
  parent.on_widget_selected do
36
35
  model_binding.call(list_selection_binding.evaluate_property)
37
36
  end
@@ -1,7 +1,7 @@
1
1
  require 'glimmer/dsl/static_expression'
2
2
  require 'glimmer/dsl/top_level_expression'
3
3
  require 'glimmer/dsl/parent_expression'
4
- require 'glimmer/opal/modal'
4
+ require 'glimmer/swt/message_box_proxy'
5
5
 
6
6
  module Glimmer
7
7
  module DSL
@@ -12,7 +12,7 @@ module Glimmer
12
12
 
13
13
  def interpret(parent, keyword, *args, &block)
14
14
  parent = args.delete_at(0)
15
- Glimmer::Opal::Modal.new(parent, args)
15
+ Glimmer::SWT::MessageBoxProxy.new(parent, args)
16
16
  end
17
17
  end
18
18
  end
@@ -7,12 +7,15 @@ module Glimmer
7
7
  include TopLevelExpression
8
8
 
9
9
  def can_interpret?(parent, keyword, *args, &block)
10
- parent and parent.respond_to?(:set_attribute) and keyword and block.nil?
10
+ parent and
11
+ parent.respond_to?(:set_attribute) and
12
+ keyword and
13
+ block.nil?
11
14
  end
12
15
 
13
16
  def interpret(parent, keyword, *args, &block)
14
17
  if keyword == 'text' # TODO move into property converters in element proxy
15
- args = [args.first.to_s.gsub('&', '') ]
18
+ args = [args.first.to_s.gsub('&', '')]
16
19
  end
17
20
  parent.set_attribute(keyword, *args)
18
21
  args.first.to_s
@@ -0,0 +1,32 @@
1
+ # Copyright (c) 2020 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/opal/color_expression'
23
+ require 'glimmer/swt/color_proxy'
24
+
25
+ module Glimmer
26
+ module DSL
27
+ module Opal
28
+ class RgbExpression < ColorExpression
29
+ end
30
+ end
31
+ end
32
+ end
@@ -0,0 +1,32 @@
1
+ # Copyright (c) 2020 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/opal/color_expression'
23
+ require 'glimmer/swt/color_proxy'
24
+
25
+ module Glimmer
26
+ module DSL
27
+ module Opal
28
+ class RgbaExpression < ColorExpression
29
+ end
30
+ end
31
+ end
32
+ end