glimmer-dsl-swt 4.24.4.4 → 4.24.4.6

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: e66b329b7d9bf09db34b1b4b9d98a42b52793a6822512ecb1cd95b55a9a8e664
4
- data.tar.gz: 2840c2f1c4cb5064afd54e8723668de648541568cdc9d23626fd07c791bfe1bd
3
+ metadata.gz: e35a647a3770c1d5d57e5f7f8a26ad1f607e1c77719797643238f11e99ba9a55
4
+ data.tar.gz: dbf9f410d0c1008ad62e590811168ea8b0ec2e119dfc275a2feed6454cf5f1ff
5
5
  SHA512:
6
- metadata.gz: 5072ef09d0a73a58f4e8957c1e69efb69843fb31eeb658513368287754357833f69ab263acc36395242c12f9089a48e48541d68abc4dbf1bb1acc06ef4dfd0d5
7
- data.tar.gz: 9ea20dfe409781ec75beed5f5f68afee7e91e09d4a0c14bb43b002525497dcd3948257eccabd8c9513597b108b4e5d051f38faa0c2459c5e44a7a398ee4601f9
6
+ metadata.gz: a49ad225fa01ee4725a3103766ec7f7a4ecfea439df3d66ca3fc77448345766f4e60072691f903579d27d7a6999172581aadfcea5445c5ea973ef56894b40388
7
+ data.tar.gz: c4dc1ae979fccb36b594a368c7f49e48722782589fa65b432d2e04d0306cbf8b878b0e98418d49b9f14955dc5266e9bc1bf7eaee510d9b72d9ab63ac9785100a
data/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # Change Log
2
2
 
