Eclipse实用操作

1、缩进:Tab

2、退格:Shift+Tab

3、包结构展开方式:Package Presentation

4、快速定位文件:按ctrl键不放,鼠标移至链接处

5、为属性快速生成相应的get和set方法:右键->Source->Generate Getters and Setters

6、tab换成空格

1)window->preference->General->Editors->Text Editors->选中右侧的 insert space for tabs

2)window->preference->java->code style ->formatter->点击右侧的editor->选则左侧 tab policy的值为spaces only(如果Apply按钮为灰色,需要回到上一步,点击new按钮,根据当前的样式重新生成一个新的样式并保存,重复第二步,编辑该样式即可。)

7、快速注释及取消注释:Ctrl+Shift+C(推荐使用)、Ctrl+Shift+/和Ctrl+Shift+(会与搜狗输入法冲突)

8、eclipse自动格式化代码不换行:Window->Preferences->Java|Javascript->Code Style->Formatter->Line Wrapping->Maximum line width设置最大宽度

9、快速定位文件在左侧目录中的位置:点击左侧目录中的Link With Editor图标

10、反编译查看class文件

添加反编译插件,如图所示

 11、自动生成作者、日期注释等信息

点击进入

原文地址:https://www.cnblogs.com/aaron-shu/p/4319970.html