UsageActivationActivating the plugin is done by pressing Ctrl+Alt+H in the Java editor (this shortcut may be customized in the preferences.) This shows the calls into (callers) or calls out of (callees) the current method (i.e. the method in which the cursor is located.) The plugin may also be activated in the editor's context menu, on the toolbar or in the context menu of the Java outline, the type hierarchy, the package explorer (whenever a method is shown.) Navigation in the Call Hierarchy viewUsing the icons at the right of the view, it is possible to toggle between showing callers (F8) or callees (F9). The refresh button rebuilds the call hierarchy tree (F5). When a method is highlighted in the search result part of the view, F3 jumps to the declaration of the method. Double clicking jumps to the actual call in the code. Call DetailsIn the Call Hierarchy view, it is possible to show Call Details. The Call Details show details on the call to the method. If there are several calls to a method from another method, the different calls are listed in the details. Double clicking jumps to the location of the call. Focus on selectionSelecting "Focus on selection" from the context menu changes the root of the call hierarchy to the selected method. Method historyThe history drop down button shows the most recently shown method and allows the user to reselect a previous method. Search scopeThe context menu and view menu includes a Search submenu with which it is possible to select the search scope for calls to or from a method. The possible values are:
NOTE: When searching for calls from a method, the results are limited by the package filters (in the preferences) as well as the search scope. Preference pagesThere are two preference pages (Java/Call Hierarchy) and (Java/Call Hierarchy/Filters). Here it is possible to set up:
Searching for interfaces/implementationsIf you have the Implementors plugin ( http://eclipse-tools.sourceforge.net/implementors ) installed, two checkboxes are available in the preferences page. Enabling these enable a search for:
Search for calls to a methodThis functionality is already available when performing a normal search. However, when using EJB's extra value is added. Normally, Eclipse has no knowledge of the connection between interface and implementation bean class. When using the Implementors plugin, searching for calls to an EJB method also searches for calls to the interfaces (remote or local) that the bean class is bound to. Search for calls from a methodWhen following the call hierarchy from a method to its callees, normally the sequence stops at an interface. Enabling the use of the Implementors plugin, the call tree can be followed "across" interfaces. The call hierarchy will show the implementation class instead of the interface, thus enabling you to follow the call tree further down. Note: Currently, this interface->implementation substitution is only made if the Implementors plugin finds exactly on implementing class. If multiple implementations are found, the interface is shown as usual. If you have any ideas as to how multiple implementation classes could be presented in the call tree, feel free to let me know :-) |