A new version of Tools was added to project The Inbox:
http://source.squeak.org/inbox/Tools-fbs.308.mcz ==================== Summary ==================== Name: Tools-fbs.308 Author: fbs Time: 9 March 2011, 12:52:17.982 pm UUID: a4a01eda-1384-3544-901c-ab17b8875fc4 Ancestors: Tools-fbs.307 Renamed HierarchyBrowser's classList instvar to classDisplayList - the name was confusing because this list and self classList contained _similar_ but not identical data, namely that the instvar used spaces to indicate the subclass relationships between classes. Class comment added to indicate same. =============== Diff against Tools-fbs.307 =============== Item was changed: ----- Method: ClassListBrowser>>initForClassesNamed:title: (in category 'initialization') ----- initForClassesNamed: nameList title: aTitle "Initialize the receiver for the class-name-list and title provided" self systemOrganizer: SystemOrganization. metaClassIndicated := false. defaultTitle := aTitle. + classDisplayList := nameList copy. - classList := nameList copy. self class openBrowserView: (self openSystemCatEditString: nil) label: aTitle "ClassListBrowser new initForClassesNamed: #(Browser CategoryViewer) title: 'Frogs'"! Item was changed: Browser subclass: #HierarchyBrowser + instanceVariableNames: 'classDisplayList centralClass' - instanceVariableNames: 'classList centralClass' classVariableNames: '' poolDictionaries: '' category: 'Tools-Browser'! + + !HierarchyBrowser commentStamp: 'fbs 3/9/2011 12:02' prior: 0! + I provide facilities to explore classes in the context of their subclass hierarchy. + + My classDisplayList instvar uses indentation to show the subclassing relationship between the displayed classes. + ! Item was changed: ----- Method: HierarchyBrowser>>classList (in category 'class list') ----- classList + classDisplayList := classDisplayList select: [:each | Smalltalk includesKey: each withBlanksTrimmed asSymbol]. + ^ classDisplayList! - classList := classList select: [:each | Smalltalk includesKey: each withBlanksTrimmed asSymbol]. - ^ classList! Item was changed: ----- Method: HierarchyBrowser>>classListIndex: (in category 'initialization') ----- classListIndex: newIndex "Cause system organization to reflect appropriate category" | newClassName ind | newIndex ~= 0 ifTrue: + [newClassName := (classDisplayList at: newIndex) copyWithout: $ . - [newClassName := (classList at: newIndex) copyWithout: $ . selectedSystemCategory := (systemOrganizer categories at: (systemOrganizer numberOfCategoryOfElement: newClassName))]. ind := super classListIndex: newIndex. self changed: #systemCategorySingleton. ^ ind! Item was changed: ----- Method: HierarchyBrowser>>initAlphabeticListing (in category 'initialization') ----- initAlphabeticListing | tab stab index | self systemOrganizer: SystemOrganization. metaClassIndicated := false. + classDisplayList := Smalltalk classNames.! - classList := Smalltalk classNames.! Item was changed: ----- Method: HierarchyBrowser>>initHierarchyForClass: (in category 'initialization') ----- initHierarchyForClass: aClassOrMetaClass | index nonMetaClass tab | centralClass := aClassOrMetaClass. nonMetaClass := aClassOrMetaClass theNonMetaClass. self systemOrganizer: SystemOrganization. metaClassIndicated := aClassOrMetaClass isMeta. + classDisplayList := OrderedCollection new. - classList := OrderedCollection new. tab := ''. nonMetaClass allSuperclasses reverseDo: [:aClass | + classDisplayList add: tab , aClass name. - classList add: tab , aClass name. tab := tab , ' ']. + index := classDisplayList size + 1. - index := classList size + 1. nonMetaClass allSubclassesWithLevelDo: [:aClass :level | | stab | stab := ''. 1 to: level do: [:i | stab := stab , ' ']. + classDisplayList add: tab , stab , aClass name] - classList add: tab , stab , aClass name] startingLevel: 0. self classListIndex: index! |
Free forum by Nabble | Edit this page |