Eclipse newbie: How to add Javadoc?

Posted on 2006-04-17
Last Modified: 2011-09-20
Dear Eclipse Experts,

I'm sure I'm missing something obvious here...

In JBuilder, I could just right-click class declarations and methods, and a nice add-Javadoc window would pop up.  Is there anything similar in Eclipse?  Or do I have to hand-code it?

Question by:BrianMc1958
    LVL 10

    Expert Comment

    Surely that feature is there in Eclipse. You can right click on the class/method/field declaration
    in the outline or anywhere else and got to Source -> Add JavaDoc Comment.

    There is a shortcut too.. Alt + Shift + J


    Author Comment

    When I do that, I automitcally get this:

     * @author Administrator

    I actually want to put in a "@todo", and I'd like it to be part of the existing JavaDoc for the class.  Is there a way to do that?  

    LVL 10

    Accepted Solution

    Yes you can do that by editing templates.
    Go to Window -> Preferences -> Java -> ... Templates
    (I don't remember the exact location... but it's somewhere inside Java)

    There, under comments, you'll find many existing templates. Edit the one for new types and
    put in whatever you want to.


    Author Comment

    Thanks.  I'll take a look at it...


    Featured Post

    Find Ransomware Secrets With All-Source Analysis

    Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

    Join & Write a Comment

    Suggested Solutions

    Title # Comments Views Activity
    tenRun challenge 28 67
    mergeTwo  challenge 13 53
    Performance issue while iterating with streams 5 34
    powerN  challenge 3 36
    An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
    Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
    Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
    Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…

    728 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now