Eclipse 替换所有类中的文本?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/3376440/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-10 19:32:06  来源:igfitidea点击:

Eclipse Replace text in all Classes?

eclipse

提问by Ian Vink

Is there a command to replace a string of code with another in all .java files in an Eclipse project?

在 Eclipse 项目的所有 .java 文件中,是否有命令将一串代码替换为另一个代码?

In Visual Studio there is a "Replace in all files" option that I can't seem to find in Eclipse.

在 Visual Studio 中,我似乎在 Eclipse 中找不到“替换所有文件”选项。

回答by walterbing1

Press Ctrl+Hor 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.

Ctrl+H或在“搜索”菜单中查找“搜索”>“搜索”或“搜索”>“文件”,具体取决于版本。在对话框底部,单击替换...在那里您将找到文件中的替换功能。

回答by Rajesh D

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

Ctrl+H或在“搜索”菜单中查找“搜索”>“搜索”或“搜索”>“文件搜索”选项卡。在对话框底部,单击替换

enter image description here

在此处输入图片说明

回答by Chinmoy

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

我在 Eclipse 的 Helios 版本中尝试了以下选项。只需按 CTRL+F,您就会在屏幕上看到“查找/替换”窗口

enter image description here

在此处输入图片说明

回答by Gopi

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

我不知道命令,但只需按 'ctrl+h' 出现的对话框就会有你需要的东西

回答by Shubham Pai

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

选择单词并按 alt+shift+r然后替换单词,它应该反映在所有类中。