문제

I am using a method annotated with @Override. in case this overrides a class I am using Ctrl-t and can navigate to the declaring type. is there a way to get to the declaration in case this is an interface?
I asked another question that is similar, but this question is more precise to my needs.

도움이 되었습니까?

해결책

You could go to where the class is declared and F3 on the interfaces that the class implements.

You can also highlight the method and CTRL+ALT+H which will show you where it is called - you can often find the interface there.

You can also go to Window -> Preferences -> Java -> Editor -> Mark occurences and tick Methods implementing an interface (but I find these extra markers annoying)

Hope that helps!

Edit:

It occurs to me that in you have to go to Windows -> Preferences -> General -> Editors -> Text Editors -> Annotations

and select Override Indicators and check the tick box on the right - Show in Vertical ruler for the markers to appear next to your source code (you just click on the marker to go to the declaring interface)

다른 팁

There should be a little hollow upward-pointing triangle in the left margin of the editor. Clicking on that will take you to the declaration.

I think this is what Matt's is talking about in the last paragraph of his answer - but i've never had to switch the triangles on, they're there by default.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top