glimmer-dsl-opal 0.4.0 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +18 -0
- data/README.md +530 -13
- data/VERSION +1 -1
- data/lib/glimmer-dsl-opal/samples/hello/hello_checkbox.rb +85 -0
- data/lib/glimmer-dsl-opal/samples/hello/hello_checkbox_group.rb +68 -0
- data/lib/glimmer-dsl-opal/samples/hello/hello_custom_widget.rb +3 -3
- data/lib/glimmer-dsl-opal/samples/hello/hello_group.rb +104 -0
- data/lib/glimmer-dsl-opal/samples/hello/hello_radio.rb +108 -0
- data/lib/glimmer-dsl-opal/samples/hello/hello_radio_group.rb +84 -0
- data/lib/glimmer-dsl-swt.rb +1 -0
- data/lib/glimmer/data_binding/element_binding.rb +2 -1
- data/lib/glimmer/dsl/opal/checkbox_group_selection_data_binding_expression.rb +61 -0
- data/lib/glimmer/dsl/opal/custom_widget_expression.rb +7 -5
- data/lib/glimmer/dsl/opal/dsl.rb +4 -0
- data/lib/glimmer/dsl/opal/property_expression.rb +4 -3
- data/lib/glimmer/dsl/opal/radio_group_selection_data_binding_expression.rb +61 -0
- data/lib/glimmer/swt/button_proxy.rb +15 -1
- data/lib/glimmer/swt/checkbox_proxy.rb +80 -0
- data/lib/glimmer/swt/combo_proxy.rb +4 -4
- data/lib/glimmer/swt/custom/checkbox_group.rb +142 -0
- data/lib/glimmer/swt/custom/radio_group.rb +143 -0
- data/lib/glimmer/swt/grid_layout_proxy.rb +19 -8
- data/lib/glimmer/swt/group_proxy.rb +38 -0
- data/lib/glimmer/swt/label_proxy.rb +27 -7
- data/lib/glimmer/swt/layout_data_proxy.rb +31 -13
- data/lib/glimmer/swt/list_proxy.rb +2 -2
- data/lib/glimmer/swt/radio_proxy.rb +81 -0
- data/lib/glimmer/swt/row_layout_proxy.rb +32 -9
- data/lib/glimmer/swt/scrolled_composite_proxy.rb +20 -0
- data/lib/glimmer/swt/shell_proxy.rb +21 -9
- data/lib/glimmer/swt/widget_proxy.rb +46 -30
- metadata +15 -2
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.5.0
|
@@ -0,0 +1,85 @@
|
|
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
|
+
class HelloCheckbox
|
23
|
+
class Person
|
24
|
+
attr_accessor :skiing, :snowboarding, :snowmobiling, :snowshoeing
|
25
|
+
|
26
|
+
def initialize
|
27
|
+
reset_activities
|
28
|
+
end
|
29
|
+
|
30
|
+
def reset_activities
|
31
|
+
self.skiing = false
|
32
|
+
self.snowboarding = true
|
33
|
+
self.snowmobiling = false
|
34
|
+
self.snowshoeing = false
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
include Glimmer
|
39
|
+
|
40
|
+
def launch
|
41
|
+
person = Person.new
|
42
|
+
|
43
|
+
shell {
|
44
|
+
text 'Hello, Checkbox!'
|
45
|
+
row_layout :vertical
|
46
|
+
|
47
|
+
label {
|
48
|
+
text 'Check all snow activities you are interested in:'
|
49
|
+
font style: :bold
|
50
|
+
}
|
51
|
+
|
52
|
+
composite {
|
53
|
+
checkbox {
|
54
|
+
text 'Skiing'
|
55
|
+
selection bind(person, :skiing)
|
56
|
+
}
|
57
|
+
|
58
|
+
checkbox {
|
59
|
+
text 'Snowboarding'
|
60
|
+
selection bind(person, :snowboarding)
|
61
|
+
}
|
62
|
+
|
63
|
+
checkbox {
|
64
|
+
text 'Snowmobiling'
|
65
|
+
selection bind(person, :snowmobiling)
|
66
|
+
}
|
67
|
+
|
68
|
+
checkbox {
|
69
|
+
text 'Snowshoeing'
|
70
|
+
selection bind(person, :snowshoeing)
|
71
|
+
}
|
72
|
+
}
|
73
|
+
|
74
|
+
button {
|
75
|
+
text 'Reset Activities'
|
76
|
+
|
77
|
+
on_widget_selected do
|
78
|
+
person.reset_activities
|
79
|
+
end
|
80
|
+
}
|
81
|
+
}.open
|
82
|
+
end
|
83
|
+
end
|
84
|
+
|
85
|
+
HelloCheckbox.new.launch
|
@@ -0,0 +1,68 @@
|
|
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
|
+
class HelloCheckboxGroup
|
23
|
+
class Person
|
24
|
+
attr_accessor :activities
|
25
|
+
|
26
|
+
def initialize
|
27
|
+
reset_activities
|
28
|
+
end
|
29
|
+
|
30
|
+
def activities_options
|
31
|
+
['Skiing', 'Snowboarding', 'Snowmobiling', 'Snowshoeing']
|
32
|
+
end
|
33
|
+
|
34
|
+
def reset_activities
|
35
|
+
self.activities = ['Snowboarding']
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
include Glimmer
|
40
|
+
|
41
|
+
def launch
|
42
|
+
person = Person.new
|
43
|
+
|
44
|
+
shell {
|
45
|
+
text 'Hello, Checkbox Group!'
|
46
|
+
row_layout :vertical
|
47
|
+
|
48
|
+
label {
|
49
|
+
text 'Check all snow activities you are interested in:'
|
50
|
+
font style: :bold
|
51
|
+
}
|
52
|
+
|
53
|
+
checkbox_group {
|
54
|
+
selection bind(person, :activities)
|
55
|
+
}
|
56
|
+
|
57
|
+
button {
|
58
|
+
text 'Reset Activities'
|
59
|
+
|
60
|
+
on_widget_selected do
|
61
|
+
person.reset_activities
|
62
|
+
end
|
63
|
+
}
|
64
|
+
}.open
|
65
|
+
end
|
66
|
+
end
|
67
|
+
|
68
|
+
HelloCheckboxGroup.new.launch
|
@@ -1,5 +1,5 @@
|
|
1
1
|
# Copyright (c) 2020 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
|
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
|
@@ -0,0 +1,104 @@
|
|
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
|
+
class HelloGroup
|
23
|
+
class Person
|
24
|
+
attr_accessor :male, :female, :child, :teen, :adult, :senior
|
25
|
+
|
26
|
+
def initialize
|
27
|
+
reset
|
28
|
+
end
|
29
|
+
|
30
|
+
def reset
|
31
|
+
self.male = nil
|
32
|
+
self.female = nil
|
33
|
+
self.child = nil
|
34
|
+
self.teen = nil
|
35
|
+
self.adult = true
|
36
|
+
self.senior = nil
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
include Glimmer
|
41
|
+
|
42
|
+
def launch
|
43
|
+
person = Person.new
|
44
|
+
|
45
|
+
shell {
|
46
|
+
text 'Hello, Group!'
|
47
|
+
row_layout :vertical
|
48
|
+
|
49
|
+
group {
|
50
|
+
row_layout
|
51
|
+
|
52
|
+
text 'Gender'
|
53
|
+
font style: :bold
|
54
|
+
|
55
|
+
radio {
|
56
|
+
text 'Male'
|
57
|
+
selection bind(person, :male)
|
58
|
+
}
|
59
|
+
|
60
|
+
radio {
|
61
|
+
text 'Female'
|
62
|
+
selection bind(person, :female)
|
63
|
+
}
|
64
|
+
}
|
65
|
+
|
66
|
+
group {
|
67
|
+
row_layout
|
68
|
+
|
69
|
+
text 'Age Group'
|
70
|
+
font style: :bold
|
71
|
+
|
72
|
+
radio {
|
73
|
+
text 'Child'
|
74
|
+
selection bind(person, :child)
|
75
|
+
}
|
76
|
+
|
77
|
+
radio {
|
78
|
+
text 'Teen'
|
79
|
+
selection bind(person, :teen)
|
80
|
+
}
|
81
|
+
|
82
|
+
radio {
|
83
|
+
text 'Adult'
|
84
|
+
selection bind(person, :adult)
|
85
|
+
}
|
86
|
+
|
87
|
+
radio {
|
88
|
+
text 'Senior'
|
89
|
+
selection bind(person, :senior)
|
90
|
+
}
|
91
|
+
}
|
92
|
+
|
93
|
+
button {
|
94
|
+
text 'Reset'
|
95
|
+
|
96
|
+
on_widget_selected do
|
97
|
+
person.reset
|
98
|
+
end
|
99
|
+
}
|
100
|
+
}.open
|
101
|
+
end
|
102
|
+
end
|
103
|
+
|
104
|
+
HelloGroup.new.launch
|
@@ -0,0 +1,108 @@
|
|
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
|
+
class HelloRadio
|
23
|
+
class Person
|
24
|
+
attr_accessor :male, :female, :child, :teen, :adult, :senior
|
25
|
+
|
26
|
+
def initialize
|
27
|
+
reset
|
28
|
+
end
|
29
|
+
|
30
|
+
def reset
|
31
|
+
self.male = nil
|
32
|
+
self.female = nil
|
33
|
+
self.child = nil
|
34
|
+
self.teen = nil
|
35
|
+
self.adult = true
|
36
|
+
self.senior = nil
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
include Glimmer
|
41
|
+
|
42
|
+
def launch
|
43
|
+
person = Person.new
|
44
|
+
|
45
|
+
shell {
|
46
|
+
text 'Hello, Radio!'
|
47
|
+
row_layout :vertical
|
48
|
+
|
49
|
+
label {
|
50
|
+
text 'Gender:'
|
51
|
+
font style: :bold
|
52
|
+
}
|
53
|
+
|
54
|
+
composite {
|
55
|
+
row_layout
|
56
|
+
|
57
|
+
radio {
|
58
|
+
text 'Male'
|
59
|
+
selection bind(person, :male)
|
60
|
+
}
|
61
|
+
|
62
|
+
radio {
|
63
|
+
text 'Female'
|
64
|
+
selection bind(person, :female)
|
65
|
+
}
|
66
|
+
}
|
67
|
+
|
68
|
+
label {
|
69
|
+
text 'Age Group:'
|
70
|
+
font style: :bold
|
71
|
+
}
|
72
|
+
|
73
|
+
composite {
|
74
|
+
row_layout
|
75
|
+
|
76
|
+
radio {
|
77
|
+
text 'Child'
|
78
|
+
selection bind(person, :child)
|
79
|
+
}
|
80
|
+
|
81
|
+
radio {
|
82
|
+
text 'Teen'
|
83
|
+
selection bind(person, :teen)
|
84
|
+
}
|
85
|
+
|
86
|
+
radio {
|
87
|
+
text 'Adult'
|
88
|
+
selection bind(person, :adult)
|
89
|
+
}
|
90
|
+
|
91
|
+
radio {
|
92
|
+
text 'Senior'
|
93
|
+
selection bind(person, :senior)
|
94
|
+
}
|
95
|
+
}
|
96
|
+
|
97
|
+
button {
|
98
|
+
text 'Reset'
|
99
|
+
|
100
|
+
on_widget_selected do
|
101
|
+
person.reset
|
102
|
+
end
|
103
|
+
}
|
104
|
+
}.open
|
105
|
+
end
|
106
|
+
end
|
107
|
+
|
108
|
+
HelloRadio.new.launch
|
@@ -0,0 +1,84 @@
|
|
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
|
+
class HelloRadioGroup
|
23
|
+
class Person
|
24
|
+
attr_accessor :gender, :age_group
|
25
|
+
|
26
|
+
def initialize
|
27
|
+
reset
|
28
|
+
end
|
29
|
+
|
30
|
+
def gender_options
|
31
|
+
['Male', 'Female']
|
32
|
+
end
|
33
|
+
|
34
|
+
def age_group_options
|
35
|
+
['Child', 'Teen', 'Adult', 'Senior']
|
36
|
+
end
|
37
|
+
|
38
|
+
def reset
|
39
|
+
self.gender = nil
|
40
|
+
self.age_group = 'Adult'
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
include Glimmer
|
45
|
+
|
46
|
+
def launch
|
47
|
+
person = Person.new
|
48
|
+
|
49
|
+
shell {
|
50
|
+
text 'Hello, Radio Group!'
|
51
|
+
row_layout :vertical
|
52
|
+
|
53
|
+
label {
|
54
|
+
text 'Gender:'
|
55
|
+
font style: :bold
|
56
|
+
}
|
57
|
+
|
58
|
+
radio_group {
|
59
|
+
row_layout :horizontal
|
60
|
+
selection bind(person, :gender)
|
61
|
+
}
|
62
|
+
|
63
|
+
label {
|
64
|
+
text 'Age Group:'
|
65
|
+
font style: :bold
|
66
|
+
}
|
67
|
+
|
68
|
+
radio_group {
|
69
|
+
row_layout :horizontal
|
70
|
+
selection bind(person, :age_group)
|
71
|
+
}
|
72
|
+
|
73
|
+
button {
|
74
|
+
text 'Reset'
|
75
|
+
|
76
|
+
on_widget_selected do
|
77
|
+
person.reset
|
78
|
+
end
|
79
|
+
}
|
80
|
+
}.open
|
81
|
+
end
|
82
|
+
end
|
83
|
+
|
84
|
+
HelloRadioGroup.new.launch
|