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

7.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 7.2 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:
    (capi:contain 
     (make-instance 'capi:push-button-panel 
                    :title "Test Buttons" 
                    :items '(:one :two :three)))
    

    The push button panel appears on your screen.

  2. With the Listener as the active window, choose Values > Class.

    This invokes the Class Browser on the button panel. The class capi:push-button-panel is described in the Class Browser.

    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 3.3.3 Using the Object operations with the clipboard for details.

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

7.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.

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 7.2.4 Description list.

7.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.

  1. Deselect the Include Inherited Slots button just above the Filter box to inhibit this listing.
  2. While still examining the capi:push-button-panel class, click Include Inherited Slots to deselect this option.

    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.

7.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:

    (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.

  2. Make the Listener window active and choose Values > Class to examine the class of the object in the Class Browser.
  3. Click the Slots tab in the Class Browser to switch to the Slots view.

    Suppose you are only interested in seeing the callbacks that can be defined in a list panel.

  4. Type callback in the Filter box.

    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 3.12 Filtering information.

7.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 3.14 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.

    The capi:button-panel class is described.

  2. Double-click on CAPI:PUSH-BUTTON-PANEL in the Subclasses list.

    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.

7.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 3.2 Setting preferences, and then select Class Browser in the list on the left side.

Setting Class Browser preferences

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

Unsorted
Displays items in the order they are defined in.
By Name
Sorts items alphabetically by name. This is the default setting.
By Package
Sorts items alphabetically by package name.

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


LispWorks IDE User Guide (Macintosh version) - 01 Dec 2021 19:36:23