glimmer-dsl-swt 4.17.9.0 → 4.17.10.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3915e615b5248813ee6a9ca415c1be065f9d0ff9192e87a4a410146e0aae6f52
4
- data.tar.gz: 98c2fa055457d36b53c840de96bad374dfeaec9fd21e36782090378d4439fffe
3
+ metadata.gz: 1fb2ca2da3bc7253db8416bc1395423988fee5296324c89fa06d380cb568f28e
4
+ data.tar.gz: 3924772c16691aafe3a8cdcdc05ef0e9aa566a6843642a987e7ac0e7348c63ec
5
5
  SHA512:
6
- metadata.gz: 31978beac188701c12a27dd742452cb62c52b913dd7fd485dc1c4bd19ab52d9dea9a30a84b867691b81ac7ff23adc2cf7874bcb8718ca058526c143158d9f16f
7
- data.tar.gz: 2c1e46b47851006dbbf0187e9ba215db83c3e603d058e9fd3e8a1c2476f944c66deae8391b714e918632e7bcf0c59556edccfcc28c726698850d57e331cd0423
6
+ metadata.gz: 38e692d156d993f29e9b362e8beb34c03eeb933b0d89a1d29c957e033da6f2356408032c03a2e3cfb69d66c0feb1f5c1b863705c40e2ddf55f2282efdf2d18d0
7
+ data.tar.gz: f9c23c58000fc174b8e6c83b430f117b4ed08ab305510a1f3ee7e1262af6ddb5105e60208be95a92d2bf5adb38501822fe9a8d1bde8fb25f3ee4b70047643858
@@ -1,5 +1,39 @@
1
1
  # Change Log
2
2
 
3
+ ### 4.17.10.4
4
+
5
+ - Do not select first row in a table by default (keep unselected)
6
+ - Prevented extra call to model data in table items data-binding
7
+ - Upgraded to glimmer v1.0.5
8
+
9
+ ### 4.17.10.3
10
+
11
+ - Fixed issue in StyledText data-binding relating to capturing selection changes on mouse click
12
+
13
+ ### 4.17.10.2
14
+
15
+ - Upgraded glimmer gem to version 1.0.4
16
+ - Fixed issues relating to data-binding `styled_text` widget
17
+
18
+ ### 4.17.10.1
19
+
20
+ - Upgraded glimmer gem to version 1.0.3
21
+ - Upgraded rouge gem to version 3.25.0
22
+
23
+ ### 4.17.10.0
24
+
25
+ - Support table editing via `date_time` for date/time values
26
+ - Support table default sort configuration via sort_property
27
+ - Support table default sort configuration via sort block
28
+ - Support table default sort configuration via sort_by block
29
+ - Hello, Table! Sample editor :date_time, property: :date_time in
30
+ - Hello, Table! Sample label for (Baseball Game Schedule)
31
+ - Hello, Table! Sample combo for selecting nlds, nlcs, alds, alcs, world series
32
+ - Hello, Table! Sample promotion field that indicates things like Free Bobblehead, Free Towel, Free Umbrella, etc...
33
+ - ShellProxy#include_focus_control?
34
+ - Fix issue with table selection data-binding when in single selection mode vs multi
35
+ - Hello, Spinner! Sample
36
+
3
37
  ### 4.17.9.0
4
38
 
5
39
  - Add table style :editable to hook editing listener on mouse click automatically (instead of manually via on_widget_selected)
data/README.md CHANGED
@@ -1,6 +1,6 @@
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.17.9.0
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.17.10.4
2
2
 
