1.设置软件字体14号字体
2,设置字体换行数
3,设置智能提示
4.设置字符编码
5.设置代码注释模版
需要一个一个的加的
下面详细列出每一个子项的模板格式:
Comments-->Files(Java文件注释)
Java代码
1. /**
2. * Project Name:${project_name}
3. * File Name:${file_name}
4. * Package Name:${package_name}
5. * Date:${date}${time}
6. * Copyright (c) ${year}, [email protected] All Rights Reserved.
7. *
8. */
Comments-->Types(Java类注释)
Java代码
1. /**
2. * ClassName: ${type_name}
3. * Function: ${todo} ADD FUNCTION.
4. * Reason: ${todo} ADD REASON(可选).
5. * date: ${date} ${time}
6. *
7. * @author ${user}
8. * @version ${enclosing_type}${tags}
9. * @since JDK 1.8
10. */
Comments-->Fields(类字段注释)
Java代码
1. /**
2. * ${field}:${todo}(用一句话描述这个变量表示什么).
3. * @since JDK 1.8
4. */
Comments-->Constructors(构造函数注释)
Java代码
1. /**
2. * Creates a new instance of ${enclosing_type}.
3. *
4. * ${tags}
5. */
Comments-->Methods(Java方法注释)
Java代码
1. /**
2. * ${enclosing_method}:(这里用一句话描述这个方法的作用).
3. * ${todo}(这里描述这个方法适用条件 – 可选).
4. * ${todo}(这里描述这个方法的执行流程 – 可选).
5. * ${todo}(这里描述这个方法的使用方法 – 可选).
6. * ${todo}(这里描述这个方法的注意事项 – 可选).
7. *
8. * @author ${user}
9. * ${tags}
10. * @since JDK 1.8
11. */
Comments-->Overridingmethods(重写方法注释)
Java代码
1. /**
2. * ${todo} 简单描述该方法的实现功能(可选).
3. * ${see_to_overridden}
4. */
Comments-->Delegatemethods(代理方法注释)
Java代码
1. /**
2. * ${tags}
3. * ${see_to_target}
4. */
Comments-->Getters(Java Getter方法注释)
Java代码
1. /**
2. * ${bare_field_name}.
3. *
4. * @return the ${bare_field_name}
5. * @since JDK 1.8
6. */
Comments-->Setters(Java Setters方法注释)
Java代码
1. /**
2. * ${param}.
3. *
4. * @param ${param} the ${bare_field_name} to set
5. * @since JDK 1.8
6. */
Code-->New Javafiles(新建java文件代码模板)
Java代码
1. /**
2. * Project Name:${project_name}
3. * File Name:${file_name}
4. * Package Name:${package_name}
5. * Date:${date}${time}
6. * Copyright (c) ${year}, [email protected] All Rights Reserved.
7. *
8. */
9. ${filecomment}
10.
11.${package_declaration}
12./**
13. * ClassName:${type_name}
14. * Function: ${todo} ADD FUNCTION.
15. * Reason: ${todo} ADD REASON.
16. * Date: ${date} ${time}
17. * @author ${user}
18. * @version
19. * @since JDK 1.8
20. * @see
21. */
22.${typecomment}
23.${type_declaration}
Code-->Methodbody(方法体模板)
Java代码
1. // ${todo} Auto-generated method stub
2. ${body_statement}
Code-->Constructorbody(构造函数模板)
Java代码
1. ${body_statement}
2. // ${todo} Auto-generated constructor stub
Code-->Getterbody(字段Getter方法模板)
Java代码
1. return ${field};
Code-->Setterbody(字段Setter方法模板)
Java代码
1. ${field} = ${param};
Code-->Catchblock body(异常catch代码块模板)
Java代码
1. // ${todo} Auto-generated catch block
2. ${exception_var}.printStackTrace();
以下为我比较懒,我想导入
1. version="1.0" encoding="UTF-8" standalone="no"?>
2. * ${bare_field_name}.
3. *
4. * @return the ${bare_field_name}
5. * @since JDK 1.8
6. */ autoinsert="false" context="settercomment_context" deleted="false" description="Comment for setter method" enabled="true" id="org.eclipse.jdt.ui.text.codetemplates.settercomment" name="settercomment">/**
7. * ${param}.
8. *
9. * @param ${param} the ${bare_field_name} to set
10. * @since JDK 1.8
11. */ autoinsert="false" context="constructorcomment_context" deleted="false" description="Comment for created constructors" enabled="true" id="org.eclipse.jdt.ui.text.codetemplates.constructorcomment" name="constructorcomment">/**
12. * Creates a new instance of ${enclosing_type}.
13. *
14. * ${tags}
15. */
16. autoinsert="false" context="filecomment_context" deleted="false" description="Comment for created Java files" enabled="true" id="org.eclipse.jdt.ui.text.codetemplates.filecomment" name="filecomment">/**
17. * Project Name:${project_name}
18. * File Name:${file_name}
19. * Package Name:${package_name}
20. * Date:${date}${time}
21. * Copyright (c) ${year}, [email protected] All Rights Reserved.
22. *
23. */ autoinsert="false" context="typecomment_context" deleted="false" description="Comment for created types" enabled="true" id="org.eclipse.jdt.ui.text.codetemplates.typecomment" name="typecomment">/**
24. * ClassName: ${type_name} <br/>
25. * Function: ${todo} ADD FUNCTION. <br/>
26. * Reason: ${todo} ADD REASON(可选). <br/>
27. * date: ${date} ${time} <br/>
28. *
29. * @author ${user}
30. * @version ${enclosing_type}${tags}
31. * @since JDK 1.8
32. */ autoinsert="false" context="fieldcomment_context" deleted="false" description="Comment for fields" enabled="true" id="org.eclipse.jdt.ui.text.codetemplates.fieldcomment" name="fieldcomment">/**
33. * ${field}:${todo}(用一句话描述这个变量表示什么).
34. * @since JDK 1.8
35. */ 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">/**
36. * ${enclosing_method}:(这里用一句话描述这个方法的作用). <br/>
37. * ${todo}(这里描述这个方法适用条件 – 可选).<br/>
38. * ${todo}(这里描述这个方法的执行流程 – 可选).<br/>
39. * ${todo}(这里描述这个方法的使用方法 – 可选).<br/>
40. * ${todo}(这里描述这个方法的注意事项 – 可选).<br/>
41. *
42. * @author ${user}
43. * ${tags}
44. * @since JDK 1.8
45. */ autoinsert="false" context="overridecomment_context" deleted="false" description="Comment for overriding methods" enabled="true" id="org.eclipse.jdt.ui.text.codetemplates.overridecomment" name="overridecomment">/**
46. * ${todo} 简单描述该方法的实现功能(可选).
47. * ${see_to_overridden}
48. */ autoinsert="true" context="delegatecomment_context" deleted="false" description="Comment for delegate methods" enabled="true" id="org.eclipse.jdt.ui.text.codetemplates.delegatecomment" name="delegatecomment">/**
49. * ${tags}
50. * ${see_to_target}
51. */ autoinsert="false" context="newtype_context" deleted="false" description="Newly created files" enabled="true" id="org.eclipse.jdt.ui.text.codetemplates.newtype" name="newtype">/**
52. * Project Name:${project_name}
53. * File Name:${file_name}
54. * Package Name:${package_name}
55. * Date:${date}${time}
56. * Copyright (c) ${year}, [email protected] All Rights Reserved.
57. *
58. */
59. ${filecomment}
60.
61. ${package_declaration}
62. /**
63. * ClassName:${type_name} <br/>
64. * Function: ${todo} ADD FUNCTION. <br/>
65. * Reason: ${todo} ADD REASON. <br/>
66. * Date: ${date} ${time} <br/>
67. * @author ${user}
68. * @version
69. * @since JDK 1.8
70. * @see
71. */
72. ${typecomment}
73. ${type_declaration}
74. autoinsert="true" context="classbody_context" deleted="false" description="Code in new class type bodies" enabled="true" id="org.eclipse.jdt.ui.text.codetemplates.classbody" name="classbody">
75. autoinsert="true" context="interfacebody_context" deleted="false" description="Code in new interface type bodies" enabled="true" id="org.eclipse.jdt.ui.text.codetemplates.interfacebody" name="interfacebody">
76. autoinsert="true" context="enumbody_context" deleted="false" description="Code in new enum type bodies" enabled="true" id="org.eclipse.jdt.ui.text.codetemplates.enumbody" name="enumbody">
77. autoinsert="true" context="annotationbody_context" deleted="false" description="Code in new annotation type bodies" enabled="true" id="org.eclipse.jdt.ui.text.codetemplates.annotationbody" name="annotationbody">
78. autoinsert="true" context="catchblock_context" deleted="false" description="Code in new catch blocks" enabled="true" id="org.eclipse.jdt.ui.text.codetemplates.catchblock" name="catchblock">
79. // ${todo} Auto-generated catch block
80. ${exception_var}.printStackTrace();
81. autoinsert="false" context="methodbody_context" deleted="false" description="Code in created method stubs" enabled="true" id="org.eclipse.jdt.ui.text.codetemplates.methodbody" name="methodbody">
82. // ${todo} Auto-generated method stub
83. ${body_statement} autoinsert="true" context="constructorbody_context" deleted="false" description="Code in created constructor stubs" enabled="true" id="org.eclipse.jdt.ui.text.codetemplates.constructorbody" name="constructorbody">
84. ${body_statement}
85. // ${todo} Auto-generated constructor stub
86. autoinsert="true" context="getterbody_context" deleted="false" description="Code in created getters" enabled="true" id="org.eclipse.jdt.ui.text.codetemplates.getterbody" name="getterbody">return ${field}; autoinsert="true" context="setterbody_context" deleted="false" description="Code in created setters" enabled="true" id="org.eclipse.jdt.ui.text.codetemplates.setterbody" name="setterbody">${field} = ${param};