Revision as of 14:11, 4 July 2012 by Psomol (Talk | contribs)

Author: Petr Somol, after review by Jan Lahoda, Tomas Zezula, David Strupl

Date: 2 JUL 2012

Version: 2.0 (work in progress! subject to change)

See also: UEXJavaDoc, UEXInspectMembersAndHierarchies_version1, Java_MembersAndHierarchyPopup, TS_65_CallHierarchy.


Problem / Motivation

NetBeans 7.2 provides several tools allowing to inspect different types of hierarches and members: class members, call hierarchy, etc. These tools are spread in various contexts in various UI forms. These include the Navigator window diplayed by default docked to the left from editor window, then non-modal dialogs Inspect Memebers, Inspect File Members, Inspect Hierarchy, Inspect File Hierarchy, and a window Java Call Hierarchy that is by default placed under main editor window.

Users rightfully complain about the usability especially of the dialogs. The dialogs should enable quick inspection over various items in the displayed tree views, while viewing related details in sources and JavaDoc. The current implementation makes this difficult - it requires constant window focus switching what reduces the usability to such extent that some users refrain from using it at all.

A smoother user experience needs to be provided in order to enable users make the most of these tools at the cost of the least required usage effort.

Remark: the related JavaDoc panel redesign is proposed in UEXJavaDoc.

Current State (NetBeans 7.2)

Navigator - Members View

Fig.1: Navigator - Members View in NB72
Fig.2: Navigator - Members View, Search pops-up when typing, in NB72

Currently the most widely used tool in this context appears to be the Members View in Navigator panel (see Fig.1). Note that Navigator provides infrastructure for displaying various types of views, currently including Members View and Bean Patterns view, selectable by a combo aligned to the top of the Navigator window.

Members View lists (in tree view) the members of the class from the currently focused editor window. Recursively it lists also members of inner classes. The extent and ordering of the list is adjustable by switches, accessible in horizontal toolbar at the bottom of Members View pane. The toolbar is collapsable using a tiny arrow that appears when hovering over the upper toolbar edge. Switches available for Members View:

  • Show inherited members
  • Show fields
  • Show static members
  • Show non-public members
  • Sort by name
  • Sort by source

The view is mature in the sense that proper icons exist for all possible types of members, icons combine to visually express combined properties like private abstract enum etc., inherited members are distinguished by grayed text, deprecated members by strike over line, static members by a vertical line painted over member icon. The functionality of Members View is this:

  • single click selects the member, multiple members can be selected, then a right-click opens a menu with actions; some applicable to multiple selections, some not.
  • doubleclick opens entity in editor
  • hovering over entity shows first its complete name in case it is cropped by window border, shortly after that opens a pop-up JavaDoc window. The JavaDoc window disappears when mouse moved away from the respective intity. With JavaDoc pop-up window displayed, Ctrl-F1 opens the same content in docked JavaDoc window under the main editor area.

Members View supports Search for (sub)string in entity names (see Fig.2). With focus in Members View just start typing, this opens the Search text field. The first occurence of typed text at any position within entity highlights such entity. F3 allows to search for next. Pressing Esc or losing pane focus closes the Search pane.

Inspect Members & Inspect File Members

Fig.3: Inspect Members in NB72
Fig.4: Inspect Members with string filter and fully qualified names and inherited member display switched on in NB72

Inspect Members dialog can be invoked through Navigate->Inspect->Members or Navigate->Inspect->File Members or by right-click menus in various contexts

The difference between Members and File Members consists only in selecting the entity for which members are to be inspected. Inspect File Members refers to the whole file (effectively a class) either opened in editor or right-clicked in one of the explorer views. Inspect Members is equivalent to Inspect File Members in case no specific narrower focused entity is active either in one of explorer views or inside the source in active editor window. In case a narrower focused entity is active (typically when curret is placed inside the name of an investigable entity), the opened dialog inspects members of that particular entity.

The dialog (see Fig. 3) provides mainly a tree view of members similar to that in Navigator - Members View, but with more configuration options. The right half of dialog contains a JavaDoc pane to show JavaDoc text to the entity selected in the members tree view. The extent of the view can be reduced by specifying a required search string in Filter text line above the tree view and JavaDoc panes. Note that string matching is done from start of entity names. Below the main pair of panes a text field is used to display complete element signature of the currently selected item in tree view. Below it the following switches enable to restrict the extent or otherwise affect the appearance of the tree view as follows:

  • Show inherited members
  • Show fully qualified names
  • Show inner classes and interfaces
  • Show constructors
  • Show methods
  • Show fields
  • Show enum constants
  • Show protected members
  • Show package members
  • Show private members
  • Show static members

A doubleclick on entity opens it in editor window and closes the dialog. Multiple dialogs can be opened at once for various files/entities. Once the dialog is opened, its contents do not update. Once it is closed, there is no way of reopening it with previous contents. Switches persistence is global, each new dialog reuses the setting from the last one.

The difference to Navigator - Members View is in more options, switches allow finer specification what to view, fully qualified names can be displayed, the view can be restricted by string matching, and the dialog can be opened to show members of a given entity (Inspect Members) instead of just the members of the whole file (Inspect File Members). Navigator - Members View contents are always with respect to the whole file. But Navigator - Members View listens to file changes what the dialog does not.

Inspect Hierarchy & Inspect File Hierarchy

Fig.5: Inspect Hierarchy, Show supertype hierarchy switch on in NB72
Fig.6: Inspect Hierarchy, Show subtype hierarchy switch on in NB72

Inspect Hierarchy dialog (see Fig. 5) can be invoked through Navigate->Inspect->Hierarchy or Navigate->Inspect->File Hierarchy or by right-click menus in various contexts. The dialog shows the inheritance hierarchy with respect to the investigated entity; either as a tree of supertypes or as the reversed tree of subtypes (within the current limited scope).

The difference between Hierarchy and File Hierarchy consists only in selecting the entity for which hierarchy is to be inspected. Inspect File Hierarchy refers to the whole file (effectively a class) either opened in editor or right-clicked in one of the explorer views. Inspect Hierarchy is equivalent to Inspect File Hierarchy in case no specific narrower focused entity is active either in one of explorer views or inside the source in active editor window. In case a narrower focused entity is active (typically when curret is placed inside the name of an investigable entity), the opened dialog inspects hierarchy of that particular entity.

Inspect Hierarchy dialog UI is equivalent to that of Inspect Members dialog, with the main difference being in filter switches in the bottom. Inspect Hierarchy switches:

  • Show supertype hierarchy
  • Show subtype hierarchy
  • Show fully qualified names
  • Show inner classes and interface

and the last button in line of filters unfolds the whole tree view if any nodes are folded

Proposal for NetBeans 7.3

To make Hierarchies and Members Windows truly usable, it has been requested by users as well as confirmed by evaluation that class hierarchy needs to be available at all times, the same hold for members view. The natural way is to create dockable windows; the existing Navigator -- Members View is almost equivalent to Inspect Members and can be adjusted and reused, Hierarchy window can be defined with very similar UI.

Standard NetBeans IDE layout is 2-column, with the left column split by default to upper area with tabbed windows Projects, Files, Services and to bottom area with Navigator (set to Members View). The bigger upper area of the right column is occupied by editor tabs, the upper area is to contain variety of tabbed windows including Output, Usages, Breakpoints etc.

In this standard layout it is not straightforward to keep 2-column layout and have both Members and Hierarchy windows open at once, unless precedence is given to the new Hierarchy over one of the following: top left area panel (Projects etc.) - not acceptable, bottom left area panel - must be reserved for Members view, bottom dockable area under editor - not very practical due to its limited height. The window system however enables docking to the right of the editor windows above the bottom area - effectively shrinking only the editor windows but keeping the width of windows like Output, Search Results etc. underneath. This is the practical choice for placing Hierarchy window.

The main improvements to be achieved are:

  • instant access to various views of Members and Hierarchies for either the selected file or entity in source, depending on where user selection or caret position is
  • keeping the views live and available at any time (till now the dialog-based solution is passive, the dialogs do not update their contents, and close as soon as entity is double-clicked to go to source)
  • enable accessing view history
Fig.7. Mockup of IDE with Members View, Supertype Hierarchy, and JavaDoc window open.

Summary of Proposed changes

The existing Navigator dockable window with the existing Members View and Beans View is preserved as is and slightly extended, replacing effectively Inspect Members and Inspect File Members dialogs. In addition to its existing functionality it should preferably provide better Search pane, more entity type display switches, view History, and direct ability to open JavaDoc.

The new Hierarchy dockable window resembles Navigator - Members View closely, providing the same Search and view History functionality. The main differences are: the two types of view are Subtype View and Supertype View, replacing effectively Inspect Hierarchy and Inspect File Hierarchy dialogs, unlike Members View the Hierarchy window is not refreshed automatically on change of caret position or changed focus, refresh must be invoked manually either by the existing shortcut Alt-F12 or Alt-Shift-F12 or by the "eye" icon in top right corner. View switches also differ from those in Members view due to difference in displayed information.

JavaDoc window, if open, refreshes its contents on click in either Members View or any of Hierarchy views.

..to be specified in more detail..

Not logged in. Log in, Register

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo