Source Panel

Purpose

Features

Editing Commands

Source Panel

The file name and path of an open file are displayed in the Status line above the source panel, as well as read/write restrictions on the file. Comments in the source code are highlighted in blue, and keywords are highlighted in red. You can change the default colors by adding the following resources to the .Xdefaults file in your home directory:

codeForeground
commentForeground
keywordForeground

Working with Breakpoints

Use the Annotation Column on the left side of the Source panel to set and manage breakpoints. If a breakpoint has been set in a displayed file, the column to the left of the source code contains an icon to indicate the state of the breakpoint.

When a breakpoint is reached, the thread that encounters the breakpoint becomes the current thread, and all threads are suspended. The source where the breakpoint is set is displayed and highlighted in the Source panel.

If a current thread is suspended using the Suspend button, the source for the code being executed is displayed and highlighted in the Source panel.

Note: You cannot set breakpoints in, or step into, native (non-Java) methods.

Symbol Evaluation

During execution of your program, you can evaluate symbols in the Source panel. Select a symbol to evaluate it. If the symbol is in scope, the value appears next to the selected symbol in the Source panel. You can disable symbol evaluation by unchecking the Evaluate Selected Expression checkbox in the Preferences dialog (choose File > Preferences...).

Select a symbol and press the right mouse button to get a menu with the following options:

Menu Item Description
Popup Eval Evaluates the selected symbol and displays the results in a popup window over the Source panel. This is the default view presented as soon as you highlight the symbol.
Examine Displays the symbol being evaluated and the result of the evaluation in the Data card.
Show Class Displays the class that matches the selected symbol in the Query card.
List Declared Methods Displays all methods that match the selected symbol in the Query card.
Find Declared Variables Displays all variables that match the selected symbol in the Query card.

Copying the Source Panel

You can make a copy of the Source panel by choosing File > Clone Source Panel. If a file is displayed in the original panel when you make a copy, the file is also displayed in the copy of the panel. If no file is displayed, choose File > Open... in the copy to open a source file. The main Cosmo Code window status line is updated to show the name of the file that was opened in the copy of the window.

Annotation Column

Right-mouse-button Menu

Press the right mouse button to view a menu that displays the line number at the position of the cursor and offers the following options:

Menu Item Description
Continue to Line Continues execution to the location where the menu option is selected. For example, if a breakpoint is set at line 62 and you want to continue to line 85, press the right mouse button at line 85 and choose "Continue to Line" from the menu. Execution continues from line 62 to 85.
Enable Breakpoint Enables a disabled breakpoint. This option is active when the cursor is over an disabled breakpoint.
Disable Breakpoint Disables an active breakpoint. This option is active when the cursor is over an enabled breakpoint.
Delete Breakpoint Deletes a breakpoint. This option is active when the cursor is over a breakpoint.
Modify Breakpoint... Allows you to modify a breakpoint. The breakpoint you want to modify is displayed in the Breakpoint Dialog When you modify a breakpoint, you are actually deleting a breakpoint and creating another in its place. For example, if you have a breakpoint at line 32 in a file and you modify the line number to 35, this creates a new breakpoint at line 35 and deletes the breakpoint at line 32. This option is active when the cursor is over a breakpoint.
Create Breakpoint... Opens the Breakpoint Dialog and allows you to create a breakpoint.

Guide to the Cosmo Code Development Environment
12-96*273