glimmer-dsl-swt 4.17.10.6 → 4.18.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +39 -0
- data/LICENSE.txt +1 -1
- data/README.md +369 -60
- data/RUBY_VERSION +1 -1
- data/VERSION +1 -1
- data/bin/girb +1 -1
- data/bin/girb_runner.rb +1 -1
- data/bin/glimmer +1 -1
- data/glimmer-dsl-swt.gemspec +54 -34
- data/lib/ext/glimmer.rb +1 -1
- data/lib/ext/glimmer/config.rb +1 -1
- data/lib/glimmer-dsl-swt.rb +2 -1
- data/lib/glimmer/Rakefile +1 -1
- data/lib/glimmer/data_binding/list_selection_binding.rb +1 -1
- data/lib/glimmer/data_binding/observable_widget.rb +1 -1
- data/lib/glimmer/data_binding/shine.rb +1 -1
- data/lib/glimmer/data_binding/table_items_binding.rb +1 -1
- data/lib/glimmer/data_binding/tree_items_binding.rb +1 -1
- data/lib/glimmer/data_binding/widget_binding.rb +1 -1
- data/lib/glimmer/dsl/swt/async_exec_expression.rb +1 -1
- data/lib/glimmer/dsl/swt/bind_expression.rb +1 -1
- data/lib/glimmer/dsl/swt/block_property_expression.rb +1 -1
- data/lib/glimmer/dsl/swt/checkbox_group_selection_data_binding_expression.rb +1 -1
- data/lib/glimmer/dsl/swt/color_expression.rb +1 -1
- data/lib/glimmer/dsl/swt/column_properties_expression.rb +1 -1
- data/lib/glimmer/dsl/swt/combo_selection_data_binding_expression.rb +1 -1
- data/lib/glimmer/dsl/swt/cursor_expression.rb +1 -1
- data/lib/glimmer/dsl/swt/custom_widget_expression.rb +1 -1
- data/lib/glimmer/dsl/swt/data_binding_expression.rb +1 -1
- data/lib/glimmer/dsl/swt/dialog_expression.rb +1 -1
- data/lib/glimmer/dsl/swt/directory_dialog_expression.rb +1 -1
- data/lib/glimmer/dsl/swt/display_expression.rb +1 -1
- data/lib/glimmer/dsl/swt/dnd_expression.rb +1 -1
- data/lib/glimmer/dsl/swt/dsl.rb +1 -1
- data/lib/glimmer/dsl/swt/exec_expression.rb +5 -5
- data/lib/glimmer/dsl/swt/expand_item_expression.rb +1 -1
- data/lib/glimmer/dsl/swt/file_dialog_expression.rb +1 -1
- data/lib/glimmer/dsl/swt/font_expression.rb +1 -1
- data/lib/glimmer/dsl/swt/image_expression.rb +1 -1
- data/lib/glimmer/dsl/swt/layout_data_expression.rb +1 -1
- data/lib/glimmer/dsl/swt/layout_expression.rb +1 -1
- data/lib/glimmer/dsl/swt/list_selection_data_binding_expression.rb +1 -1
- data/lib/glimmer/dsl/swt/menu_bar_expression.rb +1 -1
- data/lib/glimmer/dsl/swt/menu_expression.rb +1 -1
- data/lib/glimmer/dsl/swt/message_box_expression.rb +1 -1
- data/lib/glimmer/dsl/swt/observe_expression.rb +1 -1
- data/lib/glimmer/dsl/swt/property_expression.rb +1 -1
- data/lib/glimmer/dsl/swt/radio_group_selection_data_binding_expression.rb +1 -1
- data/lib/glimmer/dsl/swt/rgb_expression.rb +1 -1
- data/lib/glimmer/dsl/swt/rgba_expression.rb +1 -1
- data/lib/glimmer/dsl/swt/shell_expression.rb +1 -1
- data/lib/glimmer/dsl/swt/swt_expression.rb +1 -1
- data/lib/glimmer/dsl/swt/sync_exec_expression.rb +1 -1
- data/lib/glimmer/dsl/swt/tab_item_expression.rb +1 -1
- data/lib/glimmer/dsl/swt/table_items_data_binding_expression.rb +1 -1
- data/lib/glimmer/dsl/swt/tree_items_data_binding_expression.rb +1 -1
- data/lib/glimmer/dsl/swt/tree_properties_expression.rb +1 -1
- data/lib/glimmer/dsl/swt/widget_expression.rb +1 -1
- data/lib/glimmer/dsl/swt/widget_listener_expression.rb +1 -1
- data/lib/glimmer/launcher.rb +1 -1
- data/lib/glimmer/rake_task.rb +1 -1
- data/lib/glimmer/rake_task/list.rb +1 -1
- data/lib/glimmer/rake_task/package.rb +1 -1
- data/lib/glimmer/rake_task/scaffold.rb +1 -1
- data/lib/glimmer/swt/color_proxy.rb +1 -1
- data/lib/glimmer/swt/cursor_proxy.rb +1 -1
- data/lib/glimmer/swt/custom/checkbox_group.rb +1 -1
- data/lib/glimmer/swt/custom/radio_group.rb +1 -1
- data/lib/glimmer/swt/date_time_proxy.rb +1 -1
- data/lib/glimmer/swt/directory_dialog_proxy.rb +1 -1
- data/lib/glimmer/swt/display_proxy.rb +1 -1
- data/lib/glimmer/swt/dnd_proxy.rb +1 -1
- data/lib/glimmer/swt/expand_item_proxy.rb +1 -1
- data/lib/glimmer/swt/file_dialog_proxy.rb +1 -1
- data/lib/glimmer/swt/font_proxy.rb +1 -1
- data/lib/glimmer/swt/image_proxy.rb +12 -11
- data/lib/glimmer/swt/layout_data_proxy.rb +1 -1
- data/lib/glimmer/swt/layout_proxy.rb +8 -4
- data/lib/glimmer/swt/menu_proxy.rb +10 -6
- data/lib/glimmer/swt/message_box_proxy.rb +1 -1
- data/lib/glimmer/swt/packages.rb +1 -1
- data/lib/glimmer/swt/sash_form_proxy.rb +2 -2
- data/lib/glimmer/swt/scrolled_composite_proxy.rb +1 -1
- data/lib/glimmer/swt/shell_proxy.rb +1 -1
- data/lib/glimmer/swt/style_constantizable.rb +9 -5
- data/lib/glimmer/swt/styled_text_proxy.rb +1 -1
- data/lib/glimmer/swt/swt_proxy.rb +1 -1
- data/lib/glimmer/swt/tab_item_proxy.rb +1 -1
- data/lib/glimmer/swt/table_column_proxy.rb +1 -1
- data/lib/glimmer/swt/table_proxy.rb +1 -1
- data/lib/glimmer/swt/tree_proxy.rb +26 -22
- data/lib/glimmer/swt/widget_listener_proxy.rb +1 -1
- data/lib/glimmer/swt/widget_proxy.rb +70 -25
- data/lib/glimmer/ui/custom_shell.rb +1 -1
- data/lib/glimmer/ui/custom_widget.rb +1 -1
- data/lib/glimmer/util/proc_tracker.rb +1 -1
- data/samples/elaborate/contact_manager.rb +1 -1
- data/samples/elaborate/contact_manager/contact.rb +1 -1
- data/samples/elaborate/contact_manager/contact_manager_presenter.rb +1 -1
- data/samples/elaborate/contact_manager/contact_repository.rb +1 -1
- data/samples/elaborate/login.rb +1 -1
- data/samples/elaborate/meta_sample.rb +80 -20
- data/samples/elaborate/tic_tac_toe.rb +2 -2
- data/samples/elaborate/tic_tac_toe/board.rb +1 -1
- data/samples/elaborate/tic_tac_toe/cell.rb +1 -1
- data/samples/elaborate/user_profile.rb +1 -1
- data/samples/hello/hello_browser.rb +3 -1
- data/samples/hello/hello_button.rb +1 -1
- data/samples/hello/hello_checkbox.rb +1 -1
- data/samples/hello/hello_checkbox_group.rb +1 -1
- data/samples/hello/hello_combo.rb +1 -1
- data/samples/hello/hello_computed.rb +10 -4
- data/samples/hello/hello_computed/contact.rb +1 -1
- data/samples/hello/hello_custom_shell.rb +1 -1
- data/samples/hello/hello_custom_widget.rb +1 -1
- data/samples/hello/hello_date_time.rb +1 -1
- data/samples/hello/hello_dialog.rb +78 -0
- data/samples/hello/hello_directory_dialog.rb +1 -1
- data/samples/hello/hello_drag_and_drop.rb +1 -1
- data/samples/hello/hello_expand_bar.rb +1 -1
- data/samples/hello/hello_file_dialog.rb +1 -1
- data/samples/hello/hello_group.rb +1 -1
- data/samples/hello/hello_link.rb +4 -6
- data/samples/hello/hello_list_multi_selection.rb +1 -1
- data/samples/hello/hello_list_single_selection.rb +1 -1
- data/samples/hello/hello_menu_bar.rb +185 -29
- data/samples/hello/hello_message_box.rb +10 -9
- data/samples/hello/hello_pop_up_context_menu.rb +34 -7
- data/samples/hello/hello_radio.rb +1 -1
- data/samples/hello/hello_radio_group.rb +1 -1
- data/samples/hello/hello_sash_form.rb +1 -1
- data/samples/hello/hello_spinner.rb +1 -1
- data/samples/hello/hello_styled_text.rb +1 -1
- data/samples/hello/hello_tab.rb +1 -1
- data/samples/hello/hello_table.rb +1 -1
- data/samples/hello/hello_world.rb +1 -1
- data/vendor/swt/linux/swt.jar +0 -0
- data/vendor/swt/mac/swt.jar +0 -0
- data/vendor/swt/windows/swt.jar +0 -0
- metadata +74 -42
data/lib/glimmer/launcher.rb
CHANGED
data/lib/glimmer/rake_task.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
# Copyright (c) 2007-
|
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
|
@@ -54,9 +54,9 @@ module Glimmer
|
|
54
54
|
@args = @args.first if @args.size == 1 && @args.first.is_a?(Array)
|
55
55
|
if options&.keys&.include?(:swt_image)
|
56
56
|
@swt_image = options[:swt_image]
|
57
|
-
@image_data = @swt_image.image_data
|
57
|
+
@original_image_data = @image_data = @swt_image.image_data
|
58
58
|
elsif @file_path
|
59
|
-
@image_data = ImageData.new(input_stream || @file_path)
|
59
|
+
@original_image_data = @image_data = ImageData.new(input_stream || @file_path)
|
60
60
|
@swt_image = Image.new(DisplayProxy.instance.swt_display, @image_data)
|
61
61
|
width = options[:width]
|
62
62
|
height = options[:height]
|
@@ -65,8 +65,8 @@ module Glimmer
|
|
65
65
|
scale_to(width, height) unless width.nil? || height.nil?
|
66
66
|
else
|
67
67
|
@swt_image = Image.new(*@args)
|
68
|
-
@image_data = @swt_image.image_data
|
69
|
-
end
|
68
|
+
@original_image_data = @image_data = @swt_image.image_data
|
69
|
+
end
|
70
70
|
end
|
71
71
|
|
72
72
|
def input_stream
|
@@ -77,12 +77,13 @@ module Glimmer
|
|
77
77
|
file_input_stream = object.java_class.resource_as_stream(file_path)
|
78
78
|
else
|
79
79
|
file_input_stream = java.io.FileInputStream.new(@file_path)
|
80
|
-
end
|
80
|
+
end
|
81
81
|
java.io.BufferedInputStream.new(file_input_stream) if file_input_stream
|
82
82
|
end
|
83
83
|
|
84
84
|
def scale_to(width, height)
|
85
|
-
|
85
|
+
return if @image_data.width == width && @image_data.height == height
|
86
|
+
scaled_image_data = @original_image_data.scaledTo(width, height)
|
86
87
|
device = swt_image.device
|
87
88
|
swt_image.dispose
|
88
89
|
@swt_image = Image.new(device, scaled_image_data)
|
@@ -99,7 +100,7 @@ module Glimmer
|
|
99
100
|
|
100
101
|
def respond_to?(method, *args, &block)
|
101
102
|
super || swt_image.respond_to?(method, *args, &block)
|
102
|
-
end
|
103
|
+
end
|
103
104
|
end
|
104
105
|
end
|
105
106
|
end
|
@@ -1,5 +1,5 @@
|
|
1
|
-
# Copyright (c) 2007-
|
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
|
@@ -68,6 +68,10 @@ module Glimmer
|
|
68
68
|
@swt_layout = self.class.swt_layout_class_for(underscored_layout_name).new(*args)
|
69
69
|
@swt_layout.marginWidth = 15 if @swt_layout.respond_to?(:marginWidth)
|
70
70
|
@swt_layout.marginHeight = 15 if @swt_layout.respond_to?(:marginHeight)
|
71
|
+
@swt_layout.marginTop = 0 if @swt_layout.respond_to?(:marginTop)
|
72
|
+
@swt_layout.marginRight = 0 if @swt_layout.respond_to?(:marginRight)
|
73
|
+
@swt_layout.marginBottom = 0 if @swt_layout.respond_to?(:marginBottom)
|
74
|
+
@swt_layout.marginLeft = 0 if @swt_layout.respond_to?(:marginLeft)
|
71
75
|
@widget_proxy.swt_widget.setLayout(@swt_layout)
|
72
76
|
end
|
73
77
|
|
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright (c) 2007-
|
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
|
@@ -66,7 +66,6 @@ module Glimmer
|
|
66
66
|
else
|
67
67
|
@swt_widget = swt_widget_class.new(parent.swt_widget)
|
68
68
|
end
|
69
|
-
DEFAULT_INITIALIZERS['menu']&.call(swt_widget)
|
70
69
|
|
71
70
|
if styles.include?(:bar)
|
72
71
|
parent.swt_widget.setMenuBar(swt_widget)
|
@@ -76,7 +75,7 @@ module Glimmer
|
|
76
75
|
end
|
77
76
|
|
78
77
|
def has_attribute?(attribute_name, *args)
|
79
|
-
if attribute_name.to_s
|
78
|
+
if ['text', 'enabled'].include?(attribute_name.to_s)
|
80
79
|
true
|
81
80
|
else
|
82
81
|
super(attribute_name, *args)
|
@@ -84,24 +83,29 @@ module Glimmer
|
|
84
83
|
end
|
85
84
|
|
86
85
|
def set_attribute(attribute_name, *args)
|
87
|
-
attribute_name
|
88
|
-
if attribute_name.to_s == "text"
|
86
|
+
if normalized_attribute(attribute_name) == 'text'
|
89
87
|
text_value = args[0]
|
90
88
|
@swt_menu_item.setText text_value
|
89
|
+
elsif normalized_attribute(attribute_name) == 'enabled'
|
90
|
+
value = args[0]
|
91
|
+
@swt_menu_item.setEnabled value
|
91
92
|
else
|
92
93
|
super(attribute_name, *args)
|
93
94
|
end
|
94
95
|
end
|
95
96
|
|
96
97
|
def get_attribute(attribute_name)
|
97
|
-
if attribute_name
|
98
|
+
if normalized_attribute(attribute_name) == 'text'
|
98
99
|
@swt_menu_item.getText
|
100
|
+
elsif normalized_attribute(attribute_name) == 'enabled'
|
101
|
+
@swt_menu_item.getEnabled
|
99
102
|
else
|
100
103
|
super(attribute_name)
|
101
104
|
end
|
102
105
|
end
|
103
106
|
|
104
107
|
def can_handle_observation_request?(observation_request, super_only: false)
|
108
|
+
observation_request = observation_request.to_s
|
105
109
|
super_result = super(observation_request)
|
106
110
|
if observation_request.start_with?('on_') && !super_result && !super_only
|
107
111
|
return menu_item_proxy.can_handle_observation_request?(observation_request)
|
data/lib/glimmer/swt/packages.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright (c) 2007-
|
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
|
@@ -28,7 +28,7 @@ module Glimmer
|
|
28
28
|
# Follows the Proxy Design Pattern
|
29
29
|
class SashFormProxy < WidgetProxy
|
30
30
|
def post_add_content
|
31
|
-
|
31
|
+
self.weights = @weights unless @weights.nil?
|
32
32
|
end
|
33
33
|
|
34
34
|
def set_attribute(attribute_name, *args)
|
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright (c) 2007-
|
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
|
@@ -89,11 +89,15 @@ module Glimmer
|
|
89
89
|
negative ? ~bit_value : bit_value
|
90
90
|
rescue => e
|
91
91
|
# Glimmer::Config.logger.debug {e.full_message}
|
92
|
-
|
93
|
-
|
94
|
-
negative ? ~bit_value : bit_value
|
92
|
+
if symbol.to_s.size == 1 # accelerator key
|
93
|
+
symbol.to_s.bytes.first
|
95
94
|
else
|
96
|
-
|
95
|
+
bit_value = extra_styles[swt_constant_symbol]
|
96
|
+
if bit_value
|
97
|
+
negative ? ~bit_value : bit_value
|
98
|
+
else
|
99
|
+
symbol
|
100
|
+
end
|
97
101
|
end
|
98
102
|
end
|
99
103
|
end
|