Eclipse 创建新文件时自动添加author,email,time等信息

来源:互联网 发布:网络电影分账截图 编辑:程序博客网 时间:2024/06/01 09:17

      在Eclipse中创建一个新的.java文件时,怎样用模板的方式自动添加上作者,作者email,time等信息,下面将会做图文并茂的演示:

windows-->preference 
Java-->Code Style-->Code Templates 
code-->new Java files
原来的内容是:
${filecomment} 
${package_declaration} 

${typecomment} 
${type_declaration}

点击右边的Edit按钮,将上面的内容改成:

${filecomment}
${package_declaration}
/**
 * @author 作者名 
 * @email  邮箱名
 * @time   ${date} ${time}
 */
${typecomment}
${type_declaration}

点击OK保存,新建一个类文件看看发生了什么.