glimmer-dsl-swt 4.25.0.0 → 4.25.0.1

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: 41e2be5d798d0306f341617d1052830cfd9d7c161f5901b5fc3dc0085f03ae6d
4
- data.tar.gz: 0a6b56b7cf420f0d7c27c5a191676201ed1d7c531d1f1526939dac63664eb241
3
+ metadata.gz: 25c1ee50ed943be0816df8fcb6a185002555f26f00c3901b3119b3fac7e205cf
4
+ data.tar.gz: 7b20693058c5942e78d2ffe1b43f7e2af8f09f731164338f50652bbe7d1d7819
5
5
  SHA512:
6
- metadata.gz: e244ae57af5ed8a605b1499aa48e2a9c694e59f0b7c946e5b340a2fc449f483b7b9bd57e0305d4229a3a5c940bcec0d2be333ac7fc66b1ef3ff6ac3ec06aea17
7
- data.tar.gz: c907ce1160c84865cded4ac999f5dcbd6318525f038fb020f9baff6915cd728048231160265d88fc835385e87703338b4e2ec2e3083fca342dccd7039dcc255e
6
+ metadata.gz: e2a05775a6377592290639bdc617067f40c5aff23dc261052fd0e767e7271b62b682271ab47ba5bbcbe1e175be125e0149322ba0d3dea2b88502f59906d8a55c
7
+ data.tar.gz: 8707f436fe24cff7f31809510db6b168fdd55a815504115be42e3e1f55f46a75a5c44c16edaa3ba2907fa9343b7a69493f8d8ac183b22024c75313a787586bdf
data/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # Change Log
2
2
 
3
+ ## 4.25.0.1
4
+
5
+ - Contact Manager Create Button and Table Delete Menu Item
6
+ - Make default table sorting behavior for strings case-insensitive
7
+
3
8
  ## 4.25.0.0
4
9
 
5
10
  - Upgrade to SWT 4.25
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.25.0.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.25.0.1
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.25.0.0 includes [SWT 4.25](https://download.eclipse.org/eclipse/downloads/drops4/R-4.25-202208311800/), which was released on 31 Aug 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.25.0.1 includes [SWT 4.25](https://download.eclipse.org/eclipse/downloads/drops4/R-4.25-202208311800/), which was released on 31 Aug 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.25.0.0
341
+ jgem install glimmer-dsl-swt -v 4.25.0.1
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.25.0.0'
369
+ gem 'glimmer-dsl-swt', '~> 4.25.0.1'
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.25.0.0
392
+ Glimmer (JRuby Desktop Development GUI Framework) - JRuby Gem: glimmer-dsl-swt v4.25.0.1
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.25.0.0
1
+ 4.25.0.1
Binary file
@@ -418,7 +418,7 @@ module Glimmer
418
418
  elsif sort_type[i] == Float
419
419
  value = value.to_f
420
420
  elsif sort_type[i] == String
421
- value = value.to_s
421
+ value = value.to_s.downcase
422
422
  end
423
423
  value
424
424
  end
@@ -1,5 +1,5 @@
1
1
  # Copyright (c) 2007-2022 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
@@ -1,5 +1,5 @@
1
1
  # Copyright (c) 2007-2022 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
@@ -23,7 +23,7 @@ require_relative "contact_repository"
23
23
 
24
24
  class ContactManager
25
25
  class ContactManagerPresenter
26
- attr_accessor :results
26
+ attr_accessor :results, :selected_contact
27
27
  @@contact_attributes = [:first_name, :last_name, :email]
28
28
  @@contact_attributes.each {|attribute_name| attr_accessor attribute_name}
29
29
 
@@ -33,15 +33,45 @@ class ContactManager
33
33
  end
34
34
 
35
35
  def list
36
- self.results = @contact_repository.find({})
36
+ @applied_filter = {}
37
+ filter
37
38
  end
38
39
 
39
40
  def find
40
- filter_map = {}
41
+ @applied_filter = fields
42
+ filter
43
+ end
44
+
45
+ def filter
46
+ self.results = @contact_repository.find(@applied_filter)
47
+ end
48
+
49
+ def fields
50
+ filters = {}
41
51
  @@contact_attributes.each do |attribute_name|
42
- filter_map[attribute_name] = self.send(attribute_name) if self.send(attribute_name)
52
+ filters[attribute_name] = self.send(attribute_name) if self.send(attribute_name)
43
53
  end
44
- self.results = @contact_repository.find(filter_map)
54
+ filters
55
+ end
56
+
57
+ def clear_fields
58
+ @@contact_attributes.each do |attribute_name|
59
+ self.send("#{attribute_name}=", '')
60
+ end
61
+ end
62
+
63
+ def create
64
+ created_contact = @contact_repository.create(fields)
65
+ filter
66
+ clear_fields
67
+ created_contact
68
+ end
69
+
70
+ def delete
71
+ deleted_contact = @contact_repository.delete(@selected_contact)
72
+ filter
73
+ self.selected_contact = nil
74
+ deleted_contact
45
75
  end
46
76
  end
47
77
  end
@@ -1,5 +1,5 @@
1
1
  # Copyright (c) 2007-2022 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
@@ -165,5 +165,15 @@ class ContactManager
165
165
  match
166
166
  end
167
167
  end
168
+
169
+ def create(attributes)
170
+ created_contact = Contact.new(attributes)
171
+ @contacts << created_contact
172
+ created_contact
173
+ end
174
+
175
+ def delete(contact)
176
+ @contacts.delete(contact)
177
+ end
168
178
  end
169
179
  end
@@ -96,6 +96,18 @@ class ContactManager
96
96
  horizontal_span 2
97
97
  }
98
98
 
99
+ button {
100
+ text "&Create"
101
+
102
+ on_widget_selected do
103
+ create_contact
104
+ end
105
+
106
+ on_key_pressed do |key_event|
107
+ create_contact if key_event.keyCode == swt(:cr)
108
+ end
109
+ }
110
+
99
111
  button {
100
112
  text "&Find"
101
113
 
@@ -122,7 +134,7 @@ class ContactManager
122
134
  }
123
135
  }
124
136
 
125
- table(:editable, :border) { |table_proxy|
137
+ @table = table(:editable, :border) { |table_proxy|
126
138
  layout_data {
127
139
  horizontal_alignment :fill
128
140
  vertical_alignment :fill
@@ -144,7 +156,18 @@ class ContactManager
144
156
  width 200
145
157
  }
146
158
 
159
+ menu {
160
+ menu_item {
161
+ text '&Delete'
162
+
163
+ on_widget_selected do
164
+ @contact_manager_presenter.delete
165
+ end
166
+ }
167
+ }
168
+
147
169
  items <=> [@contact_manager_presenter, :results]
170
+ selection <=> [@contact_manager_presenter, :selected_contact]
148
171
 
149
172
  on_mouse_up do |event|
150
173
  table_proxy.edit_table_item(event.table_item, event.column_index)
@@ -153,6 +176,16 @@ class ContactManager
153
176
  }
154
177
  }
155
178
  }
179
+
180
+ def create_contact
181
+ created_contact = @contact_manager_presenter.create
182
+ new_item = @table.search do |table_item|
183
+ model = table_item.data # get model embodied by table item
184
+ created_contact == model
185
+ end.first
186
+ @table.setSelection(new_item) # set selection with Table SWT API
187
+ @table.showSelection # show selection with Table SWT API
188
+ end
156
189
  end
157
190
 
158
191
  ContactManager.launch
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.25.0.0
4
+ version: 4.25.0.1
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-25 00:00:00.000000000 Z
11
+ date: 2022-10-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement