glimmer 0.7.3 → 0.7.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.markdown +5 -5
- data/VERSION +1 -1
- data/lib/glimmer/data_binding/model_binding.rb +1 -0
- data/lib/glimmer/data_binding/observable_model.rb +1 -3
- data/lib/glimmer/data_binding/tree_items_binding.rb +1 -0
- data/lib/glimmer/dsl/swt/widget_expression.rb +8 -1
- data/lib/glimmer/swt/shell_proxy.rb +0 -3
- data/lib/glimmer/swt/tree_proxy.rb +24 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7b9a101d9c4af1b6fb9aa58f816db089b0643d9928027cbfcf62af3198c75db9
|
4
|
+
data.tar.gz: 27cb07e2eb9ee19129d5a12a82e534006707884ff1541b411f03ab1ad7cc485e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2b5db460b17ba88d155861a38cb8412944ca39423c2ccf6ea834ba5dabdf8708fa3fbae7ebca46de16119105504d5684a91efd0c4900740a2444d2dd69e3ccf3
|
7
|
+
data.tar.gz: 58da5246e785736c649d6d32cec412bcf4dabd7d474e842a9c78a149aef48d6893b68e157a43254462069d4e3f81f5ce51297e08f6dda7ab35e2287719059047
|
data/README.markdown
CHANGED
@@ -1,8 +1,8 @@
|
|
1
|
-
# Glimmer 0.7.
|
1
|
+
# Glimmer 0.7.4 Beta (Desktop Development Library for Ruby)
|
2
2
|
[](http://badge.fury.io/rb/glimmer)
|
3
3
|
[](https://coveralls.io/github/AndyObtiva/glimmer?branch=master)
|
4
4
|
|
5
|
-
Glimmer is a native-UI cross-platform desktop development library written in Ruby. Glimmer's main innovation is a JRuby DSL that enables productive and efficient authoring of desktop application user-interfaces while relying on the robust Eclipse SWT library. Glimmer additionally innovates by having built-in data-binding support to greatly facilitate synchronizing the UI with domain models. As a result, that achieves true decoupling of object oriented components, enabling developers to solve business problems without worrying about UI concerns, or alternatively drive development UI-first, and then write clean business
|
5
|
+
Glimmer is a native-UI cross-platform desktop development library written in Ruby. Glimmer's main innovation is a JRuby DSL that enables productive and efficient authoring of desktop application user-interfaces while relying on the robust Eclipse SWT library. Glimmer additionally innovates by having built-in data-binding support to greatly facilitate synchronizing the UI with domain models. As a result, that achieves true decoupling of object oriented components, enabling developers to solve business problems without worrying about UI concerns, or alternatively drive development UI-first, and then write clean business models test-first afterwards.
|
6
6
|
|
7
7
|
## Examples
|
8
8
|
|
@@ -71,7 +71,7 @@ NOTE: Glimmer is in beta mode. Please help make better by adopting for small or
|
|
71
71
|
## Table of Contents
|
72
72
|
|
73
73
|
<!-- TOC START min:1 max:3 link:true asterisk:false update:true -->
|
74
|
-
- [Glimmer 0.7.
|
74
|
+
- [Glimmer 0.7.4 Beta (JRuby Desktop UI DSL + Data-Binding)](#glimmer-058-beta-jruby-desktop-ui-dsl--data-binding)
|
75
75
|
- [Examples](#examples)
|
76
76
|
- [Hello World](#hello-world)
|
77
77
|
- [Tic Tac Toe](#tic-tac-toe)
|
@@ -164,7 +164,7 @@ Please follow these instructions to make the `glimmer` command available on your
|
|
164
164
|
|
165
165
|
Run this command to install directly:
|
166
166
|
```
|
167
|
-
jgem install glimmer -v 0.7.
|
167
|
+
jgem install glimmer -v 0.7.4
|
168
168
|
```
|
169
169
|
|
170
170
|
`jgem` is JRuby's version of `gem` command.
|
@@ -175,7 +175,7 @@ Otherwise, you may also run `jruby -S gem install ...`
|
|
175
175
|
|
176
176
|
Add the following to `Gemfile`:
|
177
177
|
```
|
178
|
-
gem 'glimmer', '~> 0.7.
|
178
|
+
gem 'glimmer', '~> 0.7.4'
|
179
179
|
```
|
180
180
|
|
181
181
|
And, then run:
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.7.
|
1
|
+
0.7.4
|
@@ -40,9 +40,7 @@ module Glimmer
|
|
40
40
|
end
|
41
41
|
|
42
42
|
def property_observer_hash
|
43
|
-
|
44
|
-
@property_observers = Hash.new unless @property_observers
|
45
|
-
@property_observers
|
43
|
+
@property_observers ||= Hash.new
|
46
44
|
end
|
47
45
|
|
48
46
|
def property_observer_list(property_name)
|
@@ -41,6 +41,7 @@ module Glimmer
|
|
41
41
|
|
42
42
|
def populate_tree_node(model_tree_node, parent, tree_properties)
|
43
43
|
table_item = TreeItem.new(parent, SWT::SWTProxy[:none])
|
44
|
+
table_item.setData(model_tree_node)
|
44
45
|
table_item.setText((model_tree_node && model_tree_node.send(tree_properties[:text])).to_s)
|
45
46
|
[model_tree_node && model_tree_node.send(tree_properties[:children])].flatten.to_a.compact.each do |child|
|
46
47
|
observe(child, @tree_properties[:text])
|
@@ -17,7 +17,13 @@ module Glimmer
|
|
17
17
|
end
|
18
18
|
|
19
19
|
def interpret(parent, keyword, *args, &block)
|
20
|
-
|
20
|
+
begin
|
21
|
+
class_name = "#{keyword.camelcase(:upper)}Proxy".to_sym
|
22
|
+
widget_class = Glimmer::SWT.const_get(class_name)
|
23
|
+
rescue
|
24
|
+
widget_class = Glimmer::SWT::WidgetProxy
|
25
|
+
end
|
26
|
+
widget_class.new(keyword, parent, args)
|
21
27
|
end
|
22
28
|
end
|
23
29
|
end
|
@@ -25,3 +31,4 @@ module Glimmer
|
|
25
31
|
end
|
26
32
|
|
27
33
|
require 'glimmer/swt/widget_proxy'
|
34
|
+
require 'glimmer/swt/tree_proxy'
|
@@ -102,15 +102,12 @@ module Glimmer
|
|
102
102
|
end
|
103
103
|
|
104
104
|
def pack_same_size
|
105
|
-
minimum_size = @swt_widget.getMinimumSize
|
106
105
|
bounds = @swt_widget.getBounds
|
107
106
|
width = @swt_widget.getBounds.width
|
108
107
|
height = @swt_widget.getBounds.height
|
109
108
|
x = @swt_widget.getBounds.x
|
110
109
|
y = @swt_widget.getBounds.y
|
111
|
-
@swt_widget.setMinimumSize(bounds.width, bounds.height)
|
112
110
|
@swt_widget.pack
|
113
|
-
@swt_widget.setMinimumSize(minimum_size)
|
114
111
|
@swt_widget.setSize(width, height)
|
115
112
|
@swt_widget.setLocation(x, y)
|
116
113
|
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
require 'glimmer/swt/widget_proxy'
|
2
|
+
|
3
|
+
module Glimmer
|
4
|
+
module SWT
|
5
|
+
class TreeProxy < Glimmer::SWT::WidgetProxy
|
6
|
+
# Performs depth first search for tree items matching block condition
|
7
|
+
# Returns a Java TreeItem array to easily set as selection on org.eclipse.swt.Tree when needed
|
8
|
+
def depth_first_search(&condition)
|
9
|
+
found = []
|
10
|
+
recursive_depth_first_search(swt_widget.getItems.first, found, &condition)
|
11
|
+
found.to_java(TreeItem)
|
12
|
+
end
|
13
|
+
|
14
|
+
private
|
15
|
+
|
16
|
+
def recursive_depth_first_search(tree_item, found, &condition)
|
17
|
+
found << tree_item if condition.nil? || condition.call(tree_item)
|
18
|
+
tree_item.getItems.each do |child_tree_item|
|
19
|
+
recursive_depth_first_search(child_tree_item, found, &condition)
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: glimmer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- AndyMaleh
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-05-
|
11
|
+
date: 2020-05-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|
@@ -292,6 +292,7 @@ files:
|
|
292
292
|
- lib/glimmer/swt/shell_proxy.rb
|
293
293
|
- lib/glimmer/swt/swt_proxy.rb
|
294
294
|
- lib/glimmer/swt/tab_item_proxy.rb
|
295
|
+
- lib/glimmer/swt/tree_proxy.rb
|
295
296
|
- lib/glimmer/swt/widget_listener_proxy.rb
|
296
297
|
- lib/glimmer/swt/widget_proxy.rb
|
297
298
|
- lib/glimmer/ui/custom_shell.rb
|