MyEclipse6.5 Setting the date of the comment template in Chinese format

Source: Internet
Author: User
Tags dateformat static class

/** * MyEclipse6.5 Set the date of the comment template to the Chinese format *-------------------------------------------------------------------------------- -------------------------------* believe that most people have used the code templates function in Eclipse/myeclipse, configure the address as follows * windows-->preferences-- >java-->code Style-->code templates-->comments * Generally I will only configure two places, one is types (for comments on the class name), one is methods (for annotation methods), The configuration contents are as follows */** *  * @create ${date} ${time} * *  @author Jade 

So here's the question:

The above comments, time is English format, look very uncomfortable, then try to change to Chinese bar, there are two ways

/** * MyEclipse6.5 Set the date of the comment template to the Chinese format *-------------------------------------------------------------------------------- -------------------------------* 1) Modify the Eclipse profile D:\Develop\MyEclipse\eclipse\eclipse.ini * Modify the-duser.language= in it En is-duser.language=zh-cn (modified, none added) *-------------------------------------------------------------------------- -------------------------------------* 2) Modify Eclipse's plug-in jar (this is a bit of a hassle, but more flexible than the first one) * D:\Develop\MyEclipse\eclipse\   Plugins\org.eclipse.text_3.3.0.v20070606-0010.jar * is Org.eclipse.text_xxxx.jar (some eclipse has a different version or date from the jar behind it) * Modify the Org.eclipse.jface.text.templates.GlobalTemplateVariables class inside to find the following code * public static class Date extends Simpletemplatevariableresolver {* Public Date () {* SUPER (texttemplatemessages.getstring ("GLOBALVARIABLES.VARIABLE.D Escription.date ")); *} * Protected String Resolve (Templatecontext context) {* return dateformat.getdateinstance (). Format (new Date ()); *} *} * modified to the following contents * public static class Date extends SimpLetemplatevariableresolver {* Public Date () {* SUPER (texttemplatemessages.getstring ("GlobalVariables.variable.descr Iption.date ")); *} * Protected String Resolve (Templatecontext context) {*//return dateformat.getdateinstance (). Format (new Date ()) ; * Final SimpleDateFormat SDF = new SimpleDateFormat ("Yyyy-mm-dd HH:mm:ss"); * Return Sdf.format (New Java.util.Date ()); *   } *   } * ---------------------------------------------------------------------------------------------------------- -----* @create 2015-1-18 Morning 11:26:22 * @author Xuan Yu 

MyEclipse6.5 Set the date for the comment template in Chinese format

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.