简体   繁体   中英

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.

使用“结构”工具窗口 (在Windows中为Alt + 7 ,在OS X中为 + 7 ),而不是“文件结构”弹出窗口。

There is actually a feature that allows both "by appearance" order and 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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM