eclipse

一. 常用快捷键

内容辅助 Alt+/
显示大纲 Ctrl+O
注释 Ctrl+/, Ctrl+Shift+/, Ctrl+Shift+\
删除当前行 Ctrl+D
窗口最大化与还原 Ctrl+M
格式化代码 Ctrl+Shift+F
source Shift+Alt+S
搜资源 Ctrl+Shift+R
搜索class Ctrl+Shift+T
打开终端 Ctrl+Alt+T
显示继承关系 F4
括号匹配定位 Ctrl+Shift+P
返回上次位置 Alt+左右箭头
去掉无效import Ctrl+Shift+O
搜索工程中含指定字符串的文件 Ctrl+H
快速函数注释 Alt+Shift+J
搜索各种文件 Ctrl+Shift+R
查找下一个 Ctrl+K 
查找上一个 Ctrl+Shift+K 
转小写 Ctrl+Shift+Y
转大写 Ctrl+Shift+X
选中行上下移动 Alt+/

 

 二. 注释

打开Windows->Preferences->Java->Code Style->Code Templates,点击右边窗口中的Comments,可以看到有很多选项,我们便可对此注释信息模板进行编辑。在你需要添加注释的地方点击Sources->Ganarate Element Comment,或者使用快捷键 Alt+Shift+J ,则 eclipse 自动在该类前面添加注释。
 
1)类的注释格式设置(types):

/**  
*   
* @author ${user}  
* @date ${date} ${time}  
*/

 

2)常用注释标记符

 <br>
<p></p>
{@link com.xxx.model.Options}
{@link #getState}
{@link Object#wait(long) wait(long)}
{@code true}
<code>MIN_PRIORITY</code>
 

三. Maven

3.1 快速生成maven工程

New-->Other-->Maven:Maven Project-->New Maven Project:默认-->Archetype:maven-archetype-quichstart... 

 

四. 常用功能

1)eclipse显示被隐藏的文件或文件夹
点击左边导航(Navigator或者PackageExplorer等)右上角的小三角 --> Filters-->点击需要显示文件,让复选框处于非选中状态。 
 
2)pom.xml修改
<include>**/*.xml</include>
后,需要删除.classpath-->mvn clean eclipse:eclipse重新生成。

3)thrift@override报错
方法一:Project->Properties->Java Compiler->Compiler compliance leve:选择1.6以上版本
方法二:有可能是类的package不对,在最上边修正即可,如:package thrift;

4)激活pom配置中的profile
工程右击-->Properties-->Maven-->Active Maven Profiles框中输入要激活的profile,如dev。

posted @ 2015-12-29 11:22  waterystone  阅读(325)  评论(0编辑  收藏  举报