Eclipse Replace text in all Classes? - eclipse

Is there a command to replace a string of code with another in all .java files in an Eclipse project?
In Visual Studio there is a "Replace in all files" option that I can't seem to find in Eclipse.

Press Ctrl+H or look in the Search menu for Search>Search or Search>File depending on version. At bottom of dialog box, click Replace... There you'll find the replace in files functionality.

Press Ctrl+H or look in the Search menu for Search>Search or Search>File Search Tab. At bottom of dialog box, click Replace

I have tried the following option in Helios Version of Eclipse. Simply press CTRL+F you will get the "Find/Replace" Window on your screen

I don't know about command but just
press 'ctrl+h' the dialog that appears woulh have what you need

Select the word and press alt+shift+r then replace the word, it should reflect in all classes.

Related

Search in intellij vs eclipse

I recently moved to intellij-idea-12 from eclipse.
In eclipse if select a text and click 'ctrl+k' or 'ctrl+shift+k', it takes me to next/previous search text within the file.
In intellij if i do select text and click 'ctrl+l' or 'ctrl+shift+l' it is not taking me to the search text.
In intellij first i have to do 'ctrl+f', then only 'ctrl+l' or 'ctrl+shift+l' are working.
Is there any setting to make it work like eclipse searching.
Note: I am not talking about changing keymap in intellij.
With the caret on the word you want to search for (or with the text highlighted), press CTRL+F3. After that, you can just press F3 to find the next occurrence and SHIFT+F3 to find the previous occurrence.
Note that I am still using version 11.1.5
By default it's ALT+J to move down and shift+ALT+J to move up.

"Replace all" in project / selection not working?

In Netbeans 7.2, after selecting packages or a project and opening the dialog Edit->Replace or Edit->Replace in projects, I can't find a button or option to replace all occurrences. The only way I found is to open a file, select Edit->Replace and then "Replace all", but this obviously applies only to the current file.
How to find & replace in a custom selection over files, packages, projects, ...?
Edit
The "Search Results" window looks like this after Edit->Replace in projects...->Find:
There is no button or menu to do the replacement.
If you use Edit -> Replace (in Projects) a Search Results window appears, listing all matches available for your selection.
But now you have to click on Replace xy matches for completion.
Note that the Search Results window must be large enough so that all buttons show up!

Is there a "Find in Files" shortcut in Eclipse?

