All Manuals > LispWorks IDE User Guide > 8 The Class Browser

NextPrevUpTopContentsIndex

8.1 Simple use of the Class Browser

This section describes some of the basic ways in which you can use the Class Browser by giving some examples. If you wish, you can skip this section and look at the descriptions of each individual view: these start with Examining slot information.

When examining a class, the slot names of the class are displayed by default.

To examine a class, follow the instructions below:

  1. Create a push button panel by entering the following in the Listener:
  2. (capi:contain 
     (make-instance 'capi:push-button-panel 
                    :title "Test Buttons" 
                    :items '(:one :two :three)))

    The push button panel appears on your screen.

  3. With the Listener as the active window, choose Works > Values > Class .
  4. This invokes the Class Browser on the button panel. The class capi:push-button-panel is described in the Class Browser.

Figure 8.1 Examining classes in the Class Browser

Notice that, although you invoked the browser on an object that is an instance of a class, the class itself is described in the Class Browser. Similarly, if you had pasted the object into an Inspector, the instance of that object would be inspected. Using the environment, it is very easy to pass Common Lisp objects between different tools in this intelligent fashion. This behavior is achieved using the LispWorks IDE clipboard; see Using the Object operations with the clipboard for details.

See Performing operations on selected objects for a full description of the standard action commands available.

8.1.1 Examining slots

A list of the slots in the current class is printed in the Slots area. By selecting any slot, you can examine it in more detail in the Description area.

While still examining the capi:push-button-panel class, select any slot in the Slots area.

Figure 8.2 Description of a slot

A description of the slot is given in the Description area. For details about the information contained in this description, see Description list.

8.1.2 Examining inherited slots

By default, inherited slots (those slots which are defined in a superclass of the current class, rather than the current class itself) are listed in the Slots area along with the slots defined in the current class. Deselect the Include Inherited Slots button just above the Filter box to inhibit this listing.

  1. While still examining the capi:push-button-panel class, click Include Inherited Slots to deselect this option.
  2. No slots are displayed in the Slots area. This is because all the slots available to the capi:push-button-panel class are inherited from its superclasses. No slots are defined explicitly on the capi:push-button-panel class.

  3. Select Include Inherited Slots again, and then select a few slots in the Slot area in turn.

Notice that the slot description for each slot tells you which superclass the slot is defined on.

8.1.3 Filtering slot information

The Filter box can be used to filter out information about slots you are not interested in. This is especially useful if you are examining classes which contain a large number of slots.

The example below shows you how to create an instance of a CAPI object, and then limit the display in the Class Browser so that the only slots displayed are those you are interested in:

  1. In a Listener, create a button object by typing the following:
  2. (capi:contain (make-instance 'capi:list-panel
                                 :items '("Apple" "Orange" "Pear")))

    This creates a list panel object and displays it on your screen. The list panel object is the current value in the Listener.

  3. Make the Listener window active and choose Works > Values > Class to examine the class of the object in the Class Browser.
  4. Click the Slots tab in the Class Browser to switch to the Slots view.
  5. Suppose you are only interested in seeing the callbacks that can be defined in a list panel.

  6. Type callback in the Filter box.

Figure 8.3 Using filters to limit the display in the Class Browser

You can immediately see the types of callback that are available to CAPI list panel objects. See the CAPI User Guide and Reference Manual for details about these callbacks.

For more information about using filters, see Filtering information.

8.1.4 Examining other classes

There are two ways that you can examine other classes. The first is to type the name of the class you wish to see into the Class text box at the top of the browser. For long class names, you might find it useful to type just a few characters and then press Up or Down to invoke in-place completion. Press Return or click and the named class is described.

  1. While still examining class capi:list-panel, type capi:push-button-panel into the Class area.

The class capi:push-button-panel is described.

Because some class names may be potentially quite long, you can use completion to reduce typing. This allows you to select from a list of all class names which begin with the partial input you have entered. See Completion for detailed instructions. When you have entered the complete class name, click on to make this the class being described.

The second way to examine other classes is by using the Superclasses and Subclasses lists available in the hierarchy view. Click on the Hierarchy tab to display the hierarchy view.

The main part of the hierarchy view consists of two lists:

Double-click on any superclass or subclass of the current class to examine it.

  1. Double-click on CAPI:BUTTON-PANEL in the Superclasses list.
  2. The capi:button-panel class is described.

  3. Double-click on CAPI:PUSH-BUTTON-PANEL in the Subclasses list.
  4. The capi:push-button-panel class is described again.

So, using the Hierarchy tab, you can easily look through the related classes in a system.

8.1.5 Sorting information

As with many of the other tools in the LispWorks IDE, you can sort the items in any of the lists or graphs of the Class Browser using the Preferences dialog. Raise this dialog as described in Setting preferences, and then select Class Browser in the list on the left side.

Figure 8.4 Setting Class Browser preferences

Under the General tab, there are three options for sorting items, listed in the Sort panel.

For more information on sorting items, see Sorting items in views.


LispWorks IDE User Guide (Windows version) - 13 Sep 2017

NextPrevUpTopContentsIndex