Metaclass.st
changeset 8277 357428ca03c5
parent 8228 cd5c696619a3
child 8551 de314b9f8fa3
equal deleted inserted replaced
8276:9720407471d6 8277:357428ca03c5
   539     "Created: / 4.1.1997 / 20:38:16 / cg"
   539     "Created: / 4.1.1997 / 20:38:16 / cg"
   540     "Modified: / 8.8.1997 / 10:59:50 / cg"
   540     "Modified: / 8.8.1997 / 10:59:50 / cg"
   541     "Modified: / 18.3.1999 / 18:15:46 / stefan"
   541     "Modified: / 18.3.1999 / 18:15:46 / stefan"
   542 !
   542 !
   543 
   543 
       
   544 fileOutClassInstVarDefinitionOn:aStream withNameSpace:withNameSpace
       
   545     "append an expression to define my classInstanceVariables on aStream"
       
   546 
       
   547     |anySuperClassInstVar|
       
   548 
       
   549     myClass isLoaded ifFalse:[
       
   550         ^ myClass basicFileOutDefinitionOn:aStream withNameSpace:withNameSpace
       
   551     ].
       
   552 
       
   553     withNameSpace ifTrue:[
       
   554         myClass name printOn:aStream.
       
   555     ] ifFalse:[
       
   556         myClass printClassNameOn:aStream.
       
   557     ].
       
   558     aStream nextPutAll:' class instanceVariableNames:'''.
       
   559     self printInstVarNamesOn:aStream indent:8.
       
   560     aStream nextPutAll:''''.
       
   561 
       
   562     "mhmh - good idea; saw this in SmallDraw sourcecode ..."
       
   563 
       
   564     anySuperClassInstVar := false.
       
   565     myClass allSuperclassesDo:[:aSuperClass |
       
   566         aSuperClass class instVarNames do:[:ignored | anySuperClassInstVar := true].
       
   567     ].
       
   568 
       
   569     aStream cr; cr; nextPut:(Character doubleQuote); cr; space.
       
   570     anySuperClassInstVar ifFalse:[
       
   571         aStream  
       
   572             nextPutLine:'No other class instance variables are inherited by this class.'.
       
   573     ] ifTrue:[
       
   574         aStream  
       
   575             nextPutLine:'The following class instance variables are inherited by this class:'.
       
   576         aStream cr.
       
   577         myClass allSuperclassesDo:[:aSuperClass |
       
   578             aStream tab; nextPutAll:aSuperClass name; nextPutAll:' - '.
       
   579             aStream nextPutLine:(aSuperClass class instanceVariableString).
       
   580         ].
       
   581 
       
   582     ].
       
   583     aStream nextPut:(Character doubleQuote); cr.
       
   584 
       
   585     "Created: / 10.12.1995 / 16:31:25 / cg"
       
   586     "Modified: / 1.4.1997 / 16:00:33 / stefan"
       
   587     "Modified: / 3.2.2000 / 23:05:28 / cg"
       
   588 !
       
   589 
   544 fileOutDefinitionOn:aStream
   590 fileOutDefinitionOn:aStream
   545     myClass fileOutClassInstVarDefinitionOn:aStream
   591     myClass fileOutClassInstVarDefinitionOn:aStream
   546 
   592 
   547     "Modified: / 21.6.1998 / 04:10:02 / cg"
   593     "Modified: / 21.6.1998 / 04:10:02 / cg"
   548 !
   594 !
   741 ! !
   787 ! !
   742 
   788 
   743 !Metaclass class methodsFor:'documentation'!
   789 !Metaclass class methodsFor:'documentation'!
   744 
   790 
   745 version
   791 version
   746     ^ '$Header: /cvs/stx/stx/libbasic/Metaclass.st,v 1.188 2004-03-19 08:17:11 ca Exp $'
   792     ^ '$Header: /cvs/stx/stx/libbasic/Metaclass.st,v 1.189 2004-03-30 18:53:26 cg Exp $'
   747 ! !
   793 ! !
   748 
   794 
   749 Metaclass initialize!
   795 Metaclass initialize!