How do I position Eclipse type hierarchy while editing

Eclipse for Windows 64-bit machine - Version: 2022-03 (4.23.0).

I am used to having the Type Hierarchy (?) in a tab on the right side of my screen. It was like that through a number of Eclipse releases, and it worked for me! I seem to have lost that, and can't seem to get it back!

Now the nearest I can get to that layout is to do CTL-O, but the methods are in alphabetical order, and I can't seem to get the display over to the right side of the screen (alpha order is sort of OK - I am not keen on it, but it's better than nothing!). Plus it seems to be a popup, and doesn't last long enough! I have seen posts saying I can grab the CTL-O (?) tab and drag it over, but I can't find the tab.

It's probably something dumb, but I can't figure it out! Maybe a more general question would be: what's the best tool in Eclipse for navigating around a complex type hierarchy? Help would be appreciated!

1 answer

  • answered 2022-05-07 02:57 rzwitserloot

    What you're looking for is the "Type Hierarchy" view, I think.

    There are a number of reasons you can't find it.

    You switched to a new perspective.

    A perspective is an entire window layout. A full eclipse window, divided into various docked sides, and all the views that go there. The 'java' perspective has the Type Hierarchy view visible by default, I think. You may have switched to some other perspective, such as the Debug perspective, that doesn't have it by default. You should be in the java perspective. If you're not, Click the little logo with a 'J' and some boxes in the top right corner of your window, or via the main menu: "Window" > "Perspective" > "Open Perspective" > "Java".

    If you're already in the java perspective (i.e. "Java" won't even be in the list, you can't switch to the perspective you're already in of course) - or this now loads the java perspective but you still can't find it, read on!

    You removed it

    Views can be removed. To put it back, via the main menu: "Window" > "Show View" > "Type Hierachy".

    You put it in a viewset and it isn't frontmost.

    Views can be stacked together and you usually do that. A single 'window-esque' (it's not a window in the sense that you can fully drag it around, it's 'docked' to a side) viewslot can contain any number of views. You'll see tabs; the tab includes the icon of the view, and if there's room, the name, but if you pile a lot of views into a single viewslot you'll just get icons.

    The icon you're looking for 3 green dots, where the bottom 2 are 'indented by 1' vs the top one (the idea is, the 2 bottom ones are children of the top one - type hierarchy). Click it and voila, there it is.

    You minimized it

    Viewslots can be minimized, in which case you get a bar on the side, containing just the icons of the views in that viewslot. Just click it (you're looking for the icon as described above). It'll go away again as soon as you click outside of the viewslot; if you don't like that, the far right icon on the iconbar of the expanded viewslot is, if you float over, 'restore' - click that. You'll un-minimize it.

    TIP: Keyboard shortcut

    You can use CMD+SHFT+H on macs (probably CMD+ALT+H on windows? I don't really know, I'll tell you where to check in a bit) to open a dialog box where you can smart-search for a type (e.g. to find BufferedInputStream you can type 'BIS' and it'll find it, or '*InputStream'), and eclipse will then open the type hierarchy view and show the type you searched for inside it. Note that there's also the quick type hierarchy (CMD+T over here in mac land), which shows a popup at the location of your cursor, and is intended to be used when your cursor is on some type name. That's presumably not what you're looking for.

    You can check keyboard shortcuts (and make them, if you want), by going to the preferences (searching in the filter for 'keys', then search the keyboard shortcuts for "Open Type in Hierarchy" - that's the keyboard shortcut you're probably looking for.

How many English words
do you know?
Test your English vocabulary size, and measure
how many words do you know
Online Test
Powered by Examplum