added follow & back menu items.
--- a/InspView.st Tue Sep 22 17:41:12 1998 +0200
+++ b/InspView.st Thu Sep 24 12:07:12 1998 +0200
@@ -12,7 +12,8 @@
SimpleView subclass:#InspectorView
instanceVariableNames:'listView labelView workspace inspectedObject selectedLine nShown
- hasMore monitorProcess hideReceiver showHex'
+ hasMore monitorProcess hideReceiver showHex
+ inspectHistory isStandaloneInspector'
classVariableNames:'DefaultIcon'
poolDictionaries:''
category:'Interface-Inspector'
@@ -60,19 +61,19 @@
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
+ #(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'
+ InspectorView openOn:Display
+ InspectorView openOn:Display monitor:'shiftDown'
[author:]
- Claus Gittinger
+ Claus Gittinger
"
! !
@@ -112,27 +113,29 @@
|topView inspectorView|
- topView := StandardSystemView
- label:(self labelFor:anObject)
- icon:self defaultIcon
- minExtent:(100 @ 100).
+ topView := StandardSystemView new.
+ topView label:(self labelFor:anObject).
+ topView icon:self defaultIcon.
+ topView minExtent:(100 @ 100).
topView iconLabel:(self labelNameFor:anObject).
topView extent:(self defaultExtent).
inspectorView := self origin:(0.0 @ 0.0)
- corner:(1.0 @ 1.0)
- in:topView.
+ corner:(1.0 @ 1.0)
+ in:topView.
"kludge: must realize first, to be able to set menu again"
topView openAndWait.
topView windowGroup
- focusSequence:(Array with:inspectorView listView
- with:inspectorView workspace).
+ focusSequence:(Array
+ with:inspectorView listView
+ with:inspectorView workspace).
+ inspectorView isStandaloneInspector:true.
inspectorView inspect:anObject.
anInstVarName notNil ifTrue:[
- inspectorView monitor:anInstVarName
+ inspectorView monitor:anInstVarName
].
^ inspectorView
@@ -144,8 +147,8 @@
InspectorView openOn:m monitor:'value'.
2 to:10 do:[:i |
- Delay waitForSeconds:1.
- m value:i
+ Delay waitForSeconds:1.
+ m value:i
]
"
@@ -159,7 +162,7 @@
"
"Created: / 1.3.1996 / 19:30:50 / cg"
- "Modified: / 7.9.1998 / 14:15:38 / cg"
+ "Modified: / 22.9.1998 / 22:41:52 / cg"
! !
!InspectorView class methodsFor:'defaults'!
@@ -179,20 +182,20 @@
|nm i|
(i := DefaultIcon) isNil ifTrue:[
- i := self classResources at:'ICON' default:nil.
- i isNil ifTrue:[
- nm := ClassResources at:'ICON_FILE' default:'Inspector.xbm'.
- i := Image fromFile:nm resolution:100.
- i isNil ifTrue:[
- i := Image fromFile:('bitmaps/' , nm) resolution:100.
- i isNil ifTrue:[
- i := StandardSystemView defaultIcon
- ]
- ]
- ].
- i notNil ifTrue:[
- DefaultIcon := i := i on:Display
- ]
+ i := self classResources at:'ICON' default:nil.
+ i isNil ifTrue:[
+ nm := ClassResources at:'ICON_FILE' default:'Inspector.xbm'.
+ i := Image fromFile:nm resolution:100.
+ i isNil ifTrue:[
+ i := Image fromFile:('bitmaps/' , nm) resolution:100.
+ i isNil ifTrue:[
+ i := StandardSystemView defaultIcon
+ ]
+ ]
+ ].
+ i notNil ifTrue:[
+ DefaultIcon := i := i on:Display
+ ]
].
^ i
@@ -239,25 +242,34 @@
inspectedObject := anObject.
sameObject ifFalse:[
- hasMore := false.
- aList := self fieldList.
- hasMore ifTrue:[
- aList add:' ... '
- ].
+ hasMore := false.
+ aList := self fieldList.
+ hasMore ifTrue:[
+ aList add:' ... '
+ ].
].
sameObject ifTrue:[
"/ listView setContents:aList.
] ifFalse:[
- listView contents:aList.
+ listView contents:aList.
+
+ workspace contents:nil.
+ self setDoItAction.
- workspace contents:nil.
- self setDoItAction.
+ isStandaloneInspector == true ifTrue:[
+ self topView label:(self class labelFor:anObject).
+ self topView iconLabel:(self class labelNameFor:anObject).
+ ]
].
selectedLine := nil
- "Modified: / 30.7.1998 / 13:36:55 / cg"
+ "Modified: / 22.9.1998 / 22:40:56 / cg"
+!
+
+isStandaloneInspector:aBoolean
+ isStandaloneInspector := aBoolean
!
label:aString
@@ -283,11 +295,12 @@
hideReceiver := false.
showHex := false.
+ isStandaloneInspector := false.
panel := VariableHorizontalPanel
- origin:(0.0 @ 0.0)
- corner:(1.0 @ 1.0)
- in:self.
+ origin:(0.0 @ 0.0)
+ corner:(1.0 @ 1.0)
+ in:self.
helpView := View origin:(0.0 @ 0.0) corner:(0.3 @ 1.0) in:panel.
helpView level:0; borderWidth:0.
@@ -297,10 +310,10 @@
labelView bottomInset:(labelView preferredExtent y negated).
v := HVScrollableView
- for:SelectionInListView
- miniScrollerH:true
- miniScrollerV:false
- in:helpView.
+ for:SelectionInListView
+ miniScrollerH:true
+ miniScrollerV:false
+ in:helpView.
v autoHideScrollBars:true.
v origin:(0.0 @ 0.0) corner:(1.0 @ 1.0).
v topInset:(labelView preferredExtent y).
@@ -319,10 +332,10 @@
labelView2 bottomInset:(labelView preferredExtent y negated).
v := HVScrollableView
- for:CodeView
- miniScrollerH:true
- miniScrollerV:true
- in:helpView.
+ for:CodeView
+ miniScrollerH:true
+ miniScrollerV:true
+ in:helpView.
v autoHideScrollBars:true.
v origin:(0.0 @ 0.0) corner:(1.0 @ 1.0).
v topInset:(labelView2 preferredExtent y).
@@ -344,13 +357,13 @@
super realize.
inspectedObject notNil ifTrue:[
- "
- kludge to trick inspect:, which ignores setting the
- same object again ...
- "
- o := inspectedObject.
- inspectedObject := nil.
- self inspect:o
+ "
+ kludge to trick inspect:, which ignores setting the
+ same object again ...
+ "
+ o := inspectedObject.
+ inspectedObject := nil.
+ self inspect:o
]
"Created: 30.5.1996 / 09:38:37 / cg"
@@ -366,66 +379,81 @@
|items labels selectors m|
items := #(
- ('inspect' #doInspect )
- ('basicInspect' #doBasicInspect )
- ('inspect hierarchical' #doNewInspect )
- ('-')
- ('ref chains' #showReferences )
- ('-')
- ('browse' #browse )
- ('browse class hierarchy' #browseClassHierarchy )
- ('browse full class protocol' #browseFullClassProtocol)
- ('-')
- ('trace messages' #doTrace )
- ('trap message' #doTrapAll )
- ('trap all messages' #doTrap )
- ('untrace/untrap' #doUntrace )
- ).
+ ('inspect' #doInspect )
+ ('basicInspect' #doBasicInspect )
+ ('inspect hierarchical' #doNewInspect )
+ ('-')
+ ('ref chains' #showReferences )
+ ('-')
+ ('browse' #browse )
+ ('browse class hierarchy' #browseClassHierarchy )
+ ('browse full class protocol' #browseFullClassProtocol)
+ ('-')
+ ('trace messages' #doTrace )
+ ('trap message' #doTrapAll )
+ ('trap all messages' #doTrap )
+ ('untrace/untrap' #doUntrace )
+ ).
+
+ isStandaloneInspector ifTrue:[
+ items := #(
+ ('follow' #doFollow )
+ ('back' #doBack )
+ )
+ ,
+ items.
+ ].
hasMore ifTrue:[
- items := items , #(
- ('-')
- ('show more' #showMore )
- )
+ items := items , #(
+ ('-')
+ ('show more' #showMore )
+ )
].
monitorProcess isNil ifTrue:[
- items := items , #(
- ('-')
- ('start monitor' #doStartMonitor )
- ).
+ items := items , #(
+ ('-')
+ ('start monitor' #doStartMonitor )
+ ).
] ifFalse:[
- items := items , #(
- ('-')
- ('stop monitor' #doStopMonitor )
- ).
+ items := items , #(
+ ('-')
+ ('stop monitor' #doStopMonitor )
+ ).
].
showHex ifTrue:[
- items := items , #(
- ('-')
- ('decimal integers' #toggleHex )
- )
+ items := items , #(
+ ('-')
+ ('decimal integers' #toggleHex )
+ )
] ifFalse:[
- items := items , #(
- ('-')
- ('hex integers' #toggleHex )
- )
+ items := items , #(
+ ('-')
+ ('hex integers' #toggleHex )
+ )
].
m := PopUpMenu
- itemList:items
- resources:resources.
+ itemList:items
+ resources:resources.
selectedLine isNil ifTrue:[
- m disableAll:#(doInspect doBasicInspect doNewInspect
- browse browseClassHierarchy browseFullClassProtocol
- doStartMonitor)
+ m disableAll:#(doFollow doInspect doBasicInspect doNewInspect
+ browse browseClassHierarchy browseFullClassProtocol
+ doStartMonitor)
+ ].
+ (selectedLine == 1) ifTrue:[
+ m disableAll:#(doFollow)
].
+ inspectHistory size == 0 ifTrue:[
+ m disable:#doBack
+ ].
^ m
- "Modified: / 7.5.1998 / 19:37:50 / cg"
+ "Modified: / 22.9.1998 / 22:45:25 / cg"
! !
!InspectorView methodsFor:'menu actions'!
@@ -434,9 +462,9 @@
|objectToBrowseClass cls|
selectedLine notNil ifTrue:[
- objectToBrowseClass := self valueAtLine:selectedLine.
+ objectToBrowseClass := self valueAtLine:selectedLine.
] ifFalse:[
- objectToBrowseClass := inspectedObject
+ objectToBrowseClass := inspectedObject
].
cls := objectToBrowseClass class.
cls browserClass openInClass:cls selector:nil
@@ -449,9 +477,9 @@
|objectToBrowseClass cls|
selectedLine notNil ifTrue:[
- objectToBrowseClass := self valueAtLine:selectedLine.
+ objectToBrowseClass := self valueAtLine:selectedLine.
] ifFalse:[
- objectToBrowseClass := inspectedObject
+ objectToBrowseClass := inspectedObject
].
cls := objectToBrowseClass class.
cls browserClass browseClass:cls
@@ -463,9 +491,9 @@
|objectToBrowseClass cls|
selectedLine notNil ifTrue:[
- objectToBrowseClass := self valueAtLine:selectedLine.
+ objectToBrowseClass := self valueAtLine:selectedLine.
] ifFalse:[
- objectToBrowseClass := inspectedObject
+ objectToBrowseClass := inspectedObject
].
cls := objectToBrowseClass class.
cls browserClass browseClassHierarchy:cls
@@ -477,9 +505,9 @@
|objectToBrowseClass cls|
selectedLine notNil ifTrue:[
- objectToBrowseClass := self valueAtLine:selectedLine.
+ objectToBrowseClass := self valueAtLine:selectedLine.
] ifFalse:[
- objectToBrowseClass := inspectedObject
+ objectToBrowseClass := inspectedObject
].
cls := objectToBrowseClass class.
cls browserClass browseFullClassProtocol:cls
@@ -493,6 +521,41 @@
self doInspect:true
!
+doBack
+ "user selected back-menu entry"
+
+ |objectToInspect|
+
+ inspectHistory size > 0 ifTrue:[
+ objectToInspect := inspectHistory removeLast.
+ inspectHistory size == 0 ifTrue:[
+ inspectHistory := nil
+ ].
+ self inspect:objectToInspect.
+ ]
+
+ "Created: / 22.9.1998 / 18:22:01 / cg"
+ "Modified: / 22.9.1998 / 18:22:28 / cg"
+!
+
+doFollow
+ "user selected follow-menu entry"
+
+ |objectToInspect|
+
+ selectedLine notNil ifTrue:[
+ objectToInspect := self valueAtLine:selectedLine.
+ inspectHistory isNil ifTrue:[
+ inspectHistory := OrderedCollection new
+ ].
+ inspectHistory addLast:inspectedObject.
+ self inspect:objectToInspect.
+ ]
+
+ "Created: / 22.9.1998 / 18:21:08 / cg"
+ "Modified: / 22.9.1998 / 18:22:23 / cg"
+!
+
doInspect
"user selected inspect-menu entry"
@@ -510,17 +573,17 @@
"start a monitoring process"
monitorProcess isNil ifTrue:[
- monitorProcess :=
- [
- |sel|
+ monitorProcess :=
+ [
+ |sel|
- [true] whileTrue:[
- (sel := selectedLine) notNil ifTrue:[
- self showSelection:sel
- ].
- (Delay forSeconds:0.5) wait
- ]
- ] forkAt:Processor userBackgroundPriority
+ [true] whileTrue:[
+ (sel := selectedLine) notNil ifTrue:[
+ self showSelection:sel
+ ].
+ (Delay forSeconds:0.5) wait
+ ]
+ ] forkAt:Processor userBackgroundPriority
]
"Modified: 12.4.1996 / 14:20:06 / cg"
@@ -547,14 +610,14 @@
string := Dialog request:'Selector to trap on:' onCancel:nil.
string notNil ifTrue:[
- selector := string asSymbolIfInterned.
+ selector := string asSymbolIfInterned.
- selector isNil ifTrue:[
- self warn:'no such selector'
- ] ifFalse:[
- self topView withWaitCursorDo:[MessageTracer trap:inspectedObject
- selector:selector]
- ]
+ selector isNil ifTrue:[
+ self warn:'no such selector'
+ ] ifFalse:[
+ self topView withWaitCursorDo:[MessageTracer trap:inspectedObject
+ selector:selector]
+ ]
]
"Modified: 12.4.1996 / 14:07:01 / cg"
@@ -633,18 +696,18 @@
hideReceiver ifFalse:[aList add:'self'].
cls := inspectedObject class.
cls allInstVarNames do:[:instVarName |
- aList add:instVarName
+ aList add:instVarName
].
cls isVariable ifTrue:[
- n := inspectedObject basicSize.
- (n > nShown) ifTrue:[
- n := nShown.
- hasMore := true.
- ].
- 1 to:n do:[:index |
- aList add:(index printString)
- ].
+ n := inspectedObject basicSize.
+ (n > nShown) ifTrue:[
+ n := nShown.
+ hasMore := true.
+ ].
+ 1 to:n do:[:index |
+ aList add:(index printString)
+ ].
].
^ aList
@@ -662,26 +725,26 @@
"set the codeViews doit action"
workspace
- doItAction:[:theCode |
- |evaluator|
+ doItAction:[:theCode |
+ |evaluator|
- (evaluator := inspectedObject class evaluatorClass)
- notNil ifTrue:[
- evaluator
- evaluate:theCode
- in:nil
- receiver:inspectedObject
- notifying:workspace
- logged:true
- ifFail:nil
- ] ifFalse:[
- 'objects class provides no evaluator'
- ]
- ].
+ (evaluator := inspectedObject class evaluatorClass)
+ notNil ifTrue:[
+ evaluator
+ evaluate:theCode
+ in:nil
+ receiver:inspectedObject
+ notifying:workspace
+ logged:true
+ ifFail:nil
+ ] ifFalse:[
+ 'objects class provides no evaluator'
+ ]
+ ].
inspectedObject class evaluatorClass isNil ifTrue:[
- workspace doItAction:nil.
- workspace acceptAction:nil.
+ workspace doItAction:nil.
+ workspace acceptAction:nil.
]
"Modified: 1.8.1997 / 21:47:09 / cg"
@@ -691,11 +754,11 @@
|o|
hasMore ifTrue:[
- nShown := nShown * 2.
- "/ force update (which is otherwise ignored)
- o := inspectedObject.
- inspectedObject := nil.
- self inspect:o
+ nShown := nShown * 2.
+ "/ force update (which is otherwise ignored)
+ o := inspectedObject.
+ inspectedObject := nil.
+ self inspect:o
]
"Modified: / 26.8.1998 / 19:05:25 / cg"
@@ -712,7 +775,7 @@
"
inspectedObject notNil ifTrue:[
- inspectedObject removeDependent:self
+ inspectedObject removeDependent:self
].
"
inspectedObject := nil.
@@ -767,16 +830,16 @@
|objectToInspect|
selectedLine notNil ifTrue:[
- objectToInspect := self valueAtLine:selectedLine.
- basic == #new ifTrue:[
- NewInspector::InspectorView inspect:objectToInspect
- ] ifFalse:[
- basic ifTrue:[
- objectToInspect basicInspect
- ] ifFalse:[
- objectToInspect inspect
- ]
- ]
+ objectToInspect := self valueAtLine:selectedLine.
+ basic == #new ifTrue:[
+ NewInspector::InspectorView inspect:objectToInspect
+ ] ifFalse:[
+ basic ifTrue:[
+ objectToInspect basicInspect
+ ] ifFalse:[
+ objectToInspect inspect
+ ]
+ ]
]
"Modified: / 31.10.1997 / 12:46:53 / cg"
@@ -786,9 +849,9 @@
"all my input is passed on to the workspace-field"
x notNil ifTrue:[
- "/ not already delegated
+ "/ not already delegated
- workspace keyPress:aKey x:-1 y:-1
+ workspace keyPress:aKey x:-1 y:-1
].
"Modified: 4.3.1996 / 22:21:37 / cg"
@@ -811,8 +874,8 @@
lastIdx := listView list size.
lastIdx ~~ 0 ifTrue:[
- self showSelection:lastIdx.
- listView selection:lastIdx.
+ self showSelection:lastIdx.
+ listView selection:lastIdx.
]
"Created: 28.6.1996 / 15:06:38 / cg"
@@ -825,9 +888,9 @@
|objectToInspect|
selectedLine isNil ifTrue:[
- objectToInspect := inspectedObject.
+ objectToInspect := inspectedObject.
] ifFalse:[
- objectToInspect := self valueAtLine:selectedLine.
+ objectToInspect := self valueAtLine:selectedLine.
].
ObjectMemory displayRefChainTo:objectToInspect
@@ -840,18 +903,18 @@
|val obj|
(hasMore and:[lineNr == listView list size]) ifTrue:[
- "clicked on the '...' entry"
- self showMore.
- listView setSelection:lineNr.
+ "clicked on the '...' entry"
+ self showMore.
+ listView setSelection:lineNr.
].
hideReceiver ifFalse:[
- (self hasSelfEntry and:[lineNr == 1]) ifTrue:[
- "selecting self also does a re-set, this allows updating the list"
- obj := inspectedObject. "/ force re-evaluation of the fieldList.
- inspectedObject := nil.
- self inspect:obj.
- ].
+ (self hasSelfEntry and:[lineNr == 1]) ifTrue:[
+ "selecting self also does a re-set, this allows updating the list"
+ obj := inspectedObject. "/ force re-evaluation of the fieldList.
+ inspectedObject := nil.
+ self inspect:obj.
+ ].
].
val := self valueAtLine:lineNr.
selectedLine := lineNr.
@@ -864,15 +927,15 @@
"user clicked on an entry - show value in workspace"
self topView withWaitCursorDo:[
- |s|
+ |s|
- s := someValue displayString.
- showHex ifTrue:[
- someValue isInteger ifTrue:[
- s := '16r' , someValue hexPrintString
- ]
- ].
- workspace replace:s.
+ s := someValue displayString.
+ showHex ifTrue:[
+ someValue isInteger ifTrue:[
+ s := '16r' , someValue hexPrintString
+ ]
+ ].
+ workspace replace:s.
].
"Modified: / 7.5.1998 / 01:57:05 / cg"
@@ -884,7 +947,7 @@
showHex := showHex not.
sel := listView selection.
sel notNil ifTrue:[
- self showSelection:sel
+ self showSelection:sel
]
"Created: / 7.5.1998 / 01:54:52 / cg"
@@ -911,19 +974,19 @@
|index instSize|
hideReceiver ifFalse:[
- (lineNr isNil or:[lineNr == 1]) ifTrue:[
- ^ inspectedObject
- ].
- index := lineNr - 1. "/ skip self
+ (lineNr isNil or:[lineNr == 1]) ifTrue:[
+ ^ inspectedObject
+ ].
+ index := lineNr - 1. "/ skip self
] ifTrue:[
- index := lineNr
+ index := lineNr
].
instSize := inspectedObject class instSize.
(inspectedObject class isVariable not
or:[index <= instSize]) ifTrue:[
- ^ inspectedObject instVarAt:index
+ ^ inspectedObject instVarAt:index
].
index := index - instSize.
^ inspectedObject basicAt:index
@@ -934,5 +997,5 @@
!InspectorView class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libtool/Attic/InspView.st,v 1.80 1998-09-08 11:18:22 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libtool/Attic/InspView.st,v 1.81 1998-09-24 10:07:12 cg Exp $'
! !
--- a/InspectorView.st Tue Sep 22 17:41:12 1998 +0200
+++ b/InspectorView.st Thu Sep 24 12:07:12 1998 +0200
@@ -12,7 +12,8 @@
SimpleView subclass:#InspectorView
instanceVariableNames:'listView labelView workspace inspectedObject selectedLine nShown
- hasMore monitorProcess hideReceiver showHex'
+ hasMore monitorProcess hideReceiver showHex
+ inspectHistory isStandaloneInspector'
classVariableNames:'DefaultIcon'
poolDictionaries:''
category:'Interface-Inspector'
@@ -60,19 +61,19 @@
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
+ #(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'
+ InspectorView openOn:Display
+ InspectorView openOn:Display monitor:'shiftDown'
[author:]
- Claus Gittinger
+ Claus Gittinger
"
! !
@@ -112,27 +113,29 @@
|topView inspectorView|
- topView := StandardSystemView
- label:(self labelFor:anObject)
- icon:self defaultIcon
- minExtent:(100 @ 100).
+ topView := StandardSystemView new.
+ topView label:(self labelFor:anObject).
+ topView icon:self defaultIcon.
+ topView minExtent:(100 @ 100).
topView iconLabel:(self labelNameFor:anObject).
topView extent:(self defaultExtent).
inspectorView := self origin:(0.0 @ 0.0)
- corner:(1.0 @ 1.0)
- in:topView.
+ corner:(1.0 @ 1.0)
+ in:topView.
"kludge: must realize first, to be able to set menu again"
topView openAndWait.
topView windowGroup
- focusSequence:(Array with:inspectorView listView
- with:inspectorView workspace).
+ focusSequence:(Array
+ with:inspectorView listView
+ with:inspectorView workspace).
+ inspectorView isStandaloneInspector:true.
inspectorView inspect:anObject.
anInstVarName notNil ifTrue:[
- inspectorView monitor:anInstVarName
+ inspectorView monitor:anInstVarName
].
^ inspectorView
@@ -144,8 +147,8 @@
InspectorView openOn:m monitor:'value'.
2 to:10 do:[:i |
- Delay waitForSeconds:1.
- m value:i
+ Delay waitForSeconds:1.
+ m value:i
]
"
@@ -159,7 +162,7 @@
"
"Created: / 1.3.1996 / 19:30:50 / cg"
- "Modified: / 7.9.1998 / 14:15:38 / cg"
+ "Modified: / 22.9.1998 / 22:41:52 / cg"
! !
!InspectorView class methodsFor:'defaults'!
@@ -179,20 +182,20 @@
|nm i|
(i := DefaultIcon) isNil ifTrue:[
- i := self classResources at:'ICON' default:nil.
- i isNil ifTrue:[
- nm := ClassResources at:'ICON_FILE' default:'Inspector.xbm'.
- i := Image fromFile:nm resolution:100.
- i isNil ifTrue:[
- i := Image fromFile:('bitmaps/' , nm) resolution:100.
- i isNil ifTrue:[
- i := StandardSystemView defaultIcon
- ]
- ]
- ].
- i notNil ifTrue:[
- DefaultIcon := i := i on:Display
- ]
+ i := self classResources at:'ICON' default:nil.
+ i isNil ifTrue:[
+ nm := ClassResources at:'ICON_FILE' default:'Inspector.xbm'.
+ i := Image fromFile:nm resolution:100.
+ i isNil ifTrue:[
+ i := Image fromFile:('bitmaps/' , nm) resolution:100.
+ i isNil ifTrue:[
+ i := StandardSystemView defaultIcon
+ ]
+ ]
+ ].
+ i notNil ifTrue:[
+ DefaultIcon := i := i on:Display
+ ]
].
^ i
@@ -239,25 +242,34 @@
inspectedObject := anObject.
sameObject ifFalse:[
- hasMore := false.
- aList := self fieldList.
- hasMore ifTrue:[
- aList add:' ... '
- ].
+ hasMore := false.
+ aList := self fieldList.
+ hasMore ifTrue:[
+ aList add:' ... '
+ ].
].
sameObject ifTrue:[
"/ listView setContents:aList.
] ifFalse:[
- listView contents:aList.
+ listView contents:aList.
+
+ workspace contents:nil.
+ self setDoItAction.
- workspace contents:nil.
- self setDoItAction.
+ isStandaloneInspector == true ifTrue:[
+ self topView label:(self class labelFor:anObject).
+ self topView iconLabel:(self class labelNameFor:anObject).
+ ]
].
selectedLine := nil
- "Modified: / 30.7.1998 / 13:36:55 / cg"
+ "Modified: / 22.9.1998 / 22:40:56 / cg"
+!
+
+isStandaloneInspector:aBoolean
+ isStandaloneInspector := aBoolean
!
label:aString
@@ -283,11 +295,12 @@
hideReceiver := false.
showHex := false.
+ isStandaloneInspector := false.
panel := VariableHorizontalPanel
- origin:(0.0 @ 0.0)
- corner:(1.0 @ 1.0)
- in:self.
+ origin:(0.0 @ 0.0)
+ corner:(1.0 @ 1.0)
+ in:self.
helpView := View origin:(0.0 @ 0.0) corner:(0.3 @ 1.0) in:panel.
helpView level:0; borderWidth:0.
@@ -297,10 +310,10 @@
labelView bottomInset:(labelView preferredExtent y negated).
v := HVScrollableView
- for:SelectionInListView
- miniScrollerH:true
- miniScrollerV:false
- in:helpView.
+ for:SelectionInListView
+ miniScrollerH:true
+ miniScrollerV:false
+ in:helpView.
v autoHideScrollBars:true.
v origin:(0.0 @ 0.0) corner:(1.0 @ 1.0).
v topInset:(labelView preferredExtent y).
@@ -319,10 +332,10 @@
labelView2 bottomInset:(labelView preferredExtent y negated).
v := HVScrollableView
- for:CodeView
- miniScrollerH:true
- miniScrollerV:true
- in:helpView.
+ for:CodeView
+ miniScrollerH:true
+ miniScrollerV:true
+ in:helpView.
v autoHideScrollBars:true.
v origin:(0.0 @ 0.0) corner:(1.0 @ 1.0).
v topInset:(labelView2 preferredExtent y).
@@ -344,13 +357,13 @@
super realize.
inspectedObject notNil ifTrue:[
- "
- kludge to trick inspect:, which ignores setting the
- same object again ...
- "
- o := inspectedObject.
- inspectedObject := nil.
- self inspect:o
+ "
+ kludge to trick inspect:, which ignores setting the
+ same object again ...
+ "
+ o := inspectedObject.
+ inspectedObject := nil.
+ self inspect:o
]
"Created: 30.5.1996 / 09:38:37 / cg"
@@ -366,66 +379,81 @@
|items labels selectors m|
items := #(
- ('inspect' #doInspect )
- ('basicInspect' #doBasicInspect )
- ('inspect hierarchical' #doNewInspect )
- ('-')
- ('ref chains' #showReferences )
- ('-')
- ('browse' #browse )
- ('browse class hierarchy' #browseClassHierarchy )
- ('browse full class protocol' #browseFullClassProtocol)
- ('-')
- ('trace messages' #doTrace )
- ('trap message' #doTrapAll )
- ('trap all messages' #doTrap )
- ('untrace/untrap' #doUntrace )
- ).
+ ('inspect' #doInspect )
+ ('basicInspect' #doBasicInspect )
+ ('inspect hierarchical' #doNewInspect )
+ ('-')
+ ('ref chains' #showReferences )
+ ('-')
+ ('browse' #browse )
+ ('browse class hierarchy' #browseClassHierarchy )
+ ('browse full class protocol' #browseFullClassProtocol)
+ ('-')
+ ('trace messages' #doTrace )
+ ('trap message' #doTrapAll )
+ ('trap all messages' #doTrap )
+ ('untrace/untrap' #doUntrace )
+ ).
+
+ isStandaloneInspector ifTrue:[
+ items := #(
+ ('follow' #doFollow )
+ ('back' #doBack )
+ )
+ ,
+ items.
+ ].
hasMore ifTrue:[
- items := items , #(
- ('-')
- ('show more' #showMore )
- )
+ items := items , #(
+ ('-')
+ ('show more' #showMore )
+ )
].
monitorProcess isNil ifTrue:[
- items := items , #(
- ('-')
- ('start monitor' #doStartMonitor )
- ).
+ items := items , #(
+ ('-')
+ ('start monitor' #doStartMonitor )
+ ).
] ifFalse:[
- items := items , #(
- ('-')
- ('stop monitor' #doStopMonitor )
- ).
+ items := items , #(
+ ('-')
+ ('stop monitor' #doStopMonitor )
+ ).
].
showHex ifTrue:[
- items := items , #(
- ('-')
- ('decimal integers' #toggleHex )
- )
+ items := items , #(
+ ('-')
+ ('decimal integers' #toggleHex )
+ )
] ifFalse:[
- items := items , #(
- ('-')
- ('hex integers' #toggleHex )
- )
+ items := items , #(
+ ('-')
+ ('hex integers' #toggleHex )
+ )
].
m := PopUpMenu
- itemList:items
- resources:resources.
+ itemList:items
+ resources:resources.
selectedLine isNil ifTrue:[
- m disableAll:#(doInspect doBasicInspect doNewInspect
- browse browseClassHierarchy browseFullClassProtocol
- doStartMonitor)
+ m disableAll:#(doFollow doInspect doBasicInspect doNewInspect
+ browse browseClassHierarchy browseFullClassProtocol
+ doStartMonitor)
+ ].
+ (selectedLine == 1) ifTrue:[
+ m disableAll:#(doFollow)
].
+ inspectHistory size == 0 ifTrue:[
+ m disable:#doBack
+ ].
^ m
- "Modified: / 7.5.1998 / 19:37:50 / cg"
+ "Modified: / 22.9.1998 / 22:45:25 / cg"
! !
!InspectorView methodsFor:'menu actions'!
@@ -434,9 +462,9 @@
|objectToBrowseClass cls|
selectedLine notNil ifTrue:[
- objectToBrowseClass := self valueAtLine:selectedLine.
+ objectToBrowseClass := self valueAtLine:selectedLine.
] ifFalse:[
- objectToBrowseClass := inspectedObject
+ objectToBrowseClass := inspectedObject
].
cls := objectToBrowseClass class.
cls browserClass openInClass:cls selector:nil
@@ -449,9 +477,9 @@
|objectToBrowseClass cls|
selectedLine notNil ifTrue:[
- objectToBrowseClass := self valueAtLine:selectedLine.
+ objectToBrowseClass := self valueAtLine:selectedLine.
] ifFalse:[
- objectToBrowseClass := inspectedObject
+ objectToBrowseClass := inspectedObject
].
cls := objectToBrowseClass class.
cls browserClass browseClass:cls
@@ -463,9 +491,9 @@
|objectToBrowseClass cls|
selectedLine notNil ifTrue:[
- objectToBrowseClass := self valueAtLine:selectedLine.
+ objectToBrowseClass := self valueAtLine:selectedLine.
] ifFalse:[
- objectToBrowseClass := inspectedObject
+ objectToBrowseClass := inspectedObject
].
cls := objectToBrowseClass class.
cls browserClass browseClassHierarchy:cls
@@ -477,9 +505,9 @@
|objectToBrowseClass cls|
selectedLine notNil ifTrue:[
- objectToBrowseClass := self valueAtLine:selectedLine.
+ objectToBrowseClass := self valueAtLine:selectedLine.
] ifFalse:[
- objectToBrowseClass := inspectedObject
+ objectToBrowseClass := inspectedObject
].
cls := objectToBrowseClass class.
cls browserClass browseFullClassProtocol:cls
@@ -493,6 +521,41 @@
self doInspect:true
!
+doBack
+ "user selected back-menu entry"
+
+ |objectToInspect|
+
+ inspectHistory size > 0 ifTrue:[
+ objectToInspect := inspectHistory removeLast.
+ inspectHistory size == 0 ifTrue:[
+ inspectHistory := nil
+ ].
+ self inspect:objectToInspect.
+ ]
+
+ "Created: / 22.9.1998 / 18:22:01 / cg"
+ "Modified: / 22.9.1998 / 18:22:28 / cg"
+!
+
+doFollow
+ "user selected follow-menu entry"
+
+ |objectToInspect|
+
+ selectedLine notNil ifTrue:[
+ objectToInspect := self valueAtLine:selectedLine.
+ inspectHistory isNil ifTrue:[
+ inspectHistory := OrderedCollection new
+ ].
+ inspectHistory addLast:inspectedObject.
+ self inspect:objectToInspect.
+ ]
+
+ "Created: / 22.9.1998 / 18:21:08 / cg"
+ "Modified: / 22.9.1998 / 18:22:23 / cg"
+!
+
doInspect
"user selected inspect-menu entry"
@@ -510,17 +573,17 @@
"start a monitoring process"
monitorProcess isNil ifTrue:[
- monitorProcess :=
- [
- |sel|
+ monitorProcess :=
+ [
+ |sel|
- [true] whileTrue:[
- (sel := selectedLine) notNil ifTrue:[
- self showSelection:sel
- ].
- (Delay forSeconds:0.5) wait
- ]
- ] forkAt:Processor userBackgroundPriority
+ [true] whileTrue:[
+ (sel := selectedLine) notNil ifTrue:[
+ self showSelection:sel
+ ].
+ (Delay forSeconds:0.5) wait
+ ]
+ ] forkAt:Processor userBackgroundPriority
]
"Modified: 12.4.1996 / 14:20:06 / cg"
@@ -547,14 +610,14 @@
string := Dialog request:'Selector to trap on:' onCancel:nil.
string notNil ifTrue:[
- selector := string asSymbolIfInterned.
+ selector := string asSymbolIfInterned.
- selector isNil ifTrue:[
- self warn:'no such selector'
- ] ifFalse:[
- self topView withWaitCursorDo:[MessageTracer trap:inspectedObject
- selector:selector]
- ]
+ selector isNil ifTrue:[
+ self warn:'no such selector'
+ ] ifFalse:[
+ self topView withWaitCursorDo:[MessageTracer trap:inspectedObject
+ selector:selector]
+ ]
]
"Modified: 12.4.1996 / 14:07:01 / cg"
@@ -633,18 +696,18 @@
hideReceiver ifFalse:[aList add:'self'].
cls := inspectedObject class.
cls allInstVarNames do:[:instVarName |
- aList add:instVarName
+ aList add:instVarName
].
cls isVariable ifTrue:[
- n := inspectedObject basicSize.
- (n > nShown) ifTrue:[
- n := nShown.
- hasMore := true.
- ].
- 1 to:n do:[:index |
- aList add:(index printString)
- ].
+ n := inspectedObject basicSize.
+ (n > nShown) ifTrue:[
+ n := nShown.
+ hasMore := true.
+ ].
+ 1 to:n do:[:index |
+ aList add:(index printString)
+ ].
].
^ aList
@@ -662,26 +725,26 @@
"set the codeViews doit action"
workspace
- doItAction:[:theCode |
- |evaluator|
+ doItAction:[:theCode |
+ |evaluator|
- (evaluator := inspectedObject class evaluatorClass)
- notNil ifTrue:[
- evaluator
- evaluate:theCode
- in:nil
- receiver:inspectedObject
- notifying:workspace
- logged:true
- ifFail:nil
- ] ifFalse:[
- 'objects class provides no evaluator'
- ]
- ].
+ (evaluator := inspectedObject class evaluatorClass)
+ notNil ifTrue:[
+ evaluator
+ evaluate:theCode
+ in:nil
+ receiver:inspectedObject
+ notifying:workspace
+ logged:true
+ ifFail:nil
+ ] ifFalse:[
+ 'objects class provides no evaluator'
+ ]
+ ].
inspectedObject class evaluatorClass isNil ifTrue:[
- workspace doItAction:nil.
- workspace acceptAction:nil.
+ workspace doItAction:nil.
+ workspace acceptAction:nil.
]
"Modified: 1.8.1997 / 21:47:09 / cg"
@@ -691,11 +754,11 @@
|o|
hasMore ifTrue:[
- nShown := nShown * 2.
- "/ force update (which is otherwise ignored)
- o := inspectedObject.
- inspectedObject := nil.
- self inspect:o
+ nShown := nShown * 2.
+ "/ force update (which is otherwise ignored)
+ o := inspectedObject.
+ inspectedObject := nil.
+ self inspect:o
]
"Modified: / 26.8.1998 / 19:05:25 / cg"
@@ -712,7 +775,7 @@
"
inspectedObject notNil ifTrue:[
- inspectedObject removeDependent:self
+ inspectedObject removeDependent:self
].
"
inspectedObject := nil.
@@ -767,16 +830,16 @@
|objectToInspect|
selectedLine notNil ifTrue:[
- objectToInspect := self valueAtLine:selectedLine.
- basic == #new ifTrue:[
- NewInspector::InspectorView inspect:objectToInspect
- ] ifFalse:[
- basic ifTrue:[
- objectToInspect basicInspect
- ] ifFalse:[
- objectToInspect inspect
- ]
- ]
+ objectToInspect := self valueAtLine:selectedLine.
+ basic == #new ifTrue:[
+ NewInspector::InspectorView inspect:objectToInspect
+ ] ifFalse:[
+ basic ifTrue:[
+ objectToInspect basicInspect
+ ] ifFalse:[
+ objectToInspect inspect
+ ]
+ ]
]
"Modified: / 31.10.1997 / 12:46:53 / cg"
@@ -786,9 +849,9 @@
"all my input is passed on to the workspace-field"
x notNil ifTrue:[
- "/ not already delegated
+ "/ not already delegated
- workspace keyPress:aKey x:-1 y:-1
+ workspace keyPress:aKey x:-1 y:-1
].
"Modified: 4.3.1996 / 22:21:37 / cg"
@@ -811,8 +874,8 @@
lastIdx := listView list size.
lastIdx ~~ 0 ifTrue:[
- self showSelection:lastIdx.
- listView selection:lastIdx.
+ self showSelection:lastIdx.
+ listView selection:lastIdx.
]
"Created: 28.6.1996 / 15:06:38 / cg"
@@ -825,9 +888,9 @@
|objectToInspect|
selectedLine isNil ifTrue:[
- objectToInspect := inspectedObject.
+ objectToInspect := inspectedObject.
] ifFalse:[
- objectToInspect := self valueAtLine:selectedLine.
+ objectToInspect := self valueAtLine:selectedLine.
].
ObjectMemory displayRefChainTo:objectToInspect
@@ -840,18 +903,18 @@
|val obj|
(hasMore and:[lineNr == listView list size]) ifTrue:[
- "clicked on the '...' entry"
- self showMore.
- listView setSelection:lineNr.
+ "clicked on the '...' entry"
+ self showMore.
+ listView setSelection:lineNr.
].
hideReceiver ifFalse:[
- (self hasSelfEntry and:[lineNr == 1]) ifTrue:[
- "selecting self also does a re-set, this allows updating the list"
- obj := inspectedObject. "/ force re-evaluation of the fieldList.
- inspectedObject := nil.
- self inspect:obj.
- ].
+ (self hasSelfEntry and:[lineNr == 1]) ifTrue:[
+ "selecting self also does a re-set, this allows updating the list"
+ obj := inspectedObject. "/ force re-evaluation of the fieldList.
+ inspectedObject := nil.
+ self inspect:obj.
+ ].
].
val := self valueAtLine:lineNr.
selectedLine := lineNr.
@@ -864,15 +927,15 @@
"user clicked on an entry - show value in workspace"
self topView withWaitCursorDo:[
- |s|
+ |s|
- s := someValue displayString.
- showHex ifTrue:[
- someValue isInteger ifTrue:[
- s := '16r' , someValue hexPrintString
- ]
- ].
- workspace replace:s.
+ s := someValue displayString.
+ showHex ifTrue:[
+ someValue isInteger ifTrue:[
+ s := '16r' , someValue hexPrintString
+ ]
+ ].
+ workspace replace:s.
].
"Modified: / 7.5.1998 / 01:57:05 / cg"
@@ -884,7 +947,7 @@
showHex := showHex not.
sel := listView selection.
sel notNil ifTrue:[
- self showSelection:sel
+ self showSelection:sel
]
"Created: / 7.5.1998 / 01:54:52 / cg"
@@ -911,19 +974,19 @@
|index instSize|
hideReceiver ifFalse:[
- (lineNr isNil or:[lineNr == 1]) ifTrue:[
- ^ inspectedObject
- ].
- index := lineNr - 1. "/ skip self
+ (lineNr isNil or:[lineNr == 1]) ifTrue:[
+ ^ inspectedObject
+ ].
+ index := lineNr - 1. "/ skip self
] ifTrue:[
- index := lineNr
+ index := lineNr
].
instSize := inspectedObject class instSize.
(inspectedObject class isVariable not
or:[index <= instSize]) ifTrue:[
- ^ inspectedObject instVarAt:index
+ ^ inspectedObject instVarAt:index
].
index := index - instSize.
^ inspectedObject basicAt:index
@@ -934,5 +997,5 @@
!InspectorView class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libtool/InspectorView.st,v 1.80 1998-09-08 11:18:22 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libtool/InspectorView.st,v 1.81 1998-09-24 10:07:12 cg Exp $'
! !