This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 20672 - Allow reformat of Javadoc comments
Summary: Allow reformat of Javadoc comments
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Javadoc (show other bugs)
Version: 3.x
Hardware: PC Windows ME/2000
: P1 blocker with 2 votes (vote)
Assignee: Dusan Balek
URL:
Keywords: API, API_REVIEW_FAST, PLAN
Depends on:
Blocks: 60941
  Show dependency tree
 
Reported: 2002-02-19 14:32 UTC by Ben Hutchison
Modified: 2011-07-14 14:28 UTC (History)
1 user (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments
Proposed patch (103.04 KB, patch)
2011-06-30 14:12 UTC, Dusan Balek
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ben Hutchison 2002-02-19 14:32:25 UTC
When editing Javadoc comments in sourcefiles in the editor, I would like to 
control:

* Turning word wrap on so comments automatic get wrapped at a settable number 
of characters, eg 80.

* Starting line indent or prefix characters eg " * ", or "" inserted when a new 
line is created in a comment. Right now there is the choice of " " or " *", 
neither of which are my favorite choice. Better to let the user configure 
anyway.
Comment 1 Marek Grummich 2002-07-19 16:30:29 UTC
Target milestone was changed from not determined to TBD
Comment 2 _ pkuzel 2003-09-09 17:03:30 UTC
I'm now responsible for JavaDoc module.
Comment 3 _ pkuzel 2004-03-24 10:46:15 UTC
[batch] Giving up javadoc issues exclusive ownership.
Comment 4 Ben Hutchison 2004-04-21 01:10:45 UTC
Please, please, can I get this issue on the development agenda....

Neither of the proposed enhancements are super difficult to 
implement, and they would add real productivity gains to the IDE. 

1. In http://www.servlets.com/blog/archives/000040.html Jason Hutner 
describes Javadoc word-wrap as one of this top features of IntelliJ. 
Lets get it in Netbeans. I realize that this one requires a non-
trivial amount of work to get right, but there should be existing 
code to handle the actual text wrapping algorithm, eg at least Swings 
text WrappedPlainView class.

I think I saw another reuest for this in the issue database too - 
used the word "justification"

2. Javadoc line prefix: Easy -There is already a setting that allows 
you to choose " " or " *" as your javadoc line prefix. Just change 
this to allow the user to specify the prefix string property, rather 
than offering a binary choice.
Comment 5 camroe 2006-06-12 17:05:26 UTC
Eclipse, IntelliJ, Borland even Emacs and Notepad can do word wrap. I'm not sure
what the big deal is. In fact, even as I type this into the text field on this
issue site - it's doing word wrap! 
This issue seems to me to be one that would be easy to do and would add big time
to the appeal of netbeans. I can't imagine how much effort and time is wasted in
doing wrap edits to code or how much time is wasted as people download, learn,
and figure out a 3rd party thing like Jalopy.
Word wrap to the same EOL as the code, ignore everything withing the <PRE></PRE>
blocks and keep the new line before the tags and you would have something that
is way better than what is there now... nothing. 
Comment 6 ftsiang 2011-04-17 09:46:54 UTC
line wrap in netbean 7.0 is a good start. However to make this functionality truly useful additional customization options would help. Below are some options to consider

1) Allow selective word wrap. The user would be able to select what type of code blocks would be word wrapped such as /** JavaDoc comments, /* regular comments, // end of line comments, Strings within quotes, { Array declaration and assignment, <> tag content...

2) Allow the option to start wrapped lines at the left end of the window or at the starting position of the code element being wrapped. Example: If a javaDoc comment started 8 spaces in then left margin of the line wrapping would start 8 space in. If a Quote start on row 48 then the left margin to line wrap the text would start at column 48.

          /** Line wrapping for the
              javadoc comment should
              have a option to wrap
              at the starting column
              of the comment instead
              of only the beginning
              of the line */

3) Allow the option to word wrap at 1) the end of the window or 2) at the right margin settings or 3) extend a configurable number of characters beyond the left margin.
Comment 7 Dusan Balek 2011-06-30 14:12:32 UTC
Created attachment 109168 [details]
Proposed patch
Comment 8 Dusan Balek 2011-06-30 14:30:35 UTC
I would like to add several new methods to the CodeStyle to cover (Javadoc) comments formatting options.

Please see the attached patch. Thanks for the review.
Comment 9 Dusan Balek 2011-07-13 07:57:55 UTC
Fixed in jet-main.

http://hg.netbeans.org/jet-main/rev/0c0ac8295c70
Comment 10 Quality Engineering 2011-07-14 14:28:46 UTC
Integrated into 'main-golden'
Changeset: http://hg.netbeans.org/main-golden/rev/0c0ac8295c70
User: Dusan Balek <dbalek@netbeans.org>
Log: Issue #20672: Allow for reformat of Javadoc comments - fixed.