Eclipse/myeclipse How to set up a personalized code comment template

Source: Internet
Author: User

From: http://jingyan.baidu.com/article/375c8e19b4c54d25f3a22956.html

Open the Eclipse/myeclipse tool, open or create a Java project, click the menu window->preferences Pop-up Preferences window

  1. Expand the list of Java->code style->code template options on the left to see all the elements that need to be annotated

  2. Expand right-side template options comments to see the types of comment templates you can set, including Files,types,fields,constructors,methods, and more

  3. Click Types, the pattern section below displays the contents of the Class Comment template, click the Edit button on the right to modify the content of the comment template

  4. For example: I am accustomed to the following annotation format:/*** <p>title: </p>* <p>description: </p>* <p>company: </p> * @ Author * @date * *

    So enter the above content in the pattern area

  5. Place your mouse behind the title, click the Insert Variable button below, and in the list of variables that pops up, select TypeName

  6. Similarly, enter ${user} after @author, enter ${date} ${time} variable after @date, and such annotations are defined.

  7. In the actual development process, after a new class, by entering/**, and then enter automatically follow the definition of the Comment template format to fill the comment content, you can also press Shift+alt+j shortcut key to complete the action

Eclipse/myeclipse How to set up a personalized code 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.