Reputation: 21835
I want to sort members by name in the source code. Is there any easy way to do it?
I'm using NetBeans, but if there is another editor that can do that, just tell me the name of it.
Upvotes: 15
Views: 13838
Reputation: 901
For C/C++ mode, right click on the method name inside the Navigator window, then there's choice of "Sort by Name" or "Sort by Source", choose the one you like :)
Upvotes: 0
Reputation: 3651
In Netbeans 8.0.1:
Tools -> Options -> Editor -> Formatting -> Category: Ordering
Then:
Source -> Organize Members
Upvotes: 25
Reputation: 1
Here is the easy way to do it in NetBeans:
And that is it. Your source file should have the members sorted alphabetically.
Upvotes: -1
Reputation: 1338
As @PaulCroarkin said - use eclipse, Or you can use Jalopy as part of your build which will do all manner of magical formatting to your source files in the process (whether this is a good thing or not is open to debate)
Upvotes: 3
Reputation: 90111
This is implemented in Netbeans 7.3: http://netbeans.org/bugzilla/show_bug.cgi?id=212528
Upvotes: 9
Reputation:
Netbeans lets you sort the methods in the Navigator. Personally, I never saw the point in sorting methods in the code. When possible I like to keep methods together that work together. For example, the getter() and setter(). Incremental search or being able to control-click on a method to navigate to the declaration is much more useful, IMHO.
Upvotes: 1
Reputation: 17960
As of 6.0/6.1, this feature isn't available in the built-in tools. The "Navigator" view is intended to give you an ordered index of your members. To see the Navigator, go to Window->Navigating->Navigator or hit Control-F7.
Consider submitting a feature enhancement to Netbeans.
Upvotes: 0