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 123946

Summary: Patch for: Editor macros list in options dialog is unsorted and not sortable
Product: editor Reporter: matthies <matthies>
Component: MacrosAssignee: Svata Dedic <sdedic>
Status: RESOLVED FIXED    
Severity: blocker CC: markiewb
Priority: P3 Keywords: PATCH_AVAILABLE, SIMPLEFIX
Version: 6.x   
Hardware: PC   
OS: Windows XP   
Issue Type: ENHANCEMENT Exception Reporter:
Attachments: Proposed patch
Refinement

Description matthies 2007-12-13 12:45:31 UTC
The list of editor macros in the options dialog is unsorted (just ordered by most recently added), and not sortable 
(e.g. by clicking on the column headers). With many macros in the list, it is increasingly unorganized, and it becomes 
hard to visually grep for entries.

The same is also true for the Code Templates list, I think, and possibly for other such grid views in the options.
Comment 1 Vitezslav Stejskal 2008-03-03 10:29:56 UTC
Not very nice. Thanks for the RFE.
Comment 2 Max Sauer 2008-03-03 13:45:55 UTC
Fixed.
---
http://hg.netbeans.org/main/rev/0a019c77dca3
Comment 3 matthies 2008-03-10 20:19:02 UTC
Still unsorted for me in 6.1 Beta (Build 200803050202).
Comment 4 Jiri Prox 2008-03-11 08:35:11 UTC
This was not included in beta1 branch, use trunk build.
Comment 5 matthies 2008-05-02 08:11:17 UTC
Reopening because: When adding a macro ("New" button), the new macro is inserted at the end of the list, regardless of 
the list's sort order. One has to toggle the sort order for the new entry to move to the correct position.

Product Version: NetBeans IDE 6.1 (Build 200804211638)
Java: 1.6.0_04; Java HotSpot(TM) Client VM 10.0-b19
System: Windows XP version 5.1 running on x86; Cp1252; en_US (nb)
Userdir: C:\Documents and Settings\nm\.netbeans\6.1
Comment 6 matthies 2008-05-02 09:12:41 UTC
Advancing target milestone.
Comment 7 matthies 2009-08-20 13:43:52 UTC
Updated TM.
Comment 8 markiewb 2013-03-10 22:20:34 UTC
Created attachment 132433 [details]
Proposed patch

I like to propose this simple patch to solve the issue: The table is resorted after adding a macro to the table. I could have add a property change listener to the table model, but this change listener would only on the first modification of the model. So this minimal approach.

@NB-Devs: Please review and commit.
Comment 9 markiewb 2013-03-10 22:21:48 UTC
(In reply to comment #8)
> Created attachment 132433 [details]
> Proposed patch
> 
> I like to propose this simple patch to solve the issue: The table is resorted
> after adding a macro to the table. I could have add a property change listener
> to the table model, but this change listener would only on the first
> modification of the model. So this minimal approach.
> 
> @NB-Devs: Please review and commit.

Oh i missed a word:
I could have add a property change listener to the table model, but this change listener would only fire on the first modification of the model.
Comment 10 markiewb 2013-05-02 18:52:28 UTC
@Svata: Any change to get the patch integrated in 7.4?
Comment 11 Svata Dedic 2013-05-03 06:39:06 UTC
Created attachment 134070 [details]
Refinement

I added a little refinement - the table is scrolled to the newly added element + row is selected. Please review.
Comment 12 markiewb 2013-05-03 20:41:14 UTC
(In reply to comment #11)
> Created attachment 134070 [details]
> Refinement
> 
> I added a little refinement - the table is scrolled to the newly added element
> + row is selected. Please review.

@Svata: Looks good and works the way it should work.
Comment 13 Svata Dedic 2013-05-04 22:09:55 UTC
Applied in rev http://hg.netbeans.org/jet-main/rev/6e0a0a16de6b
Comment 14 Quality Engineering 2013-05-06 04:01:02 UTC
Integrated into 'main-golden', will be available in build *201305052300* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/6e0a0a16de6b
User: Svata Dedic <sdedic@netbeans.org>
Log: #123946: macro list is sorted after new macro is added [Benno Markiewicz]