开发者

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

You know how in Eclipse's Preferences wi开发者_JAVA百科ndow (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


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.


Ctrl+Shift+R

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


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.

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


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


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.


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