glimmer-dsl-opal 0.9.3 → 0.10.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (83) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +7 -0
  3. data/LICENSE.txt +1 -1
  4. data/README.md +50 -43
  5. data/VERSION +1 -1
  6. data/lib/display.rb +1 -1
  7. data/lib/glimmer-dsl-opal.rb +2 -1
  8. data/lib/glimmer-dsl-opal/ext/file.rb +1 -1
  9. data/lib/glimmer-dsl-opal/ext/glimmer/dsl/engine.rb +3 -2
  10. data/lib/glimmer-dsl-opal/samples/elaborate/contact_manager/contact_repository.rb +4 -4
  11. data/lib/glimmer-dsl-opal/samples/elaborate/tic_tac_toe.rb +1 -1
  12. data/lib/glimmer-dsl-opal/samples/hello/hello_browser.rb +1 -1
  13. data/lib/glimmer-dsl-opal/samples/hello/hello_button.rb +1 -1
  14. data/lib/glimmer-dsl-opal/samples/hello/hello_checkbox.rb +1 -1
  15. data/lib/glimmer-dsl-opal/samples/hello/hello_checkbox_group.rb +1 -1
  16. data/lib/glimmer-dsl-opal/samples/hello/hello_combo.rb +1 -1
  17. data/lib/glimmer-dsl-opal/samples/hello/hello_computed.rb +1 -1
  18. data/lib/glimmer-dsl-opal/samples/hello/hello_computed/contact.rb +1 -1
  19. data/lib/glimmer-dsl-opal/samples/hello/hello_custom_shell.rb +1 -1
  20. data/lib/glimmer-dsl-opal/samples/hello/hello_custom_widget.rb +1 -1
  21. data/lib/glimmer-dsl-opal/samples/hello/hello_date_time.rb +1 -1
  22. data/lib/glimmer-dsl-opal/samples/hello/hello_dialog.rb +78 -0
  23. data/lib/glimmer-dsl-opal/samples/hello/hello_group.rb +1 -1
  24. data/lib/glimmer-dsl-opal/samples/hello/hello_list_multi_selection.rb +1 -1
  25. data/lib/glimmer-dsl-opal/samples/hello/hello_list_single_selection.rb +1 -1
  26. data/lib/glimmer-dsl-opal/samples/hello/hello_menu_bar.rb +1 -1
  27. data/lib/glimmer-dsl-opal/samples/hello/hello_message_box.rb +1 -1
  28. data/lib/glimmer-dsl-opal/samples/hello/hello_pop_up_context_menu.rb +1 -1
  29. data/lib/glimmer-dsl-opal/samples/hello/hello_radio.rb +1 -1
  30. data/lib/glimmer-dsl-opal/samples/hello/hello_radio_group.rb +1 -1
  31. data/lib/glimmer-dsl-opal/samples/hello/hello_tab.rb +1 -1
  32. data/lib/glimmer-dsl-opal/samples/hello/hello_table.rb +1 -1
  33. data/lib/glimmer-dsl-opal/samples/hello/hello_world.rb +1 -1
  34. data/lib/glimmer-dsl-swt.rb +1 -1
  35. data/lib/glimmer/dsl/opal/async_exec_expression.rb +1 -1
  36. data/lib/glimmer/dsl/opal/block_property_expression.rb +1 -1
  37. data/lib/glimmer/dsl/opal/checkbox_group_selection_data_binding_expression.rb +1 -1
  38. data/lib/glimmer/dsl/opal/color_expression.rb +1 -1
  39. data/lib/glimmer/dsl/opal/custom_widget_expression.rb +1 -1
  40. data/lib/glimmer/dsl/opal/dialog_expression.rb +20 -0
  41. data/lib/glimmer/dsl/opal/display_expression.rb +1 -1
  42. data/lib/glimmer/dsl/opal/dsl.rb +1 -1
  43. data/lib/glimmer/dsl/opal/exec_expression.rb +1 -1
  44. data/lib/glimmer/dsl/opal/font_expression.rb +1 -1
  45. data/lib/glimmer/dsl/opal/menu_bar_expression.rb +1 -1
  46. data/lib/glimmer/dsl/opal/menu_expression.rb +1 -1
  47. data/lib/glimmer/dsl/opal/radio_group_selection_data_binding_expression.rb +1 -1
  48. data/lib/glimmer/dsl/opal/rgb_expression.rb +1 -1
  49. data/lib/glimmer/dsl/opal/rgba_expression.rb +1 -1
  50. data/lib/glimmer/dsl/opal/swt_expression.rb +4 -4
  51. data/lib/glimmer/dsl/opal/sync_exec_expression.rb +1 -1
  52. data/lib/glimmer/swt.rb +1 -1
  53. data/lib/glimmer/swt/color_proxy.rb +1 -1
  54. data/lib/glimmer/swt/control_editor.rb +1 -1
  55. data/lib/glimmer/swt/custom/checkbox_group.rb +1 -1
  56. data/lib/glimmer/swt/custom/radio_group.rb +1 -1
  57. data/lib/glimmer/swt/dialog_proxy.rb +173 -0
  58. data/lib/glimmer/swt/display_proxy.rb +4 -0
  59. data/lib/glimmer/swt/font_proxy.rb +1 -1
  60. data/lib/glimmer/swt/label_proxy.rb +1 -1
  61. data/lib/glimmer/swt/latest_dialog_proxy.rb +42 -0
  62. data/lib/glimmer/swt/latest_message_box_proxy.rb +1 -1
  63. data/lib/glimmer/swt/latest_shell_proxy.rb +1 -1
  64. data/lib/glimmer/swt/layout_data_proxy.rb +4 -0
  65. data/lib/glimmer/swt/make_shift_shell_proxy.rb +1 -1
  66. data/lib/glimmer/swt/menu_item_proxy.rb +1 -1
  67. data/lib/glimmer/swt/menu_proxy.rb +1 -1
  68. data/lib/glimmer/swt/message_box_proxy.rb +3 -7
  69. data/lib/glimmer/swt/row_layout_proxy.rb +22 -2
  70. data/lib/glimmer/swt/shell_proxy.rb +13 -1
  71. data/lib/glimmer/swt/style_constantizable.rb +1 -1
  72. data/lib/glimmer/swt/swt_proxy.rb +1 -1
  73. data/lib/glimmer/swt/tab_folder_proxy.rb +1 -1
  74. data/lib/glimmer/swt/table_editor.rb +1 -1
  75. data/lib/glimmer/swt/table_item_proxy.rb +1 -1
  76. data/lib/glimmer/swt/table_proxy.rb +1 -1
  77. data/lib/glimmer/swt/widget_proxy.rb +3 -2
  78. data/lib/glimmer/ui/custom_shell.rb +1 -1
  79. data/lib/glimmer/ui/custom_widget.rb +1 -1
  80. data/lib/glimmer/util/proc_tracker.rb +1 -1
  81. data/lib/net/http.rb +1 -1
  82. data/lib/os.rb +1 -1
  83. metadata +10 -6
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2020 Andy Maleh
1
+ # Copyright (c) 2020-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) 2020 Andy Maleh
1
+ # Copyright (c) 2020-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) 2020 Andy Maleh
1
+ # Copyright (c) 2020-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) 2020 Andy Maleh
1
+ # Copyright (c) 2020-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) 2020 Andy Maleh
1
+ # Copyright (c) 2020-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) 2020 Andy Maleh
1
+ # Copyright (c) 2020-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) 2020 Andy Maleh
1
+ # Copyright (c) 2020-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) 2020 Andy Maleh
1
+ # Copyright (c) 2020-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) 2020 Andy Maleh
1
+ # Copyright (c) 2020-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) 2020-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) 2020 Andy Maleh
1
+ # Copyright (c) 2020-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) 2020 Andy Maleh
1
+ # Copyright (c) 2020-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) 2020 Andy Maleh
1
+ # Copyright (c) 2020-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,20 @@
1
+ require 'glimmer/dsl/static_expression'
2
+ require 'glimmer/dsl/top_level_expression'
3
+ require 'glimmer/dsl/parent_expression'
4
+ require 'glimmer/swt/dialog_proxy'
5
+
6
+ module Glimmer
7
+ module DSL
8
+ module Opal
9
+ class DialogExpression < StaticExpression
10
+ include TopLevelExpression
11
+ include ParentExpression
12
+
13
+ def interpret(parent, keyword, *args, &block)
14
+ parent = args.delete_at(0)
15
+ Glimmer::SWT::DialogProxy.new(parent, args)
16
+ end
17
+ end
18
+ end
19
+ end
20
+ end
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2020 Andy Maleh
1
+ # Copyright (c) 2020-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
@@ -27,7 +27,7 @@ require 'glimmer/dsl/opal/radio_group_selection_data_binding_expression'
27
27
  require 'glimmer/dsl/opal/checkbox_group_selection_data_binding_expression'
