Reputation: 6832
As we know,Eclipse can help us generate code comments for types and methods,e.g,we can go
Preferences > Java > Code Style > Code Templates > Comments
to configure a template for Java types.
Here is my template for Types:
/**
* @className:${package_name}.${file_name}
* @description:${todo}
* @author <a href="mailto:[email protected]">Author</a>
* @date ${date} ${time}
*/
Well when I press
/ * * and Enter before a class type,the Eclipse will generate comments below:
/**
*
* @className:com.abc.demo.Demo.java
* @description:TODO
* @author <a href="mailto:[email protected]">Author</a>
* @date May 26, 2013 8:56:12 AM
*/
In fact,there are two things which are not what I expected.
@className
,so everytime I have to press ctrl + D to delete it;2013-05-26
but it is May 26, 2013
),and what’s even weirder is,the time is not correct(or Not my timezone's current time?)So can it really generated code templates as I will below:
/**
* @className:com.abc.demo.Demo.java
* @description:TODO
* @author <a href="mailto:[email protected]">Author</a>
* @date 2013-05-26 09:30 PM
*/
btw,I am working on Windows 7 with Eclipse Helios.
Upvotes: 1
Views: 1239
Reputation: 1428
About the date formatting, have a look at this SO entry : How to set the Eclipse date variable format?
In short, setting "-Duser.language" and "-Duser.region" may help.
Upvotes: 1