Tools_HierarchicalClassCategoryList.st
changeset 12703 f29ee6d1349e
parent 10350 2e6715c12e41
child 14019 bf03aea592f9
equal deleted inserted replaced
12702:2759bbb8d06b 12703:f29ee6d1349e
   157 addCategory:category
   157 addCategory:category
   158     |item path parentPath parentCategory parentItem|
   158     |item path parentPath parentCategory parentItem|
   159 
   159 
   160     item:= categoryToItemDictionary at:category ifAbsent:nil.
   160     item:= categoryToItemDictionary at:category ifAbsent:nil.
   161     item isNil ifTrue:[
   161     item isNil ifTrue:[
   162 	path := category asCollectionOfSubstringsSeparatedBy:$-.
   162         path := category asCollectionOfSubstringsSeparatedBy:$-.
   163 
   163 
   164 	item := ClassCategoryItem new.
   164         item := ClassCategoryItem new.
   165 	item category:category.
   165         item category:category.
   166 	item label:(path last).
   166         item label:(path last).
   167 	categoryToItemDictionary at:category put:item.
   167         categoryToItemDictionary at:category put:item.
   168 
   168 
   169 	category size > 0 ifTrue:[
   169         category size > 0 ifTrue:[
   170 	    "/ find the parent ...
   170             "/ find the parent ...
   171 	    parentPath := path copyWithoutLast:1.
   171             parentPath := path copyButLast:1.
   172 	    parentCategory := parentPath asStringWith:$-.
   172             parentCategory := parentPath asStringWith:$-.
   173 
   173 
   174 	    parentItem := self addCategory:parentCategory .
   174             parentItem := self addCategory:parentCategory .
   175 
   175 
   176 	    parentItem add:item sortBlock:[:i1 :i2 | i1 category asLowercase < i2 category asLowercase].
   176             parentItem add:item sortBlock:[:i1 :i2 | i1 category asLowercase < i2 category asLowercase].
   177 	]
   177         ]
   178     ].
   178     ].
   179     ^ item
   179     ^ item
   180 !
   180 !
   181 
   181 
   182 generateHierarchicalCategoryTree
   182 generateHierarchicalCategoryTree
   400 ! !
   400 ! !
   401 
   401 
   402 !HierarchicalClassCategoryList class methodsFor:'documentation'!
   402 !HierarchicalClassCategoryList class methodsFor:'documentation'!
   403 
   403 
   404 version
   404 version
   405     ^ '$Header: /cvs/stx/stx/libtool/Tools_HierarchicalClassCategoryList.st,v 1.9 2011-07-20 12:54:09 cg Exp $'
   405     ^ '$Header: /cvs/stx/stx/libtool/Tools_HierarchicalClassCategoryList.st,v 1.10 2013-04-25 13:10:14 stefan Exp $'
   406 !
   406 !
   407 
   407 
   408 version_CVS
   408 version_CVS
   409     ^ '$Header: /cvs/stx/stx/libtool/Tools_HierarchicalClassCategoryList.st,v 1.9 2011-07-20 12:54:09 cg Exp $'
   409     ^ '$Header: /cvs/stx/stx/libtool/Tools_HierarchicalClassCategoryList.st,v 1.10 2013-04-25 13:10:14 stefan Exp $'
   410 ! !
   410 ! !
       
   411