0
|
1 |
"
|
5
|
2 |
COPYRIGHT (c) 1989 by Claus Gittinger
|
45
|
3 |
All Rights Reserved
|
0
|
4 |
|
|
5 |
This software is furnished under a license and may be used
|
|
6 |
only in accordance with the terms of that license and with the
|
|
7 |
inclusion of the above copyright notice. This software may not
|
|
8 |
be provided or otherwise made available to, or used by, any
|
|
9 |
other person. No title to or ownership of the software is
|
|
10 |
hereby transferred.
|
|
11 |
"
|
|
12 |
|
73
|
13 |
'From Smalltalk/X, Version:2.10.4 on 28-feb-1995 at 2:12:00 am'!
|
|
14 |
|
93
|
15 |
SimpleView subclass:#InspectorView
|
|
16 |
instanceVariableNames:'listView workspace inspectedObject selectedLine nShown
|
|
17 |
hasMore monitorProcess'
|
73
|
18 |
classVariableNames:'DefaultIcon'
|
|
19 |
poolDictionaries:''
|
|
20 |
category:'Interface-Inspector'
|
0
|
21 |
!
|
|
22 |
|
|
23 |
InspectorView comment:'
|
5
|
24 |
COPYRIGHT (c) 1989 by Claus Gittinger
|
45
|
25 |
All Rights Reserved
|
0
|
26 |
|
110
|
27 |
$Header: /cvs/stx/stx/libtool/Attic/InspView.st,v 1.27 1995-08-10 13:14:22 claus Exp $
|
29
|
28 |
'!
|
|
29 |
|
|
30 |
!InspectorView class methodsFor:'documentation'!
|
|
31 |
|
|
32 |
copyright
|
|
33 |
"
|
|
34 |
COPYRIGHT (c) 1989 by Claus Gittinger
|
45
|
35 |
All Rights Reserved
|
29
|
36 |
|
|
37 |
This software is furnished under a license and may be used
|
|
38 |
only in accordance with the terms of that license and with the
|
|
39 |
inclusion of the above copyright notice. This software may not
|
|
40 |
be provided or otherwise made available to, or used by, any
|
|
41 |
other person. No title to or ownership of the software is
|
|
42 |
hereby transferred.
|
|
43 |
"
|
|
44 |
!
|
|
45 |
|
|
46 |
version
|
|
47 |
"
|
110
|
48 |
$Header: /cvs/stx/stx/libtool/Attic/InspView.st,v 1.27 1995-08-10 13:14:22 claus Exp $
|
|
49 |
$Revision: 1.27 $
|
29
|
50 |
"
|
|
51 |
!
|
0
|
52 |
|
29
|
53 |
documentation
|
|
54 |
"
|
|
55 |
This class implements an graphical inspector.
|
|
56 |
Inspecting can be done on an object -
|
|
57 |
(where its instvarnames/values are inspected)
|
|
58 |
or a list of objects (where a namearray/valuesarray is inspected).
|
|
59 |
The later is used by the debugger to inspect method variables/args.
|
|
60 |
|
|
61 |
The system calls the inspector through the global variable 'Inspector'
|
|
62 |
which is bound to this class (but could be redefined - it actually is
|
|
63 |
set to MiniInspector in a smalltalk without graphical user interface).
|
0
|
64 |
|
29
|
65 |
Also notice, that there are two methods to inspect an object:
|
|
66 |
sending #basicInspect to any object, will open this kind of inspector on
|
|
67 |
it (showing instance variables which are physically present).
|
|
68 |
|
|
69 |
Sending it #inspect, will - depending on the object - sometimes invoke a
|
|
70 |
specialized inspector.
|
|
71 |
(see OrderedCollectionInspectorView, ImageInspectorView etc. as examples).
|
|
72 |
|
|
73 |
examples:
|
45
|
74 |
#(1 2 3 4) asOrderedCollection inspect
|
|
75 |
#(1 2 3 4) asOrderedCollection basicInspect
|
|
76 |
(Array new:10000) inspect
|
|
77 |
(Image fromFile:'bitmaps/claus.gif') inspect
|
|
78 |
(Image fromFile:'bitmaps/claus.gif') basicInspect
|
|
79 |
(Image fromFile:'bitmaps/SBrowser.xbm') inspect
|
|
80 |
(Image fromFile:'bitmaps/SBrowser.xbm') basicInspect
|
29
|
81 |
"
|
|
82 |
! !
|
0
|
83 |
|
|
84 |
!InspectorView class methodsFor:'instance creation'!
|
|
85 |
|
|
86 |
openOn:anObject
|
|
87 |
"create and launch a new inspector for anObject"
|
|
88 |
|
105
|
89 |
|topView inspectorView|
|
0
|
90 |
|
|
91 |
topView := StandardSystemView
|
105
|
92 |
label:(self labelFor:anObject)
|
73
|
93 |
icon:self defaultIcon
|
45
|
94 |
minExtent:(100 @ 100).
|
0
|
95 |
|
110
|
96 |
topView iconLabel:(self labelNameFor:anObject).
|
106
|
97 |
topView extent:(Screen current extent // 3).
|
0
|
98 |
|
|
99 |
inspectorView := self origin:(0.0 @ 0.0)
|
45
|
100 |
corner:(1.0 @ 1.0)
|
|
101 |
in:topView.
|
0
|
102 |
|
3
|
103 |
"kludge: must realize first, to be able to set menu again"
|
8
|
104 |
topView open.
|
0
|
105 |
inspectorView inspect:anObject.
|
69
|
106 |
^ inspectorView
|
0
|
107 |
|
29
|
108 |
"
|
|
109 |
InspectorView openOn:(5 @ 7)
|
|
110 |
InspectorView openOn:(Array new:400)
|
|
111 |
DictionaryInspectorView openOn:(IdentityDictionary new)
|
|
112 |
"
|
73
|
113 |
!
|
0
|
114 |
|
73
|
115 |
for:anObject
|
|
116 |
"create and launch a new inspector for anObject.
|
|
117 |
This protocol is a historic leftover - this method will vanish."
|
0
|
118 |
|
73
|
119 |
^ self openOn:anObject
|
0
|
120 |
!
|
|
121 |
|
73
|
122 |
inspect:anObject
|
|
123 |
"create and launch a new inspector for anObject.
|
|
124 |
This protocol is a historic leftover - this method will vanish."
|
|
125 |
|
|
126 |
^ self openOn:anObject
|
|
127 |
! !
|
|
128 |
|
|
129 |
!InspectorView class methodsFor:'defaults'!
|
|
130 |
|
|
131 |
defaultIcon
|
|
132 |
DefaultIcon isNil ifTrue:[
|
|
133 |
DefaultIcon := Form fromFile:'Inspector.xbm' resolution:100
|
|
134 |
].
|
|
135 |
^ DefaultIcon
|
105
|
136 |
!
|
|
137 |
|
|
138 |
labelFor:anObject
|
110
|
139 |
"return the windowLabel to use in my topView, when inspecting anObject."
|
|
140 |
|
|
141 |
^ ClassResources string:'Inspector on: %1' with:(self labelNameFor:anObject)
|
|
142 |
!
|
|
143 |
|
|
144 |
labelNameFor:anObject
|
|
145 |
"return the iconLabel to use in my topView, when inspecting anObject.
|
|
146 |
Simply returns the className or name of anObjects class"
|
|
147 |
|
105
|
148 |
|nm|
|
|
149 |
|
|
150 |
anObject isClass ifTrue:[
|
|
151 |
nm := anObject displayString
|
|
152 |
].
|
|
153 |
nm isNil ifTrue:[
|
|
154 |
nm := anObject classNameWithArticle
|
|
155 |
].
|
|
156 |
|
110
|
157 |
^ nm
|
73
|
158 |
! !
|
|
159 |
|
|
160 |
!InspectorView methodsFor:'accessing'!
|
|
161 |
|
|
162 |
inspect:anObject
|
|
163 |
"define the object to be inspected"
|
|
164 |
|
|
165 |
|aList sameObject|
|
|
166 |
|
|
167 |
sameObject := anObject == inspectedObject.
|
|
168 |
inspectedObject := anObject.
|
|
169 |
|
|
170 |
hasMore := false.
|
|
171 |
aList := self fieldList.
|
|
172 |
hasMore ifTrue:[
|
|
173 |
aList add:' ... '
|
|
174 |
].
|
|
175 |
|
|
176 |
sameObject ifTrue:[
|
|
177 |
listView setContents:aList.
|
80
|
178 |
"/ listView selection:1.
|
73
|
179 |
] ifFalse:[
|
|
180 |
listView contents:aList
|
|
181 |
].
|
|
182 |
|
|
183 |
workspace contents:nil.
|
|
184 |
self setDoItAction.
|
|
185 |
|
|
186 |
selectedLine := nil
|
29
|
187 |
!
|
|
188 |
|
73
|
189 |
listView
|
|
190 |
^ listView
|
52
|
191 |
! !
|
|
192 |
|
|
193 |
!InspectorView methodsFor:'private'!
|
0
|
194 |
|
73
|
195 |
setDoItAction
|
|
196 |
workspace doItAction:[:theCode |
|
100
|
197 |
(inspectedObject class evaluatorClass)
|
73
|
198 |
evaluate:theCode
|
|
199 |
in:nil
|
|
200 |
receiver:inspectedObject
|
|
201 |
notifying:workspace
|
|
202 |
logged:true
|
|
203 |
ifFail:nil
|
|
204 |
].
|
|
205 |
|
|
206 |
!
|
|
207 |
|
|
208 |
showMore
|
|
209 |
hasMore ifTrue:[
|
|
210 |
nShown := nShown * 2.
|
|
211 |
self inspect:inspectedObject
|
|
212 |
]
|
|
213 |
!
|
|
214 |
|
|
215 |
fieldList
|
56
|
216 |
"return a list of names to show in the selectionList.
|
|
217 |
Leave hasMore as true, if a '...' entry should be added."
|
0
|
218 |
|
79
|
219 |
|aList n cls s|
|
0
|
220 |
|
29
|
221 |
aList := OrderedCollection new.
|
0
|
222 |
aList add:'self'.
|
29
|
223 |
cls := inspectedObject class.
|
|
224 |
cls isClass ifTrue:[
|
45
|
225 |
cls allInstVarNames do:[:instVarName |
|
|
226 |
aList add:instVarName
|
|
227 |
]
|
29
|
228 |
] ifFalse:[
|
45
|
229 |
1 to:cls instSize do:[:index |
|
|
230 |
aList add:('instvar' , index printString)
|
|
231 |
]
|
0
|
232 |
].
|
29
|
233 |
cls isVariable ifTrue:[
|
45
|
234 |
n := inspectedObject basicSize.
|
|
235 |
(n > nShown) ifTrue:[
|
|
236 |
n := nShown.
|
56
|
237 |
hasMore := true.
|
45
|
238 |
].
|
79
|
239 |
(inspectedObject respondsTo:#keys) ifTrue:[
|
|
240 |
s := ReadStream on:(inspectedObject keys).
|
|
241 |
1 to:n do:[:index |
|
|
242 |
aList add:(s next printString)
|
|
243 |
]
|
|
244 |
] ifFalse:[
|
|
245 |
1 to:n do:[:index |
|
|
246 |
aList add:(index printString)
|
|
247 |
]
|
45
|
248 |
].
|
0
|
249 |
].
|
|
250 |
^ aList
|
73
|
251 |
! !
|
|
252 |
|
|
253 |
!InspectorView methodsFor:'user interaction'!
|
|
254 |
|
|
255 |
showSelection:lineNr
|
|
256 |
"user clicked on an instvar - show value in workspace"
|
|
257 |
|
107
|
258 |
|val string|
|
73
|
259 |
|
|
260 |
(hasMore and:[lineNr == listView list size]) ifTrue:[
|
|
261 |
"clicked on the '...' entry"
|
|
262 |
self showMore.
|
|
263 |
listView selection:lineNr.
|
|
264 |
].
|
|
265 |
|
|
266 |
lineNr == 1 ifTrue:[
|
|
267 |
"selecting self also does a re-set, this allows updating the list"
|
|
268 |
self inspect:inspectedObject.
|
|
269 |
].
|
|
270 |
val := self valueAtLine:lineNr.
|
|
271 |
string := val displayString.
|
|
272 |
workspace replace:string.
|
|
273 |
selectedLine := lineNr.
|
|
274 |
!
|
|
275 |
|
|
276 |
destroy
|
|
277 |
inspectedObject := nil.
|
93
|
278 |
monitorProcess notNil ifTrue:[
|
|
279 |
monitorProcess terminate
|
|
280 |
].
|
73
|
281 |
super destroy
|
0
|
282 |
!
|
|
283 |
|
73
|
284 |
valueAtLine:lineNr
|
|
285 |
"helper - return the value of the selected entry"
|
|
286 |
|
|
287 |
|index instSize|
|
|
288 |
|
|
289 |
lineNr == 1 ifTrue:[
|
|
290 |
^ inspectedObject
|
|
291 |
].
|
|
292 |
index := lineNr - 1. "/ skip self
|
|
293 |
instSize := inspectedObject class instSize.
|
|
294 |
|
|
295 |
(inspectedObject class isVariable not
|
|
296 |
or:[index <= instSize]) ifTrue:[
|
|
297 |
^ inspectedObject instVarAt:index
|
|
298 |
].
|
|
299 |
index := index - instSize.
|
|
300 |
^ inspectedObject basicAt:index
|
|
301 |
!
|
|
302 |
|
|
303 |
doInspect
|
|
304 |
"user selected inspect-menu entry"
|
|
305 |
|
|
306 |
self doInspect:false
|
|
307 |
!
|
|
308 |
|
|
309 |
doInspect:basic
|
|
310 |
"user selected inspect-menu entry"
|
|
311 |
|
|
312 |
|objectToInspect|
|
|
313 |
|
|
314 |
selectedLine notNil ifTrue:[
|
|
315 |
objectToInspect := self valueAtLine:selectedLine.
|
|
316 |
basic ifTrue:[
|
|
317 |
objectToInspect basicInspect
|
|
318 |
] ifFalse:[
|
|
319 |
objectToInspect inspect
|
|
320 |
]
|
56
|
321 |
]
|
3
|
322 |
!
|
|
323 |
|
73
|
324 |
doBasicInspect
|
|
325 |
"user selected inspect-menu entry"
|
0
|
326 |
|
73
|
327 |
self doInspect:true
|
0
|
328 |
!
|
|
329 |
|
98
|
330 |
doTrapAll
|
93
|
331 |
"place a trap on all messages sent to the inspected object"
|
|
332 |
|
|
333 |
self topView withWaitCursorDo:[MessageTracer trapAll:inspectedObject]
|
|
334 |
!
|
|
335 |
|
98
|
336 |
doTrap
|
|
337 |
"place a trap on a message sent to the inspected object"
|
|
338 |
|
|
339 |
|string selector|
|
|
340 |
|
|
341 |
string := Dialog request:'Selector to trap on:'.
|
108
|
342 |
string notEmpty ifTrue:[
|
98
|
343 |
selector := string asSymbolIfInterned.
|
|
344 |
].
|
|
345 |
selector isNil ifTrue:[
|
|
346 |
self warn:'no such selector'
|
|
347 |
] ifFalse:[
|
|
348 |
self topView withWaitCursorDo:[MessageTracer trap:inspectedObject
|
|
349 |
selector:selector]
|
|
350 |
]
|
|
351 |
!
|
|
352 |
|
93
|
353 |
doTrace
|
|
354 |
"place a trace on all messages sent to the inspected object"
|
|
355 |
|
|
356 |
self topView withWaitCursorDo:[MessageTracer traceAll:inspectedObject]
|
|
357 |
!
|
|
358 |
|
|
359 |
doUntrace
|
|
360 |
"remove traps/traces"
|
|
361 |
|
|
362 |
MessageTracer untrace:inspectedObject
|
|
363 |
!
|
|
364 |
|
|
365 |
doStartMonitor
|
|
366 |
"start a monitoring process"
|
|
367 |
|
|
368 |
monitorProcess isNil ifTrue:[
|
|
369 |
monitorProcess :=
|
|
370 |
[
|
|
371 |
|sel|
|
|
372 |
|
|
373 |
[true] whileTrue:[
|
|
374 |
(sel := listView selection) notNil ifTrue:[
|
|
375 |
self showSelection:sel
|
|
376 |
].
|
|
377 |
(Delay forSeconds:0.5) wait
|
|
378 |
]
|
|
379 |
] forkAt:Processor userBackgroundPriority
|
|
380 |
]
|
|
381 |
!
|
|
382 |
|
|
383 |
doStopMonitor
|
|
384 |
"stop the monitor"
|
|
385 |
|
|
386 |
monitorProcess terminate.
|
|
387 |
monitorProcess := nil
|
|
388 |
!
|
|
389 |
|
0
|
390 |
keyPress:aKey x:x y:y
|
|
391 |
"all my input is passed on to the workspace-field"
|
|
392 |
|
|
393 |
workspace keyPress:aKey x:0 y:0
|
|
394 |
!
|
|
395 |
|
45
|
396 |
update:something with:someArgument from:changedObject
|
0
|
397 |
"handle updates from other inspectors"
|
|
398 |
|
|
399 |
|oldSelection|
|
|
400 |
|
45
|
401 |
changedObject == inspectedObject ifTrue:[
|
|
402 |
oldSelection := listView selection.
|
|
403 |
self inspect:inspectedObject.
|
|
404 |
oldSelection notNil ifTrue:[
|
|
405 |
self showSelection:oldSelection
|
|
406 |
]
|
0
|
407 |
]
|
|
408 |
!
|
|
409 |
|
|
410 |
doAccept:theText
|
|
411 |
|value index|
|
|
412 |
|
100
|
413 |
value := inspectedObject class evaluatorClass
|
45
|
414 |
evaluate:theText
|
|
415 |
receiver:inspectedObject
|
|
416 |
notifying:workspace.
|
73
|
417 |
|
|
418 |
selectedLine notNil ifTrue:[
|
|
419 |
selectedLine == 1 ifFalse:[
|
|
420 |
index := selectedLine - 1.
|
|
421 |
(inspectedObject class isVariable) ifFalse:[
|
|
422 |
inspectedObject instVarAt:index put:value
|
|
423 |
] ifTrue:[
|
|
424 |
index <= (inspectedObject class instSize) ifTrue:[
|
45
|
425 |
inspectedObject instVarAt:index put:value
|
73
|
426 |
] ifFalse:[
|
|
427 |
index := index - inspectedObject class instSize.
|
|
428 |
inspectedObject basicAt:index put:value
|
45
|
429 |
]
|
|
430 |
]
|
|
431 |
]
|
0
|
432 |
].
|
|
433 |
inspectedObject changed
|
|
434 |
!
|
|
435 |
|
52
|
436 |
inspectOwners
|
56
|
437 |
"open an inspector on owners of the inspectedObject.
|
|
438 |
(this is a secret function)"
|
|
439 |
|
52
|
440 |
self withCursor:(Cursor questionMark) do:[
|
|
441 |
|owners dict|
|
|
442 |
|
|
443 |
owners := (ObjectMemory whoReferences:inspectedObject) asOrderedCollection.
|
|
444 |
owners size > 500 ifTrue:[
|
|
445 |
(self confirm:'there are ' , owners size printString , ' owners.\\Do you really want to see them all ?' withCRs)
|
|
446 |
ifFalse:[^ self]
|
|
447 |
].
|
|
448 |
dict := IdentityDictionary new.
|
|
449 |
owners do:[:owner |
|
|
450 |
|set names oClass|
|
|
451 |
|
|
452 |
owner ~~ self ifTrue:[
|
|
453 |
set := Set new.
|
|
454 |
names := owner class allInstVarNames.
|
|
455 |
oClass := owner class.
|
|
456 |
1 to:oClass instSize do:[:i |
|
|
457 |
(owner instVarAt:i) == inspectedObject ifTrue:[
|
|
458 |
set add:(names at:i).
|
|
459 |
].
|
|
460 |
].
|
|
461 |
oClass isVariable ifTrue:[
|
|
462 |
oClass isPointers ifTrue:[
|
|
463 |
1 to:owner basicSize do:[:i |
|
|
464 |
(owner basicAt:i) == inspectedObject ifTrue:[
|
|
465 |
set add:i
|
|
466 |
]
|
|
467 |
]
|
|
468 |
]
|
|
469 |
].
|
|
470 |
dict at:owner put:set
|
|
471 |
].
|
|
472 |
].
|
|
473 |
dict inspect
|
|
474 |
]
|
108
|
475 |
!
|
|
476 |
|
|
477 |
browseClass
|
|
478 |
|objectToBrowseClass|
|
|
479 |
|
|
480 |
selectedLine notNil ifTrue:[
|
|
481 |
objectToBrowseClass := self valueAtLine:selectedLine.
|
|
482 |
] ifFalse:[
|
|
483 |
objectToBrowseClass := inspectedObject
|
|
484 |
].
|
|
485 |
SystemBrowser browseClass:objectToBrowseClass class
|
|
486 |
!
|
|
487 |
|
|
488 |
browseClassHierarchy
|
|
489 |
|objectToBrowseClass|
|
|
490 |
|
|
491 |
selectedLine notNil ifTrue:[
|
|
492 |
objectToBrowseClass := self valueAtLine:selectedLine.
|
|
493 |
] ifFalse:[
|
|
494 |
objectToBrowseClass := inspectedObject
|
|
495 |
].
|
|
496 |
SystemBrowser browseClassHierarchy:objectToBrowseClass class
|
|
497 |
!
|
|
498 |
|
|
499 |
browseFullClassProtocol
|
|
500 |
|objectToBrowseClass|
|
|
501 |
|
|
502 |
selectedLine notNil ifTrue:[
|
|
503 |
objectToBrowseClass := self valueAtLine:selectedLine.
|
|
504 |
] ifFalse:[
|
|
505 |
objectToBrowseClass := inspectedObject
|
|
506 |
].
|
|
507 |
SystemBrowser browseFullClassProtocol:objectToBrowseClass class
|
0
|
508 |
! !
|
73
|
509 |
|
|
510 |
!InspectorView methodsFor:'initialization'!
|
|
511 |
|
|
512 |
mapped
|
|
513 |
"delayed setup of lists till map-time -
|
|
514 |
this makes startup of inspectors a bit faster"
|
|
515 |
|
|
516 |
|o|
|
|
517 |
|
|
518 |
super mapped.
|
|
519 |
"
|
|
520 |
kludge to trick inspect:, which ignores setting the
|
|
521 |
same object again ...
|
|
522 |
"
|
|
523 |
o := inspectedObject.
|
|
524 |
inspectedObject := nil.
|
|
525 |
self inspect:o
|
|
526 |
!
|
|
527 |
|
|
528 |
initialize
|
|
529 |
|v panel|
|
|
530 |
|
|
531 |
super initialize.
|
|
532 |
|
|
533 |
panel := VariableHorizontalPanel
|
|
534 |
origin:(0.0 @ 0.0)
|
|
535 |
corner:(1.0 @ 1.0)
|
|
536 |
in:self.
|
|
537 |
|
|
538 |
v := HVScrollableView
|
|
539 |
for:SelectionInListView
|
|
540 |
miniScrollerH:true
|
|
541 |
miniScrollerV:false
|
|
542 |
in:panel.
|
|
543 |
v origin:(0.0 @ 0.0) corner:(0.3 @ 1.0).
|
|
544 |
|
|
545 |
listView := v scrolledView.
|
|
546 |
listView action:[:lineNr | self showSelection:lineNr].
|
|
547 |
listView doubleClickAction:[:lineNr | self doInspect].
|
|
548 |
listView ignoreReselect:false.
|
98
|
549 |
listView menuHolder:self; menuPerformer:self; menuMessage:#fieldMenu.
|
73
|
550 |
|
|
551 |
v := HVScrollableView
|
|
552 |
for:CodeView
|
|
553 |
miniScrollerH:true
|
|
554 |
miniScrollerV:false
|
|
555 |
in:panel.
|
|
556 |
v origin:(0.3 @ 0.0) corner:(1.0 @ 1.0).
|
|
557 |
workspace := v scrolledView.
|
|
558 |
|
|
559 |
workspace acceptAction:[:theText | self doAccept:theText asString].
|
|
560 |
|
|
561 |
nShown := 100.
|
|
562 |
hasMore := false.
|
98
|
563 |
! !
|
|
564 |
|
|
565 |
!InspectorView methodsFor:'menu'!
|
73
|
566 |
|
|
567 |
fieldMenu
|
|
568 |
|labels selectors|
|
|
569 |
|
|
570 |
hasMore ifTrue:[
|
|
571 |
labels := #(
|
|
572 |
'inspect'
|
|
573 |
'basicInspect'
|
|
574 |
'-'
|
93
|
575 |
'trace messages'
|
98
|
576 |
'trap message'
|
|
577 |
'trap all messages'
|
93
|
578 |
'untrace/untrap'
|
|
579 |
'-'
|
108
|
580 |
'browse class'
|
|
581 |
'browse class hierarchy'
|
|
582 |
'browse full class protocol'
|
|
583 |
'-'
|
73
|
584 |
'show more'
|
|
585 |
).
|
|
586 |
|
|
587 |
selectors := #(
|
|
588 |
doInspect
|
|
589 |
doBasicInspect
|
93
|
590 |
nil
|
|
591 |
doTrace
|
98
|
592 |
doTrapAll
|
93
|
593 |
doTrap
|
|
594 |
doUntrace
|
73
|
595 |
nil
|
108
|
596 |
browseClass
|
|
597 |
browseClassHierarchy
|
|
598 |
browseFullClassProtocol
|
|
599 |
nil
|
73
|
600 |
showMore
|
|
601 |
).
|
|
602 |
] ifFalse:[
|
|
603 |
labels := #(
|
|
604 |
'inspect'
|
|
605 |
'basicInspect'
|
93
|
606 |
'-'
|
|
607 |
'trace messages'
|
98
|
608 |
'trap message'
|
|
609 |
'trap all messages'
|
93
|
610 |
'untrace/untrap'
|
108
|
611 |
'-'
|
|
612 |
'browse class'
|
|
613 |
'browse class hierarchy'
|
|
614 |
'browse full class protocol'
|
73
|
615 |
).
|
|
616 |
|
|
617 |
selectors := #(
|
|
618 |
doInspect
|
|
619 |
doBasicInspect
|
93
|
620 |
nil
|
|
621 |
doTrace
|
|
622 |
doTrap
|
98
|
623 |
doTrapAll
|
93
|
624 |
doUntrace
|
108
|
625 |
nil
|
|
626 |
browseClass
|
|
627 |
browseClassHierarchy
|
|
628 |
browseFullClassProtocol
|
73
|
629 |
).
|
|
630 |
].
|
|
631 |
|
93
|
632 |
monitorProcess isNil ifTrue:[
|
|
633 |
labels := labels , #('-' 'start monitor').
|
|
634 |
selectors := selectors , #(nil #doStartMonitor).
|
|
635 |
] ifFalse:[
|
|
636 |
labels := labels , #('-' 'stop monitor').
|
|
637 |
selectors := selectors , #(nil #doStopMonitor).
|
|
638 |
].
|
|
639 |
|
|
640 |
"/ labels := labels , #('-' 'owners').
|
|
641 |
"/ selectors := selectors , #(nil #inspectOwners).
|
|
642 |
|
73
|
643 |
^ PopUpMenu
|
|
644 |
labels:(resources array:labels)
|
|
645 |
selectors:selectors
|
|
646 |
! !
|
|
647 |
|
|
648 |
!InspectorView methodsFor:'release'!
|
|
649 |
|
|
650 |
release
|
|
651 |
"release inpected object. This is normally not needed,
|
|
652 |
since the garbage collector will find this memory alone.
|
|
653 |
However, if some applications keeps inspectors (for example,
|
|
654 |
the debugger does this), this would be freed very late."
|
|
655 |
|
|
656 |
"
|
|
657 |
inspectedObject notNil ifTrue:[
|
|
658 |
inspectedObject removeDependent:self
|
|
659 |
].
|
|
660 |
"
|
|
661 |
inspectedObject := nil.
|
|
662 |
workspace doItAction:nil.
|
|
663 |
workspace contents:nil.
|
|
664 |
listView contents:nil
|
|
665 |
! !
|