UEXInspectMembersAndHierarchies

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

Date: 8 AUG 2012

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

See also: UEXJavaDoc, UEXInspectMembersAndHierarchies_version1, Java_MembersAndHierarchyPopup, TS_65_CallHierarchy.

Contents

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 through a button.

The new Hierarchy dockable window resembles Navigator - Members View closely, providing the same Search and view History functionality, and direct ability to open JavaDoc through a button. 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.

Navigator window

In situations when there is nothing to be displayed (no entity nor file is selected active in IDE), Navigator should display the same empty pane with <No View Available> message in the center as before.

Content change is triggered by

  • focus change in explorer view or in editor or change of caret position (the same functionality as before)
  • focus change (click on entity) in Hierarchy window
  • user selection of view in History combo
  • invoking Inspect Members (Ctrl-Shift-F12) or Inspect File Members (Ctrl-F12) action
  • change in settings affecting the view (in bottom toolbar or pop-up menu)

Rebuilding the view may be time consuming. As before, as long as the content is being prepared, the main pane should display the clock icon with message "Please wait.." exactly as it is done now in Navigator-Members View.

Interoperability with JavaDoc dockable window is as follows:

  • hovering over entity in Navigator shows JavaDoc popup as before, Ctr-F1 then opens JavaDoc window as before
  • single click on entity in Navigator updates JavaDoc window (if opened)
  • opening JavaDoc is possible through icon in top right corner of Members View

When decreasing Navigator width, the bottom toolbar (and Search bar) may become too long to be displayed in entirety. In such case add the on-hover-over little doublearrow to the right that would open a pop-up toolbar containing those icons that did not fit into the bottom toolbar.

History combo

Whenever Inspect Members (Ctrl-Shift-F12) or Inspect File Members (Ctrl-F12) action is invoked, the respective entity is displayed in Navigator - Members View, and the view is added to History combo.

When user selects an entity recorded in History combo, the Navigator contents get updated to show the entity's members. This entity is displayed until any other user action that triggers Navigator window content update (focus change, caret move in editor, click on entity in Hierarchy window).

Search bar

Search bar appears as before when typing with focus in Navigator window. The bar should (if possible) offer the option "Filter", and "Match Case". Filter would filter out all items from the view that do not match (do not contain) the typed string.

Display Switches bar

What is included in Members View can be adjusted using buttons in bottom toolbar (or pop-up menu). Ordered as in Fig.7 these include:

  • Show inherited members
  • Show fields
  • Show methods
  • Show constructors
  • Show non-public members
  • Show static members
  • Show inner classes and interfaces
  • Show enum constants
  • Show fully qualified names
  • Sort by name
  • Sort by source

Remark: button shapes and sizes should follow NetBeans conventions, see the updated Fig.7.

Pop-Up menu

Pop-up menu in addition to its current contents should enable:

  • filtering the view to the same extent as described in Display Switches bar, possibly even finer
  • filtering using various combined choices "non-private methods only", "fields only", "inner classes only", that would set multiple switches at once
  • right-click in Members View on entities that are themselves viewable (inner classes, complex variable types) should offer additional actions allowing to "Inspect Members for this entity", but possibly also "Inspect Hierarchy for this entity"
  • actions "unfold all" and "fold all"

Hierarchy window

See Navigator window description for default behavior which is the same in Hierarchy window. The main difference is in content change and view type.

Content change is triggered by

  • invoking Inspect Hierarchy (Ctrl-Shift-F12) or Inspect File Hierarchy (Ctrl-F12) action
  • pressing the eye icon in top right corner, which is equivalent to Inspect Hierarchy action
  • user selection of view in History combo
  • change in settings affecting the view (in bottom toolbar or pop-up menu)


The top left combo offers choices mirroring the views implemented in Inspect Hierarchy dialog and possibly other related choices:

  • Supertype View
  • Subtype View
  • (...to be considered...) Call Hierarchy


Interoperability with JavaDoc dockable window is as follows:

  • hovering over entity in Hierarchy shows JavaDoc popup as in Navigator, Ctr-F1 then opens JavaDoc window
  • single click on entity in Hierarchy updates JavaDoc window (if opened) and Navigator window (if opened)
  • opening JavaDoc is possible through icon in top right corner of Hierarchy window

History combo

Equivalent to Navigator - History combo.

Search bar

Equivalent to Navigator - Search bar.

Display Switches bar

Supertype View can be adjusted using buttons in bottom toolbar. Ordered as in Fig.7 these include:

  • Show inner classes and interfaces
  • Show fully qualified names
  • Sort by name
  • Sort by source

Subtype Hierarchy can be adjusted using buttons in bottom toolbar. Ordered as in Fig.7 these include:

  • Show inner classes and interfaces
  • Show fully qualified names

Remark: button shapes and sizes should follow NetBeans conventions, see the updated Fig.7.

Pop-Up menu

Equivalent to Navigator - Pop Up Menu.


..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