SortedInspector

What is it?

Sorted Inspector window image.A SortedInspector is an improved object inspector that gives the programmer the ability to control how the instance variables of the inspected object are displayed. The order of the display can be changed on the fly using the Sort menu. The programmer can also change the default sort order using code in the supplied DevTools workspace.

When the DevTools are installed, Object>>inspect is modified so that the default type of inspector becomes a SortedInspector.


Image of the SortedInspector instance pane popup menu. New items include "inspect sorted", and the "sort" and "browse” submenus.Instance pane pop-up menu items:

The menu items which the programmer will see might be slightly different than the ones seen here. For example, if the PDP Debugger (Professional Debug Package,) is not installed, fewer menu choices will be available.

Also, some additions to the Instance pane pop-up menu that are made in standard Inspectors by newer versions of the PDP Debugger may not appear in this menu.

To use any of those missing menu items, see Inspector>>fieldMenu and add any of the missing items to SortedInspector>>fieldMenu by editing and saving the method.

inspect

This menu item is unchanged. It is the same menu item normally seen in the pop-up menu. The selected instance variable will be inspected using the default type of inspector.

inspect sorted

Some classes, such as OrderedCollection, override the default inspector with one designed for themselves. The inspect sorted menu item will force the instance variable to be inspected using a SortedInspector.

See Inspector>>inspectFieldSorted and its callers for additional details.


Image of the new "sort" submenu. Items include "hierarchy“, "alpha" and "none".Sort menu:

The submenu items (pictured on the right) provide a way to change the order of the instance variables. The sort order can be changed anytime during the inspection of an object and can be changed as often as desired. Normally, hierarchy is the default sort order, but this can be changed using code in the supplied DevTools workspace.

hierarchy

This choice will resort the instance variables in a way that is reminiscent of a Hierarchy Browser. On the far left will be the class names in the object’s hierarchy. Under each class name, and slightly indented, are the instance variables defined at that level of the object’s hierarchy. In addition, at each class level, the variables are sorted in alphabetical order. [I originally saw this approach in other versions of Smalltalk and decided to try and bring it to VisualWorks.]

For more information on this, see SortedInspector>>hierarchy, SortedInspector>>fieldList and their callers.

alpha

This choice will resort the instance variables in alphabetical order regardless of how they were defined in the object’s hierarchy. This choice can be especially useful in large objects when you are trying to track down the value of just one variable, but you can’t remember where it was defined in the object.

For more information on this, see SortedInspector>>alpha, SortedInspector>>fieldList and their callers.

none

This choice will resort the instance variables back to the order normally seen in standard object inspectors. The variables will appear in the order in which they were defined in the object’s hierarchy.

For more information on this, see SortedInspector>>none, SortedInspector>>fieldList and their callers.


Image of the new "browse" submenu. Items included are "class" and "hierarchy".Browse menu:

These submenu items will bring up a class code browser using the class type of the selected instance variable. These menu items can be especially useful when trying to understand how an instance variable is being used.

If there is an accessor method defined for the instance variable, then that method will automatically be selected when the browser finishes opening. This automatic selection of the accessor method can be turned on or off using code in the supplied DevTools workspace.

class

This menu item will open a Class Browser on the class type of the selected instance variable. If there is an accessor method defined for the instance variable, then that method will automatically be selected when the browser finishes opening.

See Inspector>>browseClass and its callers for additional details.

hierarchy

This menu item will open a Class Hierarchy Browser on the class type of the selected instance variable. If there is an accessor method defined for the instance variable, then that method will automatically be selected when the browser finishes opening.

See Inspector>>browseHierarchy and its callers for additional details.


Image of the SortedInspector text pane popup menu. Items include "paste previous...", "debug it...", "map keystrokes..." and the "browse" submenu.Text edit/value pane popup menu items:

This pop-up menu is similar to the enhanced TextEditor pop-up menu. The paste method call... submenu item has been removed because it is currently only available in code browsers.


Other functionality:

If there is room on the screen, a SortedInspector will try to open at a size which will allow the entire list of instance variables and class names to be seen without scrolling.

See Inspector>>initialSizeFor: and its callers for additional details.
 
When an instance variable is selected and double clicked, an inspector will open on the value of the selected instance variable. In most cases, the inspector opened will be a SortedInspector. However, if the class of the instance has overridden the type of inspector for instances of that class, an inspector of that type will be opened. If a SortedInspector is desired rather than the overridden type, hold the Shift key down while double clicking the variable.

See Inspector>>inspectField, its callers, and the menu item inspect sorted for additional details.

Image of cascading window options working with three open SortedInspector windows.When a new SortedInspector is opened from another SortedInspector, the new one will try to open down and to the right of its parent SortedInspector.

This cascading feature works best if the Window tab of the File | Settings dialog is set to Automatic placement.

For additional details on this “automatic cascading” see SortedIsnpector>>initialPositionFor: and its callers.


[ < Documentation ] [ Class Hierarchy Browser changes > ]

[ Main ] [ Table of Contents ] [ Contact info ] [ Index ]

[ Home ]

This work is licensed under a Creative Commons License.

Creative Commons License