|
|
Class: InspectorView
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
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.
defaults
-
defaultExtent
-
-
defaultIcon
-
return the browsers default window icon
-
defaultTopViewExtent
-
-
rememberLastExtent: anExtent
-
instance creation
-
for: anObject
-
create and launch a new inspector for anObject.
This protocol is a historic leftover - this method will vanish.
-
inspect: anObject
-
create and launch a new inspector for anObject.
This protocol is a historic leftover - this method will vanish.
-
openOn: anObject
-
create and launch a new inspector for anObject
-
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).
-
openOn: anObject withEvalPane: withEvalPane
-
-
openOn: anObject withEvalPane: withEvalPane withLabel: aLabel
-
queries-plugin
-
aspectSelectors
-
accessing
-
allowFollow: aBoolean
-
enable/disable the follow menu item;
This is disabled for inspectors which are embedded in the debugger
-
dereferenceValueHolders: aBoolean
-
-
fieldListLabel: aString
-
-
hideReceiver: aBoolean
-
hide/show the self-entry for the inspected object;
This is hidden for context inspectors in the debugger
-
inspect: anObject
-
set/update the object to be inspected
-
isStandaloneInspector: aBoolean
-
obsolete now
-
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) **
-
listView
-
-
reinspect
-
update display for a changed inspectedObject
-
suppressPseudoSlots: aBoolean
-
-
workspace
-
accessing-channels
-
inspectedObjectHolder
-
-
inspectedObjectHolder: aValueHolder
-
change & update
-
update: something with: aParameter from: changedObject
-
Invoked when one of my dependees sends a change notification.
drag & drop
-
getDisplayObjects
-
-
getDropObjects
-
event handling
-
keyPress: key x: x y: y
-
handle special keys
-
sizeChanged: how
-
initialization & release
-
destroy
-
-
initialize
-
-
initializeDragAndDrop
-
-
realize
-
delayed setup of lists till first map-time -
this makes startup of inspectors a bit faster
-
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.
-
setInitialSelection
-
menu
-
fieldMenu
-
return the menu for the field-list
-
numberBaseItems
-
-
optionalFilenameSelectionItems
-
-
optionalMethodOrBlockSelectionItems
-
-
optionalStreamSelectionItems
-
-
optionalViewSelectionItems
-
menu actions
-
browse
-
-
browseClass
-
-
browseClassHierarchy
-
-
browseFullClassProtocol
-
-
browseHome
-
-
browseMethodsClass
-
-
browseUpdateMethods
-
-
doBack
-
user selected back-menu entry
-
doBasicInspect
-
user selected inspect-menu entry
-
doFollow
-
user selected follow-menu entry
-
doInspect
-
user selected inspect-menu entry
-
doNewInspect
-
-
doStartMonitor
-
start a monitoring process
-
doStopMonitor
-
stop the monitor
-
doTraceAll
-
place a trace on all messages sent to the inspected object
-
doTrap
-
place a trap on a message sent to the inspected object
-
doTrapAll
-
place a trap on all messages sent to the inspected object
-
doTrapAnyInstVarChange
-
place a trap which is triggered if any instVar of the inspected object is changed
-
doTrapInstVarChange
-
place a trap which is triggered if the selected instVar of the inspected object is changed
-
doUntrace
-
remove traps/traces
-
inspectOwners
-
open an inspector on owners of the inspectedObject.
(this is a secret function)
-
letSelectedObjectPerform: aSelector
-
-
openFileBrowser
-
-
openWidgetHierarchy
-
-
showOwners
-
-
showReferences
-
user selected references-menu entry
-
showStreamContents
-
private
-
baseInspectedObjectClass
-
-
defaultLabel
-
-
derivedFieldNames
-
-
derivedFields
-
the check below is not sufficient - if someone catches messages, for example.
Therefore, we do a manual lookup here:
-
extraNamedFieldNames
-
-
extraNamedFields
-
by redefining inspectorExtraNamedFields to return an array of
pseudo-fieldName->value associations, the inspectors left list can be extended
-
extraNamedVarIndexForLine: lineNr
-
helper - return the index for a named instVar;
nil, if self or a keyed instvar is selected.
-
fieldList
-
return a list of names to show in the selectionList.
Leave hasMore as true, if a '...' entry should be added.
-
hasSelfEntry
-
-
indexList
-
return a list of indexes to show in the selectionList.
Set hasMore to true, if a '...' entry should be added.
-
indexOfFirstNamedInstvarInList
-
helper - return the index for the first named instVar;
nil, if self or a keyed instvar is selected.
-
indexedFieldList
-
return a list of indexed-variable names to show in the selectionList.
Set hasMore to true, if a '...' entry should be added.
-
indexedValueAtIndex: idx
-
-
indexedValueAtIndex: idx put: newValue
-
-
indexedValueAtKey: key
-
kludge
-
instVarIndexForLine: lineNr
-
helper - return the index for a named instVar;
nil, if self or a keyed instvar is selected.
-
keyIndexForLine: lineNr
-
helper - return the index of the key-list;
nil, if self or a namedInstVar is selected.
-
namedFieldAt: idx
-
-
namedFieldAt: idx put: newValue
-
-
namedFieldList
-
return a list of instVar names to show in the selectionList.
-
pseudoFieldNames
-
return a list of names to show in the selectionList.
Leave hasMore as true, if a '...' entry should be added.
-
pseudoFieldNamesWithIndexed: withIndexed
-
return a list of names to show in the selectionList.
Leave hasMore as true, if a '...' entry should be added.
-
setAcceptAction
-
set the codeViews accept action
-
setDoItAction
-
set the codeViews doit action
-
showAllIndexedVarsInFieldList
-
-
showMore
-
-
stringWithAllIndexedVarValues
-
-
stringWithAllInstVarValues
-
-
stringWithMessages: which
-
-
theSingleSelectionIndex
-
helper - return the index of the (single) selected entry.
Nil if nothing or multiple items are selected
-
valueAtLine: lineNr
-
helper - return the value of the selected entry
-
valueAtLine: lineNr put: newValue
-
-
valueForSpecialLine: line
-
queries
-
canInspect: anObject
-
-
compilerClass
-
-
dereferenceValueHolders
-
-
labelFor: anObject
-
return the windowLabel to use in my topView, when inspecting anObject.
-
labelNameFor: anObject
-
return the iconLabel to use in my topView, when inspecting anObject.
Simply returns the className or name of anObjects class
-
selectedKeyName
-
-
suppressPseudoSlots
-
selection
-
basicDisplayStringForValue: someValue
-
return the value's displayString to be pasted into the workspace.
-
displayStringForValue: someValue
-
return the value's displayString to be pasted into the workspace.
-
selection: lineNr
-
-
showSelection: lineNr
-
user clicked on an instvar - show value in workspace
-
showValue: someValue
-
user clicked on an entry - show value in workspace
user interaction
-
doAccept: theText
-
-
doCopyKey
-
put the instVar-name into the text-copy-buffer
-
doInspect: basic
-
user selected inspect-menu entry
-
doUpdate
-
-
monitor: anInstVarName
-
start a monitoring process, showing the given instVar
in regular intervals.
-
selection
-
helper - return the value of the (single) selected entry.
Nil if nothing or multiple items are selected
-
showLast
-
user clicked on an instvar - show value in workspace
-
toggleHex
-
-
tryToSelectKeyNamed: aString
-
workspace protocol
-
modified: aBoolean
-
-
saveAs: file doAppend: doAppend
-
|