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 237609 - Patch for: Wrong expanded text shown after sorting code template table by abbreviation
Summary: Patch for: Wrong expanded text shown after sorting code template table by abb...
Status: RESOLVED DUPLICATE of bug 240300
Alias: None
Product: editor
Classification: Unclassified
Component: Completion & Templates (show other bugs)
Version: 7.4
Hardware: PC Linux
: P3 normal (vote)
Assignee: Dusan Balek
URL:
Keywords: PATCH_AVAILABLE
Depends on:
Blocks:
 
Reported: 2013-10-24 10:06 UTC by oyviste
Modified: 2014-05-16 08:54 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Shows issue (40.46 KB, image/png)
2013-10-26 11:50 UTC, markiewb
Details
Proposed patch (2.64 KB, patch)
2013-11-10 13:14 UTC, markiewb
Details | Diff
Patch in action (201.05 KB, image/png)
2013-11-10 13:14 UTC, markiewb
Details
Proposed patch v2 (4.28 KB, patch)
2013-11-10 19:21 UTC, markiewb
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description oyviste 2013-10-24 10:06:49 UTC
When sorting the code template table by column "Abbreviation" under Options -> Editor -> Code Templates, the expanded text of templates shown below the table seems to lose correspondence with the selected row in the table.

Reproduce:
1. Go to Options -> Editor -> Code Templates
2. Sort table by Abbreviation by clicking on the column header.
3. Select some row, for example abbreviation "logbps".
4. Observe that the expanded text in the window below does not in fact belong to the selected code template. The expanded text in this case belongs to the "jaxbm" abbreviation, although "logbps" is selected.

(5. By closing and reopening the Options window, the correct row is then selected, corresponding to the previously shown expanded text.)
Comment 1 markiewb 2013-10-26 11:50:52 UTC
Created attachment 141584 [details]
Shows issue

Happens also in dev builds. See screenshot


Product Version: NetBeans IDE Dev (Build 201310200001)
Updates: Updates available
Java: 1.7.0_40; Java HotSpot(TM) 64-Bit Server VM 24.0-b56
Runtime: Java(TM) SE Runtime Environment 1.7.0_40-b43
System: Windows 7 version 6.1 running on amd64; Cp1252; en_US (nb)
User directory: C:\Users\markiewb\AppData\Roaming\NetBeans\dev
Cache directory: C:\Users\markiewb\AppData\Local\NetBeans\Cache\dev
Comment 2 markiewb 2013-11-10 13:14:12 UTC
Created attachment 142036 [details]
Proposed patch

Please review and commit the proposed patch. The patches introduces the correct mapping of the currently selected row and the index within the rowmodel.
Comment 3 markiewb 2013-11-10 13:14:33 UTC
Created attachment 142037 [details]
Patch in action
Comment 4 markiewb 2013-11-10 13:46:49 UTC
Oh. Even another small issue in my patch. 

* Sort by expanded text
* Create a new abbreviation ->
ACTUAL: new abbreviation is not focused/selected
EXPECTED: new abbreviation is focused/selected

I will have a look at it too.
Comment 5 markiewb 2013-11-10 19:21:20 UTC
Created attachment 142041 [details]
Proposed patch v2

(In reply to markiewb from comment #4)
> Oh. Even another small issue in my patch. 
> 
> * Sort by expanded text
> * Create a new abbreviation ->
> ACTUAL: new abbreviation is not focused/selected
> EXPECTED: new abbreviation is focused/selected
> 
> I will have a look at it too.
Fixed. See new patch
Comment 6 Dusan Balek 2014-05-16 08:54:46 UTC
Already fixed in NB 8.0 - see issue #240300.

*** This bug has been marked as a duplicate of bug 240300 ***