eXept Software AG Logo

Smalltalk/X Webserver

Documentation of class 'InspectorView':

Home

everywhere
www.exept.de
for:
[back]

Class: InspectorView


Inheritance:

   Object
   |
   +--GraphicsContext
      |
      +--DeviceGraphicsContext
         |
         +--GraphicsMedium
            |
            +--DisplaySurface
               |
               +--SimpleView
                  |
                  +--InspectorView
                     |
                     +--ClassInspectorView
                     |
                     +--ContextInspectorView
                     |
                     +--DictionaryInspectorView
                     |
                     +--ImageInspectorView
                     |
                     +--OrderedCollectionInspectorView
                     |
                     +--SetInspectorView

Package:
stx:libtool
Category:
Interface-Inspector
Version:
rev: 1.213 date: 2010/03/13 23:36:24
user: cg
file: InspectorView.st directory: libtool
module: stx stc-classLibrary: libtool
Author:
Claus Gittinger

Description:


This class implements a graphical inspector.
Inspecting can be done on an object -
(where its instvarnames/values are inspected)
or a list of objects (where a nameArray/valuesArray is inspected).
The later is used by the debugger to inspect method variables/args.

The system calls the inspector through the global variable 'Inspector'
which is bound to this class (but could be redefined - it actually is
set to MiniInspector in a smalltalk without graphical user interface,
or to NewInspector if that is wanted).

Also notice, that there are two methods to inspect an object:
sending #basicInspect to any object, will open this kind of inspector on 
it (showing instance variables which are physically present).

Sending it #inspect, will - depending on the object - sometimes invoke a
specialized inspector. 
(see OrderedCollectionInspectorView, ImageInspectorView, 
 ColorInspectorView etc. as examples).

You can also open a monitoring inspector, which displays some instance
variable in regular intervals. See #openOn:monitor:.

examples:
        #(1 2 3 4) asOrderedCollection inspect
        #(1 2 3 4) asOrderedCollection basicInspect
        (Array new:10000) inspect
        (Image fromFile:'bitmaps/claus.gif') inspect
        (Image fromFile:'bitmaps/claus.gif') basicInspect
        (Image fromFile:'bitmaps/SBrowser.xbm') inspect
        (Image fromFile:'bitmaps/SBrowser.xbm') basicInspect

        InspectorView openOn:Display
        InspectorView openOn:Display monitor:'shiftDown'

The InspectorView can also be used as a subComponent within another view.
In this case, the isStandAlone flag should be cleared, to prevent the
inspector from changing the topViews window label.

Notice:
    the instvars 'inspectedObject' and 'selectedLine' have been 
    renamed to 'object' and 'selectionIndex' for squeak compatibility;
    however, the old vars are kept (in sync) for a while, to allow for
    smooth migration.

  Controlling the contents from the inspected object.

