glimmer-dsl-swt 4.24.2.2 → 4.24.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/README.md +5 -5
- data/VERSION +1 -1
- data/docs/reference/GLIMMER_GUI_DSL_SYNTAX.md +73 -12
- data/docs/reference/GLIMMER_SAMPLES.md +1 -1
- data/glimmer-dsl-swt.gemspec +0 -0
- data/lib/glimmer/swt/custom/code_text.rb +1 -0
- 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: 774fc1f559ec5f11db66bdb42369c85e7df2a50f9f7f361e293a16c173ca394b
|
4
|
+
data.tar.gz: 5f45c3421a272bd377d3d8cb2457008e5ff2c5533ff3dcd0d25ae540cb549520
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 31ad8918c664072c497d08183dfc9662dda92548cd2afe876d962219e364dbb9bde7efa75ea509e03df84fd2f91561d2d753d15d54e1f405502097b3c1036b0b
|
7
|
+
data.tar.gz: 9c14b3e9a70f70c63e95858eec0ee229ed46ff89b1217f715ac93b9388108f70ea9b428da127ad63eee0d356762e1fa7fe07c3481a819e698629703a37f3b735
|
data/CHANGELOG.md
CHANGED
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 />](https://github.com/AndyObtiva/glimmer) Glimmer DSL for SWT 4.24.2.
|
1
|
+
# [<img src="https://raw.githubusercontent.com/AndyObtiva/glimmer/master/images/glimmer-logo-hi-res.png" height=85 />](https://github.com/AndyObtiva/glimmer) Glimmer DSL for SWT 4.24.2.3
|
2
2
|
## JRuby Desktop Development GUI Framework
|
3
3
|
[![Gem Version](https://badge.fury.io/rb/glimmer-dsl-swt.svg)](http://badge.fury.io/rb/glimmer-dsl-swt)
|
4
4
|
[![Travis CI](https://travis-ci.com/AndyObtiva/glimmer-dsl-swt.svg?branch=master)](https://travis-ci.com/github/AndyObtiva/glimmer-dsl-swt)
|
@@ -21,7 +21,7 @@ Featured in JRuby Cookbook](http://shop.oreilly.com/product/9780596519650.do) an
|
|
21
21
|
|
22
22
|
![Eclipse SWT RCP NASA Mars Rover](/images/glimmer-eclipse-swt-rcp-nasa-mars-rover.png)
|
23
23
|
|
24
|
-
[Glimmer DSL for SWT](https://rubygems.org/gems/glimmer-dsl-swt) 4.24.2.
|
24
|
+
[Glimmer DSL for SWT](https://rubygems.org/gems/glimmer-dsl-swt) 4.24.2.3 includes [SWT 4.24](https://download.eclipse.org/eclipse/downloads/drops4/R-4.24-202206070700/), which was released on June 7, 2022. Gem version numbers are in sync with the SWT library versions. The first two digits represent the SWT version number. The last two digits represent the minor and patch versions of Glimmer DSL for SWT.
|
25
25
|
|
26
26
|
**Starting in version 4.20.0.0, [Glimmer DSL for SWT](https://rubygems.org/gems/glimmer-dsl-swt) comes with the new [***Shine***](/docs/reference/GLIMMER_GUI_DSL_SYNTAX.md#shine) syntax** for highly intuitive and visually expressive View/Model Attribute Mapping, relying on `<=>` for bidirectional (two-way) data-binding and `<=` for unidirectional (one-way) data-binding, providing an alternative to the `bind` keyword. That was [originally conceived back in 2007](https://andymaleh.blogspot.com/2007/12/data-shining-in-glimmer.html).
|
27
27
|
|
@@ -338,7 +338,7 @@ jgem install glimmer-dsl-swt
|
|
338
338
|
|
339
339
|
Or this command if you want a specific version:
|
340
340
|
```
|
341
|
-
jgem install glimmer-dsl-swt -v 4.24.2.
|
341
|
+
jgem install glimmer-dsl-swt -v 4.24.2.3
|
342
342
|
```
|
343
343
|
|
344
344
|
`jgem` is JRuby's version of `gem` command.
|
@@ -366,7 +366,7 @@ Note: if you're using activerecord or activesupport, keep in mind that Glimmer u
|
|
366
366
|
|
367
367
|
Add the following to `Gemfile`:
|
368
368
|
```
|
369
|
-
gem 'glimmer-dsl-swt', '~> 4.24.2.
|
369
|
+
gem 'glimmer-dsl-swt', '~> 4.24.2.3'
|
370
370
|
```
|
371
371
|
|
372
372
|
And, then run:
|
@@ -389,7 +389,7 @@ glimmer
|
|
389
389
|
```
|
390
390
|
|
391
391
|
```
|
392
|
-
Glimmer (JRuby Desktop Development GUI Framework) - JRuby Gem: glimmer-dsl-swt v4.24.2.
|
392
|
+
Glimmer (JRuby Desktop Development GUI Framework) - JRuby Gem: glimmer-dsl-swt v4.24.2.3
|
393
393
|
|
394
394
|
Usage: glimmer [--bundler] [--pd] [--quiet] [--debug] [--log-level=VALUE] [[ENV_VAR=VALUE]...] [[-jruby-option]...] (application.rb or task[task_args]) [[application2.rb]...]
|
395
395
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
4.24.2.
|
1
|
+
4.24.2.3
|
@@ -4807,32 +4807,93 @@ You may see another example at the [Hello, Radio Group!](/docs/reference/GLIMMER
|
|
4807
4807
|
|
4808
4808
|
##### Code Text Custom Widget
|
4809
4809
|
|
4810
|
-
`code_text` is a Glimmer built-in custom widget that displays syntax highlighted Ruby code
|
4810
|
+
`code_text` is a Glimmer built-in custom widget that displays syntax highlighted code (e.g. Ruby/JavaScript/HTML code) for 204 languages (see [options](#code-text-options) for the full list) by automating customizations for the SWT [StyledText](https://help.eclipse.org/2020-09/topic/org.eclipse.platform.doc.isv/reference/api/org/eclipse/swt/custom/StyledText.html) widget.
|
4811
4811
|
|
4812
|
-
|
4813
|
-
|
4814
|
-
|
4815
|
-
|
4816
|
-
|
4812
|
+
To utilize, simply use `code_text` in place of the multi-line `text` and `styled_text` widgets. If you set the `code_text` `text` property value to multi-line code content (e.g. Ruby/JavaScript/HTML code), it automatically styles it with syntax highlighting.
|
4813
|
+
|
4814
|
+
`code_text` attempts to use a monospace font if available, seeking font names in the following order (specified in `Glimmer::SWT::Custom::CodeText::FONT_NAMES_PREFERRED`):
|
4815
|
+
1. `'Consolas'`
|
4816
|
+
2. `'Courier'`
|
4817
|
+
3. `'Monospace'`
|
4818
|
+
4. `'Liberation Mono'`
|
4819
|
+
5. First available font that contains the word `mono` (case-insensitive)
|
4820
|
+
6. Default system font (if no other font in the list is found)
|
4817
4821
|
|
4818
4822
|
It is used in the [Glimmer Meta-Sample (The Sample of Samples)](#samples):
|
4819
4823
|
|
4820
4824
|
![Glimmer Meta-Sample](/images/glimmer-meta-sample.png)
|
4821
4825
|
|
4822
|
-
|
4826
|
+
Dark Mode:
|
4827
|
+
|
4828
|
+
![Glimmer Meta-Sample](/images/glimmer-meta-sample-dark-mode.png)
|
4829
|
+
|
4830
|
+
Code Text Simple Example (default language is Ruby):
|
4823
4831
|
|
4824
4832
|
```ruby
|
4825
|
-
|
4826
|
-
|
4833
|
+
code_text {
|
4834
|
+
text bind(SampleDirectory, 'selected_sample.code', read_only: true)
|
4835
|
+
editable bind(SampleDirectory, 'selected_sample.editable')
|
4836
|
+
}
|
4837
|
+
```
|
4838
|
+
|
4839
|
+
Code Text Specified Language Example:
|
4840
|
+
|
4841
|
+
```ruby
|
4842
|
+
code_text(language: 'html') {
|
4827
4843
|
text bind(SampleDirectory, 'selected_sample.code', read_only: true)
|
4828
4844
|
editable bind(SampleDirectory, 'selected_sample.editable')
|
4829
4845
|
}
|
4830
|
-
# ...
|
4831
4846
|
```
|
4832
4847
|
|
4833
|
-
|
4848
|
+
Code Text Lines and Margins Example:
|
4849
|
+
|
4850
|
+
```ruby
|
4851
|
+
code_text(lines: true) {
|
4852
|
+
text <=> [SampleDirectory, 'selected_sample.code']
|
4853
|
+
editable <= [SampleDirectory, 'selected_sample.editable']
|
4854
|
+
left_margin 7
|
4855
|
+
right_margin 7
|
4856
|
+
}
|
4857
|
+
```
|
4858
|
+
|
4859
|
+
Code Text Customized Lines Width and Background Example:
|
4860
|
+
|
4861
|
+
```ruby
|
4862
|
+
code_text(lines: {width: 3}) {
|
4863
|
+
line_numbers {
|
4864
|
+
background Display.system_dark_theme? ? :black : :white
|
4865
|
+
}
|
4866
|
+
text <=> [SampleDirectory, 'selected_sample.code']
|
4867
|
+
editable <= [SampleDirectory, 'selected_sample.editable']
|
4868
|
+
left_margin 7
|
4869
|
+
right_margin 7
|
4870
|
+
}
|
4871
|
+
```
|
4872
|
+
|
4873
|
+
Code Text Customized Root Composite Margins/Spacing Background Example:
|
4874
|
+
|
4875
|
+
```ruby
|
4876
|
+
code_text(lines: true) {
|
4877
|
+
root {
|
4878
|
+
grid_layout(2, false) {
|
4879
|
+
horizontal_spacing 0
|
4880
|
+
margin_left 0
|
4881
|
+
margin_right 0
|
4882
|
+
margin_top 0
|
4883
|
+
margin_bottom 0
|
4884
|
+
}
|
4885
|
+
}
|
4886
|
+
line_numbers {
|
4887
|
+
background Display.system_dark_theme? ? :black : :white
|
4888
|
+
}
|
4889
|
+
text <=> [SampleDirectory, 'selected_sample.code']
|
4890
|
+
editable <= [SampleDirectory, 'selected_sample.editable']
|
4891
|
+
left_margin 7
|
4892
|
+
right_margin 7
|
4893
|
+
}
|
4894
|
+
```
|
4834
4895
|
|
4835
|
-
###### Options
|
4896
|
+
###### Code Text Options
|
4836
4897
|
|
4837
4898
|
**lines**
|
4838
4899
|
(default: `false`)
|
@@ -810,7 +810,7 @@ Hello, Dialog! Open Dialog
|
|
810
810
|
|
811
811
|
#### Hello, Code Text!
|
812
812
|
|
813
|
-
This sample demonstrates the Glimmer Built-In [Code Text Custom Widget](#code-text-custom-widget).
|
813
|
+
This sample demonstrates the Glimmer Built-In [Code Text Custom Widget](/docs/reference/GLIMMER_GUI_DSL_SYNTAX.md#code-text-custom-widget).
|
814
814
|
|
815
815
|
Code:
|
816
816
|
|
data/glimmer-dsl-swt.gemspec
CHANGED
Binary file
|
@@ -326,6 +326,7 @@ module Glimmer
|
|
326
326
|
|
327
327
|
def select_best_font_name
|
328
328
|
all_font_names = display.get_font_list(nil, true).map(&:name)
|
329
|
+
@font_name = 'Courier' if OS.mac?
|
329
330
|
FONT_NAMES_PREFERRED.each do |font_name|
|
330
331
|
@font_name ||= font_name if all_font_names.include?(font_name)
|
331
332
|
end
|
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: 4.24.2.
|
4
|
+
version: 4.24.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andy Maleh
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-08-
|
11
|
+
date: 2022-08-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|