Configure a custom template (original) under Eclipse

Source: Internet
Author: User

I am willing to admit that I am a little lazy, and the principle of laziness is that the work that can be given to machines is never done by hand. In the process of using eclipse, you have encountered the need to manually write program annotations every time. Although each program cannot be exactly the same, there is a commonality of information in the same project. So, can you extract these commonalities, create a program when you can generate it yourself. If you do it, you really have this function.

1. Open Eclipse and go to Java configuration options: Click on the Eclipse's Windows menu, select the Preferences Pop-up dialog box to select Java>code Style>code Templates as shown in the figure, Then we focus on the right side of the dialog box. Click on the comments node with the mouse and see the annotation settings for various templates in turn
The getter, Setter, constructors, Files, Types, Fields, Methods, overiding Methods, in turn, can be set by the user. Let's take types to do the example setting, first select the Types node in the box below to see the configuration for this item

/*
* Project name: Personal WAP Management system
* Function Module Name:
* Project Manager: Roy Lee
*
* filename is called: ${file_name}
* File Creator: ${user}
*
* Change record:
* Modified Person Modified Date remarks
*
*
*
* @author Roy Lee
* @version
* @time ${date} ${time}
* @copyright Anymusic LTD.
* * We can click on the Edit button on the right to modify the content. The dialog box that pops up when you click Edit is as follows:

Click OK when you have finished modifying it. Then check the File menu new a Java file and try it out to see what miracles are occurring.

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.