有用的Eclipse功能? [英] Useful Eclipse features?

查看:102
本文介绍了有用的Eclipse功能?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在短时间内使用Eclipse(大约3个月的时间)使用Eclipse,几乎每天我都会了解到我完全不了解的一些快捷方式或功能。例如,就在今天,我了解到 Ctrl + 3 是快速访问窗口的快捷方式。

I have been using Eclipse as an IDE for a short amount of time (about 3 months of full use) and almost every day I learn about some shortcut or feature that I had absolutely no idea about. For instance, just today I learned that Ctrl+3 was the shortcut for a Quick Access window.

I想知道你最有用/最喜欢的Eclipse功能是什么。 IDE很大,了解程序中更常用的部分将是有帮助的。

I was wondering what your most useful/favorite Eclipse features are. With the IDE being so big, it would be helpful to learn about the more commonly used parts of the program.

推荐答案

常用的功能是

ctrl + 1 quick-fix / spell-checker

ctrl+1 quick-fix / spell-checker

打开文件


  • ctrl + shift + t 加载类文件by classname

  • ctrl + shift + r 通过文件名加载任何文件

  • ctrl+shift+t load class file by classname
  • ctrl+shift+r load any file by filename

在类/文件名的开头进行匹配。开始您的搜索模式与*来搜索文件名/类名的任何地方。

matches are made on the start of the class/filename. start your search pattern with a * to search anywhere within the filename/classname.

格式化


  • ctrl + shift + f 格式化源文件
    (在Window | preferences | java |中设置格式化样式code style | formatter)

  • ctrl + shift + o 整理导入

  • ctrl+shift+f Format source file (set up your formatting style in Window | preferences | java | code style | formatter)
  • ctrl+shift+o Organise imports

生成代码


  • alt s r 来生成getter和setter

  • alt + s v 从超类或接口插入覆盖方法的方法签名

  • alt+s,r to generate getters and setters
  • alt+s,v to insert method signatures for overidden methods from superclass or interface

重构


  • alt + shift + l 将文本选择提取为局部变量非常方便,它确定并为您插入类型。

  • alt + 移动 + m 提取文本选择作为方法

  • alt + shift + i 内联选择方法

  • alt+shift+l Extract text-selection as local variable (really handy in that it determines and inserts the type for you.
  • alt+shift+m Extract text-selection as a method
  • alt+shift+i inline selected method

调试。

alt + shift + x 是一个非常方便的前缀运行

alt+shift+x is a really handy prefix to run stuff in your current file.


  • alt + shift + x t 在当前文件中运行单元测试

  • alt + shift + < > , j 在当前文件中运行main

  • alt + shift kbd> x , r 在服务器上运行

  • alt+shift+x, t run unit tests in current file
  • alt+shift+x, j run main in current file
  • alt+shift+x, r run on server

还有更多。在 alt + shift + x 后,右下方的弹出式窗口会向您显示这些选项。

There are more. The options are shown to you in the lower-right popup after hitting alt+shift+x.

alt + shift + x 可以切换 alt + shift + d 在所有上述示例中运行在调试器中。

alt+shift+x can be switched for alt+shift+d in all the above examples to run in the debugger.

验证

截至最近的Ganymede版本,您现在可以在指定的文件和文件夹中切换验证。我一直在等待这个功能的年龄。

As of the recent Ganymede release, you can now switch of validation in specified files and folders. I've been waiting for this feature for ages.


  • 转到项目|属性|验证

  • 点击要关闭的验证器的设置列中的...按钮

  • 将规则添加到排除组

  • Go to Project | Properties | Validation
  • click on the ... button in the settings column of the validator you want to shut up
  • Add a rule to the exclude group

代码导航


  • 按住 ctrl 使所有变量,方法和类名超链接到其定义。

  • alt + left 返回到您点击的位置 ctrl

  • alt + right 再次转发

  • hold down ctrl to make all variables, methods and classnames hyperlinks to their definitions.
  • alt+left to navigate back to where you clicked ctrl
  • alt+right to go "forwards" again

这篇关于有用的Eclipse功能?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