Java Eclipse 的隐藏功能

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/54886/
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-08-11 07:42:59  来源:igfitidea点击:

Hidden features of Eclipse

javaeclipseide

提问by DIA Tom

Alright it can be a lame question, but everybody uses these things differently. What's some of the best time savers out there for this IDE.

Tom

好吧,这可能是一个蹩脚的问题,但每个人都以不同的方式使用这些东西。此 IDE 有哪些最佳节省时间的方法。

汤姆

回答by Jay R.

Crtl+1is my favorite. The quick fixes for the red-squiggles.

Crtl+1是我的最爱。红色波浪线的快速修复。

It is also located in the Edit Menu -> Quick Fix.

它也位于编辑菜单 -> 快速修复中。

回答by Mike Stone

Ctrl+f then tick the "Regular expressions" checkbox. From that, you can search with regular expressions, but even more powerfully, you can include group matches in your replacement string ($1, $2, etc, or $0 for the whole match).

Ctrl+f 然后勾选“正则表达式”复选框。由此,您可以使用正则表达式进行搜索,但更强大的是,您可以在替换字符串中包含组匹配($1、$2 等,或整个匹配的 $0)。

回答by Ryan Guest

Alt+ Shift+ Rto refactor and rename.

Alt+ Shift+R重构和重新命名。

回答by Mike Stone

Ctrl+Shift+Oto organize imports, which will format them nicely, remove unneeded imports, and add missing imports.

Ctrl+ Shift+O来组织导入,这将很好地格式化它们,删除不需要的导入,并添加丢失的导入。

回答by pkaeding

ctrl-shift-r and its buddy, ctrl-shift-t, to open a resource or type, respectively. Resources includes all files in your open projects (including non-java files), and types includes java types either in your projects, or in a library included in the projects.

ctrl-shift-r 及其伙伴 ctrl-shift-t 分别打开资源或类型。资源包括您打开的项目中的所有文件(包括非 java 文件),类型包括您的项目中或项目中包含的库中的 java 类型。

回答by Boris Terzic

  • CTRL-SHIFT-g : finds usages of the method or field under the cursor, absolutely necessary for understanding code
  • CTRL-F6 : navigate between the list of open editor windows, if you just type it once and let go you toggle back to the previous editor window, doing this successively is a nice way to jump back and forth
  • CTRL-t : on a class or method will show you the type hierarchy, very useful for finding implementations of an interface method for example
  • CTRL-SHIFT-g :查找光标下的方法或字段的用法,对于理解代码绝对必要
  • CTRL-F6 : 在打开的编辑器窗口列表之间导航,如果你只输入一次然后放开你切换回上一个编辑器窗口,连续这样做是来回跳转的好方法
  • CTRL-t :在类或方法上将显示类型层次结构,例如对于查找接口方法的实现非常有用

回答by nutario

CTRL + b: to build the project under c++

CTRL + b:在c++下构建项目

CTRL + SHIFT + f: to format your code (c++)

CTRL + SHIFT + f: 格式化你的代码 (c++)

回答by jodonnell

Alt+Shift+UpArrow does escalating selection. Alt+Shift+Downdoes the opposite.

Alt+ Shift+Up箭头会升级选择。Alt+ Shift+Down则相反。

回答by svrist

Save Actions rocks. There you can get your Imports organized (Ctrl+Shift+o) and formatting of code (CTRL + SHIFT + f). Besides from that i love ALt + Shift + R for refactoring.

保存操作岩石。在那里你可以组织你的导入 (Ctrl+Shift+o) 和代码格式 (CTRL + SHIFT + f)。除此之外,我喜欢 ALt + Shift + R 进行重构。

My favorite things is the plugins though: They might cause you to use more time but most of the time they give quality (subjective I know)

不过,我最喜欢的东西是插件:它们可能会导致您使用更多时间,但大多数时候它们会提供质量(我知道是主观的)

  • Code coveragde (ECLEMMA)
  • Static analysis on source(PMD)
  • Static analysis on byte code(FindBugs)
  • CheckStyle
  • SpringIDE.
  • 代码覆盖率 (ECLEMMA)
  • 源静态分析(PMD)
  • 字节码静态分析(FindBugs)
  • 检查样式
  • 弹簧IDE。

Then you start to rock with the mandatory source control plugins and the maven 2 plugin.

然后你开始使用强制性的源代码控制插件和 maven 2 插件。

Rock on!

摇滚吧!

回答by erickson

Alt-Up Arrow moves the current selection up a line, Alt-Down Arrow moves it down. I also use Alt-Shift-Up/Down Arrow all the time. Ctrl-K and Ctrl-Shift-K is quite handy, finding next/previous occurrence of the current selection (or the last Find, if nothing is selected).

Alt-Up Arrow 将当前选择向上移动一行,Alt-Down Arrow 将其向下移动。我也一直使用 Alt-Shift-Up/Down Arrow。Ctrl-K 和 Ctrl-Shift-K 非常方便,查找当前选择的下一个/上一个出现(或最后一个 Find,如果没有选择)。