Question

My question is very simple. How can you create your own tooltip information for your own created methods and classes, the way all methods and classes of the standard library of java have, when you are writing code and choosing methods and subclasses?! For example, let's say I have a Class A, in which I have a Method B. Now I define a new instance of Class A in another Class C by writing "A my_class = new A()". Now when I write "my_class.B" I want the Eclipse to show me the information about the Method B in a tooltip, so I know what are the parameters I have to pass to that method B. Here is a picture example:

http://www.subshell.com/en/subshell/blog/eclipse-javadoc-tooltips100~v-full_small.jpg

I searched a while, but I didn't find any solutions for that. So maybe you know how to do that!

Was it helpful?

Solution

In eclipse, once you add the javadoc comment to your method, it will show up wherever you refer to that method. The Javadoc comment takes the form

   /**
    * This is my method description
    * @param x the total number of mangoes allowed
    * @return int the number of litres of juice possible
    */

Javadoc comments are placed just before the artifact that it describes. So a method comment will go on the line before the method, a class comment goes on the line before the class statement and so on.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top