Skip to content

Commit

Permalink
browser: add select all/inversion/none menus to target chooser lists
Browse files Browse the repository at this point in the history
  • Loading branch information
LinqLover committed Dec 22, 2024
1 parent 36987c1 commit 7cfca4c
Show file tree
Hide file tree
Showing 22 changed files with 90 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ withSystemCategories: categories
^ self new
systemCategories: categories;
classes: (categories gather: [:category |
SystemOrganizer default listAtCategoryNamed: category]);
SystemOrganizer default sl2ClassesInCategory: category]);
yourself
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ label
allClasses := OrderedCollection withAll: self classes.
self systemCategories do: [:category |
| categoryClasses |
categoryClasses := SystemOrganizer default listAtCategoryNamed: category.
categoryClasses := SystemOrganizer default sl2ClassesInCategory: category.
(allClasses includesAllOf: categoryClasses) ifTrue:
[allClasses removeAll: categoryClasses.
allCategories add: category]].
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
"fromUserOrCancel:" : "ct 12/12/2024 02:18",
"withClass:" : "ct 12/19/2024 20:54",
"withClasses:" : "ct 12/19/2024 20:55",
"withSystemCategories:" : "ct 12/19/2024 20:46",
"withSystemCategories:" : "ct 12/22/2024 01:26",
"withSystemCategory:" : "ct 12/19/2024 20:45" },
"instance" : {
"classes" : "ct 12/12/2024 02:17",
"classes:" : "ct 12/12/2024 03:41",
"editModally" : "ct 12/12/2024 03:44",
"initialize" : "ct 12/12/2024 03:41",
"label" : "ct 12/21/2024 21:35",
"label" : "ct 12/22/2024 01:26",
"systemCategories" : "ct 12/12/2024 02:17",
"systemCategories:" : "ct 12/12/2024 03:41" } }
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@ buildClassList: builder
setIndex: #selectClassAt:;
getSelectionList: #hasClassSelectedAt:;
setSelectionList: #classAt:select:;
menu: #classMenu:;
yourself
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@ buildSystemCategoryList: builder
setIndex: #selectSystemCategoryAt:;
getSelectionList: #hasSystemCategorySelectedAt:;
setSelectionList: #systemCategoryAt:select:;
menu: #systemCategoryMenu:;
yourself
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
accessing - toolbuilder
class: aClass select: aBoolean

self target classes:
self selectedClasses:
(aBoolean
ifFalse: [self target classes copyWithout: aClass]
ifTrue: [(self target classes copyWith: aClass) withoutDuplicates]).

self changed: #selectedClasses.
ifTrue: [(self target classes copyWith: aClass) withoutDuplicates]).
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
menus
classMenu: menu

^ self listMenu: menu for: #classes
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
private
classesInSystemCategory: category

^ self systemOrganizer listAtCategoryNamed: category
^ self systemOrganizer sl2ClassesInCategory: category
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ initialize
super initialize.

self initializeWithSystemOrganizer: SystemOrganizer default.
accepted := false.
accepted := false.
caches := IdentityDictionary new.
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
actions
invertSelection: selector

