Squeak class hierarchy
Last updated at 2:12 pm UTC on 18 April 2004
This was one of my first questions as well, so I bet other newbies wonder this too. –WilliamBarnettLewis
Ken G. Brown asked in the Squeak Mailing list: "Is there an easy way to post an indented listing of the complete Squeak class structure to a file for printing? I feel it would be helpful to see a short form of all that is available in the environment and how it is organized."
Hierarchy in the System Browser
- Open up a "System Browser",
- select "Kernel-Objects",
- select class Object,
- pop up the menu and select "hierarchy". This will create exactly what you want.
- To get it to a file, scroll to the end of the text, place mouse pointer after all the text and double-click. This selects all the hierarchy text, which you can then copy-and-paste to your favorite text editor.
Hierarchy text file with a script
If you want to do this in a more direct and less GUI based fashion, evaluate: (FileStream newFileNamed: 'hierarchySqueak2.4.txt') nextPutAll: Object printHierarchy; close
To automatically generate a separate fileout file for a class and for each of its subclasses:anyClassNameHere withAllSubclassesDo: [:aClass | aClass fileOut]
I would think twice about doing this with Object though - you will get a load of files. :-)
Fileout of all classes in a category
On a related note, to automatically generate a file out of classes in a catagory, do:SystemOrganization fileOutCategory: 'CatagoryName'.
You can also use the following to get a crude version of HTML output (see below for a better solution):SystemOrganization fileOutCategory: 'BrickGame' asHtml: true.
It would be quite easy to print each Class in a catagory as a seperate file, but this is left as an exercise for the reader.
Generating HTML documentation from classes or class hierarchy