7

I have turned on class hierarchy view for Java in eclipse and it is showing some arbitrary class, unrelated with my editor or something other apparently.

Link with editor option is on and has no effect.

How to fix?

UPDATE

Link with editor is in Hierarchy view:

enter image description here

Dims
  • 47,675
  • 117
  • 331
  • 600

3 Answers3

1
  1. click on the classname
  2. press F4 to see the hierarchy
nagy.zsolt.hun
  • 6,292
  • 12
  • 56
  • 95
  • Is it possible to make it automatically show current class in the editor? Otherwise what does "Link with editor" mean? – Dims Feb 17 '14 at 10:01
  • I don't know about any way to make the "Type Hierarchy" view refresh on clicks to classnames. You probably saw "Link with editor" in the "Package Explorer" view, there it means that the file you are editing is selected in the Package Explorer view (it makes navigation easier in big projects). – nagy.zsolt.hun Feb 17 '14 at 12:15
  • No, `Link...` is from Hierarchy view. – Dims Feb 17 '14 at 17:25
  • I've never seen this menu, good to know there is one. About your question: seems like its a bug. – nagy.zsolt.hun Feb 18 '14 at 09:19
1

Here is Erich Gamma's response from 2002: "The back linking works only when the type is visible in the hierarchy. For performance reasons (type hierarchy computation is expensive) we don't want to recompute a type hierarchy on editor switching."

It seems they have never addressed this counter-intuitive behavior.

See the following bugs for details:

Rex Sheridan
  • 123
  • 1
  • 5
0

Yes Link with Editor is not working, I think its a bug. Alternatively,

If editor is opened then keep caret on the class name then press F4 or press Ctrl + Shift + H. This opens a dialog. Enter the class name for which you want to see its type hierarchy.

Dragging a file from Package Explorer to Type Hierarchy view also works.

Chandrayya G K
  • 8,719
  • 5
  • 40
  • 68