When writing complex programs using Java, will you often be confused about the inheritance of layers and the invocation of one method at a time? Fortunately, we have a good IDE like eclipse that can help us figure this out-it's going to use Eclipse's powerful code-tracking capabilities.
1. Use open declaration to view declarations of classes, methods, and variables. This is the most commonly used feature, if you want to track the object on the right-click, select Open Declaration, you can jump to its declaration of the place. This function has a shortcut key is F3, of course you can also hold down the CTRL key, the mouse moves over will become a small hand, click on it.
2. With open type hierarchy you can see the inheritance of the class, you can see the inheritance level navigation in the Hierarchy window. Right-click on the method or class name, select Open Type hierarchy, shortcut key is F4.
3. Use the open call hierarchy to see the hierarchy of calls to the method. If you want to know where a method is called in other places, this function is very useful, in fact, it is also very common, such as to reconstruct a method, want to know what other places he may have influence, you can use this function. Right-click on the method name, select Open Type hierarchy, shortcut key is ctrl+alt+h. You can see the navigation of the method's call hierarchy in the Calls Hierarchy window.
4, with open Super Implemention can see the current method in the parent class implementation or the interface declaration (if the method is a parent class or interface overrides), right-click on the method name, select Open Super implemention.
5, finally introduced a super easy to use function, called open implemention, is can jump to a call method of the specific implementation of the place to go. Why do you think this is super useful? People who have used spring know that they are now advocating interface-oriented programming, so if you use open declaration to track the invocation of a method, you will only see the method's declaration in the interface, but not the implementation of the method in the specific class, and of course, you can use the call Hierarchy first get the entire call level of the method, and then navigate to the specific implementation, but the operation is a bit cumbersome. With the open implemention, you can directly see the implementation of the Code, in the method name right click, choose Open implemention on it! Just to enjoy this feature, you can install an Eclipse plugin.
(Now you can, press CTRL + T or hold down CTRL, mouse over the method name, there will be open interface and open implemention two options)
Links: http://nileshk.com/2005/10/12/open-implementation-plugin-for-eclipse.html
Code tracking for Eclipse shortcuts