[squeak-dev] The Trunk: Tools-fbs.310.mcz
commits at source.squeak.org
commits at source.squeak.org
Wed Apr 20 23:05:54 UTC 2011
Levente Uzonyi uploaded a new version of Tools to project The Trunk:
http://source.squeak.org/trunk/Tools-fbs.310.mcz
==================== Summary ====================
Name: Tools-fbs.310
Author: fbs
Time: 13 March 2011, 10:07:08.312 pm
UUID: 8a075873-ee8f-8848-bebc-e74296b9fd9a
Ancestors: Tools-fbs.308
Reuse Browser's hierarchy-flattening: it does the same job.
=============== Diff against Tools-fbs.308 ===============
Item was changed:
----- Method: Browser>>flattenHierarchyTree:on:indent: (in category 'class list') -----
flattenHierarchyTree: classHierarchy on: col indent: indent
+ ^ self
+ flattenHierarchyTree: classHierarchy
+ on: col
+ indent: indent
+ by: Character space.!
-
- | plusIndent |
- plusIndent := String space.
- classHierarchy do: [:assoc |
- | class childs |
- class := assoc key.
- col add: indent , class name.
- childs := assoc value.
- self
- flattenHierarchyTree: childs
- on: col
- indent: indent , plusIndent].
- ^ col!
Item was added:
+ ----- Method: Browser>>flattenHierarchyTree:on:indent:by: (in category 'class list') -----
+ flattenHierarchyTree: classHierarchy on: col indent: indent by: indentChars
+ "Recursively add to col the names in classHierarchy indenting to show the hierarchical relationship. Use indentChars to do the indenting: spaces, tabs, etc."
+ | plusIndent |
+ plusIndent := indentChars.
+ classHierarchy do: [:assoc |
+ | class childs |
+ class := assoc key.
+ col add: indent , class name.
+ childs := assoc value.
+ self
+ flattenHierarchyTree: childs
+ on: col
+ indent: indent , plusIndent
+ by: indentChars].
+ ^ col!
Item was changed:
----- Method: HierarchyBrowser>>initHierarchyForClass: (in category 'initialization') -----
initHierarchyForClass: aClassOrMetaClass
+ | index nonMetaClass |
- | index nonMetaClass tab |
centralClass := aClassOrMetaClass.
nonMetaClass := aClassOrMetaClass theNonMetaClass.
self systemOrganizer: SystemOrganization.
metaClassIndicated := aClassOrMetaClass isMeta.
classDisplayList := OrderedCollection new.
+ self
+ flattenHierarchyTree: (self createHierarchyTreeOf: (nonMetaClass allSuperclasses, { nonMetaClass }, nonMetaClass allSubclasses))
+ on: classDisplayList
+ indent: ''
+ by: ' '.
+
+ self flag: #todo. "Use #selectClass:"
+ index := nonMetaClass allSuperclasses size + 1. "Select nonMetaClass."
- tab := ''.
- nonMetaClass allSuperclasses reverseDo:
- [:aClass |
- classDisplayList add: tab , aClass name.
- tab := tab , ' '].
- index := classDisplayList size + 1.
- nonMetaClass allSubclassesWithLevelDo:
- [:aClass :level | | stab |
- stab := ''. 1 to: level do: [:i | stab := stab , ' '].
- classDisplayList add: tab , stab , aClass name]
- startingLevel: 0.
self classListIndex: index!
More information about the Squeak-dev
mailing list
|