kristain

博客园 首页 新随笔 联系 订阅 管理

  设置注释模板的入口: Window->Preference->Java->Code Style->Code Template 然后展开Comments节点就是所有需设置注释的元素。

文件注释codetemplates.xml:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<templates>
	<template autoinsert="false" context="typecomment_context" deleted="false" description="Comment for created types" enabled="true" id="org.eclipse.jdt.ui.text.codetemplates.typecomment" name="typecomment">/**
 * Description:
 * ${file_name} Create on ${date} ${time} 
 * @author Kristain
 * @version 1.0
 * Copyright (c) ${year} Company,Inc. All Rights Reserved.
 */</template>
</templates>

方法注释method.xml:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<templates>
	<template autoinsert="false" context="methodcomment_context" deleted="false" description="Comment for non-overriding methods" enabled="true" id="org.eclipse.jdt.ui.text.codetemplates.methodcomment" name="methodcomment">/**
 * Description:
 * Date:${date}
 * @author kristain
 * ${tags} 
 * @return ${return_type}
 */</template>
</templates>
posted on 2011-06-07 23:48  kristain  阅读(5271)  评论(0编辑  收藏  举报