self
perform: (#'selected{1}:' format: {selector capitalized}) asSymbol
with:
((self perform: (#'available{1}' format: {selector capitalized}) asSymbol)
copyWithoutAll:
(self perform: (#'selected{1}' format: {selector capitalized}))).
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
menus
listMenu: menu for: selector

^ menu
add: 'Select all' selector: #selectAll: argument: selector;
add: 'Select inversion' selector: #invertSelection: argument: selector;
add: 'Select none' selector: #selectNone: argument: selector;
yourself
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
actions
selectAll: selector

self
perform: (#'selected{1}:' format: {selector capitalized})
with: (self perform: (#'available{1}' format: {selector capitalized})).
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
actions
selectNone: selector

self
perform: (#'selected{1}:' format: {selector capitalized}) asSymbol
with: #().
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
accessing
selectedSystemCategories: categories

self target systemCategories: categories.

self changed: #selectedSystemCategories.

self selectedClasses: (self selectedClasses intersection: self availableClasses).
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
accessing - toolbuilder
systemCategory: category select: aBoolean

self target systemCategories:
self selectedSystemCategories:
(aBoolean
ifFalse: [self target systemCategories copyWithout: category]
ifTrue: [(self target systemCategories copyWith: category) withoutDuplicates]).

self changed: #selectedSystemCategories.

aBoolean
ifTrue: [self selectedClasses: (self selectedClasses , (self classesInSystemCategory: category)) withoutDuplicates]
ifFalse: [self selectedClasses: (self selectedClasses intersection: self availableClasses)].
aBoolean ifTrue:
[self selectedClasses: (self selectedClasses , (self classesInSystemCategory: category)) withoutDuplicates].
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
menus
systemCategoryMenu: menu

^ self listMenu: menu for: #systemCategories
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,18 @@
"availableClasses" : "ct 12/17/2024 22:09",
"availableSystemCategories" : "ct 12/12/2024 02:38",
"buildButtons:" : "ct 12/12/2024 02:21",
"buildClassList:" : "ct 12/12/2024 03:16",
"buildClassList:" : "ct 12/22/2024 00:32",
"buildCreateDialogWith:" : "ct 12/12/2024 02:20",
"buildEditDialogWith:" : "ct 12/12/2024 03:46",
"buildSystemCategoryList:" : "ct 12/12/2024 03:16",
"buildSystemCategoryList:" : "ct 12/22/2024 00:38",
"cancel" : "ct 12/12/2024 03:05",
"cancelColor" : "ct 12/12/2024 03:03",
"changed:" : "ct 2/8/2022 14:49",
"changedDependent:" : "ct 2/8/2022 14:49",
"class:select:" : "ct 12/12/2024 05:53",
"class:select:" : "ct 12/22/2024 01:29",
"classAt:select:" : "ct 12/12/2024 03:33",
"classesInSystemCategory:" : "ct 12/12/2024 04:43",
"classMenu:" : "ct 12/22/2024 00:43",
"classesInSystemCategory:" : "ct 12/22/2024 01:25",
"close:" : "ct 12/12/2024 03:05",
"createOrCancel:" : "ct 12/12/2024 03:38",
"dependentAspectsOn:" : "ct 2/8/2022 14:49",
Expand All @@ -33,21 +34,27 @@
"hasClassSelectedAt:" : "ct 12/12/2024 03:04",
"hasSystemCategorySelected:" : "ct 12/12/2024 03:14",
"hasSystemCategorySelectedAt:" : "ct 12/12/2024 03:14",
"initialize" : "ct 12/12/2024 03:07",
"initialize" : "ct 12/22/2024 01:07",
"initializeWithSystemOrganizer:" : "ct 12/21/2024 21:38",
"invertSelection:" : "ct 12/22/2024 00:41",
"listMenu:for:" : "ct 12/22/2024 00:44",
"selectAll:" : "ct 12/22/2024 00:46",
"selectClass:" : "ct 12/12/2024 03:33",
"selectClassAt:" : "ct 12/12/2024 03:32",
"selectNone:" : "ct 12/22/2024 00:45",
"selectSystemCategory:" : "ct 12/12/2024 03:23",
"selectSystemCategoryAt:" : "ct 12/12/2024 03:23",
"selectedClass" : "ct 12/12/2024 03:02",
"selectedClassIndex" : "ct 12/12/2024 03:02",
"selectedClasses" : "ct 12/12/2024 03:39",
"selectedClasses:" : "ct 12/12/2024 03:50",
"selectedSystemCategories" : "ct 12/12/2024 03:39",
"selectedSystemCategories:" : "ct 12/22/2024 01:29",
"selectedSystemCategory" : "ct 12/12/2024 02:46",
"selectedSystemCategoryIndex" : "ct 12/12/2024 02:48",
"systemCategory:select:" : "ct 12/20/2024 02:50",
"systemCategory:select:" : "ct 12/22/2024 01:28",
"systemCategoryAt:select:" : "ct 12/12/2024 03:25",
"systemCategoryMenu:" : "ct 12/22/2024 00:45",
"systemOrganizer" : "ct 12/12/2024 02:58",
"systemOrganizer:" : "ct 12/12/2024 02:58",
"target" : "ct 12/12/2024 03:37",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
*SwaLintBrowser-UI-formatting-pseudo-override
format: aCollection

^ (self asString format: aCollection) asSymbol
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
"class" : {
},
"instance" : {
"cull:cull:" : "ct 5/16/2023 20:21" } }
"cull:cull:" : "ct 5/16/2023 20:21",
"format:" : "ct 12/22/2024 00:46" } }
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
*SwaLintBrowser-Core-accessing
sl2ClassesInCategory: categoryName

^ (self listAtCategoryNamed: categoryName)
collect: [:className | self environment classNamed: className]
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"class" : {
},
"instance" : {
"sl2ClassesInCategory:" : "ct 12/22/2024 01:25" } }
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
{
"name" : "SystemOrganizer" }

0 comments on commit 7cfca4c

Please sign in to comment.