Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add a hyperlink in a comment in eclipse javadocs

I would like Eclipse to resolve e.g. this hyperlink in a javadoc:

/*
 * for reference, look here: http://www.google.com
 */

The goal would be that the hyperlink is just "clickable" as any normal hyperlink (e.g. as in pdf or doc files).

like image 881
ptikobj Avatar asked Jan 11 '11 10:01

ptikobj


People also ask

How do I add a hyperlink to a Javadoc?

Creating a Link to Javadoc of Another Class To summarize, @link is preferred when we use a class or method name in the description. On the other hand, @see is used when a relevant reference is not mentioned in the description or as a replacement for multiple links to the same reference.

How do you hyperlink in eclipse?

In eclipse, you can paste the link to a comment, hold down control and click it. If you want to be able to just press it without holding anything down, go to Window -> Preferences -> General -> Editors -> Text Editors -> Hyperlinking, then click on URL and remove the modifier key, click apply, click ok and you're done!

How do you comment Javadoc in Eclipse?

Bear the following in mind when using Add Javadoc comment (Alt+Shift+J): To add a comment to a field, position the cursor on the field declaration. To add a comment to a method, position the cursor anywhere in the method or on its declaration.


1 Answers

That is only possible in a JavaDoc comment!

Example:

/**
 * for reference, look here: <a href="http://www.google.com">Google</a>
 */

After generating the Javadoc, you have a normal hyperlink. An other way is to watch in the JavaDoc view of Eclipse!

EDIT: Another way in a normal comment is to press the CTRL and click with the left mouse botton on the link!

like image 198
Tim Avatar answered Sep 30 '22 12:09

Tim