aspose file tools*
The moose likes IDEs, Version Control and other tools and the fly likes Comments format along with java code Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Bookmark "Comments format along with java code" Watch "Comments format along with java code" New topic
Author

Comments format along with java code

Harikrishna Gorrepati
Ranch Hand

Joined: Sep 23, 2010
Posts: 422
Hi, I have the following java code plus comments and want to keep the same format in Eclipse java file. But, when I say Ctrl+Shift+F (Format option), I am loosing all format. Please advice what should I do ?


OCPJP 6.0-81% | Preparing for OCWCD
http://www.certpal.com/blogs/cert-articles | http://sites.google.com/site/mostlyjava/scwcd |
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5843
    
    7

Go to Windows | Preferences | Java | Appearance | Formatter and click Edit next to the active profile. On the Profile dialog, click that Comments button and uncheck the various settings. For this particular comment, unchecking "Enable block formatting" should be sufficient.

But personally, I would change this comment into a javadoc comment for the either the class of the main method, using HTML tags for the options (a..g).

By the way, either your post has a typo or you are missing the '/' on line 25 after the '*' to end the comment.


JBoss In Action
Harikrishna Gorrepati
Ranch Hand

Joined: Sep 23, 2010
Posts: 422
Thanks Peter. It was a typo error. I unchecked "Enable Javadoc comment formatting" and it worked.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Comments format along with java code