Java MembersAndHierarchyPopup

Java Members And Hierarchy Popup Windows

Status of Members And Hierarchy pop up windows NetBeans 6.0

9th April, 2007

  • The keyboard shortcuts have been added to the actions.
Action Keyboard Shortcut
Inspect Members Ctrl+F12
Inspect Members At Caret Ctrl+Shift+F12
Inspect Hierarchy Alt+F12
Inspect Hierarchy At Caret Alt+Shift+F12
  • The Inspect Members and Hierarchy actions have been added to the Java file node popup menu.
  • The signature field now shows values of static final fields of primary and String type.
  • The signature field shows default values of Annotation methods.
  • The Annotations are shown (when available) in the editor pane on the right.

20th March, 2007

The initial implementation of Members and Hierarchy pop up windows has been checked into the NetBeans 6.0 trunk and is available in the nightly builds.

  • Inspect Members and Inspect Hierarchy Actions - show the members and hierarchy pop up windows for selected Java file or Java editor.

Inspect Members and Inspect Hierarchy Actions

  • Proposed location of Inspect Members and Inspect Hierarchy Actions in Java file node popup menu

Inspect Members and Inspect Hierarchy Actions in Java file node popup menu

  • Members window - shows the members and Javadoc of the selected Java type.

Members Window

  • Hierarchy Window - shows the hierarchy and Javadoc of selected Java type.

Hierarchy Window

  • Inspect Members and Inspect Hierarchy Actions for type under the caret - show the members and hierarchy pop up windows for Java type at the caret in Java Editor.

Inspect Members and Inspect Hierarchy Actions for type under the caret

Abstract

Modern Java IDEs have a views for showing Java File/Class Structure (top level Classes/Interfaces/Enums/Annotations, methods, fields and inner Classes/Interfaces/Enums/Annotations) as well as Class hierarchies (super classes/interfaces). Two variants of such views are prevelant:

  1. The docked views that shows the structure or the hierarchy of the currently selected Java file
  2. The popup views that show the structure or the hierarchy of the Class undert the caret in current Java (what abot Java embedded in other language editors?) editor or nodes selected in the Explorer like views. The popup window is generally transient and can be dismissed by simply losing the focus.

NetBeans has had the first variant i.e. the Navigator Window for some time now. See Fig. 1 and 2 below.

Navigator Members (Structure) View
Fig. 1 Navigator Members (Structure) View

Navigator Inheritance (Hierarchy) View
Fig. 2 Navigator Inheritance (Hierarchy) View

However it has lacked the popup variant.

There have been contributes modules Java File Structure and Java Type Hierarchy available for the Structure and Hierarchy view but these are not part of the NetBeans IDE Java Support. See Fig. 3 and 4 below.

Structure View
Fig. 3 Structure View

Hierarchy View
Fig. 4 Hierarchy View

This task is about correcting that deficiency. It must be noted that, starting with NetBeans 6.0 it is possible to undock the Navigator window from the main IDE frame. However this is not the same as the popup view as it will become clear in the discussion below.

HIE Question: Should these popup windows be refered to as Windows, Views, Popups in NetBeans terminology?
HIE Question: Does the term Structure make sense for popup window that will show the structure? or Should we stick to the word Members?
HIE Question: Does the term Hierarchy make sense for popup window that will show the hierarchy? or Should we stick to the word Inheritance?

Issuezilla

There is an issuezilla feature entry for this Issue 89604

The following is initial proposal for the members and hierarchy windows

Actions for invoking the popup windows

The following four actions will be added to invoke the popup views:

  • Show structure of current java file - this action will show the popup structure window of the current(active) Java editor's file or Java file node selected in the Explorer views such as Projects or Files Window.
  • Show structure of type under caret - this action will show the popup structure window of the type of the element under the caret in current(active) Java editor or the type of Java element node selected in the Explorer views such as Projects or Files Window.
  • Show hierarchy of current java file - this action will show the popup hierarchy window of the current(active) Java editor's file or Java file node selected in the Explorer views such as Projects or Files Window.
  • Show hierarchy of type under caret - this action will show the popup hierarchy window of the type of the element under the caret in current(active) Java editor or the type of Java element node selected in the Explorer views such as Projects or Files Window.

HIE Question: Need icons for these actions.
HIE Question: Need keyboard shortcuts for these actions.

Structure Popup Window

NOTE: There are beginnings of the Structure view in the contrib/ Java Navigation.

You can try the module by downloading the NBM and installing it using Tools:Update Center:Install Manually Downloaded Modules (.nbm file)

See Fig. 5

Structure View
Fig. 5 Structure view based on Retouche APIs

The Structure Popup window will show the structure of:

  1. current(active) editor's Java file
  2. type of the Java File node selected in Explorer views such as Projects window, Files window. HIE Question: Should this work for .java files in jar files?
  3. type of the Java Element node selected in Explorer views such as Projects window, Files window. HIE Question: Should this work for Java Element nodes under the expanded jar file nodes?
  4. type under caret in the current(active) Java editor

The Structure window has following sections separated by horizontal separator:

  1. Text Filter Section
    1. Text filter text field - as the user types text in this field the Structure tree will only show the matching constructors, methods and files. The Java Classes are not filtered out.
    2. Case Sensitive check box - when selected the text filtering above is case sensitive
  2. Structure Section
    1. Structure Tree
    2. JavaDoc Pane - this will show the Javadoc for the node selected in the Structure tree. The reason for showing this in a text pane is that it allows copying of some text (e.g. sample code) from it unlike the tooltip mechanism used in the Navigator window. Also the aplit pane allows the user a better control over the screen real eastate. HIE Question: Should this be shows as a tooltip as shown in the Navigator window?
  3. Element Signature Field - this will show a full read-only signature of the node selected in the Structure tree. This is useful for copying. HIE Question: Is this useful?
  4. Toolbar section
    1. Filters toolbar
  5. Help Section
    1. Help label - this will show a small (I18Ned) paragraph describing the usage of the Structure view and it's GUI.
    2. Help button - this will show the online help for Structure window
  6. Status bar - this will show status messages and/or error messages

The following describes more details of some of the items mentioned above:

Text Filter Text Field

As the user types text in this field the Structure tree will only show the matching constructors, methods and fields. The UP, DOWN, HOME, END keys are passed through to the Structure Tree and have the standard effect of selection and movement. Ctrl+HOME and Ctrl+END keys ate used to move the caret to the beginning and end of the text field. HIE Question: Should reqular eexpressions or wildcards (i.e. * and ?) be supported?

Structure Tree

The Structure Tree shows tree structure of the selected item. The following items are shown:

  • Package
  • Top level Classes, Enums, Interfaces, Annotations
  • Constrcutors
  • Inner Classes, Enums, Interfaces, Annotations
  • Methods
  • Inner Classes, Enums, Interfaces, Annotations
  • Fields
  • Inner Classes, Enums, Interfaces, Annotations
  •  :
  •  :

The selection changes affect the Javadoc Pane and Element Signature Field. Double clicking or typing ENTER on the selected element dismisses the popup window and opens the source code for the element. When the source code is not available a message (with a beep or visible beep) is shown in the status bar. When Class, Enum, Interface and Annotation element is selected Ctrl+CLICK or Ctrl+ENTER loads the element in the Structure window.

Javadoc Pane

The Javadoc Pane shows the Javadoc formatted in the same fashion as the Navigator window tooltip. The extenal hyperlinks in the Javadoc comment should work.

Filters

  1. Show/Hide Inherited members (Not shown in the screenshot above). This will show the inherited members. HIE Question: How to handle showing members of java.lang.Object?. HIE: Need Icon.
  2. Show/Hide Inner classes HIE: Need Icon
  3. Show/Hide Fully qualified names of Java Classes HIE: Need Icon
  4. Show/Hide Constructors HIE: Use Icon from Java module?
  5. Show/Hide Methods HIE: Use Icon from Java module?
  6. Show/Hide Fields HIE: Use Icon from Java module?
  7. Show/Hide private HIE: Use Icon from Java module?
  8. Show/Hide protected HIE: Use Icon from Java module?
  9. Show/Hide package HIE: Use Icon from Java module?
  10. Show/Hide static HIE: Use Icon from Java module?

Hierarchy Popup Window

This is the Hierachy view available in the contib/ Java Type Hierarchy module.

Hierarchy View
Fig. 6 Hierarchy View

The Hierarchy Popup window will show the hierarchy of classes in :

  1. current(active) editor's Java file
  2. type of the Java File node selected in Explorer views such as Projects window, Files window. HIE Question: Should this work for .java files in jar files?
  3. type of the Java Element node selected in Explorer views such as Projects window, Files window. HIE Question: Should this work for Java Element nodes under the expanded jar file nodes?
  4. type under caret in the current(active) Java editor

