1. Click Window->preference->java, Code Style, Formatter
2. Click on the right import to select the *.xml template file to import.
3. If you need to make changes to the template, you can click Edit
Template instance:
<?xml version= "1.0" encoding= "UTF-8"? ><profiles version= "Ten" ><profile name= "Zhiwei profile" version= " "><setting id=" Org.eclipse.jdt.core.formatter.align_type_members_on_columns "value=" false "/>< Setting id= "Org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression" value= "/><" Setting id= "Org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant" value= "/><setting" Id= "Org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call" value= "/><" Setting id= "Org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation" value= "/><" Setting id= "Org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression" value= "16 "/>, ...... ..... ..... ..... ..... ..... ..... ..... ..... ..... ....... ........
Note Template import:
1. Click Window->preference->java, Code Style, code Templates
2. Click on the right comments, then click Import to select *.xml template file.
3. If you need to make changes to the template, click on an item under comments and click Edit
Instance:
<?xml version= "1.0" encoding= "UTF-8" standalone= "no"? ><templates><template 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 ">/** * @Title: ${file_name} * @ Package ${package_name} * @Description: * @author ${user} * @date ${date} ${time} * @version V1.0 */ /**. ..........................................................................................................................
Eclipse Comment Templates and Formatting template import steps