From 7cfca4cb51e2b9f68b94efa4c67af20aa451b8e8 Mon Sep 17 00:00:00 2001 From: Christoph Thiede Date: Sun, 22 Dec 2024 03:15:05 +0100 Subject: [PATCH] browser: add select all/inversion/none menus to target chooser lists --- .../class/withSystemCategories..st | 2 +- .../SL2Target.class/instance/label.st | 2 +- .../SL2Target.class/methodProperties.json | 4 ++-- .../instance/buildClassList..st | 1 + .../instance/buildSystemCategoryList..st | 1 + .../instance/class.select..st | 6 ++---- .../instance/classMenu..st | 4 ++++ .../instance/classesInSystemCategory..st | 2 +- .../instance/initialize.st | 3 ++- .../instance/invertSelection..st | 9 +++++++++ .../instance/listMenu.for..st | 8 ++++++++ .../instance/selectAll..st | 6 ++++++ .../instance/selectNone..st | 6 ++++++ .../instance/selectedSystemCategories..st | 8 ++++++++ .../instance/systemCategory.select..st | 9 +++------ .../instance/systemCategoryMenu..st | 4 ++++ .../methodProperties.json | 19 +++++++++++++------ .../Symbol.extension/instance/format..st | 4 ++++ .../Symbol.extension/methodProperties.json | 3 ++- .../instance/sl2ClassesInCategory..st | 5 +++++ .../methodProperties.json | 5 +++++ .../SystemOrganizer.extension/properties.json | 2 ++ 22 files changed, 90 insertions(+), 23 deletions(-) create mode 100644 packages/SwaLintBrowser.package/SL2TargetChooser.class/instance/classMenu..st create mode 100644 packages/SwaLintBrowser.package/SL2TargetChooser.class/instance/invertSelection..st create mode 100644 packages/SwaLintBrowser.package/SL2TargetChooser.class/instance/listMenu.for..st create mode 100644 packages/SwaLintBrowser.package/SL2TargetChooser.class/instance/selectAll..st create mode 100644 packages/SwaLintBrowser.package/SL2TargetChooser.class/instance/selectNone..st create mode 100644 packages/SwaLintBrowser.package/SL2TargetChooser.class/instance/selectedSystemCategories..st create mode 100644 packages/SwaLintBrowser.package/SL2TargetChooser.class/instance/systemCategoryMenu..st create mode 100644 packages/SwaLintBrowser.package/Symbol.extension/instance/format..st create mode 100644 packages/SwaLintBrowser.package/SystemOrganizer.extension/instance/sl2ClassesInCategory..st create mode 100644 packages/SwaLintBrowser.package/SystemOrganizer.extension/methodProperties.json create mode 100644 packages/SwaLintBrowser.package/SystemOrganizer.extension/properties.json diff --git a/packages/SwaLintBrowser.package/SL2Target.class/class/withSystemCategories..st b/packages/SwaLintBrowser.package/SL2Target.class/class/withSystemCategories..st index da122df..25ef3ff 100644 --- a/packages/SwaLintBrowser.package/SL2Target.class/class/withSystemCategories..st +++ b/packages/SwaLintBrowser.package/SL2Target.class/class/withSystemCategories..st @@ -4,5 +4,5 @@ withSystemCategories: categories ^ self new systemCategories: categories; classes: (categories gather: [:category | - SystemOrganizer default listAtCategoryNamed: category]); + SystemOrganizer default sl2ClassesInCategory: category]); yourself \ No newline at end of file diff --git a/packages/SwaLintBrowser.package/SL2Target.class/instance/label.st b/packages/SwaLintBrowser.package/SL2Target.class/instance/label.st index 6ba14e2..8109281 100644 --- a/packages/SwaLintBrowser.package/SL2Target.class/instance/label.st +++ b/packages/SwaLintBrowser.package/SL2Target.class/instance/label.st @@ -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]]. diff --git a/packages/SwaLintBrowser.package/SL2Target.class/methodProperties.json b/packages/SwaLintBrowser.package/SL2Target.class/methodProperties.json index dc4620f..8237abc 100644 --- a/packages/SwaLintBrowser.package/SL2Target.class/methodProperties.json +++ b/packages/SwaLintBrowser.package/SL2Target.class/methodProperties.json @@ -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" } } diff --git a/packages/SwaLintBrowser.package/SL2TargetChooser.class/instance/buildClassList..st b/packages/SwaLintBrowser.package/SL2TargetChooser.class/instance/buildClassList..st index e88fbed..70c532e 100644 --- a/packages/SwaLintBrowser.package/SL2TargetChooser.class/instance/buildClassList..st +++ b/packages/SwaLintBrowser.package/SL2TargetChooser.class/instance/buildClassList..st @@ -13,4 +13,5 @@ buildClassList: builder setIndex: #selectClassAt:; getSelectionList: #hasClassSelectedAt:; setSelectionList: #classAt:select:; + menu: #classMenu:; yourself \ No newline at end of file diff --git a/packages/SwaLintBrowser.package/SL2TargetChooser.class/instance/buildSystemCategoryList..st b/packages/SwaLintBrowser.package/SL2TargetChooser.class/instance/buildSystemCategoryList..st index 815d224..c5f3240 100644 --- a/packages/SwaLintBrowser.package/SL2TargetChooser.class/instance/buildSystemCategoryList..st +++ b/packages/SwaLintBrowser.package/SL2TargetChooser.class/instance/buildSystemCategoryList..st @@ -13,4 +13,5 @@ buildSystemCategoryList: builder setIndex: #selectSystemCategoryAt:; getSelectionList: #hasSystemCategorySelectedAt:; setSelectionList: #systemCategoryAt:select:; + menu: #systemCategoryMenu:; yourself \ No newline at end of file diff --git a/packages/SwaLintBrowser.package/SL2TargetChooser.class/instance/class.select..st b/packages/SwaLintBrowser.package/SL2TargetChooser.class/instance/class.select..st index 8de96a2..21dc137 100644 --- a/packages/SwaLintBrowser.package/SL2TargetChooser.class/instance/class.select..st +++ b/packages/SwaLintBrowser.package/SL2TargetChooser.class/instance/class.select..st @@ -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. \ No newline at end of file + ifTrue: [(self target classes copyWith: aClass) withoutDuplicates]). \ No newline at end of file diff --git a/packages/SwaLintBrowser.package/SL2TargetChooser.class/instance/classMenu..st b/packages/SwaLintBrowser.package/SL2TargetChooser.class/instance/classMenu..st new file mode 100644 index 0000000..5aaae98 --- /dev/null +++ b/packages/SwaLintBrowser.package/SL2TargetChooser.class/instance/classMenu..st @@ -0,0 +1,4 @@ +menus +classMenu: menu + + ^ self listMenu: menu for: #classes \ No newline at end of file diff --git a/packages/SwaLintBrowser.package/SL2TargetChooser.class/instance/classesInSystemCategory..st b/packages/SwaLintBrowser.package/SL2TargetChooser.class/instance/classesInSystemCategory..st index 2017937..62d8484 100644 --- a/packages/SwaLintBrowser.package/SL2TargetChooser.class/instance/classesInSystemCategory..st +++ b/packages/SwaLintBrowser.package/SL2TargetChooser.class/instance/classesInSystemCategory..st @@ -1,4 +1,4 @@ private classesInSystemCategory: category - ^ self systemOrganizer listAtCategoryNamed: category \ No newline at end of file + ^ self systemOrganizer sl2ClassesInCategory: category \ No newline at end of file diff --git a/packages/SwaLintBrowser.package/SL2TargetChooser.class/instance/initialize.st b/packages/SwaLintBrowser.package/SL2TargetChooser.class/instance/initialize.st index 0cf7cca..2f98909 100644 --- a/packages/SwaLintBrowser.package/SL2TargetChooser.class/instance/initialize.st +++ b/packages/SwaLintBrowser.package/SL2TargetChooser.class/instance/initialize.st @@ -4,4 +4,5 @@ initialize super initialize. self initializeWithSystemOrganizer: SystemOrganizer default. - accepted := false. \ No newline at end of file + accepted := false. + caches := IdentityDictionary new. \ No newline at end of file diff --git a/packages/SwaLintBrowser.package/SL2TargetChooser.class/instance/invertSelection..st b/packages/SwaLintBrowser.package/SL2TargetChooser.class/instance/invertSelection..st new file mode 100644 index 0000000..e7c0f27 --- /dev/null +++ b/packages/SwaLintBrowser.package/SL2TargetChooser.class/instance/invertSelection..st @@ -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}))). \ No newline at end of file diff --git a/packages/SwaLintBrowser.package/SL2TargetChooser.class/instance/listMenu.for..st b/packages/SwaLintBrowser.package/SL2TargetChooser.class/instance/listMenu.for..st new file mode 100644 index 0000000..1716479 --- /dev/null +++ b/packages/SwaLintBrowser.package/SL2TargetChooser.class/instance/listMenu.for..st @@ -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 \ No newline at end of file diff --git a/packages/SwaLintBrowser.package/SL2TargetChooser.class/instance/selectAll..st b/packages/SwaLintBrowser.package/SL2TargetChooser.class/instance/selectAll..st new file mode 100644 index 0000000..dceebba --- /dev/null +++ b/packages/SwaLintBrowser.package/SL2TargetChooser.class/instance/selectAll..st @@ -0,0 +1,6 @@ +actions +selectAll: selector + + self + perform: (#'selected{1}:' format: {selector capitalized}) + with: (self perform: (#'available{1}' format: {selector capitalized})). \ No newline at end of file diff --git a/packages/SwaLintBrowser.package/SL2TargetChooser.class/instance/selectNone..st b/packages/SwaLintBrowser.package/SL2TargetChooser.class/instance/selectNone..st new file mode 100644 index 0000000..da50c70 --- /dev/null +++ b/packages/SwaLintBrowser.package/SL2TargetChooser.class/instance/selectNone..st @@ -0,0 +1,6 @@ +actions +selectNone: selector + + self + perform: (#'selected{1}:' format: {selector capitalized}) asSymbol + with: #(). \ No newline at end of file diff --git a/packages/SwaLintBrowser.package/SL2TargetChooser.class/instance/selectedSystemCategories..st b/packages/SwaLintBrowser.package/SL2TargetChooser.class/instance/selectedSystemCategories..st new file mode 100644 index 0000000..a0ca89c --- /dev/null +++ b/packages/SwaLintBrowser.package/SL2TargetChooser.class/instance/selectedSystemCategories..st @@ -0,0 +1,8 @@ +accessing +selectedSystemCategories: categories + + self target systemCategories: categories. + + self changed: #selectedSystemCategories. + + self selectedClasses: (self selectedClasses intersection: self availableClasses). \ No newline at end of file diff --git a/packages/SwaLintBrowser.package/SL2TargetChooser.class/instance/systemCategory.select..st b/packages/SwaLintBrowser.package/SL2TargetChooser.class/instance/systemCategory.select..st index 5023141..e3a6ebf 100644 --- a/packages/SwaLintBrowser.package/SL2TargetChooser.class/instance/systemCategory.select..st +++ b/packages/SwaLintBrowser.package/SL2TargetChooser.class/instance/systemCategory.select..st @@ -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)]. \ No newline at end of file + aBoolean ifTrue: + [self selectedClasses: (self selectedClasses , (self classesInSystemCategory: category)) withoutDuplicates]. \ No newline at end of file diff --git a/packages/SwaLintBrowser.package/SL2TargetChooser.class/instance/systemCategoryMenu..st b/packages/SwaLintBrowser.package/SL2TargetChooser.class/instance/systemCategoryMenu..st new file mode 100644 index 0000000..a2578c6 --- /dev/null +++ b/packages/SwaLintBrowser.package/SL2TargetChooser.class/instance/systemCategoryMenu..st @@ -0,0 +1,4 @@ +menus +systemCategoryMenu: menu + + ^ self listMenu: menu for: #systemCategories \ No newline at end of file diff --git a/packages/SwaLintBrowser.package/SL2TargetChooser.class/methodProperties.json b/packages/SwaLintBrowser.package/SL2TargetChooser.class/methodProperties.json index f3e301c..c69e1b4 100644 --- a/packages/SwaLintBrowser.package/SL2TargetChooser.class/methodProperties.json +++ b/packages/SwaLintBrowser.package/SL2TargetChooser.class/methodProperties.json @@ -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", @@ -33,10 +34,14 @@ "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", @@ -44,10 +49,12 @@ "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", diff --git a/packages/SwaLintBrowser.package/Symbol.extension/instance/format..st b/packages/SwaLintBrowser.package/Symbol.extension/instance/format..st new file mode 100644 index 0000000..626266c --- /dev/null +++ b/packages/SwaLintBrowser.package/Symbol.extension/instance/format..st @@ -0,0 +1,4 @@ +*SwaLintBrowser-UI-formatting-pseudo-override +format: aCollection + + ^ (self asString format: aCollection) asSymbol \ No newline at end of file diff --git a/packages/SwaLintBrowser.package/Symbol.extension/methodProperties.json b/packages/SwaLintBrowser.package/Symbol.extension/methodProperties.json index c3087a6..048605b 100644 --- a/packages/SwaLintBrowser.package/Symbol.extension/methodProperties.json +++ b/packages/SwaLintBrowser.package/Symbol.extension/methodProperties.json @@ -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" } } diff --git a/packages/SwaLintBrowser.package/SystemOrganizer.extension/instance/sl2ClassesInCategory..st b/packages/SwaLintBrowser.package/SystemOrganizer.extension/instance/sl2ClassesInCategory..st new file mode 100644 index 0000000..042aec3 --- /dev/null +++ b/packages/SwaLintBrowser.package/SystemOrganizer.extension/instance/sl2ClassesInCategory..st @@ -0,0 +1,5 @@ +*SwaLintBrowser-Core-accessing +sl2ClassesInCategory: categoryName + + ^ (self listAtCategoryNamed: categoryName) + collect: [:className | self environment classNamed: className] \ No newline at end of file diff --git a/packages/SwaLintBrowser.package/SystemOrganizer.extension/methodProperties.json b/packages/SwaLintBrowser.package/SystemOrganizer.extension/methodProperties.json new file mode 100644 index 0000000..2935839 --- /dev/null +++ b/packages/SwaLintBrowser.package/SystemOrganizer.extension/methodProperties.json @@ -0,0 +1,5 @@ +{ + "class" : { + }, + "instance" : { + "sl2ClassesInCategory:" : "ct 12/22/2024 01:25" } } diff --git a/packages/SwaLintBrowser.package/SystemOrganizer.extension/properties.json b/packages/SwaLintBrowser.package/SystemOrganizer.extension/properties.json new file mode 100644 index 0000000..17470c9 --- /dev/null +++ b/packages/SwaLintBrowser.package/SystemOrganizer.extension/properties.json @@ -0,0 +1,2 @@ +{ + "name" : "SystemOrganizer" }