myeclipse 添加头文件注释(更改头注释的内容)

通过菜单 Window->Preference 打开参数设置面板,然后选择:
1.Java -> Code Style -> Code     Templates
2.在右侧选择Comments,将其中的Files项,然后选右边的"Edit",进入编辑模式:
3.进入编辑模式后就可以自定义注释了。另外可以插入一些变量,如年、日期等等。
4.最后,确保 Code -> New Java files 中有:"${filecomment}"
一、创建新Java文件头部注释
windows-->preference
Java-->Code Style-->Code Templates
code-->new Java files
编辑它
${filecomment}
${package_declaration}
/**
* @author 作者
* @version 创建时间:${date} ${time}
* 类说明
*/
${typecomment}
${type_declaration}
 
二、为方法提供注释模板
设置方法注释模板:选择eclipse菜单栏中【窗口】下的【首选项】,展开左边树到Java->代码样式->代码模板,展开右边出现的对话框中的注释->方法,点击右边的【编辑】按钮。编辑其中的内容。也可以点击下面的【插入变量】按钮添加变量。例如:
/**
*@author${user}
*功能:
*${tags} 
*/
 
通过菜单 Window->Preference 打开参数设置面板,然后选择:
1.Java -> Code Style -> Code     Templates
2.在右侧选择Comments,将其中的Files项,然后选右边的"Edit",进入编辑模式:
3.进入编辑模式后就可以自定义注释了。另外可以插入一些变量,如年、日期等等。
4.最后,确保 Code -> New Java files 中有:"${filecomment}" 一、创建新Java文件头部注释
windows-->preference
Java-->Code Style-->Code Templates
code-->new Java files
编辑它
${filecomment}
${package_declaration}
/**
* @author 作者
* @version 创建时间:${date} ${time}
* 类说明
*/
${typecomment}
${type_declaration}
 
二、为方法提供注释模板
设置方法注释模板:选择eclipse菜单栏中【窗口】下的【首选项】,展开左边树到Java->代码样式->代码模板,展开右边出现的对话框中的注释->方法,点击右边的【编辑】按钮。编辑其中的内容。也可以点击下面的【插入变量】按钮添加变量。例如:
/**
*@author${user}
*功能:
*${tags} 
*/
 

猜你喜欢

转载自stanlyy.iteye.com/blog/667342