glimmer-dsl-swt 4.18.5.0 → 4.18.5.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +43 -0
- data/README.md +16 -11
- data/VERSION +1 -1
- data/docs/reference/GLIMMER_GUI_DSL_SYNTAX.md +179 -33
- data/docs/reference/GLIMMER_SAMPLES.md +58 -0
- data/glimmer-dsl-swt.gemspec +7 -7
- data/lib/glimmer/data_binding/widget_binding.rb +4 -1
- data/lib/glimmer/dsl/swt/dialog_expression.rb +18 -9
- data/lib/glimmer/dsl/swt/dsl.rb +1 -0
- data/lib/glimmer/dsl/swt/font_expression.rb +1 -1
- data/lib/glimmer/dsl/swt/shape_expression.rb +1 -1
- data/lib/glimmer/dsl/swt/shell_expression.rb +1 -1
- data/lib/glimmer/swt/custom/drawable.rb +10 -2
- data/lib/glimmer/swt/custom/shape.rb +458 -58
- data/lib/glimmer/swt/custom/shape/arc.rb +35 -0
- data/lib/glimmer/swt/custom/shape/focus.rb +2 -2
- data/lib/glimmer/swt/custom/shape/image.rb +35 -9
- data/lib/glimmer/swt/custom/shape/line.rb +88 -4
- data/lib/glimmer/swt/custom/shape/oval.rb +18 -0
- data/lib/glimmer/swt/custom/shape/point.rb +10 -5
- data/lib/glimmer/swt/custom/shape/polygon.rb +105 -15
- data/lib/glimmer/swt/custom/shape/polyline.rb +88 -15
- data/lib/glimmer/swt/custom/shape/rectangle.rb +19 -0
- data/lib/glimmer/swt/custom/shape/text.rb +13 -3
- data/lib/glimmer/swt/{directory_dialog_proxy.rb → dialog_proxy.rb} +36 -7
- data/lib/glimmer/swt/font_proxy.rb +12 -6
- data/lib/glimmer/swt/message_box_proxy.rb +1 -0
- data/lib/glimmer/swt/properties.rb +3 -0
- data/lib/glimmer/swt/proxy_properties.rb +145 -0
- data/lib/glimmer/swt/transform_proxy.rb +39 -35
- data/lib/glimmer/swt/widget_proxy.rb +32 -60
- data/samples/elaborate/contact_manager.rb +2 -0
- data/samples/elaborate/login.rb +2 -0
- data/samples/elaborate/mandelbrot_fractal.rb +1 -0
- data/samples/elaborate/meta_sample.rb +1 -0
- data/samples/elaborate/tetris.rb +2 -1
- data/samples/elaborate/tic_tac_toe.rb +2 -0
- data/samples/elaborate/user_profile.rb +10 -8
- data/samples/hello/hello_browser.rb +2 -0
- data/samples/hello/hello_button.rb +2 -0
- data/samples/hello/hello_canvas.rb +157 -77
- data/samples/hello/hello_canvas_animation.rb +2 -0
- data/samples/hello/hello_canvas_transform.rb +2 -0
- data/samples/hello/hello_checkbox.rb +2 -0
- data/samples/hello/hello_checkbox_group.rb +2 -0
- data/samples/hello/hello_code_text.rb +2 -0
- data/{lib/glimmer/dsl/swt/directory_dialog_expression.rb → samples/hello/hello_color_dialog.rb} +44 -24
- data/samples/hello/hello_combo.rb +2 -0
- data/samples/hello/hello_computed.rb +2 -0
- data/samples/hello/hello_cursor.rb +2 -0
- data/samples/hello/hello_custom_shell.rb +1 -0
- data/samples/hello/hello_custom_widget.rb +2 -0
- data/samples/hello/hello_date_time.rb +2 -0
- data/samples/hello/hello_dialog.rb +2 -0
- data/samples/hello/hello_directory_dialog.rb +2 -0
- data/samples/hello/hello_drag_and_drop.rb +5 -3
- data/samples/hello/hello_expand_bar.rb +2 -0
- data/samples/hello/hello_file_dialog.rb +2 -0
- data/samples/hello/hello_font_dialog.rb +84 -0
- data/samples/hello/hello_group.rb +2 -0
- data/samples/hello/hello_link.rb +2 -0
- data/samples/hello/hello_list_multi_selection.rb +2 -0
- data/samples/hello/hello_list_single_selection.rb +2 -0
- data/samples/hello/hello_menu_bar.rb +2 -0
- data/samples/hello/hello_message_box.rb +2 -0
- data/samples/hello/hello_pop_up_context_menu.rb +2 -0
- data/samples/hello/hello_progress_bar.rb +2 -0
- data/samples/hello/hello_radio.rb +2 -0
- data/samples/hello/hello_radio_group.rb +2 -0
- data/samples/hello/hello_sash_form.rb +2 -0
- data/samples/hello/hello_spinner.rb +2 -0
- data/samples/hello/hello_styled_text.rb +19 -17
- data/samples/hello/hello_tab.rb +2 -0
- data/samples/hello/hello_table.rb +2 -0
- data/samples/hello/hello_world.rb +2 -0
- metadata +6 -6
- data/lib/glimmer/dsl/swt/file_dialog_expression.rb +0 -48
- data/lib/glimmer/swt/file_dialog_proxy.rb +0 -68
@@ -34,6 +34,7 @@ module Glimmer
|
|
34
34
|
class Shape
|
35
35
|
class Rectangle < Shape
|
36
36
|
def parameter_names
|
37
|
+
# TODO consider optimizing just like text where it is set upon updating attribute and here you just return a variable
|
37
38
|
if @args.to_a.size >= 6
|
38
39
|
rectangle_round_parameter_names
|
39
40
|
elsif @args.to_a.size == 5
|
@@ -80,6 +81,24 @@ module Glimmer
|
|
80
81
|
end
|
81
82
|
end
|
82
83
|
|
84
|
+
def point_xy_array
|
85
|
+
[[x, y], [x + calculated_width, y], [x + calculated_width, y + calculated_height], [x, y + calculated_height]]
|
86
|
+
end
|
87
|
+
|
88
|
+
def absolute_point_xy_array
|
89
|
+
[[absolute_x, absolute_y], [absolute_x + calculated_width, absolute_y], [absolute_x + calculated_width, absolute_y + calculated_height], [absolute_x, absolute_y + calculated_height]]
|
90
|
+
end
|
91
|
+
|
92
|
+
# checks if drawn or filled rectangle includes the point denoted by x and y (if drawn, it only returns true if point lies on the edge)
|
93
|
+
def include?(x, y)
|
94
|
+
if filled?
|
95
|
+
contain?(x, y)
|
96
|
+
else
|
97
|
+
comparison_lines = absolute_point_xy_array.zip(absolute_point_xy_array.rotate(1))
|
98
|
+
comparison_lines.any? {|line| Line.include?(line.first.first, line.first.last, line.last.first, line.last.last, x, y)}
|
99
|
+
end
|
100
|
+
end
|
101
|
+
|
83
102
|
end
|
84
103
|
end
|
85
104
|
end
|
@@ -43,15 +43,15 @@ module Glimmer
|
|
43
43
|
end
|
44
44
|
|
45
45
|
def text_parameter_names
|
46
|
-
[:
|
46
|
+
[:string, :x, :y]
|
47
47
|
end
|
48
48
|
|
49
49
|
def text_transparent_parameter_names
|
50
|
-
[:
|
50
|
+
[:string, :x, :y, :is_transparent]
|
51
51
|
end
|
52
52
|
|
53
53
|
def text_flags_parameter_names
|
54
|
-
[:
|
54
|
+
[:string, :x, :y, :flags]
|
55
55
|
end
|
56
56
|
|
57
57
|
def set_parameter_attribute(attribute_name, *args)
|
@@ -66,7 +66,17 @@ module Glimmer
|
|
66
66
|
super
|
67
67
|
end
|
68
68
|
|
69
|
+
def width
|
70
|
+
@extent&.x
|
71
|
+
end
|
72
|
+
|
73
|
+
def height
|
74
|
+
@extent&.y
|
75
|
+
end
|
76
|
+
|
69
77
|
end
|
78
|
+
|
79
|
+
String = Text
|
70
80
|
end
|
71
81
|
end
|
72
82
|
end
|
@@ -22,10 +22,15 @@
|
|
22
22
|
require 'glimmer/swt/swt_proxy'
|
23
23
|
require 'glimmer/swt/widget_proxy'
|
24
24
|
require 'glimmer/swt/display_proxy'
|
25
|
+
require 'glimmer/swt/proxy_properties'
|
25
26
|
|
26
27
|
module Glimmer
|
27
28
|
module SWT
|
28
|
-
# Proxy for org.eclipse.swt.widgets.
|
29
|
+
# Proxy for org.eclipse.swt.widgets.Dialog superclass
|
30
|
+
# of dialogs like FileDialog, DirectoryDialog, ColorDialog, and FontDialog
|
31
|
+
#
|
32
|
+
# (if you're seeking the `dialog` keyword, that's just a `shell` variation
|
33
|
+
# under ShellProxy instead.
|
29
34
|
#
|
30
35
|
# Automatically uses the current shell if one is open.
|
31
36
|
# Otherwise, it instantiates a new shell parent
|
@@ -33,14 +38,34 @@ module Glimmer
|
|
33
38
|
# Optionally takes a shell as an argument
|
34
39
|
#
|
35
40
|
# Follows the Proxy Design Pattern
|
36
|
-
class
|
41
|
+
class DialogProxy
|
37
42
|
# TODO write rspec tests
|
43
|
+
include ProxyProperties
|
44
|
+
|
38
45
|
include_package 'org.eclipse.swt.widgets'
|
46
|
+
include_package 'org.eclipse.swt.printing'
|
47
|
+
|
48
|
+
class << self
|
49
|
+
include_package 'org.eclipse.swt.widgets'
|
50
|
+
include_package 'org.eclipse.swt.printing'
|
51
|
+
|
52
|
+
def dialog_class(keyword)
|
53
|
+
the_class = eval(keyword.camelcase(:upper))
|
54
|
+
the_class if the_class.ancestors.include?(org.eclipse.swt.widgets.Dialog)
|
55
|
+
rescue => e
|
56
|
+
Glimmer::Config.logger.debug {"Dialog for keyword #{keyword} not found!"}
|
57
|
+
Glimmer::Config.logger.debug { e.full_message }
|
58
|
+
nil
|
59
|
+
end
|
60
|
+
end
|
39
61
|
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
62
|
+
attr_reader :swt_dialog
|
63
|
+
|
64
|
+
def initialize(keyword, *args, swt_dialog: nil)
|
65
|
+
DisplayProxy.instance.auto_exec do
|
66
|
+
dialog_class = self.class.dialog_class(keyword)
|
67
|
+
if swt_dialog
|
68
|
+
@swt_dialog = swt_dialog
|
44
69
|
else
|
45
70
|
style_args = args.select {|arg| arg.is_a?(Symbol) || arg.is_a?(String)}
|
46
71
|
if style_args.any?
|
@@ -57,10 +82,14 @@ module Glimmer
|
|
57
82
|
end
|
58
83
|
parent = args[0]
|
59
84
|
@parent_proxy = parent.is_a?(Shell) ? ShellProxy.new(swt_widget: parent) : parent
|
60
|
-
@
|
85
|
+
@swt_dialog = dialog_class.new(*args)
|
61
86
|
end
|
62
87
|
end
|
63
88
|
end
|
89
|
+
|
90
|
+
def proxy_source_object
|
91
|
+
@swt_dialog
|
92
|
+
end
|
64
93
|
|
65
94
|
end
|
66
95
|
end
|
@@ -54,13 +54,19 @@ module Glimmer
|
|
54
54
|
# that is :normal, :bold, or :italic
|
55
55
|
def initialize(widget_proxy = nil, font_properties)
|
56
56
|
@widget_proxy = widget_proxy
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
font_properties
|
57
|
+
if font_properties.is_a?(FontData)
|
58
|
+
font_datum = font_properties
|
59
|
+
@font_properties = {name: font_properties.name, height: font_properties.height, style: font_properties.style}
|
60
|
+
elsif font_properties.is_a?(Hash)
|
61
|
+
@font_properties = font_properties
|
62
|
+
detect_invalid_font_property(font_properties)
|
63
|
+
font_properties[:style] = SWTProxy[*font_properties[:style]]
|
64
|
+
# TODO consider supporting other properties like locale in the future
|
65
|
+
font_data_args = [:name, :height, :style].map do |font_property_name|
|
66
|
+
font_properties[font_property_name] || send(font_property_name)
|
67
|
+
end
|
68
|
+
font_datum = FontData.new(*font_data_args)
|
62
69
|
end
|
63
|
-
font_datum = FontData.new(*font_data_args)
|
64
70
|
@swt_font = Font.new(DisplayProxy.instance.swt_display, font_datum)
|
65
71
|
end
|
66
72
|
|
@@ -0,0 +1,145 @@
|
|
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/properties'
|
23
|
+
|
24
|
+
module Glimmer
|
25
|
+
module SWT
|
26
|
+
# Provides a default implementation for proxy properties, that is
|
27
|
+
# properties that come from a proxy object source such as swt_widget
|
28
|
+
# having Java camelcase format
|
29
|
+
module ProxyProperties
|
30
|
+
include Properties
|
31
|
+
|
32
|
+
# Subclasses must override to privde a proxy source if they want to take advantage of
|
33
|
+
# default implementation of attribute setters/getters
|
34
|
+
# It tries swt_widget, swt_display, swt_image, and swt_dialog by default.
|
35
|
+
def proxy_source_object
|
36
|
+
if respond_to?(:swt_widget)
|
37
|
+
swt_widget
|
38
|
+
elsif respond_to?(:swt_display)
|
39
|
+
swt_display
|
40
|
+
elsif respond_to?(:swt_image)
|
41
|
+
swt_image
|
42
|
+
elsif respond_to?(:swt_dialog)
|
43
|
+
swt_dialog
|
44
|
+
elsif respond_to?(:swt_transform)
|
45
|
+
swt_transform
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
def has_attribute_getter?(attribute_getter_name, *args)
|
50
|
+
attribute_getter_name = attribute_getter_name.to_s.underscore
|
51
|
+
return false unless !attribute_getter_name.end_with?('=') && !attribute_getter_name.start_with?('set_')
|
52
|
+
args.empty? && proxy_source_object&.respond_to?(attribute_getter_name)
|
53
|
+
end
|
54
|
+
|
55
|
+
def has_attribute_setter?(attribute_setter_name, *args)
|
56
|
+
attribute_setter_name = attribute_setter_name.to_s
|
57
|
+
underscored_attribute_setter_name = attribute_setter_name.underscore
|
58
|
+
return false unless attribute_setter_name.end_with?('=') || (attribute_setter_name.start_with?('set_') && !args.empty?)
|
59
|
+
attribute_name = underscored_attribute_setter_name.sub(/^set_/, '').sub(/=$/, '')
|
60
|
+
has_attribute?(attribute_name, *args)
|
61
|
+
end
|
62
|
+
|
63
|
+
def has_attribute?(attribute_name, *args)
|
64
|
+
Glimmer::SWT::DisplayProxy.instance.auto_exec do
|
65
|
+
proxy_source_object&.respond_to?(attribute_setter(attribute_name), args) ||
|
66
|
+
respond_to?(ruby_attribute_setter(attribute_name), args)
|
67
|
+
end
|
68
|
+
end
|
69
|
+
|
70
|
+
def set_attribute(attribute_name, *args)
|
71
|
+
swt_widget_operation = false
|
72
|
+
result = nil
|
73
|
+
Glimmer::SWT::DisplayProxy.instance.auto_exec do
|
74
|
+
result = if proxy_source_object&.respond_to?(attribute_setter(attribute_name))
|
75
|
+
swt_widget_operation = true
|
76
|
+
proxy_source_object&.send(attribute_setter(attribute_name), *args) unless proxy_source_object&.send(attribute_getter(attribute_name)) == args.first
|
77
|
+
elsif proxy_source_object&.respond_to?(ruby_attribute_setter(attribute_name))
|
78
|
+
swt_widget_operation = true
|
79
|
+
proxy_source_object&.send(ruby_attribute_setter(attribute_name), args)
|
80
|
+
end
|
81
|
+
end
|
82
|
+
unless swt_widget_operation
|
83
|
+
result = send(ruby_attribute_setter(attribute_name), args)
|
84
|
+
end
|
85
|
+
result
|
86
|
+
end
|
87
|
+
|
88
|
+
def get_attribute(attribute_name)
|
89
|
+
swt_widget_operation = false
|
90
|
+
result = nil
|
91
|
+
Glimmer::SWT::DisplayProxy.instance.auto_exec do
|
92
|
+
result = if proxy_source_object&.respond_to?(attribute_getter(attribute_name))
|
93
|
+
swt_widget_operation = true
|
94
|
+
proxy_source_object&.send(attribute_getter(attribute_name))
|
95
|
+
elsif proxy_source_object&.respond_to?(ruby_attribute_getter(attribute_name))
|
96
|
+
swt_widget_operation = true
|
97
|
+
proxy_source_object&.send(ruby_attribute_getter(attribute_name))
|
98
|
+
elsif proxy_source_object&.respond_to?(attribute_name)
|
99
|
+
swt_widget_operation = true
|
100
|
+
proxy_source_object&.send(attribute_name)
|
101
|
+
end
|
102
|
+
end
|
103
|
+
unless swt_widget_operation
|
104
|
+
result = if respond_to?(ruby_attribute_getter(attribute_name))
|
105
|
+
send(ruby_attribute_getter(attribute_name))
|
106
|
+
else
|
107
|
+
send(attribute_name)
|
108
|
+
end
|
109
|
+
end
|
110
|
+
result
|
111
|
+
end
|
112
|
+
|
113
|
+
def method_missing(method, *args, &block)
|
114
|
+
if has_attribute_setter?(method, *args)
|
115
|
+
set_attribute(method, *args)
|
116
|
+
elsif has_attribute_getter?(method, *args)
|
117
|
+
get_attribute(method, *args)
|
118
|
+
else
|
119
|
+
Glimmer::SWT::DisplayProxy.instance.auto_exec do
|
120
|
+
proxy_source_object&.send(method, *args, &block)
|
121
|
+
end
|
122
|
+
end
|
123
|
+
rescue => e
|
124
|
+
begin
|
125
|
+
super
|
126
|
+
rescue Exception => inner_error
|
127
|
+
Glimmer::Config.logger.error { "Neither self.class.name nor #{proxy_source_object&.class.name} can handle the method ##{method}" }
|
128
|
+
Glimmer::Config.logger.error { e.full_message }
|
129
|
+
raise inner_error
|
130
|
+
end
|
131
|
+
end
|
132
|
+
|
133
|
+
def respond_to?(method, *args, &block)
|
134
|
+
result = super
|
135
|
+
return true if result
|
136
|
+
Glimmer::SWT::DisplayProxy.instance.auto_exec do
|
137
|
+
proxy_source_object&.respond_to?(method, *args, &block)
|
138
|
+
end
|
139
|
+
end
|
140
|
+
|
141
|
+
end
|
142
|
+
|
143
|
+
end
|
144
|
+
|
145
|
+
end
|
@@ -20,7 +20,7 @@
|
|
20
20
|
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
21
21
|
|
22
22
|
require 'glimmer/swt/display_proxy'
|
23
|
-
require 'glimmer/swt/
|
23
|
+
require 'glimmer/swt/proxy_properties'
|
24
24
|
require 'glimmer/swt/custom/shape'
|
25
25
|
|
26
26
|
module Glimmer
|
@@ -29,7 +29,7 @@ module Glimmer
|
|
29
29
|
#
|
30
30
|
# Follows the Proxy Design Pattern
|
31
31
|
class TransformProxy
|
32
|
-
include
|
32
|
+
include ProxyProperties
|
33
33
|
|
34
34
|
include_package 'org.eclipse.swt.graphics'
|
35
35
|
include_package 'org.eclipse.swt.widgets'
|
@@ -37,32 +37,36 @@ module Glimmer
|
|
37
37
|
attr_reader :swt_transform, :parent
|
38
38
|
|
39
39
|
def initialize(parent, *args, swt_transform: nil, multiply: false)
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
if
|
44
|
-
args.
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
40
|
+
Glimmer::SWT::DisplayProxy.instance.auto_exec do
|
41
|
+
@parent = parent
|
42
|
+
@multiply = multiply
|
43
|
+
if swt_transform.nil?
|
44
|
+
if !args.first.is_a?(Display) && !args.first.is_a?(DisplayProxy)
|
45
|
+
args.prepend DisplayProxy.instance.swt_display
|
46
|
+
end
|
47
|
+
if args.first.is_a?(DisplayProxy)
|
48
|
+
args[0] = args[0].swt_display
|
49
|
+
end
|
50
|
+
if args.last.is_a?(TransformProxy)
|
51
|
+
args[-1] = args[-1].swt_transform
|
52
|
+
end
|
53
|
+
if args.last.nil? || args.last.is_a?(Transform)
|
54
|
+
@swt_transform = args.last
|
55
|
+
@parent&.set_attribute('transform', self)
|
56
|
+
else
|
57
|
+
@swt_transform = Transform.new(*args)
|
58
|
+
end
|
55
59
|
else
|
56
|
-
@swt_transform =
|
60
|
+
@swt_transform = swt_transform
|
57
61
|
end
|
58
|
-
else
|
59
|
-
@swt_transform = swt_transform
|
60
62
|
end
|
61
63
|
end
|
62
64
|
|
63
65
|
def post_add_content
|
64
66
|
if @multiply
|
65
|
-
|
67
|
+
Glimmer::SWT::DisplayProxy.instance.auto_exec {
|
68
|
+
@parent.multiply(@swt_transform)
|
69
|
+
}
|
66
70
|
else
|
67
71
|
@parent&.set_attribute('transform', self)
|
68
72
|
end
|
@@ -72,32 +76,32 @@ module Glimmer
|
|
72
76
|
Glimmer::DSL::Engine.add_content(self, Glimmer::DSL::SWT::TransformExpression.new, &block)
|
73
77
|
end
|
74
78
|
|
79
|
+
def proxy_source_object
|
80
|
+
@swt_transform
|
81
|
+
end
|
82
|
+
|
75
83
|
def has_attribute?(attribute_name, *args)
|
76
|
-
@swt_transform.respond_to?(attribute_name) ||
|
84
|
+
Glimmer::SWT::DisplayProxy.instance.auto_exec { @swt_transform.respond_to?(attribute_name) } || super
|
77
85
|
end
|
78
86
|
|
79
87
|
def set_attribute(attribute_name, *args)
|
80
88
|
if @swt_transform.respond_to?(attribute_name)
|
81
|
-
@swt_transform.send(attribute_name, *args)
|
82
|
-
elsif @swt_transform.respond_to?(attribute_setter(attribute_name))
|
83
|
-
@swt_transform.send(attribute_setter(attribute_name), *args)
|
84
|
-
end
|
85
|
-
end
|
86
|
-
|
87
|
-
def get_attribute(attribute_name)
|
88
|
-
if @swt_transform.respond_to?(attribute_getter(attribute_name))
|
89
|
-
@swt_transform.send(attribute_getter(attribute_name))
|
89
|
+
Glimmer::SWT::DisplayProxy.instance.auto_exec { @swt_transform.send(attribute_name, *args) }
|
90
90
|
else
|
91
|
-
|
91
|
+
super
|
92
92
|
end
|
93
93
|
end
|
94
94
|
|
95
95
|
def method_missing(method_name, *args, &block)
|
96
|
-
result = @swt_transform.send(method_name, *args, &block)
|
96
|
+
result = Glimmer::SWT::DisplayProxy.instance.auto_exec { @swt_transform.send(method_name, *args, &block) }
|
97
97
|
result.nil? ? self : result
|
98
98
|
rescue => e
|
99
|
-
|
100
|
-
|
99
|
+
begin
|
100
|
+
super
|
101
|
+
rescue Exception => inner_e
|
102
|
+
Glimmer::Config.logger.error {"Neither TransformProxy nor #{@swt_transform.class.name} can handle the method ##{method}"}
|
103
|
+
Glimmer::Config.logger.error {e.full_message}
|
104
|
+
end
|
101
105
|
end
|
102
106
|
|
103
107
|
def respond_to?(method, *args, &block)
|