3
- ## JRuby Desktop Development GUI Library
3
+ ## JRuby Desktop Development GUI Framework
4
4
  [![Gem Version](https://badge.fury.io/rb/glimmer-dsl-swt.svg)](http://badge.fury.io/rb/glimmer-dsl-swt)
5
5
  [![Travis CI](https://travis-ci.com/AndyObtiva/glimmer-dsl-swt.svg?branch=master)](https://travis-ci.com/github/AndyObtiva/glimmer-dsl-swt)
6
6
  [![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)
@@ -238,7 +238,7 @@ Glimmer App:
238
238
 
239
239
  ## Table of contents
240
240
 
241
- - [Glimmer (Ruby Desktop Development GUI Library)](#-glimmer-ruby-desktop-development-gui-library)
241
+ - [Glimmer (JRuby Desktop Development GUI Framework)](#jruby-desktop-development-gui-framework)
242
242
  - [Examples](#examples)
243
243
  - [Hello, World!](#hello-world)
244
244
  - [Tic Tac Toe](#tic-tac-toe)
@@ -353,13 +353,14 @@ Glimmer App:
353
353
  - [Hello, Expand Bar!](#hello-expand-bar)
354
354
  - [Hello, Radio!](#hello-radio)
355
355
  - [Hello, Radio Group!](#hello-radio-group)
356
- - [Hello, Checkbox!](#hello-checkbox)
357
356
  - [Hello, Group!](#hello-group)
358
357
  - [Hello, Checkbox!](#hello-checkbox)
359
358
  - [Hello, Checkbox Group!](#hello-checkbox-group)
360
359
  - [Hello, Directory Dialog!](#hello-directory-dialog)
361
360
  - [Hello, File Dialog!](#hello-file-dialog)
362
361
  - [Hello, Date Time!](#hello-date-time)
362
+ - [Hello, Spinner!](#hello-spinner)
363
+ - [Hello, Table!](#hello-table)
363
364
  - [Elaborate Samples](#elaborate-samples)
364
365
  - [User Profile](#user-profile)
365
366
  - [Login](#login)
@@ -453,7 +454,7 @@ jgem install glimmer-dsl-swt
453
454
 
454
455
  Or this command if you want a specific version:
455
456
  ```
456
- jgem install glimmer-dsl-swt -v 4.17.9.0
457
+ jgem install glimmer-dsl-swt -v 4.17.10.4
457
458
 
458
459
  ```
459
460
 
@@ -530,7 +531,7 @@ bin/glimmer samples
530
531
  Below are the full usage instructions that come up when running `glimmer` without args.
531
532
 
532
533
  ```
533
- Glimmer (Ruby Desktop Development GUI Library) - JRuby Gem: glimmer-dsl-swt v4.17.9.0
534
+ Glimmer (JRuby Desktop Development GUI Framework) - JRuby Gem: glimmer-dsl-swt v4.17.10.4
534
535
 
535
536
 
536
537
  Usage: glimmer [--bundler] [--pd] [--quiet] [--debug] [--log-level=VALUE] [[ENV_VAR=VALUE]...] [[-jruby-option]...] (application.rb or task[task_args]) [[application2.rb]...]
@@ -708,7 +709,7 @@ glimmer bin/greeter
708
709
 
709
710
  #### Desktopify
710
711
 
711
- This scaffolding mode enables you to desktopify a web app. Glimmer Scaffolding basically wraps the website with a [Browser Widget](#browser-widget).
712
+ This scaffolding mode enables you to desktopify a web app. Glimmer Scaffolding basically turns a website into a desktop application by wrapping the website with a [Browser Widget](#browser-widget).
712
713
 
713
714
  The desktopify app is similar to the standard scaffolded app. It can be extended and the [browser may even be instrumented](https://help.eclipse.org/2020-09/topic/org.eclipse.platform.doc.isv/reference/api/org/eclipse/swt/browser/Browser.html).
714
715
 
@@ -1008,7 +1009,7 @@ Output:
1008
1009
 
1009
1010
  Css glimmer-dsl-css 1.1.0 AndyMaleh Glimmer DSL for CSS
1010
1011
  Opal glimmer-dsl-opal 0.4.0 AndyMaleh Glimmer DSL for Opal
1011
- Swt glimmer-dsl-swt 4.17.9.0
1012
+ Swt glimmer-dsl-swt 4.17.10.4
1012
1013
  AndyMaleh Glimmer DSL for SWT
1013
1014
  Tk glimmer-dsl-tk 0.0.6 AndyMaleh Glimmer DSL for Tk
1014
1015
  Xml glimmer-dsl-xml 1.1.0 AndyMaleh Glimmer DSL for XML
@@ -2269,6 +2270,117 @@ This automatically leverages the SWT TableEditor custom class behind the scenes,
2269
2270
  passed table item text into something else.
2270
2271
  It automatically persists the change to `items` data-bound model on ENTER/FOCUS-OUT or cancels on ESC/NO-CHANGE.
2271
2272
 
2273
+ ##### Table Selection
2274
+
2275
+ Table Selection data-binding is simply done via the `selection` property.
2276
+
2277
+ ```ruby
2278
+ selection bind(group, :selected_person)
2279
+ ```
2280
+
2281
+ If it's a multi-selection table (`table(:multi)`), then the data-bound model property oughta be a collection.
2282
+
2283
+ ```ruby
2284
+ selection bind(group, :selected_people)
2285
+ ```
2286
+
2287
+ ##### Table Editing
2288
+
2289
+ Glimmer provides a custom SWT style for table editing called `:editable` to obviate the need for an `on_mouse_up` listener.
2290
+
2291
+ For example, the code above could be simplified as:
2292
+
2293
+ ```ruby
2294
+ shell {
2295
+ @table = table(:editable) {
2296
+ table_column {
2297
+ text "Name"
2298
+ width 120
2299
+ }
2300
+ table_column {
2301
+ text "Age"
2302
+ width 120
2303
+ }
2304
+ table_column {
2305
+ text "Adult"
2306
+ width 120
2307
+ }
2308
+ items bind(group, :people), column_properties(:name, :age, :adult)
2309
+ selection bind(group, :selected_person)
2310
+ }
2311
+ }
2312
+ ```
2313
+
2314
+ Additionally, Glimmer supports the idea of custom editors or no editor per column.
2315
+
2316
+ Example:
2317
+
2318
+ ```ruby
2319
+ shell {
2320
+ @table = table(:editable) {
2321
+ table_column {
2322
+ text "Name"
2323
+ width 120
2324
+ }
2325
+ table_column {
2326
+ text "Age"
2327
+ width 120
2328
+ editor :spinner
2329
+ }
2330
+ table_column {
2331
+ text "Adult"
2332
+ width 120
2333
+ editor :checkbox
2334
+ }
2335
+ items bind(group, :people), column_properties(:name, :age, :adult)
2336
+ selection bind(group, :selected_person)
2337
+ }
2338
+ }
2339
+ ```
2340
+
2341
+ The example above uses a `spinner` widget editor for the age column since it's an `Integer` and
2342
+ a `checkbox` widget (`button(:check)`) editor for the adult column since it's a `Boolean`
2343
+
2344
+ Here are all the supported types of table editors:
2345
+ - `text`: expects a `String` property
2346
+ - `combo`: expects a `String` property accompanied by a matching `property_options` property by convention to provide items to present in the `combo`
2347
+ - `checkbox`: expects a `Boolean` property
2348
+ - `radio`: expects a `Boolean` property
2349
+ - `spinner`: expects an `Integer` property
2350
+ - `date`: expects a `DateTime` property
2351
+ - `date_drop_down`: expects a `DateTime` property
2352
+ - `time`: expects a `DateTime` property
2353
+
2354
+ An editor may also take additional arguments (SWT styles such as :long for the date field) that are passed to the editor widget, as well as hash options to
2355
+ customize the property being used for editing (e.g. property: :raw_name for a :formatted_name field) in case it differs from the property used to display
2356
+ the data in the table.
2357
+
2358
+ Example:
2359
+
2360
+ ```ruby
2361
+ shell {
2362
+ @table = table(:editable) {
2363
+ table_column {
2364
+ text "Date of Birth"
2365
+ width 120
2366
+ editor :date_drop_down, property: :date_time
2367
+ }
2368
+ table_column {
2369
+ text "Industry"
2370
+ width 120
2371
+ # assume there is a `Person#industry_options` property method on the model to provide items to the `combo`
2372
+ editor :combo, :read_only # passes :ready_only SWT style to `combo` widget
2373
+ }
2374
+ items bind(group, :people), column_properties(:formatted_date, :industry)
2375
+ selection bind(group, :selected_person)
2376
+ }
2377
+ }
2378
+ ```
2379
+
2380
+ Check out [Hello, Table!](#hello-table) for an actual example including table editors.
2381
+
2382
+ [Are We There Yet?](#are-we-there-yet) is an actual production Glimmer application that takes full advantage of table capabilities.
2383
+
2272
2384
  ##### Table Sorting
2273
2385
 
2274
2386
  Glimmer automatically adds sorting support to the SWT `Table` widget.
@@ -2285,6 +2397,8 @@ Should you have a special data type that could not be compared automatically, Gl
2285
2397
  - `sort_by(&block)`: this works just like Ruby `Enumerable` `sort_by`. The block receives the table column data as argument.
2286
2398
  - `sort(&comparator)`: this works just like Ruby `Enumerable` `sort`. The comparator block receives two objects from the table column data.
2287
2399
 
2400
+ These alternatives could be used inside `table_column` for column-clicked sorting or in the `table` body directly to set the initial default sort.
2401
+
2288
2402
  You may also set `additional_sort_properties` on the parent `table` widget to have secondary sorting applied. For example, if you set `additional_sort_properties :name, :project_name`, then whenever you sort by `:name`, it additionally sorts by `:project_name` afterwards, and vice versa. This only works for columns that either have no custom sort set or have a `sort_property` with one property only (but no sort or sort_by block)
2289
2403
 
2290
2404
  Example:
@@ -2392,6 +2506,8 @@ You can data-bind any of these properties:
2392
2506
 
2393
2507
  Learn more at the [Hello, Date Time!](#hello-date-time) sample.
2394
2508
 
2509
+ If you need a better widget with the ability to customize the date format pattern, check out the [Nebula CDateTime Glimmer Custom Widget](https://github.com/AndyObtiva/glimmer-cw-cdatetime-nebula)
2510
+
2395
2511
  ### Observer
2396
2512
 
2397
2513
  Glimmer comes with `Observer` module, which is used internally for data-binding, but can also be used externally for custom use of the Observer Pattern. It is hidden when observing widgets, and used explicitly when observing models.
@@ -3757,14 +3873,6 @@ Hello, Radio Group!
3757
3873
 
3758
3874
  ![Hello Radio Group](images/glimmer-hello-radio-group.png)
3759
3875
 
3760
- #### Hello, Checkbox!
3761
-
3762
- This sample demonstrates the use of a `checkbox` (aka `check` or `button(:check)`) in Glimmer.
3763
-
3764
- Code:
3765
-
3766
- [samples/hello/hello_checkbox.rb](https://github.com/AndyObtiva/glimmer-dsl-swt/blob/master/samples/hello/hello_checkbox.rb)
3767
-
3768
3876
  #### Hello, Group!
3769
3877
 
3770
3878
  This sample demonstrates the use of a `group` in Glimmer (not to be confused with the logical radio group custom widget, this is just an alternative to `composite` that provides a border around content).
@@ -3853,6 +3961,66 @@ Hello, Date Time!
3853
3961
 
3854
3962
  ![Hello Date Time](images/glimmer-hello-date-time.png)
3855
3963
 
3964
+ #### Hello, Spinner!
3965
+
3966
+ This sample demonstrates the use of `spinner` widget in Glimmer
3967
+
3968
+ Code:
3969
+
3970
+ [samples/hello/hello_spinner.rb](https://github.com/AndyObtiva/glimmer-dsl-swt/blob/master/samples/hello/hello_spinner.rb)
3971
+
3972
+ Hello, Spinner!
3973
+
3974
+ ![Hello Spinner](images/glimmer-hello-spinner.png)
3975
+
3976
+ #### Hello, Table!
3977
+
3978
+ This sample demonstrates the use of [table](#table) widget in Glimmer, including data-binding, multi-type editing, sorting, and filtering.
3979
+
3980
+ Code:
3981
+
3982
+ [samples/hello/hello_table.rb](https://github.com/AndyObtiva/glimmer-dsl-swt/blob/master/samples/hello/hello_table.rb)
3983
+
3984
+ Hello, Table!
3985
+
3986
+ ![Hello Table](images/glimmer-hello-table.png)
3987
+
3988
+ Hello, Table! Editing Game Date
3989
+
3990
+ ![Hello Table](images/glimmer-hello-table-editing-game-date.png)
3991
+
3992
+ Hello, Table! Editing Game Time
3993
+
3994
+ ![Hello Table](images/glimmer-hello-table-editing-game-time.png)
3995
+
3996
+ Hello, Table! Editing Home Team
3997
+
3998
+ ![Hello Table](images/glimmer-hello-table-editing-home-team.png)
3999
+
4000
+ Hello, Table! Sorted Game Date Ascending
4001
+
4002
+ ![Hello Table](images/glimmer-hello-table-sorted-game-date-ascending.png)
4003
+
4004
+ Hello, Table! Sorted Game Date Descending
4005
+
4006
+ ![Hello Table](images/glimmer-hello-table-sorted-game-date-descending.png)
4007
+
4008
+ Hello, Table! Playoff Type Combo
4009
+
4010
+ ![Hello Table](images/glimmer-hello-table-playoff-type-combo.png)
4011
+
4012
+ Hello, Table! Playoff Type Changed
4013
+
4014
+ ![Hello Table](images/glimmer-hello-table-playoff-type-changed.png)
4015
+
4016
+ Hello, Table! Game Booked
4017
+
4018
+ ![Hello Table](images/glimmer-hello-table-game-booked.png)
4019
+
4020
+ Hello, Table! Context Menu
4021
+
4022
+ ![Hello Table](images/glimmer-hello-table-context-menu.png)
4023
+
3856
4024
  ### Elaborate Samples
3857
4025
 
3858
4026
  For more elaborate samples, check the following:
@@ -4246,4 +4414,4 @@ Copyright (c) 2007-2020 - Andy Maleh.
4246
4414
 
4247
4415
  --
4248
4416
 
4249
- [<img src="https://raw.githubusercontent.com/AndyObtiva/glimmer/master/images/glimmer-logo-hi-res.png" height=40 />](https://github.com/AndyObtiva/glimmer) Built for [Glimmer](https://github.com/AndyObtiva/glimmer) (Ruby Desktop Development GUI Library).
4417
+ [<img src="https://raw.githubusercontent.com/AndyObtiva/glimmer/master/images/glimmer-logo-hi-res.png" height=40 />](https://github.com/AndyObtiva/glimmer) Built for [Glimmer](https://github.com/AndyObtiva/glimmer) (DSL Framework).
data/VERSION CHANGED
@@ -1 +1 @@
1
- 4.17.9.0
1
+ 4.17.10.4
@@ -2,16 +2,16 @@
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
3
  # Instead, edit Juwelier::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
- # stub: glimmer-dsl-swt 4.17.9.0 ruby lib
5
+ # stub: glimmer-dsl-swt 4.17.10.4 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "glimmer-dsl-swt".freeze
9
- s.version = "4.17.9.0"
9
+ s.version = "4.17.10.4"
10
10
 
11
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
12
12
  s.require_paths = ["lib".freeze]
13
13
  s.authors = ["AndyMaleh".freeze]
14
- s.date = "2020-11-07"
14
+ s.date = "2020-12-02"
15
15
  s.description = "Glimmer DSL for SWT (JRuby Desktop Development GUI Library)".freeze
16
16
  s.email = "andy.am@gmail.com".freeze
17
17
  s.executables = ["glimmer".freeze, "girb".freeze]
@@ -152,6 +152,7 @@ Gem::Specification.new do |s|
152
152
  "samples/hello/hello_radio.rb",
153
153
  "samples/hello/hello_radio_group.rb",
154
154
  "samples/hello/hello_sash_form.rb",
155
+ "samples/hello/hello_spinner.rb",
155
156
  "samples/hello/hello_styled_text.rb",
156
157
  "samples/hello/hello_tab.rb",
157
158
  "samples/hello/hello_table.rb",
@@ -171,7 +172,7 @@ Gem::Specification.new do |s|
171
172
  end
172
173
 
173
174
  if s.respond_to? :add_runtime_dependency then
174
- s.add_runtime_dependency(%q<glimmer>.freeze, ["~> 1.0.2"])
175
+ s.add_runtime_dependency(%q<glimmer>.freeze, ["~> 1.0.5"])
175
176
  s.add_runtime_dependency(%q<super_module>.freeze, ["~> 1.4.1"])
176
177
  s.add_runtime_dependency(%q<nested_inherited_jruby_include_package>.freeze, ["~> 0.3.0"])
177
178
  s.add_runtime_dependency(%q<puts_debuggerer>.freeze, ["~> 0.10.2"])
@@ -181,7 +182,7 @@ Gem::Specification.new do |s|
181
182
  s.add_runtime_dependency(%q<os>.freeze, [">= 1.0.0", "< 2.0.0"])
182
183
  s.add_runtime_dependency(%q<rake>.freeze, [">= 10.1.0", "< 14.0.0"])
183
184
  s.add_runtime_dependency(%q<text-table>.freeze, [">= 1.2.4", "< 2.0.0"])
184
- s.add_runtime_dependency(%q<rouge>.freeze, [">= 3.23.0", "< 4.0.0"])
185
+ s.add_runtime_dependency(%q<rouge>.freeze, [">= 3.25.0", "< 4.0.0"])
185
186
  s.add_development_dependency(%q<juwelier>.freeze, [">= 2.4.9", "< 3.0.0"])
186
187
  s.add_development_dependency(%q<warbler>.freeze, [">= 2.0.5", "< 3.0.0"])
187
188
  s.add_development_dependency(%q<rspec-mocks>.freeze, ["~> 3.5.0"])
@@ -190,7 +191,7 @@ Gem::Specification.new do |s|
190
191
  s.add_development_dependency(%q<simplecov>.freeze, ["~> 0.16.1"])
191
192
  s.add_development_dependency(%q<simplecov-lcov>.freeze, ["~> 0.7.0"])
192
193
  else
193
- s.add_dependency(%q<glimmer>.freeze, ["~> 1.0.2"])
194
+ s.add_dependency(%q<glimmer>.freeze, ["~> 1.0.5"])
194
195
  s.add_dependency(%q<super_module>.freeze, ["~> 1.4.1"])
195
196
  s.add_dependency(%q<nested_inherited_jruby_include_package>.freeze, ["~> 0.3.0"])
196
197
  s.add_dependency(%q<puts_debuggerer>.freeze, ["~> 0.10.2"])
@@ -200,7 +201,7 @@ Gem::Specification.new do |s|
200
201
  s.add_dependency(%q<os>.freeze, [">= 1.0.0", "< 2.0.0"])
201
202
  s.add_dependency(%q<rake>.freeze, [">= 10.1.0", "< 14.0.0"])
202
203
  s.add_dependency(%q<text-table>.freeze, [">= 1.2.4", "< 2.0.0"])
203
- s.add_dependency(%q<rouge>.freeze, [">= 3.23.0", "< 4.0.0"])
204
+ s.add_dependency(%q<rouge>.freeze, [">= 3.25.0", "< 4.0.0"])
204
205
  s.add_dependency(%q<juwelier>.freeze, [">= 2.4.9", "< 3.0.0"])
205
206
  s.add_dependency(%q<warbler>.freeze, [">= 2.0.5", "< 3.0.0"])
206
207
  s.add_dependency(%q<rspec-mocks>.freeze, ["~> 3.5.0"])
@@ -1,5 +1,5 @@
1
1
  # Copyright (c) 2007-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
@@ -38,16 +38,16 @@ module Glimmer
38
38
  @model_binding = model_binding
39
39
  @table.swt_widget.data = @model_binding
40
40
  @column_properties = column_properties
41
+ @table.on_widget_disposed do |dispose_event|
42
+ unregister_all_observables
43
+ end
41
44
  if @table.respond_to?(:column_properties=)
42
45
  @table.column_properties = @column_properties
43
46
  else # assume custom widget
44
47
  @table.body_root.column_properties = @column_properties
45
48
  end
46
- call(@model_binding.evaluate_property)
47
49
  @table_observer_registration = observe(model_binding)
48
- @table.on_widget_disposed do |dispose_event|
49
- unregister_all_observables
50
- end
50
+ call
51
51
  end
52
52
 
53
53
  def call(new_model_collection=nil)
@@ -61,11 +61,11 @@ module Glimmer
61
61
  add_dependent(@table_observer_registration => @table_items_observer_registration)
62
62
  @model_collection = new_model_collection
63
63
  end
64
- populate_table(@model_collection, @table, @column_properties)
64
+ populate_table(@model_collection, @table, @column_properties)
65
65
  end
66
66
 
67
67
  def populate_table(model_collection, parent, column_properties)
68
- selected_table_item_models = parent.swt_widget.getSelection.map(&:getData)
68
+ selected_table_item_models = parent.swt_widget.getSelection.map(&:get_data)
69
69
  parent.finish_edit!
70
70
  parent.swt_widget.items.each(&:dispose)
71
71
  parent.swt_widget.removeAll
@@ -74,12 +74,11 @@ module Glimmer
74
74
  for index in 0..(column_properties.size-1)
75
75
  table_item.setText(index, model.send(column_properties[index]).to_s)
76
76
  end
77
- table_item.setData(model)
77
+ table_item.set_data(model)
78
78
  end
79
- selected_table_items = parent.search {|item| selected_table_item_models.include?(item.getData) }
80
- selected_table_items = [parent.swt_widget.getItems.first].to_java(TableItem) if selected_table_items.empty? && !parent.swt_widget.getItems.empty?
81
- parent.swt_widget.setSelection(selected_table_items) unless selected_table_items.empty?
82
- parent.sort
79
+ selected_table_items = parent.search {|item| selected_table_item_models.include?(item.get_data) }
80
+ parent.swt_widget.setSelection(selected_table_items)
81
+ parent.sort!
83
82
  parent.swt_widget.redraw if parent&.swt_widget&.respond_to?(:redraw)
84
83
  end
85
84
  end