Please use the Apache issue tracking system for new NetBeans issues (https://issues.apache.org/jira/projects/NETBEANS0/issues) !!
Bug 215552 - Patch for: Support selecting javadoc/lines when executing "Select next element"/"Expand selection" on a method or class
Patch for: Support selecting javadoc/lines when executing "Select next elemen...
Status: RESOLVED FIXED
Product: java
Classification: Unclassified
Component: Editor
7.2
PC Windows 7
: P3 with 1 vote (vote)
: 7.4
Assigned To: Dusan Balek
issues@java
: PATCH_AVAILABLE
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-07-15 12:07 UTC by markiewb
Modified: 2013-03-27 17:59 UTC (History)
1 user (show)

See Also:
Issue Type: ENHANCEMENT
:


Attachments
Visual example with actual and expected behaviour (69.20 KB, image/png)
2012-07-15 12:07 UTC, markiewb
Details
Proposed patch (3.18 KB, patch)
2013-02-10 23:19 UTC, markiewb
Details | Diff
Proposed patch v2 - adds line selection and expand selectio (5.08 KB, patch)
2013-03-11 22:34 UTC, markiewb
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description markiewb 2012-07-15 12:07:50 UTC
Created attachment 122032 [details]
Visual example with actual and expected behaviour

Support selecting javadoc when executing "Select next element"/"Expand selection" on a method or class.

Example:
<code>
    /**
     * My method comment.
     */
    public void doIt() {
    }
</code>
Place the cursor into the method name f.e. do|It. 
Invoke "select next element", then the method gets selected f.e. public ...{}.
Invoke "select next element" again, then

*Actual:* the class gets selected
*Expected:* the comment of the method including the method itself gets selected

See the screenshot to see what i mean.

The same behaviour can be spotted when doing the procedure with classes and variable comment

----
Product Version: NetBeans IDE 7.2 RC1 (Build 201206272359)
Java: 1.6.0_30; Java HotSpot(TM) 64-Bit Server VM 20.5-b03
System: Windows 7 version 6.1 running on amd64; Cp1252; de_DE (nb)
Comment 1 markiewb 2013-02-10 23:19:38 UTC
Created attachment 131212 [details]
Proposed patch

I like to propose the following patch to solve this issue.

The patch allows you to select also javadoc comments of members as requested.

@NetBeans-Dev: Please review, discuss and commit.
Comment 2 markiewb 2013-02-10 23:21:06 UTC
FYI: This issue looks like a part of the RFE http://netbeans.org/bugzilla/show_bug.cgi?id=56561
Comment 3 markiewb 2013-03-11 22:34:10 UTC
Created attachment 132482 [details]
Proposed patch v2 - adds line selection and expand selectio

I extended the patch 
* to support full line selections
* so that the selection start at the end. This way the editor scrolls to the beginning not to the end while expanding
Comment 4 Dusan Balek 2013-03-27 10:41:00 UTC
Patch integrated. Thanks for your contribution!

http://hg.netbeans.org/jet-main/rev/59f4e0b49dfe
Comment 5 markiewb 2013-03-27 14:13:21 UTC
(In reply to comment #4)
> Patch integrated. Thanks for your contribution!
> 
> http://hg.netbeans.org/jet-main/rev/59f4e0b49dfe

@Dusan: Thank very much. 
I only want to note again that the patch also changed the selection-start-end-behavior. It is inverted now (caret at selection-start). Have you noticed that? What is your opinion? 

IMHO i like to have to this more useful behavior, so it is nice to have this "multiple-issue"-patch applied, but maybe this will create follow-up issues. All other editor implementations (f.e. PHP, HTML) still use the "caret at selection-end"-behavior. Feel free to revert the 2 lines change in SelectCodeElementAction.select() is necessary OR is there a need for a new umbrella-ticket for changing the other editors?
Comment 6 Dusan Balek 2013-03-27 15:43:25 UTC
The inverted selection-start-end-behavior makes more sense to me so I've applied whole patch including this particular change.
Comment 7 markiewb 2013-03-27 17:59:13 UTC
(In reply to comment #6)
> The inverted selection-start-end-behavior makes more sense to me so I've
> applied whole patch including this particular change.

Some opinion! Thanks
Comment 8 markiewb 2013-03-27 17:59:36 UTC
(In reply to comment #6)
> The inverted selection-start-end-behavior makes more sense to me so I've
> applied whole patch including this particular change.

Typo: Same opinion!


By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo