The ClassBrowser plugin
Written by Shlomy Reinstein, January 2007.
Table of Contents
The ClassBrowser plugin provides a dockable window presenting the hierarchy of a selected class, along with its members (including inherited members, if requested). You can jump to each element (class/member) in the hierarchy by double-clicking it. The hierarchy is generated using information provided by the Ctags tool.
The dockable window of ClassBrowser contains a split pane, presenting the class hierarchy in the upper part and the members of the currently-selected class (within the hierarchy) in the lower part. Double-clicking a member or a class jumps to the definition of that class or member.
The class hierarchy pane
The class hierarchy is presented as a tree. Three separate hierarchies can be displayed:
You can toggle between the hierarchies using buttons above the hierarchy. When the complete class hierarchy is not available, the button to select it is hidden.
- The complete class hierarchy: Presents all the base (super) classes as well as all the derived (sub) classes, and is available only when the hierarchy has a single root, i.e. there is no multiple inheritance from the selected class towards the root.
- The base (super) class hierarchy: Presents all the classes from which the selected class is derived. Here, the selected class is at the root of the tree, and each class node has its direct base classes as children.
- The derived (sub) class hierarchy: Presents all the classes that are derived from the selected class. The selected class is at the root of the tree, and each class node has its direct descendants as children.
The class members pane
The members of the class that is currently selected in the hierarchy pane are displayed in the lower part of the split pane (the members pane). Two views are available:
You can toggle between the views using buttons above the members pane. In addition, the members pane contains buttons for hiding members having specific attributes:
- Self members: Lists all the members defined in the selected class.
- Inherited: Lists all the members defined in the selected class, as well as the members inherited from its base (super) classses. In this view, the name of the defining class is appended to each member, so you know where each member comes from.
- F: Hides fields (data members)
- S: Hides static members (both data and function members)
- NP: Hides non-public members (both data and function members)
ClassBrowser uses the CtagsInterface plugin to provide it with the tag information. It also uses CtagsInterface to jump to selected tags (classes/members). Hence, you must have CtagsInterface installed and configured properly.
To make the best use of ClassBrowser, configure the CtagsInterface plugin to provide the following options to Ctags:
These options tell Ctags to generate inheritance information, function/method signatures, access of class members (public/private/...), and provide complete names for tag kinds.
To use ClassBrowser, do one of the following:
Generating the hierarchy may take a while, depending on the sizes of the hierarchy and the tag database. Wait patiently, and you will get the hierarchy in a "Class Hierarchy Browser" dockable.
- Select the name of a class in a jEdit buffer, and invoke "Plugins -> Class Browser -> Show Class Hierarchy"
- Invoke "Plugins -> Class Browser -> Show Class Hierarchy .." and enter the name of the class in the input dialog that opens.
- The support for classes within a scope (e.g. classes under a namespace in C++, inner classes in Java) is quite limited in this version. Due to the information generated by Ctags, such classes can never be accurately supported, but future versions of the plugin will attempt to better handle scoped classes. For now, if you want to see the upper part of the hierarchy of a scoped class (i.e. the tree of 'super' or 'base' classes, search for the plain class name (i.e. without the namespace/outer class name). If you want to see the lower part of the hierarchy (i.e. the 'sub' or 'derived' classes), use the qualified class name.
Any feedback would be most welcome. Please send your feedback to the jedit-users or jedit-devel mailing list.