Discussion:
The Trunk: Tools-pre.835.mcz
(too old to reply)
c***@source.squeak.org
0000-12-04 09:41:42 UTC
Permalink
Patrick Rein uploaded a new version of Tools to project The Trunk:
http://source.squeak.org/trunk/Tools-pre.835.mcz

==================== Summary ====================

Name: Tools-pre.835
Author: pre
Time: 3 December 2018, 10:41:37.808597 am
UUID: 41d6096e-dc6a-e14e-a821-8a68d70f1098
Ancestors: Tools-pre.834

Pushes the refactoring of FileCOntentsBrowser instance creation methods further to eliminate all duplicate code.

=============== Diff against Tools-pre.834 ===============

Item was changed:
----- Method: FileContentsBrowser class>>browseFiles: (in category 'instance creation') -----
browseFiles: fileList
"Open a browser on the packages found within the files in the list; we expect the list to contain acceptable filename strings.
If there is more than one package found the browser will be a full system browser, otherwise it will be a category browser"
+ ^ (self createBrowserForPackagesFrom: fileList withEach: [:fileName |
+ FilePackage fromFileNamed: fileName]) buildAndOpenBrowser
- | browser organizerAndPackageDict |
- Cursor wait showWhile: [
- organizerAndPackageDict := self buildOrganizerWithPackagesFrom: fileList withEach: [:fileName |
- FilePackage fromFileNamed: fileName].
- (browser := self systemOrganizer: organizerAndPackageDict first)
- packages: organizerAndPackageDict second].
- ^ browser buildAndOpenBrowser
!

Item was removed:
- ----- Method: FileContentsBrowser class>>buildOrganizerWithPackagesFrom:withEach: (in category 'private') -----
- buildOrganizerWithPackagesFrom: collectionOfPackageSources withEach: filePackageCreation
-
- | organizer packageDict |
- packageDict := Dictionary new.
- organizer := SystemOrganizer defaultList: Array new.
-
- collectionOfPackageSources do: [:src | | package |
- package := filePackageCreation value: src.
- packageDict
- at: package packageName
- put: package.
- organizer
- classifyAll: package classes keys
- under: package packageName].
-
- ^ {organizer . packageDict}!

Item was added:
+ ----- Method: FileContentsBrowser class>>createBrowserForPackagesFrom:withEach: (in category 'private') -----
+ createBrowserForPackagesFrom: collectionOfPackageSources withEach: filePackageCreation
+
+ | browser packageDict organizer |
+ Cursor wait showWhile: [
+ browser := self new.
+ packageDict := Dictionary new.
+ organizer := SystemOrganizer defaultList: Array new.
+
+ collectionOfPackageSources do: [:src | | package |
+ package := filePackageCreation value: src.
+ packageDict
+ at: package packageName
+ put: package.
+ organizer
+ classifyAll: package classes keys
+ under: package packageName].
+
+ (browser := self systemOrganizer: organizer)
+ packages: packageDict].
+ ^ browser!

Item was changed:
----- Method: FileContentsBrowser class>>createBrowserForStream:named: (in category 'private') -----
createBrowserForStream: aStream named: aString

+ ^ self createBrowserForPackagesFrom: {aStream} withEach: [:stream |
+ (FilePackage new fullName: aString; fileInFrom: aStream)]!
- | browser organizerAndPackageDict |
- Cursor wait showWhile: [
- browser := self new.
- organizerAndPackageDict := self buildOrganizerWithPackagesFrom: {aStream} withEach: [:stream |
- (FilePackage new fullName: aString; fileInFrom: aStream)].
- (browser := self systemOrganizer: organizerAndPackageDict first)
- packages: organizerAndPackageDict second

Loading...