Eclipse FAQ Font Change, add comment template

Source: Internet
Author: User

Some students may and I have the same trouble, every time I want to change the font size, background color, etc., need Baidu to know how to do ... Do not know that there is no such situation of children, anyway, I often meet, always remember, write down today, incidentally, I can forget the time to check.

1.Eclipse Font Changes: Open the Eclipse main screen, locate Windows, and select the last item Preferences. I use a picture to show you the font change process.

2.Eclipse Adding custom annotations: In the course of project development, it is necessary to add comments, and a good comment can improve the quality of our code. So let's start adding comments: Open the Eclipse main screen, find Windows, and select the last Preferences. I'm still using a graph to show you the process of adding custom annotations .

We can also add comments by Importing the comment template (XML file) by ourselves, clicking on the import on the right and selecting the template to import the template. To make the annotations look clearer, we can edit the template after we import it (click Edit), we can add "<pre> here is template content </pre>" To change the template to the format we need, The pre tag can make the template clearer.

Add a comment shortcut:alt+shift+j, add comments for the entire class, and if you want to add a comment to a method, be sure to move the cursor over the name of the method , using the shortcut key alt+shift+j. You can add comments.

Here is my comment template (students can change their own format): Add code to an XML file, and then import the file.

  

1<?xml version= "1.0" encoding= "UTF-8" standalone= "no"? ><templates><template autoinsert= "true" context = "Settercomment_context" deleted= "false" description= "Comment for Setter Method" enabled= "true" id= " Org.eclipse.jdt.ui.text.codetemplates.settercomment "name=" Settercomment ">/**2  * @param${param} The ${bare_field_name} to set.3  */</template><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 ">/**4 * ${project_name}5 * ${file_name}6  * @author${user}7 * Create time: ${date} ${time}8 * Modified Time:9 * Modified by:Ten * version:1.0 One  */</template><template autoinsert= "true" context= "Fieldcomment_context" deleted= "false" description= " Comment for Fields "enabled=" true "id=" Org.eclipse.jdt.ui.text.codetemplates.fieldcomment "name=" Fieldcomment ">/** A  *  -  */</template><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 " >/** - * Project Name:${project_name} the  *  - * Package:${package_name} -  *  - * Filename:${file_name} +  *  -  * @author${user} +  *  A * Purpose: at  *  - * Create time: ${date} ${time} -  *  - * Create Specification: -  *  - * Modified Time: in  *  - * Modified by: to  *  + * Modified Specification: -  *  the * version:1.0 *  */ $</template><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 ">/**Purpose:Panax Notoginseng  * @author${user} -  the * Create time: ${date} ${time} +  A * ${tags} the  + * version:1.0 -  */</template><template autoinsert= "true" context= "Overridecomment_context" deleted= "false" description= " Comment for overriding methods "enabled=" true "id=" Org.eclipse.jdt.ui.text.codetemplates.overridecomment "Name=" Overridecomment ">/*(Non-javadoc) $ * ${see_to_overridden} $  */</template><template autoinsert= "true" context= "Gettercomment_context" deleted= "false" description= " Comment for Getter Method "enabled=" true "id=" Org.eclipse.jdt.ui.text.codetemplates.gettercomment "Name=" Gettercomment ">/** -  * @returnReturns The ${bare_field_name}. -  */</template><template autoinsert= "true" context= "Delegatecomment_context" deleted= "false" description= " Comment for delegate methods "Enabled=" true "id=" Org.eclipse.jdt.ui.text.codetemplates.delegatecomment "Name=" Delegatecomment ">/** the * ${tags} - * ${see_to_target}Wuyi  */</template><template autoinsert= "true" context= "Constructorcomment_context" deleted= "false" description= " Comment for created constructors "enabled=" true "id=" Org.eclipse.jdt.ui.text.codetemplates.constructorcomment "name= "Constructorcomment" >/** the * ${tags} -  */</template></templates>

================================================================================================

My csdn Blog: http://blog.csdn.net/u010049692/article/details/38681391

Eclipse FAQ Font Change, add comment template

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.