Chapter 7. Getting Started With the Browser

This chapter is designed to introduce you to the Browser, a facility accessed from the Static Analyzer for performing object-oriented queries. It tells you what you need to run the Browser, shows you how to start it, and presents a brief overview of its main window and menus. To see examples of the Browser, see Chapter 8, "Using the Browser for C++: A Sample Session," and Chapter 9, "Using the Browser for Ada: A Sample Session." If you need specific reference information on any part of the Browser's user interface, see Chapter 10, "The Browser Reference."

This chapter contains the following sections:

Starting Browser View

After you have created a fileset and built a static analysis database, you are ready to make object-oriented queries using the Browser. To access the Browser, open the Admin menu in the Static Analyzer and select "Browser." The Browser View window appears, along with a chooser window called Browsing Choices, as shown in Figure 7-1.

Figure 7-1. Browsing Choices Dialog Box

Figure 7-1 Browsing Choices Dialog Box

The Browsing Choices window lets you select an item from the fileset to be displayed in Browser View: either a class if you are using C++; or a package, task, or tagged type, if you are using Ada. The Browser View then displays detailed information on that item.

General Characteristics of the Browser

The Browser View window shows you the internal structure and relations of the item you select in a textual, outline format. You can also select components of the item and perform queries on them. The results to queries are highlighted in Browser View and can also be displayed in the Static Analyzer. Browser View can display the contents of C++ and Ada entities. This section describes the features of the Browser common to both languages. For the language-specific characteristics, see Chapter 8, "Using the Browser for C++: A Sample Session," and Chapter 9, "Using the Browser for Ada: A Sample Session."

Some features of the Browser are common to both the C++ and Ada versions. See Figure 7-2.

Figure 7-2. Browser View Features

Figure 7-2 Browser View Features

Browser View Outline Lists

The Browser displays its data in outline lists in two side-by-side panes in the Browser View window. The lists are in a hierarchical, expandable outline format organized by category. The left pane displays an individual entity and its internals; the right pane displays other items to which that entity is related. When you are looking at C++ code, Browser View displays individual classes and their members in the left pane, and related classes and members in the right pane. The Ada version displays individual packages and their components on the left, and related packages and components on the right.

Outline Icons

An outline icon is a diamond-shaped, concave icon. It appears to the left of component categories in the lists displayed in the Browser. An outline icon is used to expand or collapse a category. The icon contains an arrow pointing downward if the category is expanded (all items displayed) or to the right if the category is collapsed (all items hidden). Clicking the arrow switches back and forth between collapsing and expanding the category. A right-pointing outline icon that appears filled indicates that one or more of the hidden items satisfy the current query. Figure 7-3 illustrates these conditions.

Figure 7-3. Outline Icon Examples

Figure 7-3 Outline Icon Examples

Browser View Menus

Browser View provides these menus:

  • Admin menu—for general housekeeping

  • Views menu—for displaying relationships in a graphical format. You can request four variations of class graphs available based on these relationships:

    • inheritance, which describes the relationship of parent classes to derived classes (C++), and parent tagged types to derived tagged types (Ada).

    • containment, which describes the relationship of container classes to the classes they contain.

    • interaction, which describes the relationship of classes using methods of other classes.

    • friends, which describes the relationship of classes declaring other classes as friends.

    You can also request a call graph to view the relationships of selected methods or functions.

  • History menu—for going back to a previous Browser activity

  • Queries menu—for performing queries on the current item. (Note that you can also perform queries on a selected element in either pane by holding down the right mouse button. These popup queries menus have different selections depending on the type of element.)

  • Preference menu—for changing the appearance of the display and the behavior enacted by double-clicking with the mouse

Other Browser Window Features

The Current Subject field displays the name of the item you have selected. Its label indicates the kind of item being displayed. Note that the Current Subject field provides a form of file completion; if you enter the partial name of an item and then press the space bar, the name will be completed up to the point that a unique string can be found.

The Show in Static Analyzer toggle lets you display the results of any queries in the Static Analyzer window. the Static Analyzer shows more detail, including source information, than the Browser View does.

The Last Query button lets you display the result of the previous query to the Static Analyzer.

The Browser has annotated scroll bars. This means that when you perform a query, tick marks will appear in the scroll bars (if there are any) to indicate matching elements.