By redefining inspectorExtraAttributes or inspectorExtraNamedFields, the inspected
object can add items to the list of fields as ashown in the left list-view of the inspector.
These methods are meant to return a sequencable Collection of Associations, which represent
of pseudo slot-name, slot-value pairs.
In the list, extra attributes are shown with a dash (-), extra named fields are marked with a tick (`).
These are added (read only) to the list.


Class protocol:

defaults
o  defaultExtent

o  defaultIcon
return the browsers default window icon

o  defaultTopViewExtent

o  rememberLastExtent: anExtent

instance creation
o  for: anObject
create and launch a new inspector for anObject.
This protocol is a historic leftover - this method will vanish.

o  inspect: anObject
create and launch a new inspector for anObject.
This protocol is a historic leftover - this method will vanish.

o  openOn: anObject
create and launch a new inspector for anObject

o  openOn: anObject monitor: anInstVarNameOrNil
create and launch a new inspector for anObject.
If anInstVarNameOrNil is nonNil, let the inspector monitor it
(use an integer-printString as name, for indexed instVars).

o  openOn: anObject withEvalPane: withEvalPane

o  openOn: anObject withEvalPane: withEvalPane withLabel: aLabel

queries-plugin
o  aspectSelectors


Instance protocol:

accessing
o  allowFollow: aBoolean
enable/disable the follow menu item;
This is disabled for inspectors which are embedded in the debugger

o  dereferenceValueHolders: aBoolean

o  fieldListLabel: aString

o  hideReceiver: aBoolean
hide/show the self-entry for the inspected object;
This is hidden for context inspectors in the debugger

o  inspect: anObject
set/update the object to be inspected

o  isStandaloneInspector: aBoolean
obsolete now

o  label: aString
set the fieldListLabel - obsolete; collides with inherited label-functionality

** This is an obsolete interface - do not use it (it may vanish in future versions) **

o  listView

o  reinspect
update display for a changed inspectedObject

o  suppressPseudoSlots: aBoolean

o  workspace

accessing-channels
o  inspectedObjectHolder

o  inspectedObjectHolder: aValueHolder

change & update
o  update: something with: aParameter from: changedObject
Invoked when one of my dependees sends a change notification.

drag & drop
o  getDisplayObjects

o  getDropObjects

event handling
o  keyPress: key x: x y: y
handle special keys

o  sizeChanged: how

initialization & release
o  destroy

o  initialize

o  initializeDragAndDrop

o  realize
delayed setup of lists till first map-time -
this makes startup of inspectors a bit faster

o  release
release inpected object. This is normally not needed,
since the garbage collector will find this memory alone.
However, if some applications keeps invisible inspectors around
(for example, the debugger does this), the inspected object
would be kept from being freed or freed very late.

o  setInitialSelection

menu
o  fieldMenu
return the menu for the field-list

o  numberBaseItems

o  optionalFilenameSelectionItems

o  optionalMethodOrBlockSelectionItems

o  optionalStreamSelectionItems

o  optionalViewSelectionItems

menu actions
o  browse

o  browseClass

o  browseClassHierarchy

o  browseFullClassProtocol

o  browseHome

o  browseMethodsClass

o  browseUpdateMethods

o  doBack
user selected back-menu entry

o  doBasicInspect
user selected inspect-menu entry

o  doFollow
user selected follow-menu entry

o  doInspect
user selected inspect-menu entry

o  doNewInspect

o  doStartMonitor
start a monitoring process

o  doStopMonitor
stop the monitor

o  doTraceAll
place a trace on all messages sent to the inspected object

o  doTrap
place a trap on a message sent to the inspected object

o  doTrapAll
place a trap on all messages sent to the inspected object

o  doTrapAnyInstVarChange
place a trap which is triggered if any instVar of the inspected object is changed

o  doTrapInstVarChange
place a trap which is triggered if the selected instVar of the inspected object is changed

o  doUntrace
remove traps/traces

o  inspectOwners
open an inspector on owners of the inspectedObject.
(this is a secret function)

o  letSelectedObjectPerform: aSelector

o  openFileBrowser

o  openWidgetHierarchy

o  showOwners

o  showReferences
user selected references-menu entry

o  showStreamContents

private
o  baseInspectedObjectClass

o  defaultLabel

o  derivedFieldNames

o  derivedFields
the check below is not sufficient - if someone catches messages, for example.
Therefore, we do a manual lookup here:

o  extraNamedFieldNames

o  extraNamedFields
by redefining inspectorExtraNamedFields to return an array of
pseudo-fieldName->value associations, the inspectors left list can be extended

o  extraNamedVarIndexForLine: lineNr
helper - return the index for a named instVar;
nil, if self or a keyed instvar is selected.

o  fieldList
return a list of names to show in the selectionList.
Leave hasMore as true, if a '...' entry should be added.

o  hasSelfEntry

o  indexList
return a list of indexes to show in the selectionList.
Set hasMore to true, if a '...' entry should be added.

o  indexOfFirstNamedInstvarInList
helper - return the index for the first named instVar;
nil, if self or a keyed instvar is selected.

o  indexedFieldList
return a list of indexed-variable names to show in the selectionList.
Set hasMore to true, if a '...' entry should be added.

o  indexedValueAtIndex: idx

o  indexedValueAtIndex: idx put: newValue

o  indexedValueAtKey: key
kludge

o  instVarIndexForLine: lineNr
helper - return the index for a named instVar;
nil, if self or a keyed instvar is selected.

o  keyIndexForLine: lineNr
helper - return the index of the key-list;
nil, if self or a namedInstVar is selected.

o  namedFieldAt: idx

o  namedFieldAt: idx put: newValue

o  namedFieldList
return a list of instVar names to show in the selectionList.

o  pseudoFieldNames
return a list of names to show in the selectionList.
Leave hasMore as true, if a '...' entry should be added.

o  pseudoFieldNamesWithIndexed: withIndexed
return a list of names to show in the selectionList.
Leave hasMore as true, if a '...' entry should be added.

o  setAcceptAction
set the codeViews accept action

o  setDoItAction
set the codeViews doit action

o  showAllIndexedVarsInFieldList

o  showMore

o  stringWithAllIndexedVarValues

o  stringWithAllInstVarValues

o  stringWithMessages: which

o  theSingleSelectionIndex
helper - return the index of the (single) selected entry.
Nil if nothing or multiple items are selected

o  valueAtLine: lineNr
helper - return the value of the selected entry

o  valueAtLine: lineNr put: newValue

o  valueForSpecialLine: line

queries
o  canInspect: anObject

o  compilerClass

o  dereferenceValueHolders

o  labelFor: anObject
return the windowLabel to use in my topView, when inspecting anObject.

o  labelNameFor: anObject
return the iconLabel to use in my topView, when inspecting anObject.
Simply returns the className or name of anObjects class

o  selectedKeyName

o  suppressPseudoSlots

selection
o  basicDisplayStringForValue: someValue
return the value's displayString to be pasted into the workspace.

o  displayStringForValue: someValue
return the value's displayString to be pasted into the workspace.

o  selection: lineNr

o  showSelection: lineNr
user clicked on an instvar - show value in workspace

o  showValue: someValue
user clicked on an entry - show value in workspace

user interaction
o  doAccept: theText

o  doCopyKey
put the instVar-name into the text-copy-buffer

o  doInspect: basic
user selected inspect-menu entry

o  doUpdate

o  monitor: anInstVarName
start a monitoring process, showing the given instVar
in regular intervals.

o  selection
helper - return the value of the (single) selected entry.
Nil if nothing or multiple items are selected

o  showLast
user clicked on an instvar - show value in workspace

o  toggleHex

o  tryToSelectKeyNamed: aString

workspace protocol
o  modified: aBoolean

o  saveAs: file doAppend: doAppend



ST/X 6.1.1; WebServer 1.620 at exept:8081; Mon, 21 May 2012 18:09:35 GMT