/** * 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