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 11553 - [indentation/formating] javadoc comments should be justifiable
Summary: [indentation/formating] javadoc comments should be justifiable
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Editor (show other bugs)
Version: 3.x
Hardware: PC Windows ME/2000
: P3 blocker with 19 votes (vote)
Assignee: Dusan Balek
URL:
Keywords:
: 18657 42220 53830 (view as bug list)
Depends on:
Blocks:
 
Reported: 2001-04-19 08:43 UTC by David Konecny
Modified: 2012-01-30 22:18 UTC (History)
4 users (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments
Proposal for implementation of JavaDoc formatting and indentation. (115.91 KB, application/pdf)
2006-06-06 19:50 UTC, rptmaestro
Details

Note You need to log in before you can comment on or make changes to this bug.
Description David Konecny 2001-04-19 08:43:18 UTC
reported by Henry Story <hstory@etranslate.com>:
The text in the javadoc should be wrapped to fit into the 80chars of a page.
Comment 1 Jan Lahoda 2001-04-19 15:16:19 UTC
I agree that this would be cool, by I suggest to create possibility to switch
this behaviour on/off, no statically switch it on. And, we have to think if it
is OK, to reformat already written text, or only wrap while writting.
Comment 2 David Konecny 2001-04-19 15:55:51 UTC
Surely it must be configurable. As for the reformating of the code, yes, we will 
have to discuss it! See for example 
http://www.netbeans.org/issues/show_bug.cgi?id=6409 - it is another request for 
code reformatting. All these things must be definitely configurable.
Comment 3 David Konecny 2001-05-04 12:26:57 UTC
see also issue 11950
Comment 4 Jan Chalupa 2001-05-05 21:54:14 UTC
Target milestone -> 3.3
Comment 5 David Konecny 2001-06-18 13:45:16 UTC
Changing the state of the issue to ASSIGNED, because it was covered in 
Requirements document at http://editor.netbeans.org/doc/Requirements.html
Comment 6 Jan Chalupa 2001-11-27 12:26:53 UTC
Target milestone -> 3.3.1.
Comment 7 Marek Grummich 2002-07-22 12:14:04 UTC
Set target milestone to TBD
Comment 8 Marek Grummich 2002-07-22 12:19:04 UTC
Set target milestone to TBD
Comment 9 Roman Strobl 2004-12-06 14:14:58 UTC
*** Issue 18657 has been marked as a duplicate of this issue. ***
Comment 10 Roman Strobl 2004-12-07 13:40:50 UTC
*** Issue 42220 has been marked as a duplicate of this issue. ***
Comment 11 Roman Strobl 2004-12-07 13:41:52 UTC
Changing to P3 due to issue #42220. See this issue for aditional ideas
on javadoc wrapping.
Comment 12 Roman Strobl 2004-12-07 15:05:31 UTC
Changing subcomponent to formatting.
Comment 13 Roman Strobl 2005-04-20 16:19:10 UTC
*** Issue 53830 has been marked as a duplicate of this issue. ***
Comment 14 dkarr 2005-04-26 18:21:02 UTC
It would be useful to examine how this related feature works in Emacs, as I
believe that behavior is close to optimal.  The behaviors it enables are:

* enabling/disabling comment wrapping
* setting wrap column
* in either /* or // comment, insert comment delimiter (* or //) and a space
after wrapping.
* To justify existing text (after deleting words, lines, etc.), select a region
and execute the justify function.
* automatic justification of the current line happens when space is pressed.

Note that Emacs does not attempt to auto-justify when deleting text.  The only
time justification occurs is when a pressed space is beyond the wrap column, or
when a region is selected, and the justification function is executed.
Comment 15 rptmaestro 2006-06-06 19:50:23 UTC
Created attachment 30834 [details]
Proposal for implementation of JavaDoc formatting and indentation.
Comment 16 Miloslav Metelka 2006-06-07 12:56:38 UTC
I agree with your PDF proposal. For NB 6.0 we would like to improve the
infrastructure by adding lexer module supporting language embedding so that the
syntax coloring and further operation with the javadoc content will be simplified. 
Comment 17 exolon 2010-01-09 17:49:10 UTC
Has anyone thought about implementing this yet? It doesn't sound like a big deal, but it would certainly improve readability and lower blood pressure when working on code which has massively long unwrapped comment lines.

Eclipse's code formatter does this without asking - it would seem logical to simply add it as another option to the formatter->wrapping dropdowns.
Comment 18 Sazaju 2010-11-20 11:39:42 UTC
It seems it is not a big deal, but not a needed features too (for the NetBeans team at least).

It is only my opinion, but I can't understand the Javadoc has no formatting features yet :

- Eclipse does it simply with the code formatting (what is quite logical, as the Javadoc is a part of the code);

- it is as useful as code formatting : avoid the classic waste of time in the manual formatting AND make it more readable;

- it seems more simple than code formatting : the wrap to not pass over the character's limit (80 by default) and possibly a simple XML formatting (as it uses HTML tags) seems sufficient to me;

- NetBeans already has code formatting, so there is already a base for this;

- this subject exists since 2001 !!! (this is this point which irritate me)

Maybe it's time to wake up ? How many votes are needed to make it ? Except guys who does not write Javadoc, this feature seems quite useful ... Is it the case of the NetBeans team ?
Comment 19 Geertjan Wielenga 2012-01-30 12:43:46 UTC
Configurable JavaDoc formatting has been implemented in NetBeans IDE 7.1 (see Tools menu -> Options window -> Editor tab -> Formatting subtab -> Java -> Comment).

Does that resolve this issue? Can some of you who have commented here open NetBeans IDE 7.1, and see if this is what you're looking for?
Comment 20 atr_23 2012-01-30 12:58:06 UTC
(In reply to comment #19)
> Configurable JavaDoc formatting has been implemented in NetBeans IDE 7.1 (see
> Tools menu -> Options window -> Editor tab -> Formatting subtab -> Java ->
> Comment).
> 
> Does that resolve this issue? Can some of you who have commented here open
> NetBeans IDE 7.1, and see if this is what you're looking for?

It works very nice! Before the package statement one star comments are not wrapped, but since these are often copyright statements this seems to be a good idea.
Comment 21 mcclosdl 2012-01-30 13:29:07 UTC
This is exactly what I had in mind. It's great and all the customization is great (but the defaults are exactly what I've been manually doing anyway.)  Thanks!
Comment 22 Geertjan Wielenga 2012-01-30 13:39:54 UTC
I think it makes sense to have this issue closed, since it is now possible to, when you invoke "Fomat", justify the javadoc comments with the right margin.