In Eclipse, in the package explorer, can I find files by name?

Eclipse

Eclipse Problem Overview


You know how in Eclipse's Preferences window (menu bar: Window --> Preferences), you have a hierarchy to browse, but you also have a text search field. And as you type into that search field, the hierarchy is filtered to show only entries matching what you typed?

I would love to see the same feature in the Package Explorer tab. I have 100s of files in my Package Explorer hierarchy. Oftentimes I just want to type in a partial name, and see only those matching entries.

Does this feature exist? Something related, that would accomplish the same goal? (search, not browse)?

Thanks

Eclipse Solutions


Solution 1 - Eclipse

You can do the opposite of what you want to do. Click on the white arrow on the right of the package explorer, select Filters... and type an expression with wildcards. Eclipse will not show the resources matching this pattern.

You can search for types in your workspace with the shortcut Ctrl+Shift+T or for files in general with Ctrl+Shift+R. You can specify a pattern in the same way you can do for filters.

Solution 2 - Eclipse

Ctrl+Shift+R

Type only partial name in the text field to find your file.

Solution 3 - Eclipse

There is a small button with "left right arrows" (link with editor) near Package Explorer. Click that and you can use Ctrl+Shift+R with it. It will show you the current open file in Package Explorer.

Link with editor option in eclipse

Solution 4 - Eclipse

I'm not quite sure if this is what you're looking for... but try ctrl + shift + r

Solution 5 - Eclipse

As others have mentioned, ctrl + shift + r works nicely if you have thousands of files in your project.

Also, I would like to add the following: you can add additional folder into the existing project by the following sequence: File, new, folder. In the pop-up window, select Advanced, select Link to alternate location (Linked Folder), Browse...

To add new file, just do: File, new, source file

After you added the additional file or folder, then at the project root, hit F5 to refresh the project so that the new file and the new folder will be brought into the project.

And then you can use ctrl + shift + r to also find the newly added file of the newly added folders.

Solution 6 - Eclipse

Simple. Just press Ctrl + H (Windows),

this will open up the Advanced Search window.

Go to File Search tab and type in the required parameters:

For example click here

The above example showcases me trying to search for all occurrences of .xml files within a specific folder

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionAaron FiView Question on Stackoverflow
Solution 1 - EclipsefrmView Answer on Stackoverflow
Solution 2 - EclipsepavanlimoView Answer on Stackoverflow
Solution 3 - EclipseMitechView Answer on Stackoverflow
Solution 4 - EclipsefroadieView Answer on Stackoverflow
Solution 5 - EclipseJason XiongView Answer on Stackoverflow
Solution 6 - EclipseHarsh PhoujdarView Answer on Stackoverflow