Skip to content

Commit

Permalink
fix + refactor dialogs; reintroduce overview pyramid morph
Browse files Browse the repository at this point in the history
* use #containingWindow instead of preserving toolbuilder outputs
* fix multiselection by adding observer updates required in newer Squeak versions
* use accessors for more variables
* UIManager default -> Project uiManager
* dump descriptionCollection
  • Loading branch information
LinqLover committed Dec 20, 2024
1 parent 734db2d commit 7753372
Show file tree
Hide file tree
Showing 65 changed files with 245 additions and 261 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,9 @@ actions
autoLint

self runnable ifFalse: [^ self].
SLTestAutoRunner on: classesSelected with: testsSelected calledBy: (self dependents first) reopens: self.
SLTestAutoRunner
on: self classesSelected
with: self testsSelected
calledBy: self containingWindow
reopens: self.
self close.
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,4 @@ buildWith: aBuilder
self testsFrame -> [self buildTestListWith: aBuilder].
}.

window := aBuilder build: windowSpec.
^window
^ aBuilder build: windowSpec
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
accessing
categoriesSelected: aSet

categoriesSelected := aSet.
self changed: #categoriesSelected; updateClasses.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
accessing
categoriesSelected

^ categoriesSelected
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
accessing-categories
categoryAt: anIndex

^ categoriesSelected includes: (self categories at: anIndex ifAbsent: [ ^ false ])
^ self categoriesSelected includes:
(self categories at: anIndex ifAbsent: [ ^ false ])
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
accessing-categories
categoryAt: anInteger put: aBoolean

| target |
target := self categories at: anInteger ifAbsent: [^ self].
self selectByCategory
ifTrue: [categoriesSelected := aBoolean
ifTrue: [ categoriesSelected copyWith: target ]
ifFalse: [ categoriesSelected copyWithout: target ]]
ifFalse: [| categoryList package |
package := self environment packageForCategory: target.
categoryList := self getCategoriesFor: package.
categoriesSelected := aBoolean
ifTrue: [ categoriesSelected, categoryList ]
ifFalse: [ categoriesSelected copyWithoutAll: categoryList ]].
self changed: #categorySelected; updateClasses.
self categoriesSelected:
(self selectByCategory
ifTrue: [aBoolean
ifTrue: [ self categoriesSelected copyWith: target ]
ifFalse: [ self categoriesSelected copyWithout: target ]]
ifFalse: [| categoryList package |
package := self environment packageForCategory: target.
categoryList := self getCategoriesFor: package.
aBoolean
ifTrue: [ self categoriesSelected, categoryList ]
ifFalse: [ self categoriesSelected copyWithoutAll: categoryList ]]).
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
accessing-classes
classAt: anInteger

^ classesSelected includes: (classes at: anInteger ifAbsent: [ ^ false ])
^ self classesSelected includes:
(self classes at: anInteger ifAbsent: [ ^ false ])
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
accessing-classes
classAt: anInteger put: aBoolean