The Hierarchy window has following sections separated by horizontal separator:

  1. Text Filter Section
    1. Text filter text field - as the user types text in this field the Hierarchy tree will only show the matching nodes.
    2. Case Sensitive check box - when selected the text filtering above is case sensitive
  2. Hierarchy Section
    1. Hierarchy Tree
    2. JavaDoc Pane - this will show the Javadoc for the node selected in the Structure tree. The reason for showing this in a text pane is that it allows copying of some text (e.g. sample code) from it unlike the tooltip mechanism used in the Navigator window. Also the aplit pane allows the user a better control over the screen real eastate. HIE Question: Should this be shows as a tooltip as shown in the Navigator window?
  3. Element Signature Field - this will show a full read-only signature of the node selected in the Hierarchy tree. This is useful for copying. HIE Question: Is this useful?
  4. Toolbar section
    1. Filters toolbar
  5. Help Section
    1. Help label - this will show a small (I18Ned) paragraph describing the usage of the Hierarchy view and it's GUI.
    2. Help button - this will show the online help for Hierarchy window
  6. Status bar - this will show status messages and/or error messages

The following describes more details of some of the items mentioned above:

Text Filter Text Field

As the user types text in this field the Hierarchy tree will only show the matching nodes. The UP, DOWN, HOME, END keys are passed through to the Structure Tree and have the standard effect of selection and movement. Ctrl+HOME and Ctrl+END keys ate used to move the caret to the beginning and end of the text field. HIE Question: Should reqular eexpressions or wildcards (i.e. * and ?) be supported?

Hierarchy Tree

The Hierarchy Tree shows tree hierarchy of the selected item. The following items are shown in the default view:

Super Classes (default) View

  • Class
  • Super Class
  • Super Super Class
  • Super Super Iterfaces
  • Super Interfaces
  • Super Super Iterfaces
  • Inner Class
    • Super Super Class
    • Super Super Iterfaces
  • Super Interfaces
    • Super Super Iterfaces

Super Hierarchy View
Fig. 7 Super Hierarchy (mockup) View

Sub Classes (alternate) View

  • Super Super Class
  • Super Class
  • Class
    • Sub Class
      • Sub Class
      • Sub Class
    • Sub Class
    • Sub Class
    • Sub Class

Sub Hierarchy View
Fig. 7 Sub Hierarchy (mockup) View

HIE Question: What should be the scope of sub classes view. The selected project, all open projects? Should this be a user option/filter?

The selection changes affect the Javadoc Pane and Element Signature Field. Double clicking or typing ENTER on the selected element dismisses the popup window and opens the source code for the element. When the source code is not available a message (with a beep or visible beep) is shown in the status bar. When Class, Enum, Interface and Annotation element is selected Ctrl+CLICK or Ctrl+ENTER loads the element in the Hierarchy window.

Javadoc Pane

The Javadoc Pane shows the Javadoc formatted in the same fashion as the Navigator window tooltip. The extenal hyperlinks in the Javadoc comment should work.

Filters

  1. Show Super Clasess and Interfaces
  2. Show Sub Classes and Interfaces. This is alt
  3. Show/Hide Fully qualified names of Java Classes HIE: Need Icon
  4. Show/Hide Inner Clasess HIE: Need Icon

General HIE Questions

  • Should the popup window be shown in a modeless dialog without window manager decorations as shown in the prototype screen shots above? This dialog will be hidden if the user clicks elsewhere (i.e. loss of focus or activated status in AWT parlance) or the user types Escape key.
  • Should the popup window be shown in a regular modeless dialog? This dialog will be hidden if the user clicks elsewhere (i.e. loss of focus or activated status in AWT parlance) or the user types Escape key or the user clicks on the Close (X) button in the title bar. Should there be an explicit Close button?
  • Should the popup window be shown in a regular modal dialog? This dialog will be hidden if the user types Escape key or the user clicks on the Close (X) button in the title bar. Should there be an explicit Close button?
  • Should the popup window be shown in a regular AWT frame?
  • What background color should be used for the popup windows?
  • Need Icons for some actions.
  • Need Keyboard Shortcuts for certain actions.

I18N

The UI of the action as well as the popup windows will be I18Ned. The standards mechanism available in NetBeans API (e.g. NbBundle) will be used to implement I18N.

Accesibility (A11Y)

The UI of the action as well as the popup windows will be fully Accesibility compliant.

Performance

TODO

  • Describe Response time
  • Describe use of Please wait... nodes
  • Memory usage and leaks - an extra care needs to be taken to make sure that none of the objects from Javac context are held on to for long period of time.
  • What else?

Error handling and reporting

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