Is there a "Find in Files" shortcut in Eclipse, as there is in Visual Studio (Ctrl+Shift+F)?
I have looked in these two lists:
Eclipse Shortcuts
"Show All Shortcuts" shortcut: Ctrl+Shift+L.
Thanks.
select workspace and press Ctrl-H
Which dialog is selected, depends on which file type is selected in the Project Explorer view. For example, if you selected a .js file and press Ctrl-H, it will bring up the dialog with the "Javascript Search" tab selected. If you want to search all files, you can press Ctrl-F7 to select the Project Explorer view, use arrow keys to select a folder above your files, then press Ctrl-H (or select a file, whose type doesn't trigger a custom dialog tab).
Thanks to the other two solutions, but here is the complete answer I was looking for, which addresses how I search all the text within the files, not just types, methods, packages, constructors, and fields:
Ctrl+H to open the "Search" dialog box
"File Search" tab, if it does not appear, expand the window or use the left/right arrows
type in the text to search for
Use "*.java", in my case since I am coding in Java, to search just these files
Click "Search"
If you are using only the File Search, you can Disable all other Searches in the Search Panel (Customize... lower left Corner). Then you have the File Search everytime you Press Ctrl+H
Ctrl+H to bring up the search box
Click 'Customize' in the lower left
Checkmark 'Remember last used page'
Click OK.
Select the file search tab and do a search
If you want to use the type-specific search (Java, Javascript ...etc) you can use Ctrl+H, which opens the search dialog, then click the Search button.
If you simply want to search for all text occurrences in the whole the workspace click the word (or select the text) you want to search then hit Ctrl+Alt+G. You will directly get all the found occurrences without even using a dialog box.
I find Ctrl+Alt+G is the best solution because it shows the variable name in different by related files (e.g. Java and XML, or Javascript and HTML) while still having the type-specific search feature available through Ctrl+H
You can rebind the Ctrl+Alt+G to finding text in a project or a working set instead of the whole workspace if that's more appealing to you.
Yes, there is shortcuts for searching Eclipse, these shortcuts are very useful when we search for particular html, jsp , xml, java, properties ,class, jar,search file with keywords.
Ctrl+H is used open Tag, in that you can select type of file Remote Search, File search, git search, java search, javascript search , etc
Ctrl+Shift+R is used to search all files in the current project
Ctrl+Shift+T is used to search all files in the workspace
press Ctrl + H . Then choose "File Search" tab.
additional search options
search for resources press Ctrl + Shift + R
search for Java types press Ctrl + Shift + T
Source: Eclipse: Default to "File Search" Tab in Search Dialog
Go to your key bindings Windows > Preferences > General > Keys
Unbind the Shorcut "Ctrl+H" for the "Open Search Dialog"
Filter/Search for "File Search" and use the "Ctrl+H" here instead.
I believe adding plug-ins power your needs.
If you install Plug-in named InstaSearch it makes your searching faster inside current active working projects.
It shows the result as you type.
http://marketplace.eclipse.org/content/instasearch#.VIp-_5_PGPQ
As pointed out, CTRL + H opens the Search dialog.
Since I use only Find in Files (and set File name patterns when needed), I clicked on Customize... button on the bottom of the Search dialog. It opens Search Page Selection dialog, where I turned off all other options.
You can also click on Remember last used page in the same dialog.
Ctrl+Alt+F (Find Text in Project -Customized Key)
Note - Ctrl+Alt+G is for Find text in a workspace, not in a project
How to customize this Key
Window->Preferance->General->Keys-> Search for 'Find Text in Project'->Type 'Ctrl+Alt+F' in binding ->Apply
Note - this will be helpful if the developer is working on multiple project simultaneously.

Double Clicking Highlighting

In Notepad++ if you double click a word to highlight it, all the occurrences of the word in the file are also highlighted, a feature that is quite handy for finding where variables are declared/used.
Does the eclipse editor have this functionality? :) If so, how can I turn it on?
For the Eclipse Java editor, you can go to Window->Preferences in the menu, then Java->Editor->Mark Occurrences in the options tree and check off anything you want highlighted in this way.
Note that the editor understands Java scoping rules, so if you have 2 local variables with the same name in two different functions, it will only highlight within the current function.
I found a plugin called eclipse-glance that searches like notepad++ but without double-clicking
http://code.google.com/p/eclipse-glance/
Closest to original what I have found is alt-shift-O
For activate double click hightlighting in Eclipse:
activate double click hightlighting in Eclipse
For change color of double click hightlighting in Eclipse:
change color of double click hightlighting in Eclipse

How do I activate word wrapping in text editor in Aptana Studio?

How do I activate line wrapping in text editor in Aptana Studio?
I'm interested about wrapping in view mode (in order to not have to do horizontal scrolling).
Tried right-clicking within the editor and selecting ‘word wrap’ from the context menu?
On Main Menu click "Window" choose "Preferences". In left-side list, click "Aptana Studio". An alphabetical list on right side will show. Select "Editors" then check "Enable word wrap (requires restart)".
It seems to work on the latest version of Aptana as well. Here are some screenshots of where you can find such option.
I'm using Aptana Studio 3 and you can right click anywhere in the code and select Word Wrap which should be the second last option.
I'm using Aptana Studio 3, build: 3.4.2 and found that 'word wrap' can be change with in editor from context menu, BUT only if the mouse are on line number field! If the mouse is on text editor the option 'word wrap' missing. This change only setting for current opened file. It will be good to change default option !
Window > Preferences > Aptana > Editors...
Actually click on the word "Editors", you don't need to click the "+" symbol next to it. Once that loads, go to the "Advanced" tab, and you should see the option you're looking for to enable word wrap.
Found that here.
http://forums.aptana.com/viewtopic.php?f=14&t=7482
Once you restart, you should be good to go.