111

I have been messing around with Android Studio and so far I like most of what I have seen. One thing that has been annoying me though is this lack of "Table of Contents" for a class. I apologize for not knowing exactly what to call it. But what I am referring to is the dropdown menu in eclipse that lists all the methods, interfaces, classes and so on that are in that class file. This then allows you to jump to that position. This view is when you are in "Package Explorer" and click the arrow to the left of the class. This is one thing that makes me really miss eclipse. I know that you can easily search with Ctrl+F inside a document but I often forget the method names. I tried looking through here but to no avail. Just wondering if anyone knows some way to handle this.

Zoe
  • 27,060
  • 21
  • 118
  • 148
Ryan Smith
  • 1,628
  • 3
  • 13
  • 18

5 Answers5

248

IDEA has a tab called "Structure", which shows all the methods, fields, etc. of the currently-open class.

IDEA window with Structure tab

C. K. Young
  • 219,335
  • 46
  • 382
  • 435
  • 10
    Great, exactly what I was looking for. Too bad I couldn't have figured it out on my own. – Ryan Smith Aug 19 '13 at 02:58
  • 3
    I wonder why they could not have implemented a pulldown list to jump to a method, in that breadcrumb style navigation just under the main toolbar, like QtCreator, XCode and others do. Would have been so much more convenient. – iforce2d Aug 24 '14 at 03:08
  • 4
    I was able to drag "Structure" to the right side of the UI. Now I can see the class structure and the project structure at the same time - like I had it in Eclipse. – Someone Somewhere Jan 14 '15 at 19:06
  • 9
    CMD + O in Eclipse is like fn + CMD + F12 in Android Studio ! – jazzyjester Mar 04 '15 at 11:49
  • 4
    @jazzyjester you deserve the correct answer. **CMD+F12** awesome. Using 'Fn' key depends on the Keyboard model though. – sud007 Mar 26 '15 at 15:39
  • 1
    It's hidden in the menu under "View" -> "Tool Windows" -> "Structure", an if you're searching for a way to shift it to the right: https://www.jetbrains.com/idea/help/manipulating-the-tool-windows.html#move – BurninLeo Feb 27 '16 at 19:13
51

I've just got a Tip of the Day popup in Android Studio helping with exactly this problem.

You can quickly navigate in the currently edited file with Ctrl/+F12 (Navigate | File Structure).

It shows the list of members of the current class. Select an element you want to navigate to and press the Enter key or the F4 key. To easily locate an item in the list, just start typing its name.

Also, as danny117 points out, you can use Alt/+7 to show / hide the same content in a side panel view (shown above in Chris Jester-Young's answer).

Marcel Bro
  • 4,907
  • 4
  • 43
  • 70
14

View > Tool Windows > Structure

Bobby
  • 6,115
  • 4
  • 35
  • 36
4

In addition to what Chris Jester-Young said, it's worth pointing out how to see the methods and properties of a class pointed by the cursor.

a) Type Ctrl + H in the class pointed by cursor.

b) In the class name, in the hierarchy window, double-click the class name. The system, upon confirmation, will decompile and open the class code.

c) Alt + 7 (Windows) or Command + 7 (MAC) to display the structure window.

d) One can now visualize properties, methods, derived classes, derived interfaces, and even include inherited items. All related to the class under the caret.

Paulo Buchsbaum
  • 2,471
  • 26
  • 29
1

I'm currently using Beta 0.8.9 of the Android Studio and what you need to do is click on the settings icon in the Android Project View. If you select 'Show Members' then the Classes become expandable and you can navigate around the class using the project view.

Phil Thain
  • 11
  • 2