[up] [next]

Introduction

SystemBrowsers are the main tools for programming in Smalltalk; they allow you to both browse through the system, search for a method and to create, modify or remove classes and methods.

The standard System Browser consists of 5 major subviews; these components are:

[systemBrowser hardcopy]
An old screenshot the browser in "Motif" style.

  1. class category list
  2. class list
  3. class/instance toggle
  4. method category list
  5. method list
  6. code view

(the actual appearance of the Browser depends on the viewStyle setting; the picture above was taken with the "iris-style" in effect)

Notice:

This document describes the pre 2.10.4 systemBrowser. In later releases, additional views presenting the instance variables of the current class and for namespace selection have been added.
The menu items for variable-searches are now found in the variableLists popup menu.

Class Category List

Within the system, all classes are assigned to a class category, this category has NO semantic function of any kind, it is simply an attribute, to group classes for easier handling. (actually, beside the browser, there are not many uses of class categories.)

Once a class category is selected (by clicking on the entry in the class category list), the class list shows all classes belonging to that category.
The systemBrowser also offers two "special" categories: "* all *" which will display all classes and show them alphabetically, and "* hierarchy *" which also shows all classes, but indents them by inheritance as a tree.

Class List

Selecting a class in the class list, will show all method categories in the method category list.

Method Category (Protocol) List

Like class categories, method categories are only used for grouping related methods; typically, methods are categorized by function or effect. Like class categories, these have no semantic effect. Method categories are also often referred to as "protocols".

Selecting a method category will show all methods in that category. The special category "* all *" shows all methods in alphabetic order.

Method List

Finally, selecting a method in the method list will show the corresponding method's source code in the code view.
Notice that, if the classes source file has been removed, or is not accessible, the codeview will show the string "no source available".

Also keep in mind, that these lists (like all selection lists) respond to keyboard events: especially, alpha-keys (search for the next entry with that character), cursor UP/DOWN, page UP/DOWN, HOME and END-keys are useful for navigation.

For examples on typical uses of the browser, see the last section(s) of this document.

Class vs. Instance

The browser allows working on both a class and its metaclass (i.e. the classes class). Smalltalk beginners should keep in mind, that classes are objects like anything else in the system - thus the behavior of classes is described by another class (the so called metaclass). The set of messages understood by instances of a class is called instance protocol, while the set of messages understood by the class is called the class protocol.
Just like instances inherit protocol from the superclass(es), class protocol is inherited from the metaclasses superclass(es).

To switch, there are two toggle buttons named "class" and "instance".
Selecting "instance" (which is the default) makes your changes affect the class, while selecting "class" makes them affect the metaclass.

If you are not too familiar with this concept, try the "hierarchy" function of the class-lists popupMenu - especially take a careful look at this hierarchy when looking at the class protocol.

Starting an Application by double clicking on a class

For your convenience, a double click on a class, which is an application (i.e. subclass of ApplicationModel or a TopView application), can be started (opened) by double clicking on the class.
(actually, any class which returns true from the #isVisualStartable message can be started this way)

Of course, this performs the same as evaluating "className open" in a workspace.

Opening a tool by double clicking on a method

For selectors, which are marked as windowSpec, menuSpec or imageSpec methods, a corresponding editor application is opened on double-click.
That means, that a GUI-Painter is opened when you double-click a windowSpec method, or an imageEditor is opened when you double-click an imageSpec method.


Doc $Revision: 1.17 $ $Date: 2018/10/13 14:35:50 $