Tools__VariableList.st
changeset 10550 a57b8a71a061
parent 10495 756e95b937cb
child 10871 f3a06b214071
equal deleted inserted replaced
10549:1f387878f9c6 10550:a57b8a71a061
   492     "Modified: / 12-04-2011 / 21:36:33 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   492     "Modified: / 12-04-2011 / 21:36:33 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   493 !
   493 !
   494 
   494 
   495 listOfVariables
   495 listOfVariables
   496     |nameList numClasses classes class commonSubclass showingClassVars
   496     |nameList numClasses classes class commonSubclass showingClassVars
   497      sortByName|
   497      sortByName classesAlreadyProcessed|
   498 
   498 
   499     classHolder isNil ifTrue:[
   499     classHolder isNil ifTrue:[
   500         "/ testing
   500         "/ testing
   501         ^ #()
   501         ^ #()
   502     ].
   502     ].
   519 
   519 
   520     numClasses > 1 ifTrue:[
   520     numClasses > 1 ifTrue:[
   521         "/ multiple classes - sort alphabetically ...
   521         "/ multiple classes - sort alphabetically ...
   522         "/ unless there is a common subclass ...
   522         "/ unless there is a common subclass ...
   523         nameList := Set new.
   523         nameList := Set new.
       
   524         classesAlreadyProcessed := IdentitySet new.
   524         classes do:[:class |
   525         classes do:[:class |
   525             showingClassVars ifTrue:[
   526             (classesAlreadyProcessed includes:class) ifFalse:[
   526                 self showingInheritedClassVars ifTrue:[
   527                 showingClassVars ifTrue:[
   527                     class theNonMetaclass withAllSuperclassesDo:[:cls|
   528                     self showingInheritedClassVars ifTrue:[
       
   529                         class theNonMetaclass withAllSuperclassesDo:[:cls|
       
   530                             (classesAlreadyProcessed includes:cls) ifFalse:[
       
   531                                 nameList addAll:
       
   532                                     (cls classVarNames collect:[:nm|self listEntryForClass: cls name: nm]).
       
   533                                 classesAlreadyProcessed add:cls.
       
   534                             ]
       
   535                         ]
       
   536                     ] ifFalse:[
   528                         nameList addAll:
   537                         nameList addAll:
   529                             (cls classVarNames collect:[:nm|self listEntryForClass: cls name: nm])
   538                             (class classVarNames collect:[:nm|self listEntryForClass: class name: nm])                            
   530                     ]
   539                     ]
   531                 ] ifFalse:[
   540                 ] ifFalse:[
   532                     nameList addAll:
   541                     class withAllSuperclassesDo:[:cls|
   533                         (class classVarNames collect:[:nm|self listEntryForClass: class name: nm])                            
   542                         (classesAlreadyProcessed includes:cls) ifFalse:[
   534                 ]
   543                             nameList addAll:
   535             ] ifFalse:[
   544                                     (cls classVarNames collect:[:nm|self listEntryForClass: cls name: nm]).                            
   536                 class withAllSuperclassesDo:[:cls|
   545                             classesAlreadyProcessed add:cls.
   537                     nameList addAll:
   546                         ]
   538                                 (cls classVarNames collect:[:nm|self listEntryForClass: cls name: nm])                            
   547                     ]
   539                 ]
   548                 ]
   540             ]
   549             ]
   541         ].
   550         ].
   542         nameList := nameList asOrderedCollection.
   551         nameList := nameList asOrderedCollection.
   543     ] ifFalse:[
   552     ] ifFalse:[
   567         nameList := nameList asSortedCollection:[:a :b|a name < b name].
   576         nameList := nameList asSortedCollection:[:a :b|a name < b name].
   568     ].
   577     ].
   569     ^ nameList
   578     ^ nameList
   570 
   579 
   571     "Created: / 05-02-2000 / 13:42:11 / cg"
   580     "Created: / 05-02-2000 / 13:42:11 / cg"
   572     "Modified: / 26-02-2000 / 01:05:36 / cg"
       
   573     "Modified: / 28-04-2011 / 13:18:56 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   581     "Modified: / 28-04-2011 / 13:18:56 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
   582     "Modified: / 08-08-2011 / 16:20:58 / cg"
   574 !
   583 !
   575 
   584 
   576 postBuildWith:aBuilder
   585 postBuildWith:aBuilder
   577     |listView|
   586     |listView|
   578 
   587 
   718 ! !
   727 ! !
   719 
   728 
   720 !VariableList class methodsFor:'documentation'!
   729 !VariableList class methodsFor:'documentation'!
   721 
   730 
   722 version_CVS
   731 version_CVS
   723     ^ '$Header: /cvs/stx/stx/libtool/Tools__VariableList.st,v 1.11 2011-08-05 11:35:48 vrany Exp $'
   732     ^ '$Header: /cvs/stx/stx/libtool/Tools__VariableList.st,v 1.12 2011-08-08 16:28:30 cg Exp $'
   724 ! !
   733 ! !