3
+ ## 4.24.4.6
4
+
5
+ - Support `refined_table` sorting (now clicking on headers sorts the entire `model_array` collection, not just the visible rows)
6
+ - Support `table` `no_sort` attribute to disable sorting in general if needed
7
+ - Fix issue with Tetris sample upon restart of game (WidgetProxy#shell_proxy method was failing for being disposed, now it retains a reference to parent that stays if disposed)
8
+
9
+ ## 4.24.4.5
10
+
11
+ - Support `refined_table` `:editable` SWT style and `model_array` bidirectional data-binding
12
+ - Update Hello, Refined Table! to allow editing the table
13
+ - Support `Glimmer::UI::CustomWidget`/`Glimmer::UI::CustomShell` support for `swt_style_symbols` read-only attribute to access array of SWT style symbols (works better than `swt_style` because some widgets support custom Glimmer-only SWT style symbols not originally supported by SWT)
14
+
3
15
  ## 4.24.4.4
4
16
 
5
17
  - Support `refined_table` `selection` data-binding
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.4.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.4.6
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.4.4 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.
24
+ [Glimmer DSL for SWT](https://rubygems.org/gems/glimmer-dsl-swt) 4.24.4.6 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.4.4
341
+ jgem install glimmer-dsl-swt -v 4.24.4.6
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.4.4'
369
+ gem 'glimmer-dsl-swt', '~> 4.24.4.6'
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.4.4
392
+ Glimmer (JRuby Desktop Development GUI Framework) - JRuby Gem: glimmer-dsl-swt v4.24.4.6
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.4.4
1
+ 4.24.4.6
@@ -4320,37 +4320,53 @@ Options:
4320
4320
  - `page` (default: `1` if table is filled and `0` otherwise): specifies initial page
4321
4321
  - `query` (default: `''`): specifies filter query term (empty shows all results)
4322
4322
 
4323
- Note that currently `refined_table` only supports displaying a **read-only** table (meaning it can read updates from the model, but it cannot write back to the model through `TableEditor` cells). Also, it does not support selection or sorting by clicking columns yet.
4323
+ Note that currently `refined_table` does not support sorting by clicking columns yet.
4324
4324
 
4325
4325
  Example taken from [Hello, Refined Table!](/docs/reference/GLIMMER_SAMPLES.md#hello-refined-table):
4326
4326
 
4327
4327
  ![hello refined table](/images/glimmer-hello-refined-table.png)
4328
4328
 
4329
4329
  ```ruby
4330
- #... more code precedes
4331
-
4332
- refined_table(per_page: 20) {
4330
+ #...
4331
+ refined_table(:editable, :border, per_page: 20) { # also `page: 1` by default
4333
4332
  table_column {
4334
4333
  width 100
4335
4334
  text 'Date'
4335
+ editor :date_drop_down
4336
4336
  }
4337
4337
  table_column {
4338
4338
  width 200
4339
4339
  text 'Ballpark'
4340
+ editor :none
4340
4341
  }
4341
4342
  table_column {
4342
4343
  width 150
4343
4344
  text 'Home Team'
4345
+ editor :combo, :read_only # read_only is simply an SWT style passed to combo widget
4344
4346
  }
4345
4347
  table_column {
4346
4348
  width 150
4347
4349
  text 'Away Team'
4350
+ editor :combo, :read_only # read_only is simply an SWT style passed to combo widget
4351
+ }
4352
+
4353
+ menu {
4354
+ menu_item {
4355
+ text 'Book'
4356
+
4357
+ on_widget_selected do
4358
+ message_box {
4359
+ text 'Game Booked!'
4360
+ message "The game \"#{@baseball_season.selected_game}\" has been booked!"
4361
+ }.open
4362
+ end
4363
+ }
4348
4364
  }
4349
4365
 
4350
- model_array <= [@baseball_season, :games, column_attributes: {'Home Team' => :home_team_name, 'Away Team' => :away_team_name}]
4366
+ model_array <=> [@baseball_season, :games, column_attributes: {'Home Team' => :home_team_name, 'Away Team' => :away_team_name}]
4367
+ selection <=> [@baseball_season, :selected_game]
4351
4368
  }
4352
-
4353
- #...more code follows
4369
+ #...
4354
4370
  ```
4355
4371
 
4356
4372
  #### Tree
Binary file
@@ -149,7 +149,7 @@ module Glimmer
149
149
  @composite = composite {
150
150
  grid_layout(2, false)
151
151
 
152
- @line_numbers_styled_text_proxy = styled_text(swt(swt(swt_style), :h_scroll!, :v_scroll!)) {
152
+ @line_numbers_styled_text_proxy = styled_text(swt(swt(@swt_style), :h_scroll!, :v_scroll!)) {
153
153
  layout_data(:right, :fill, false, true)
154
154
 
155
155
  text <= [self, :styled_text_proxy_text,
@@ -186,7 +186,7 @@ module Glimmer
186
186
  }
187
187
 
188
188
  def code_text_widget
189
- @styled_text_proxy = styled_text(swt_style) {
189
+ @styled_text_proxy = styled_text(@swt_style) {
190
190
  # custom_widget_property_owner # TODO implement to route properties here without declaring method_missing
191
191
  layout_data :fill, :fill, true, true if lines
192
192
 
@@ -50,11 +50,12 @@ module Glimmer
50
50
  if new_widget_binding.property.to_s == 'model_array' && !@data_bound
51
51
  @data_bound = true
52
52
  model_binding = new_widget_binding.model_binding
53
+ configure_sorting
53
54
  observe(self, :model_array) do
54
55
  filter_and_paginate
55
56
  end
56
57
  @table_proxy.content {
57
- items <=> [self, :refined_model_array, model_binding.binding_options.merge(read_only: true)]
58
+ items <=> [self, :refined_model_array, model_binding.binding_options]
58
59
  }
59
60
  filter_and_paginate
60
61
  end
@@ -72,7 +73,7 @@ module Glimmer
72
73
 
73
74
  pagination
74
75
 
75
- @children_owner = @table_proxy = table(swt_style) {
76
+ @children_owner = @table_proxy = table(*swt_style_symbols) {
76
77
  layout_data(:fill, :fill, true, true)
77
78
  }
78
79
  }
@@ -210,6 +211,38 @@ module Glimmer
210
211
  self.page = corrected_page(page)
211
212
  self.refined_model_array = filtered_model_array[(page - 1) * per_page, per_page]
212
213
  end
214
+
215
+ private
216
+
217
+ def configure_sorting
218
+ @table_proxy.sort_strategy = lambda do
219
+ array = model_array.dup
220
+ array = array.sort_by(&:hash) # this ensures consistent subsequent sorting in case there are equivalent sorts to avoid an infinite loop
221
+ # Converting value to_s first to handle nil cases. Should work with numeric, boolean, and date fields
222
+ if @table_proxy.sort_block
223
+ sorted_array = array.sort(&@table_proxy.sort_block)
224
+ elsif @table_proxy.sort_by_block
225
+ sorted_array = array.sort_by(&@table_proxy.sort_by_block)
226
+ else
227
+ sorted_array = array.sort_by do |object|
228
+ @table_proxy.sort_property.each_with_index.map do |a_sort_property, i|
229
+ value = object.send(a_sort_property)
230
+ # handle nil and difficult to compare types gracefully
231
+ if @table_proxy.sort_type[i] == Integer
232
+ value = value.to_i
233
+ elsif @table_proxy.sort_type[i] == Float
234
+ value = value.to_f
235
+ elsif @table_proxy.sort_type[i] == String
236
+ value = value.to_s
237
+ end
238
+ value
239
+ end
240
+ end
241
+ end
242
+ sorted_array = sorted_array.reverse if @table_proxy.sort_direction == :descending
243
+ self.model_array = sorted_array
244
+ end
245
+ end
213
246
  end
214
247
  end
215
248
  end
@@ -27,15 +27,15 @@ module Glimmer
27
27
  # A proxy object representing SWT TableColumn
28
28
  # Accepts a :no_sort custom style to disable sorting on this column
29
29
  class TableColumnProxy < Glimmer::SWT::WidgetProxy
30
- attr_reader :no_sort, :sort_property, :editor
30
+ attr_reader :sort_property, :editor
31
+ attr_accessor :no_sort, :sort_block, :sort_by_block
31
32
  alias no_sort? no_sort
32
- attr_accessor :sort_block, :sort_by_block
33
33
 
34
34
  def initialize(underscored_widget_name, parent, args)
35
35
  @no_sort = args.delete(:no_sort)
36
36
  super
37
37
  on_widget_selected do |event|
38
- parent.sort_by_column!(self)
38
+ parent.sort_by_column!(self) unless no_sort?
39
39
  end unless no_sort?
40
40
  end
41
41
 
@@ -247,7 +247,7 @@ module Glimmer
247
247
 
248
248
  attr_reader :table_editor, :table_editor_widget_proxy, :sort_property, :sort_direction, :sort_block, :sort_type, :sort_by_block, :additional_sort_properties, :editor, :editable
249
249
  attr_writer :column_properties
250
- attr_accessor :table_items_binding
250
+ attr_accessor :table_items_binding, :sort_strategy
251
251
  alias column_attributes= column_properties=
252
252
  alias editable? editable
253
253
 
@@ -398,36 +398,46 @@ module Glimmer
398
398
 
399
399
  def sort!(internal_sort: false)
400
400
  return unless sort_property && (sort_type || sort_block || sort_by_block)
401
- original_array = array = model_binding.evaluate_property
402
- array = array.sort_by(&:hash) # this ensures consistent subsequent sorting in case there are equivalent sorts to avoid an infinite loop
403
- # Converting value to_s first to handle nil cases. Should work with numeric, boolean, and date fields
404
- if sort_block
405
- sorted_array = array.sort(&sort_block)
406
- elsif sort_by_block
407
- sorted_array = array.sort_by(&sort_by_block)
401
+ if sort_strategy
402
+ sort_strategy.call
408
403
  else
409
- sorted_array = array.sort_by do |object|
410
- sort_property.each_with_index.map do |a_sort_property, i|
411
- value = object.send(a_sort_property)
412
- # handle nil and difficult to compare types gracefully
413
- if sort_type[i] == Integer
414
- value = value.to_i
415
- elsif sort_type[i] == Float
416
- value = value.to_f
417
- elsif sort_type[i] == String
418
- value = value.to_s
404
+ original_array = array = model_binding.evaluate_property
405
+ array = array.sort_by(&:hash) # this ensures consistent subsequent sorting in case there are equivalent sorts to avoid an infinite loop
406
+ # Converting value to_s first to handle nil cases. Should work with numeric, boolean, and date fields
407
+ if sort_block
408
+ sorted_array = array.sort(&sort_block)
409
+ elsif sort_by_block
410
+ sorted_array = array.sort_by(&sort_by_block)
411
+ else
412
+ sorted_array = array.sort_by do |object|
413
+ sort_property.each_with_index.map do |a_sort_property, i|
414
+ value = object.send(a_sort_property)
415
+ # handle nil and difficult to compare types gracefully
416
+ if sort_type[i] == Integer
417
+ value = value.to_i
418
+ elsif sort_type[i] == Float
419
+ value = value.to_f
420
+ elsif sort_type[i] == String
421
+ value = value.to_s
422
+ end
423
+ value
419
424
  end
420
- value
421
425
  end
422
426
  end
427
+ sorted_array = sorted_array.reverse if sort_direction == :descending
428
+ if model_binding.binding_options.symbolize_keys[:read_only_sort]
429
+ table_items_binding.call(sorted_array, internal_sort: true) unless internal_sort
430
+ else
431
+ model_binding.call(sorted_array)
432
+ end
433
+ sorted_array
423
434
  end
424
- sorted_array = sorted_array.reverse if sort_direction == :descending
425
- if model_binding.binding_options.symbolize_keys[:read_only_sort]
426
- table_items_binding.call(sorted_array, internal_sort: true) unless internal_sort
427
- else
428
- model_binding.call(sorted_array)
435
+ end
436
+
437
+ def no_sort=(value)
438
+ table_column_proxies.each do |table_column_proxy|
439
+ table_column_proxy.no_sort = value
429
440
  end
430
- sorted_array
431
441
  end
432
442
 
433
443
  def editor=(args)
@@ -167,6 +167,7 @@ module Glimmer
167
167
  parent = swt_widget.parent
168
168
  @parent_proxy = parent&.get_data('proxy') || parent_proxy_class.new(swt_widget: parent)
169
169
  end
170
+ shell_proxy # populates @shell_proxy attribute
170
171
  if @swt_widget&.get_data('proxy').nil?
171
172
  @swt_widget.set_data('proxy', self)
172
173
  DEFAULT_INITIALIZERS[underscored_widget_name.to_s.to_sym]&.call(@swt_widget)
@@ -201,10 +202,12 @@ module Glimmer
201
202
  end
202
203
 
203
204
  def shell_proxy
204
- if @swt_widget.respond_to?(:shell)
205
- @swt_widget.shell.get_data('proxy')
205
+ if @swt_widget.respond_to?(:shell) && !@swt_widget.is_disposed
206
+ @shell_proxy = @swt_widget.shell.get_data('proxy')
207
+ elsif @parent_proxy&.shell_proxy
208
+ @shell_proxy = @parent_proxy&.shell_proxy
206
209
  else
207
- @parent_proxy&.shell_proxy
210
+ @shell_proxy
208
211
  end
209
212
  end
210
213
 
@@ -161,13 +161,13 @@ module Glimmer
161
161
  end
162
162
  end
163
163
 
164
- attr_reader :body_root, :parent, :parent_proxy, :swt_style, :options
164
+ attr_reader :body_root, :parent, :parent_proxy, :swt_style_symbols, :options
165
165
 
166
- def initialize(parent, *swt_constants, options, &content)
166
+ def initialize(parent, *swt_style_symbols, options, &content)
167
167
  SWT::DisplayProxy.current_custom_widgets_and_shapes << self
168
168
  @parent_proxy = @parent = parent
169
169
  @parent_proxy = @parent&.get_data('proxy') if @parent.respond_to?(:get_data) && @parent.get_data('proxy')
170
- @swt_style = SWT::SWTProxy[*swt_constants] # TODO support non-standard styles like :editable, perhaps by packing in an array instead of interpreting right away
170
+ @swt_style_symbols = swt_style_symbols
171
171
  options ||= {}
172
172
  @options = self.class.options.merge(options)
173
173
  @content = Util::ProcTracker.new(content) if content
@@ -191,9 +191,10 @@ module Glimmer
191
191
  post_add_content if content.nil?
192
192
  end
193
193
 
194
+ # Calls post_initialize_child on children_owner by default
194
195
  # Subclasses may override to perform post initialization work on an added child
195
196
  def post_initialize_child(child)
196
- # No Op by default
197
+ children_owner.post_initialize_child(child)
197
198
  end
198
199
 
199
200
  def post_add_content
@@ -210,6 +211,14 @@ module Glimmer
210
211
  @swt_widget
211
212
  end
212
213
 
214
+ # returns calculated SWT style integer value from swt_style_symbols
215
+ # keep in mind that it would not work when using glimmer-only
216
+ # custom swt_style_symbols like :editable for table
217
+ # In that case, just reference swt_style_symbols array instead
218
+ def swt_style
219
+ @swt_style ||= SWT::SWTProxy[*@swt_style_symbols]
220
+ end
221
+
213
222
  def observer_registrations
214
223
  @observer_registrations ||= []
215
224
  end
@@ -31,3 +31,4 @@ Hello, Custom Shell!: c8Eb8GWM_XQ
31
31
  Hello, Custom Shape!: H3J8ecp30Ak
32
32
  Battleship: b00OWeLZOt8
33
33
  Klondike Solitaire: qOzgiz9X3sI
34
+ Tetris: oQbBCXACOLY
@@ -28,11 +28,11 @@ class Tetris
28
28
 
29
29
  options :parent_shell, :game
30
30
 
31
- after_body {
31
+ after_body do
32
32
  @game_over_observer = observe(game, :game_over) do |game_over|
33
33
  close if !game_over
34
34
  end
35
- }
35
+ end
36
36
 
37
37
  body {
38
38
  dialog(parent_shell) {
@@ -36,12 +36,13 @@ class EmailShell
36
36
  option :to, default: '"John Irwin" <john.irwin@example.com>'
37
37
 
38
38
  before_body do
39
- @swt_style |= swt(:shell_trim, :modeless)
39
+ # build a custom swt_style based on passed in swt style symbols (built-in CustomShell attribute)
40
+ @swt_style = swt(:shell_trim, :modeless, *swt_style_symbols)
40
41
  end
41
42
 
42
43
  body {
43
- # pass received swt_style through to shell to customize it (e.g. :dialog_trim for a blocking shell)
44
- shell(parent_shell, swt_style) {
44
+ # pass received @swt_style through to shell to customize it (e.g. :dialog_trim for a blocking shell)
45
+ shell(parent_shell, @swt_style) {
45
46
  grid_layout(2, false)
46
47
 
47
48
  text subject
@@ -65,8 +65,8 @@ class GreetingLabel
65
65
  end
66
66
 
67
67
  body {
68
- # pass received swt_style through to label to customize (e.g. :center to center text)
69
- label(swt_style) {
68
+ # pass received swt style symbols through to label to customize (e.g. :center to center text)
69
+ label(*swt_style_symbols) {
70
70
  text "#{greeting}, #{name}!"
71
71
  font @font
72
72
  foreground <=> [self, :label_color]
@@ -59,6 +59,10 @@ class HelloRefinedTable
59
59
  {town: 'San Francisco', name: 'Giants', ballpark: 'Oracle Park'},
60
60
  ].map {|team_kwargs| new(team_kwargs)}
61
61
  end
62
+
63
+ def all_team_names
64
+ @all_team_names ||= BaseballTeam.all.map {|t| t[:name]}
65
+ end
62
66
  end
63
67
 
64
68
  def complete_name
@@ -71,14 +75,36 @@ class HelloRefinedTable
71
75
  home_team.complete_name
72
76
  end
73
77
 
78
+ def home_team_name=(new_name)
79
+ new_home_team = BaseballTeam.all.find {|t| t[:name] == new_name}
80
+ self.home_team = new_home_team if new_home_team
81
+ end
82
+
83
+ def home_team_name_options
84
+ BaseballTeam.all_team_names
85
+ end
86
+
74
87
  def away_team_name
75
88
  away_team.complete_name
76
89
  end
77
90
 
91
+ def away_team_name=(new_name)
92
+ new_away_team = BaseballTeam.all.find {|t| t[:name] == new_name}
93
+ self.away_team = new_away_team if new_away_team
94
+ end
95
+
96
+ def away_team_name_options
97
+ BaseballTeam.all_team_names
98
+ end
99
+
78
100
  def ballpark
79
101
  home_team.ballpark
80
102
  end
81
103
 
104
+ def date=(new_date)
105
+ self['date'] = new_date.respond_to?(:to_date) ? new_date.to_date : new_date
106
+ end
107
+
82
108
  def to_s
83
109
  "#{home_team_name} vs #{away_team_name} at #{ballpark}"
84
110
  end
@@ -86,6 +112,7 @@ class HelloRefinedTable
86
112
 
87
113
  BaseballSeason = Struct.new(:year) do
88
114
  attr_accessor :selected_game
115
+ attr_writer :games
89
116
 
90
117
  def games
91
118
  if @games.nil?
@@ -137,22 +164,26 @@ class HelloRefinedTable
137
164
  shell {
138
165
  text 'Hello, Refined Table!'
139
166
 
140
- refined_table(per_page: 20) { # also `page: 1` by default
167
+ refined_table(:editable, :border, per_page: 20) { # also `page: 1` by default
141
168
  table_column {
142
169
  width 100
143
170
  text 'Date'
171
+ editor :date_drop_down
144
172
  }
145
173
  table_column {
146
174
  width 200
147
175
  text 'Ballpark'
176
+ editor :none
148
177
  }
149
178
  table_column {
150
179
  width 150
151
180
  text 'Home Team'
181
+ editor :combo, :read_only # read_only is simply an SWT style passed to combo widget
152
182
  }
153
183
  table_column {
154
184
  width 150
155
185
  text 'Away Team'
186
+ editor :combo, :read_only # read_only is simply an SWT style passed to combo widget
156
187
  }
157
188
 
158
189
  menu {
@@ -168,7 +199,7 @@ class HelloRefinedTable
168
199
  }
169
200
  }
170
201
 
171
- model_array <= [@baseball_season, :games, column_attributes: {'Home Team' => :home_team_name, 'Away Team' => :away_team_name}]
202
+ model_array <=> [@baseball_season, :games, column_attributes: {'Home Team' => :home_team_name, 'Away Team' => :away_team_name}]
172
203
  selection <=> [@baseball_season, :selected_game]
173
204
  }
174
205
  }
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.4.4
4
+ version: 4.24.4.6
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-09-17 00:00:00.000000000 Z
11
+ date: 2022-09-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement