Ok, a big thanks goes out to Scott Stroz for this one. I've been using Eclipse for a while now but never needed to do a multi-file search and replace until last week. Turns out it is rather simple, but I had never really noticed the feature before. I figure a quick blog post may help others, and since I know I'll probably forget in six months, it will help me as well.
First, select the root folder in Navigator:

Second, go to Search/File in the navigation menu.

Enter your text in "Containing text" (I entered UDF). Note the Scope. This is critical. It should have "Selected resources" picked. If it is disabled, it means you didn't click in the Navigator first. This bugs/confuses the heck out of me. If you do 2 multi-file search and replaces, it is easy to forget to click back here. It is like Eclipse 'forgets' you had chosen a folder before.
Now, instead of hitting Search, click the Replace... button. Obvious, I know, but I swear I had never noticed it before.
Eclipse will now automatically run the search. You will be given a list of results, and the chance to enter your replacement term.

Just type in the term and hit Replace or Replace All.
So far this has worked perfectly for me. I did screw up one time and forgot to change the value on the "With" field, but that was entirely user error, and not Eclipse's fault. Also don't forget what I said about clicking back in the Navigator before you do the search.
Archived Comments
Don't do much refactoring do you :) I use this utility heavily, but never really on Selected Resources (thanks for the tip about selecting the folder)
I use the Workspace Scope (search all open projects) and the Enclosing Projects ( current project you are working with ). Also the shortcut to this dialog is Ctrl-H (win)
What kills me about the search view is I can not for the life of me find out what the shortcut is to easily jump to the next (or previous match). I know it is ctrl+K for a file search, but that doesn't work in the search view across multiple files.
Another thing that bunches my panties is the single file search doesn't start at the top when it reaches the bottom of the document so you have to remember to Ctrl+Home to start at the top before searching. Ahhhhh!
If anyone has solutions for the last two questions, please share.
I'd also add that you can run a replace without using the "Replace..." button in the Search dialog:
Once the list of results is displayed in the search view, you can right-click on an item (or whatever you Mac guys do) in this view and both "Replace Selected..." and "Replace All..." will appear as options in the context menu. I find this to be more flexible, as you can Ctrl-click to highlight multiple specific matches, and also remove individual matches from the search results before performing the replacement.
The enhancements to the search view are actually one of the biggest reasons I prefer 3.4 to previous versions of Eclipse, as the individual "hits" for each file are displayed, whereas in 3.3 and earlier there is only a count of the instances found in each file, and no context is shown.
@Dallas, if the search view is active, Ctrl+. and Ctrl+, will move you to the next and previous matches, respectively. Also, regarding your question on the Find command (the single file search), you can check the "Wrap Search" box, which I think will do what you want (jump to the top of the file after reaching the end).
You can also do this in Dreamweaver CS4 by setting up your websites in the site manager (they have to be saved locally). Then when doing find/replace you select the "Search entire local site." I use it a lot to check or change links.
does anybody know if there's a way howto exclude directories from searching? Within my project folder there's a huge directory called "images". This should be ignored completely from going though, because it slows down the search processs... I'm missing an option "exclude subdirectories" within the search dialog.
I used to suffer from a "resource is out of sync with the file system" error when searching until I found this great posting...
http://cfteeps.blogspot.com...
Thanks Ezra, the single file option was the trick.
Although, sadly ctrl + and - are not working for the search view. Any ideas what I might be doing wrong? I've even tried the keys with the search view maximized to make sure it was active. Nothing happens.
msthanks.
Thanks for the tip! I never noticed the Replace button either. I think this is a lesson in UI design. If your users don't know a feature is there, it won't be used!
The "Replace..." button should have additional spacing to set it apart from Cancel/Search. Also, the (mostly useless) "Customize..." button adds to the clutter making the useful button harder to find.
Only the positive side, Eclipse does get the button ordering consistent with the OS by putting the Search button far right on OS X and the Cancel button far right on Windows.
@Dallas, two things:
First, make sure you are using the correct shortcuts -- the "next" command is ctrl-period, and the "previous" command is ctrl-comma (from your comment, it looks like you are trying to use ctrl-plus and ctrl-minus instead).
Also, which version of Eclipse are you running? I typically run 3.4, where this behavior works as expected, but I just tried it in 3.3, and the results were inconsistent (e.g., focus was sometimes changed from the search view back to the editor, at which point the shortcuts no longer work). I note that under 3.4 these keyboard shortcuts are listed next to the commands in the search view context menu, whereas in 3.3 they are not...
@Juerg, you can restrict a search to a selection of directories/files by defining a working set. In Ray's screen shot of the Search dialog, note the "Working set" option in the Scope section -- click on the "Choose..." button, and you will be able to define a working set that consists of only the resources you wish to include.
If you upgrade to Ganymede (latest version of Eclipse) the multi-file search is even better. It shows a break-down of each file in the results showing each line matched. This means you can review your search results more easily without opening each file and only jump to the files and lines you really need to.
Thanks man , it helped me a lot.Since eclipse doesn't comes equipped with "header file refactoring" , i used this and done with the job in a min :)
>>the single file search doesn't start at the top when it reaches the bottom of the document so you have to remember
Actually ctrl+k behavior is controlled by the settings in the find dialog (ctrl+f). So in find dialog if "Wrap search" is selected, Ctrl+k will start searching from beginning of file when it reaches the end.
Thanks for the tip on selecting the folder.. obvious when you see it... but still :)
nice tip, haven't noticed replace button all these days