Searching for Declarations of and References to a Program Element

To find declarations of or references to any program element in code in the workspace, use the Search dialog.  Launch the Search dialog box by clicking the Search button searchup.gif (1077 bytes) on the toolbar, or by selecting Search from the Workspace menu.

In the Search dialog box, specify the following criteria:

  1. Search string - If a program element was selected in the browser before you launched the search, its name will be inserted into this field by default.   Use the default name, or type over it to Indicate the name or part of the name of the element you want to find.  Use the asterisk (*) wildcard character to represent any number of characters in the string.
  2. Element - Indicate the type of program element you want to find.  If you select Type, for example, it searches classes and interfaces with the name pattern given in the Search string field. 
  3. Scope - Indicate the scope of code searched.  If you select Hierarchy, for example, it searches the superclasses and subclasses of the selected class.  If you select Text element, Workspace searches can be extremely slow. Searches limited to Project or
    Package will be much faster.
  4. Usage - Indicate whether you want to search for references or declarations, or both.

Click Start to start the search.  The number of occurrences found are shown as the search runs.  Click Stop to halt the search and pass any results on to the Search Results window.  Click Cancel to cancel the search without reporting any found occurrences.

The results of the search, if any occurrences were found, are added to the Search Results window, which also lists the results of previous searches.  The Description pane lists all the searches run in this session.  If you select one of the searches, the Results pane shows the list of elements in which the declarations or references are made for the selected search.  If you select one of the elements, the Source pane displays the program element's source code, with the first declaration or reference highlighted.

You can re-run the search from the Search Results window to update the list of occurrences as the workspace changes.

ngrelc.gif (533 bytes)
Workspace
Repository
Projects and Other Program Elements

ngrelt.gif (466 bytes)
Searching for a Program Element in the Workspace
Searching for a Program Element in the Repository
Searching for Text in a Source Pane