In this section, you will search the workbench for Java elements.
In the Search dialog, you can perform file, text or Java searches. Java searches operate on the structure of the code. File searches operate on the files by name and/or text content. Java searches are faster, since there is an underlying indexing structure for the code structure. Text searches allow you to find matches inside comments and strings.
Then click Search. While searching you may click Cancel at any time to stop the search. Partial results will be shown.
Use the Show Next Match () and Show Previous Match () buttons to navigate to each match. If the file in which the match was found is not currently open, it is opened in an editor.
Java searches can also be performed from specific views, including the Outline, Type Hierarchy view and the Package Explorer view.
From the Package Explorer view, open junit.framework.TestCase.java. In the editor, select the class name TestCase and from the context menu, select References > Workspace.
The Search Results view shows the results for the TestCase search. Select a search result and open the context menu. You can continue searching the selected element's references and declarations.
If you want to follow multiple levels of method calls, you can also use Navigate > Open Call Hierarchy.
In the Search Results view, click the arrow next to the Previous Search Results toolbar button to see a menu containing the list of the most recent searches. You can choose items from this menu to view previous searches. The list can be cleared by choosing Clear History.
The Previous Search Results button will display a dialog with the list of all previous searches from the current session.
Selecting a previous search from this dialog will let you view that search.