This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes IDEs, Version Control and other tools and the fly likes How to automatically place JavaDoc comments in Eclipse? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Bookmark "How to automatically place JavaDoc comments in Eclipse?" Watch "How to automatically place JavaDoc comments in Eclipse?" New topic
Author

How to automatically place JavaDoc comments in Eclipse?

James Dekker
Ranch Hand

Joined: Dec 09, 2006
Posts: 215
Fellow Ranchers,

I am using Eclipse Ganymede... How can I set it so that for every class, method, instance declaration, etc. that I create, Eclipse automatically places JavaDoc?

Right now I am using control space (Content Assist) right after I type in /**.

Would prefer it to be always generated (decorating my code) while I am developing.

Happy programming,

James
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Alt-Shift-J, IRC, or from the context menu. It won't add Javadocs automagically if you type in a function. If it's created from a template, like when overriding etc., you can define the template for the Javadoc as well.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16019
    
  20

I believe I used to have a tool that would do that, but I don't remember what it was. Jalopy might do it, and it's available as an Eclipse plugin.

You don't need to do a control-space to make autodoc comments work. Just type "/**" above the method/class definition and press ENTER. Eclipse will automatically close the comment and put in as much of the doc body as it can deduce. No control key press required.


Customer surveys are for companies who didn't pay proper attention to begin with.
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

The key sequence will do it from anywhere in the method, though :D
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: How to automatically place JavaDoc comments in Eclipse?