28
28
  require 'glimmer/dsl/opal/block_property_expression'
29
29
  require 'glimmer/dsl/opal/menu_expression'
30
- # require 'glimmer/dsl/opal/menu_bar_expression'
30
+ require 'glimmer/dsl/opal/dialog_expression'
31
31
 
32
32
  module Glimmer
33
33
  module DSL
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2020 Andy Maleh
1
+ # Copyright (c) 2020-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) 2020 Andy Maleh
1
+ # Copyright (c) 2020-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) 2020-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) 2020 Andy Maleh
1
+ # Copyright (c) 2020-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) 2020 Andy Maleh
1
+ # Copyright (c) 2020-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) 2020 Andy Maleh
1
+ # Copyright (c) 2020-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) 2020 Andy Maleh
1
+ # Copyright (c) 2020-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) 2020-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) 2020 Andy Maleh
1
+ # Copyright (c) 2020-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) 2020 Andy Maleh
1
+ # Copyright (c) 2020-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) 2020 Andy Maleh
1
+ # Copyright (c) 2020-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) 2020 Andy Maleh
1
+ # Copyright (c) 2020-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) 2020 Andy Maleh
1
+ # Copyright (c) 2020-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) 2020 Andy Maleh
1
+ # Copyright (c) 2020-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,173 @@
1
+ # Copyright (c) 2020-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/widget_proxy'
23
+ require 'glimmer/swt/display_proxy'
24
+
25
+ module Glimmer
26
+ module SWT
27
+ class DialogProxy < CompositeProxy
28
+ STYLE = <<~CSS
29
+ .ui-dialog .ui-dialog-content {
30
+ background: rgb(235, 235, 235);
31
+ }
32
+ .ui-dialog-titlebar {
33
+ background: rgb(80, 116, 211);
34
+ color: white;
35
+ }
36
+ .ui-dialog .dialog .ui-widget-overlay {
37
+ z-index: 10 !important;
38
+ background-color: rgba(0, 0, 0, 0.4);
39
+ opacity: 1;
40
+ }
41
+ .ui-dialog * {
42
+ z-index: 200 !important;
43
+ }
44
+ CSS
45
+
46
+
47
+ # .close {
48
+ # color: #aaaaaa;
49
+ # float: right;
50
+ # font-weight: bold;
51
+ # margin: 5px;
52
+ # }
53
+ # .close:hover,
54
+ # .close:focus {
55
+ # color: #000;
56
+ # text-decoration: none;
57
+ # cursor: pointer;
58
+ # }
59
+
60
+ attr_reader :text
61
+
62
+ def initialize(parent, args, block)
63
+ i = 0
64
+ @parent = parent
65
+ @parent = nil if parent.is_a?(LatestShellProxy)
66
+ @parent ||= DisplayProxy.instance.shells.last || ShellProxy.new([])
67
+ @args = args
68
+ @block = block
69
+ @children = Set.new
70
+ @enabled = true
71
+ # on_widget_selected {
72
+ # hide
73
+ # }
74
+ DisplayProxy.instance.dialogs << self
75
+ @parent.post_initialize_child(self)
76
+ end
77
+
78
+ def text=(txt)
79
+ @text = txt
80
+ if @init
81
+ dom_element.dialog('option', 'title', @text)
82
+ else
83
+ dom_element.attr('title', @text)
84
+ end
85
+ end
86
+
87
+ def open
88
+ unless @init
89
+ dom_element.remove_class('hide')
90
+ dom_element.dialog({'auto_open' => false})
91
+ @init = true
92
+ dom_element.dialog('option', 'appendTo', parent.path)
93
+ dom_element.dialog('option', 'modal', true) # NOTE: Not Working! Doing manually below by relying on overlay in ShellProxy.
94
+ if DisplayProxy.instance.dialogs.size == 1 # only add for first dialog open
95
+ Element['.dialog-overlay'].remove_class('hide')
96
+ end
97
+ dom_element.dialog('option', 'closeOnEscape', true)
98
+ dom_element.dialog('option', 'draggable', true)
99
+ dom_element.dialog('option', 'width', 'auto')
100
+ dom_element.dialog('option', 'minHeight', 'none')
101
+ dom_element.on('dialogclose') do
102
+ unless @hiding
103
+ close
104
+ else
105
+ @hiding = false
106
+ end
107
+ end
108
+ else
109
+ dom_element.dialog('open')
110
+ end
111
+ @open = true
112
+ end
113
+
114
+ def open?
115
+ @open
116
+ end
117
+
118
+ def hide
119
+ @hiding = true
120
+ dom_element.dialog('close')
121
+ @open = false
122
+ Element['.dialog-overlay'].add_class('hide') unless DisplayProxy.instance.dialogs.any?(&:open?)
123
+ end
124
+
125
+ def close
126
+ dom_element.dialog('destroy')
127
+ dom_element.remove
128
+ @open = false
129
+ @init = false
130
+ Element['.dialog-overlay'].add_class('hide') unless DisplayProxy.instance.dialogs.any?(&:open?)
131
+ DisplayProxy.instance.dialogs.delete(self)
132
+ end
133
+
134
+
135
+ def content(&block)
136
+ Glimmer::DSL::Engine.add_content(self, Glimmer::DSL::Opal::DialogExpression.new, &block)
137
+ end
138
+
139
+ def path
140
+ if @init # it gets moved once initialized by jQuery UI, so only ID is reliable then
141
+ "##{id}"
142
+ else
143
+ super
144
+ end
145
+ end
146
+
147
+ # def selector
148
+ # super + ' .close'
149
+ # end
150
+ #
151
+ # def listener_path
152
+ # widget_path + ' .close'
153
+ # end
154
+ #
155
+ # def observation_request_to_event_mapping
156
+ # {
157
+ # 'on_widget_selected' => {
158
+ # event: 'click'
159
+ # },
160
+ # }
161
+ # end
162
+
163
+ def dom
164
+ @dom ||= html {
165
+ div(id: id, class: "#{name} hide", title: text) {
166
+ }
167
+ }.to_s
168
+ end
169
+ end
170
+ end
171
+ end
172
+
173
+ require 'glimmer/dsl/opal/dialog_expression'
@@ -32,6 +32,10 @@ module Glimmer
32
32
  @message_boxes ||= []
33
33
  end
34
34
 
35
+ def dialogs
36
+ @dialogs ||= []
37
+ end
38
+
35
39
  def render
36
40
  # No rendering as body is rendered as part of ShellProxy.. this class only serves as an SWT Display utility
37
41
  end
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2020 Andy Maleh
1
+ # Copyright (c) 2020-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) 2020 Andy Maleh
1
+ # Copyright (c) 2020-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,42 @@
1
+ # Copyright (c) 2020-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
+ module Glimmer
23
+ module SWT
24
+ class LatestDialogProxy #< DialogProxy
25
+ # TODO consider overriding all methods from DialogProxy and proxying to them
26
+ # TODO consider the idea of promoting this object into the real dialog once Document is ready
27
+
28
+ def initialize(parent, args, block)
29
+ # No Op
30
+ end
31
+
32
+ def open
33
+ Document.ready? do
34
+ DisplayProxy.instance.dialogs.last&.open
35
+ end
36
+ end
37
+
38
+ end
39
+
40
+ end
41
+
42
+ end