preeze
preeze

Reputation: 1101

Intellij IDEA: view class methods in their real order

I am switching to IntelliJ IDEA from Eclipse. Currently I am using IDEA v 12.0.4.

In Eclipse when you called Class Outline view (Ctrl + O) you saw methods in the order they are declared in the class. While the similar File Structure view in IDEA (Ctrl + F12) lists methods in the alphabetical order which I find less convenient for myself in some cases.

Is there a way in IDEA's File Structure popup to see class methods listed in the order they appear in the class? Ideally I would like to have a possibility to switch from alphabetical to natural ordering.

Upvotes: 44

Views: 18264

Answers (3)

Eyal Roth
Eyal Roth

Reputation: 4019

There is actually a feature that allows both "by appearance" order and omitting the grouping of members/fields and methods. I found the answer here, in a duplicate of this question:

You can find the settings icon on right top of the project window, there you can find the option as below, to get the natural order.

sort by type

According to the documentation though, this feature should do something else entirely:

If the option is off, the items (files, classes, etc.) are sorted alphabetically. If the option is on, the files are sorted by their extensions. The .java files appear in the following order: interfaces, classes, enumerations, etc.

Upvotes: 0

LppEdd
LppEdd

Reputation: 21134

You can use the Structure tool windows in the Floating mode.
Then use Alt+7 instead of Ctrl+0.

Upvotes: 0

Ingo Kegel
Ingo Kegel

Reputation: 47995

Use the "Structure" tool window ( Alt+7 on Windows, +7 on OS X) instead of the "File structure" popup.

Upvotes: 54

Related Questions