Fork me on GitHub

Java Code Inspection

Class / Interface Hierarchy

When viewing a java class or interface you can view the type hierarchy by issuing the command :JavaHierarchy. This will open a temporary buffer with an inversed tree view of the type hierarchy with the current class / interface at the root.

public class XmlCodeCompleteCommand
  public class WstCodeCompleteCommand
    public class AbstractCodeCompleteCommand
      public class AbstractCommand
        public interface Command

Inner classes / interfaces are also supported. Just place the cursor on the inner class / interface before calling :JavaHierarchy.

While you are in the hierarchy tree buffer, you can jump to the type under the cursor using one of the following key bindings:

  • <cr> - open the type using the (default action).
  • E - open the type via :edit
  • S - open the type via :split
  • T - open the type via :tabnew
  • ? - view help buffer

Configuration

Vim Settings

  • g:EclimJavaHierarchyDefaultAction (defaults to ‘split’) - Determines the command used to open the type when hitting <enter> on the type entry in the hierarchy buffer.

Call Hierarchy

When viewing a java source file you can view the call hierarchy of a method by issuing the command :JavaCallHierarchy. This will open a temporary buffer with an inversed tree view of the hierarchy of callers of the requested method.

foo(int) : Object - org.test.SomeClass
   bar() : void - org.test.AnotherClass
     main() : void - org.test.MainClass
   baz(String) : int - org.test.AnotherClass

While you are in the hierarchy tree buffer, you can jump to the call under the cursor using one of the following key bindings:

  • <cr> - open the type using the (default action).
  • E - open the type via :edit
  • S - open the type via :split
  • T - open the type via :tabnew
  • ? - view help buffer

:JavaCallHierarchy can also be used to view the callees for a method by invoking the command with a !:

:JavaCallHierarchy!

By default the call hierarchy (caller and callee) will search across your entire workspace. If you want to limit the search to just the current project you can use the scope (-s) option:

:JavaCallHierarchy -s project

Configuration

Vim Settings

  • g:EclimJavaCallHierarchyDefaultAction (defaults to ‘split’) - Determines the command used to open the file when hitting <enter> on an entry in the hierarchy buffer.