classesSelected := classesSelected
perform: (aBoolean ifTrue: [ #copyWith: ] ifFalse: [ #copyWithout: ])
with: (classes at: anInteger ifAbsent: [ ^ self ]).
self changed: #classSelected; changed: #runnable.
| target |
target := self classes at: anInteger ifAbsent: [ ^ self ].
self classesSelected:
(self classesSelected
perform: (aBoolean ifTrue: [ #copyWith: ] ifFalse: [ #copyWithout: ])
with: target).
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
accessing
classesSelected

^ classesSelected
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
accessing-categories
filterCategories

| pattern |
pattern := UIManager default
pattern := Project uiManager
request: 'Pattern(s) to select categories:\ (separate patterns with '';'')' withCRs
initialAnswer: (categoryPattern ifNil: ['*']).
(pattern isNil or: [pattern isEmpty]) ifTrue:
[^self].
categoriesSelected := ((categoryPattern := pattern) subStrings: ';')
inject: Set new
into: [:matches :subPattern|
matches
addAll: (self categories select: [ :each | subPattern match: each]);
yourself].
self changed: #categorySelected; update.
self categoriesSelected:
(((categoryPattern := pattern) subStrings: ';')
inject: Set new
into: [:matches :subPattern|
matches
addAll: (self categories select: [ :each | subPattern match: each]);
yourself]).
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
accessing-classes
filterClasses

| pattern |
pattern := UIManager default
pattern := Project uiManager
request: 'Pattern(s) to select tests:\ (separate patterns with '';'')' withCRs
initialAnswer: (classPattern ifNil: ['*']).
(pattern isNil or: [pattern isEmpty]) ifTrue:
[^self].
classesSelected := ((classPattern := pattern) subStrings: ';')
inject: Set new
into: [:matches :subPattern|
matches
addAll: (classes select: [ :each | subPattern match: each name]);
yourself].
self
changed: #classSelected;
changed: #runnable;
update.
self classesSelected:
(((classPattern := pattern) subStrings: ';')
inject: Set new
into: [:matches :subPattern|
matches
addAll: (self classes select: [ :each | subPattern match: each name]);
yourself]).
self update.
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,10 @@ filterTestCategories
initialAnswer: (testCategoryPattern ifNil: ['*']).
(pattern isNil or: [pattern isEmpty]) ifTrue:
[^self].
testCategoriesSelected := ((testCategoryPattern := pattern) subStrings: ';')
self testCategoriesSelected:
(((testCategoryPattern := pattern) subStrings: ';')
inject: Set new
into: [:matches :subPattern|
matches
addAll: (self testCategories select: [ :each | subPattern match: each name]);
yourself].
self
changed: #testCategorySelected;
update.
yourself]).
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
accessing-test
filterTests

| pattern |
pattern := UIManager default
pattern := Project uiManager
request: 'Pattern(s) to select tests:\ (separate patterns with '';'')' withCRs
initialAnswer: (testPattern ifNil: ['*']).
(pattern isNil or: [pattern isEmpty]) ifTrue:
[^self].
testsSelected := ((testPattern := pattern) subStrings: ';')
inject: Set new
into: [:matches :subPattern|
matches
addAll: (tests select: [ :each | subPattern match: each name]);
yourself].
self
changed: #testSelected;
changed: #runnable;
update.
self testsSelected:
(((testPattern := pattern) subStrings: ';')
inject: Set new
into: [:matches :subPattern|
matches
addAll: (self tests select: [ :each | subPattern match: each name]);
yourself]).
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
updating
findClassesForSelectedCategories
| items |
categoriesSelected isEmpty ifTrue: [ ^ OrderedCollection new ].
items := categoriesSelected gather: [ :category |
self categoriesSelected isEmpty ifTrue: [ ^ OrderedCollection new ].
items := self categoriesSelected gather: [ :category |
((Smalltalk organization listAtCategoryNamed: category)
collect: [ :each | Smalltalk at: each ])].
^ items asOrderedCollection
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
updating
findTestsForSelectedTestCategories
| items |
testCategoriesSelected isEmpty ifTrue: [ ^ OrderedCollection new ].
items := testCategoriesSelected gather: [ :category | environment testsAtCategory: category ].
self testCategoriesSelected ifEmpty: [ ^ OrderedCollection new ].
items := self testCategoriesSelected gather: [ :category | self environment testsAtCategory: category ].
^ items asOrderedCollection
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,4 @@ initializeInstanceVariables
classes := OrderedCollection new.
tests := OrderedCollection new.
testIndex := 0.
selectByCategory := true.
descriptionCollection := OrderedCollection new.
selectByCategory := true.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ actions
run

self runnable ifFalse: [^ self].
self environment selectedTests: testsSelected.
self environment selectedClasses: classesSelected.
self environment selectedTests: self testsSelected.
self environment selectedClasses: self classesSelected.
SLResultDialog onEnvironment:
(SLTestRunner onEnvironment: self environment).
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
actions
runnable

^ classesSelected notEmpty and: [testsSelected notEmpty]
^ self classesSelected notEmpty and: [self testsSelected notEmpty]
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
accessing-categories
selectAllCategories

categoriesSelected := self categories asSet.
self changed: #categorySelected; update.
self categoriesSelected: self categories asSet.
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,5 @@ selectAllClasses
"Fixed to update all selections now that the
selection invalidation has been optimised."

classesSelected := classes asSet.
self
changed: #classSelected;
changed: #runnable;
update.
self classesSelected: self classes asSet.
self update.
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
accessing-testCategories
selectAllTestCategories

testCategoriesSelected := self testCategories asSet.
self changed: #testCategorySelected; update.
self testCategoriesSelected: self testCategories asSet.
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
accessing-test
selectAllTests
"Fixed to update all selections now that the
selection invalidation has been optimised."

testsSelected := tests asSet.
self
changed: #testSelected;
changed: #runnable;
update.
self testsSelected: self tests asSet.
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
accessing-categories
selectInverseCategories

categoriesSelected := self categories asSet
removeAll: categoriesSelected;
yourself.
self changed: #allSelections; changed: #categorySelected; update.
self categoriesSelected:
(self categories asSet
removeAll: self categoriesSelected;
yourself).
self changed: #allSelections.
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
accessing-classes
selectInverseClasses
"Fixed to update all selections now that the
selection invalidation has been optimised."

classesSelected := classes asSet
removeAll: classesSelected;
yourself.
self
changed: #classSelected;
changed: #runnable;
update.

self classesSelected:
(self classes asSet
removeAll: classesSelected;
yourself).
self update.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
accessing-testCategories
selectInverseTestCategories

testCategoriesSelected := self testCategories asSet
removeAll: testCategoriesSelected;
yourself.
self changed: #testCategorySelected; update.
self testCategoriesSelected:
(self testCategories asSet
removeAll: self testCategoriesSelected;
yourself).
Original file line number Diff line number Diff line change
@@ -1,15 +1,7 @@
accessing-test
selectInverseTests
"Fixed to update all selections now that the
selection invalidation has been optimised."

testsSelected := tests asSet
removeAll: testsSelected;
yourself.
descriptionCollection := OrderedCollection new
addAll: testsSelected;
yourself.
self
changed: #testSelected;
changed: #runnable;
update.
self testsSelected:
(self tests asSet
removeAll: self testsSelected;
yourself).
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
accessing-categories
selectNoCategories

categoriesSelected := Set new.
self changed: #allSelections; changed: #categorySelected; update.
self categoriesSelected: Set new.
self changed: #allSelections.
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
accessing-testCategories
selectNoTestCategories

testCategoriesSelected := Set new.
self changed: #testCategorySelected; update.
self testCategoriesSelected: Set new.
Loading

0 comments on commit 7753372

Please sign in to comment.