eclipse 注解模板&idea 快捷键

1.idea 快捷键

Alt+回车 导入包,自动修正
Ctrl+N  
查找类
Ctrl+Shift+N
查找文件
Ctrl+Alt+L 
格式化代码

Ctrl+Alt+O 优化导入的类和包
Alt+Insert
生成代码(get,set方法,构造函数等)
Ctrl+E
或者Alt+Shift+C  最近更改的代码
Ctrl+R
替换文本

Ctrl+F 查找文本
Ctrl+Shift+Space
自动补全代码
Ctrl+
空格 代码提示

Ctrl+Alt+Space 类名或接口名提示

Ctrl+P 方法参数提示

Ctrl+Shift+Alt+N 查找类中的方法或变量

Alt+Shift+C 对比最近修改的代码

Shift+F6  重构-重命名
Ctrl+Shift+
先上键
Ctrl+X
删除行
Ctrl+D
复制行
Ctrl+/
 Ctrl+Shift+/  注释(// 或者/*...*/ 
Ctrl+J 
自动代码
Ctrl+E
最近打开的文件

Ctrl+H 显示类结构图

Ctrl+Q 显示注释文档
Alt+F1
查找代码所在位置
Alt+1
快速打开或隐藏工程面板

Ctrl+Alt+ left/right 返回至上次浏览的位置
Alt+ left/right
切换代码视图

Alt+ Up/Down 在方法间快速移动定位

Ctrl+Shift+Up/Down 代码向上/下移动。

F2 Shift+F2 高亮错误或警告快速定位

 

代码标签输入完成后,按Tab,生成代码。

选中文本,按Ctrl+Shift+F7 ,高亮显示所有该文本,按Esc高亮消失。

Ctrl+W 选中代码,连续按会有其他效果

选中文本,按Alt+F3 ,逐个往下查找相同文本,并高亮显示。

Ctrl+Up/Down 光标跳转到第一行或最后一行下

Ctrl+B 快速打开光标处的类或方法 

 

File -> Invalidate caches  IDEA 清除缓存

 

2.注解模板

编辑注释模板的方法:Window->Preference->Java->Code Style->Code Template 然后展开Comments节点就是所有需设置注释的元素啦。现就每一个元素逐一介绍:

1.文件(Files)注释标签:

[html]  view plain copy print ?
 
  1. /**  
  2.  *   
  3.  * @Title:  ${file_name}   
  4.  * @Package ${package_name}   
  5.  * @Description:    ${todo}(用一句话描述该文件做什么)   
  6.  * @author: dk   
  7.  * @date:   ${date} ${time}       
  8.  */  


2.类型(Types)注释标签(类的注释):

[html]  view plain copy print ?
 
  1. /**   
  2.  * @ClassName:  ${type_name}   
  3.  * @Description:${todo}(这里用一句话描述这个类的作用)   
  4.  * @author: dk
  5.  * @date:   ${date} ${time}   
  6.  *   
  7.  * ${tags}   
  8.  */  


3.字段(Fields)注释标签:

[html]  view plain copy print ?
 
  1. /**   
  2.  * @Fields ${field} : ${todo}(用一句话描述这个变量表示什么)   
  3.  */   


4.构造函数标签:

[html]  view plain copy print ?
 
  1. /**   
  2.  * @Title:  ${enclosing_type}   
  3.  * @Description:    ${todo}(这里用一句话描述这个方法的作用)   
  4.  * @param:  ${tags}  
  5.  * @throws   
  6.  */  


5.方法(Methods)标签:

[html]  view plain copy print ?
 
  1. /**   
  2.  * @Title: ${enclosing_method}   
  3.  * @Description: ${todo}(这里用一句话描述这个方法的作用)   
  4.  * ${tags}      
  5.  * @return: ${return_type}      
  6.  * @throws   
  7.  */  

6.覆盖方法(Overriding Methods)标签:

[html]  view plain copy print ?
 
  1. /**   
  2.  * <p>Title: ${enclosing_method}</p>   
  3.  * <p>Description: </p>   
  4.  * ${tags}   
  5.  * ${see_to_overridden}   
  6.  */  


7.代表方法(Delegate Methods)标签:

[html]  view plain copy print ?
 
  1. /**  
  2.  * ${tags}  
  3.  * ${see_to_target}  
  4.  */  


8.getter方法标签:

[html]  view plain copy print ?
 
  1. /**  
  2.  * @Title:  ${enclosing_method} <BR>  
  3.  * @Description: please write your description <BR>  
  4.  * @return: ${field_type} <BR>  
  5.  */  


9.setter方法标签:

 

[html]  view plain copy print ?
 
  1. /**  
  2.  * @Title:  ${enclosing_method} <BR>  
  3.  * @Description: please write your description <BR>  
  4.  * @return: ${field_type} <BR>  
  5.  */  

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值