Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to search for a method name in Eclipse [duplicate]

Tags:

The Cmd + O only allow you to search for method in the current opened file, are there any easy method to search for method in your project?

like image 434
Howard Avatar asked Jul 27 '12 04:07

Howard


People also ask

How do I search for a specific method in Eclipse?

The Eclipse search dialog box allows you to search for files that contain a literal or a character pattern in the entire workspace, a set of projects, a specific project or folders selects in the package explorer view. Clicking on the Search menu and selecting Search or File or Java. Clicking Ctrl + H.

How do you check where the function is getting called in Eclipse?

To navigate to where a function is called in the code, hold Ctrl while double-clicking on a function's node (in any view except Aggregate View). Doing so will open the corresponding source file in the Eclipse editor and highlight the function call.

How do you check how many times a method is called in Eclipse?

Move the cursor to the method name. Right click and select References > Project or References > Workspace from the pop-up menu. Show activity on this post.

How do I search multiple keywords in Eclipse?

Use the built-in Eclipse Search dialog. The Search menu contains multiple items (Search→ Search, Search→ File, Search→ Help, and Search→ Java), but all of them open the same dialog.


3 Answers

CTRL+H, You can see Search For box, select Method. In Scope, select Enclosing projects.

like image 78
kshen Avatar answered Sep 30 '22 00:09

kshen


Use "Java Search" in the search menu or move the caret on the function name in the source and press Ctrl+Shift+G (-> search for reference in Workspace).

[EDIT] If you don't know in which class the function is, then use the text search (which is called "File search"). Enter the name in the search field and then limit the search to "*.java" files.

like image 3
user1071979 Avatar answered Sep 28 '22 00:09

user1071979


Use Ctrl+Gto search for declarations of the method your cursor is currently sitting on, as opposed to the Shift+Ctrl+G mentioned by user1071979 which shows all references to method. kshen mentioned Ctrl+H which will give you greatest flexibility - though giving you a dialog box to fill out to go further.

like image 1
Richard Sitze Avatar answered Sep 27 '22 00:09

Richard Sitze