glimmer-dsl-swt 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/RUBY_VERSION +1 -1
- data/VERSION +1 -1
- data/lib/ext/glimmer.rb +8 -1
- data/lib/ext/glimmer/config.rb +12 -4
- data/lib/glimmer/data_binding/table_items_binding.rb +2 -2
- data/lib/glimmer/swt/packages.rb +9 -7
- data/lib/glimmer/swt/widget_proxy.rb +12 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0d324a6327e85a840d2a980ba78a47fa9c50e927b409f128c60d9b2ac38f2124
|
4
|
+
data.tar.gz: ace770a87429cbaca623310837618e14f12e8375221c433751e1feb13e768eff
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0d7e8c740b9fb6a8993e906a485cdc50241ea5a12664ff4f9ec128de2b2f77ad9718ae41fb0e9bd391546127273769769a1ac259870f2327bd29bba18d40afe3
|
7
|
+
data.tar.gz: 56406b25d9ab52e5af2043f33860cbd8cc0a5681b4e7eeba77325122c71cf9897c7bcd6f19ea68e3b3171f1e0dfa07c8d8dc501297fce2e8c83cc37ba3ed024b
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# <img src="https://raw.githubusercontent.com/AndyObtiva/glimmer/master/images/glimmer-logo-hi-res.png" height=85 /> Glimmer DSL for SWT 0.2.
|
1
|
+
# <img src="https://raw.githubusercontent.com/AndyObtiva/glimmer/master/images/glimmer-logo-hi-res.png" height=85 /> Glimmer DSL for SWT 0.2.1 (Desktop GUI)
|
2
2
|
[![Gem Version](https://badge.fury.io/rb/glimmer-dsl-swt.svg)](http://badge.fury.io/rb/glimmer-dsl-swt)
|
3
3
|
[![Travis CI](https://travis-ci.com/AndyObtiva/glimmer-dsl-swt.svg?branch=master)](https://travis-ci.com/github/AndyObtiva/glimmer-dsl-swt)
|
4
4
|
[![Coverage Status](https://coveralls.io/repos/github/AndyObtiva/glimmer-dsl-swt/badge.svg?branch=master)](https://coveralls.io/github/AndyObtiva/glimmer-dsl-swt?branch=master)
|
data/RUBY_VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
jruby-9.2.
|
1
|
+
jruby-9.2.12.0
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.1
|
data/lib/ext/glimmer.rb
CHANGED
@@ -3,11 +3,18 @@ require 'glimmer/swt/packages'
|
|
3
3
|
module Glimmer
|
4
4
|
class << self
|
5
5
|
def included(klass)
|
6
|
+
if Object.const_defined?(:ActiveSupport) && ActiveSupport.const_defined?(:Dependencies)
|
7
|
+
begin
|
8
|
+
ActiveSupport::Dependencies.unhook!
|
9
|
+
rescue => e
|
10
|
+
# noop TODO support logging unimportant details below debug level
|
11
|
+
end
|
12
|
+
end
|
6
13
|
if Config.import_swt_packages
|
7
14
|
klass.include(SWT::Packages)
|
8
15
|
klass.extend(SWT::Packages)
|
9
|
-
klass.extend(Glimmer)
|
10
16
|
end
|
17
|
+
klass.extend(Glimmer)
|
11
18
|
end
|
12
19
|
end
|
13
20
|
end
|
data/lib/ext/glimmer/config.rb
CHANGED
@@ -1,16 +1,24 @@
|
|
1
1
|
module Glimmer
|
2
2
|
module Config
|
3
|
+
DEFAULT_IMPORT_SWT_PACKAGES = [
|
4
|
+
'org.eclipse.swt',
|
5
|
+
'org.eclipse.swt.widgets',
|
6
|
+
'org.eclipse.swt.layout',
|
7
|
+
'org.eclipse.swt.graphics',
|
8
|
+
'org.eclipse.swt.browser',
|
9
|
+
'org.eclipse.swt.custom',
|
10
|
+
'org.eclipse.swt.dnd',
|
11
|
+
]
|
12
|
+
|
3
13
|
class << self
|
4
14
|
# Tells Glimmer to import SWT packages into including class (default: true)
|
5
15
|
def import_swt_packages=(value)
|
6
|
-
@@import_swt_packages =
|
16
|
+
@@import_swt_packages = value
|
7
17
|
end
|
8
18
|
|
9
19
|
# Returns whether Glimmer will import SWT packages into including class
|
10
20
|
def import_swt_packages
|
11
|
-
|
12
|
-
@@import_swt_packages = true
|
13
|
-
end
|
21
|
+
@@import_swt_packages = DEFAULT_IMPORT_SWT_PACKAGES if !defined?(@@import_swt_packages) || (defined?(@@import_swt_packages) && @@import_swt_packages == true)
|
14
22
|
@@import_swt_packages
|
15
23
|
end
|
16
24
|
end
|
@@ -22,14 +22,14 @@ module Glimmer
|
|
22
22
|
@table.body_root.column_properties = @column_properties
|
23
23
|
end
|
24
24
|
call(@model_binding.evaluate_property)
|
25
|
-
|
26
|
-
observe(model, model_binding.property_name_expression)
|
25
|
+
observe(model_binding)
|
27
26
|
@table.on_widget_disposed do |dispose_event|
|
28
27
|
unregister_all_observables
|
29
28
|
end
|
30
29
|
end
|
31
30
|
|
32
31
|
def call(new_model_collection=nil)
|
32
|
+
new_model_collection = @model_binding.evaluate_property # this ensures applying converters (e.g. :on_read)
|
33
33
|
if new_model_collection and new_model_collection.is_a?(Array)
|
34
34
|
observe(new_model_collection, @column_properties)
|
35
35
|
@model_collection = new_model_collection
|
data/lib/glimmer/swt/packages.rb
CHANGED
@@ -1,14 +1,16 @@
|
|
1
|
+
require 'ext/glimmer/config'
|
2
|
+
|
1
3
|
module Glimmer
|
2
4
|
module SWT
|
3
5
|
# This contains Java imports of SWT Java packages
|
4
6
|
module Packages
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
7
|
+
class << self
|
8
|
+
def included(klass)
|
9
|
+
Glimmer::Config.import_swt_packages.to_a.each do |package|
|
10
|
+
include_package(package) if package.is_a?(String)
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
12
14
|
end
|
13
15
|
end
|
14
16
|
end
|
@@ -75,7 +75,18 @@ module Glimmer
|
|
75
75
|
if @arg_extractor_mapping[underscored_widget_name]
|
76
76
|
@arg_extractor_mapping[underscored_widget_name].call(args)
|
77
77
|
else
|
78
|
-
|
78
|
+
extra_options = []
|
79
|
+
style_args = args.select {|arg| arg.is_a?(Symbol) || arg.is_a?(String)}
|
80
|
+
if style_args.any?
|
81
|
+
style_arg_start_index = args.index(style_args.first)
|
82
|
+
style_arg_last_index = args.index(style_args.last)
|
83
|
+
extra_options = args[style_arg_last_index+1..-1]
|
84
|
+
args = args[style_arg_start_index..style_arg_last_index]
|
85
|
+
elsif args.first.is_a?(Integer)
|
86
|
+
extra_options = args[1..-1]
|
87
|
+
args = args[0..0]
|
88
|
+
end
|
89
|
+
[args, extra_options]
|
79
90
|
end
|
80
91
|
end
|
81
92
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: glimmer-dsl-swt
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- AndyMaleh
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-07-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|