author | fm |
Mon, 28 Apr 2008 12:47:50 +0200 | |
changeset 8084 | 411aeb42a6c1 |
parent 8065 | 1fa2c55f1cf9 |
child 8090 | 45e0ec5d10f5 |
permissions | -rw-r--r-- |
0 | 1 |
" |
5 | 2 |
COPYRIGHT (c) 1989 by Claus Gittinger |
6851 | 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 |
" |
|
2657 | 12 |
"{ Package: 'stx:libtool' }" |
13 |
||
93 | 14 |
SimpleView subclass:#InspectorView |
6851 | 15 |
instanceVariableNames:'listView labelView workspace inspectedObject selectedLine nShown |
16 |
hasMore monitorProcess hideReceiver showHex inspectHistory |
|
17 |
allowFollow isStandaloneInspector selectionIndex object |
|
18 |
inspectedObjectHolder displayStringMessage suppressPseudoSlots |
|
19 |
dereferenceValueHolders' |
|
7867 | 20 |
classVariableNames:'DefaultIcon IdDictionary NextSequentialID LastExtent' |
6851 | 21 |
poolDictionaries:'' |
22 |
category:'Interface-Inspector' |
|
0 | 23 |
! |
24 |
||
871 | 25 |
!InspectorView class methodsFor:'documentation'! |
29 | 26 |
|
27 |
copyright |
|
28 |
" |
|
29 |
COPYRIGHT (c) 1989 by Claus Gittinger |
|
6851 | 30 |
All Rights Reserved |
29 | 31 |
|
32 |
This software is furnished under a license and may be used |
|
33 |
only in accordance with the terms of that license and with the |
|
34 |
inclusion of the above copyright notice. This software may not |
|
35 |
be provided or otherwise made available to, or used by, any |
|
36 |
other person. No title to or ownership of the software is |
|
37 |
hereby transferred. |
|
38 |
" |
|
39 |
! |
|
40 |
||
41 |
documentation |
|
42 |
" |
|
1570 | 43 |
This class implements a graphical inspector. |
29 | 44 |
Inspecting can be done on an object - |
45 |
(where its instvarnames/values are inspected) |
|
1570 | 46 |
or a list of objects (where a nameArray/valuesArray is inspected). |
29 | 47 |
The later is used by the debugger to inspect method variables/args. |
48 |
||
49 |
The system calls the inspector through the global variable 'Inspector' |
|
50 |
which is bound to this class (but could be redefined - it actually is |
|
1570 | 51 |
set to MiniInspector in a smalltalk without graphical user interface, |
52 |
or to NewInspector if that is wanted). |
|
0 | 53 |
|
29 | 54 |
Also notice, that there are two methods to inspect an object: |
55 |
sending #basicInspect to any object, will open this kind of inspector on |
|
56 |
it (showing instance variables which are physically present). |
|
57 |
||
58 |
Sending it #inspect, will - depending on the object - sometimes invoke a |
|
59 |
specialized inspector. |
|
1570 | 60 |
(see OrderedCollectionInspectorView, ImageInspectorView, |
61 |
ColorInspectorView etc. as examples). |
|
29 | 62 |
|
446 | 63 |
You can also open a monitoring inspector, which displays some instance |
64 |
variable in regular intervals. See #openOn:monitor:. |
|
65 |
||
29 | 66 |
examples: |
2008
52bf8b8afd3b
separated allowFollow from isStandAlone flag
Claus Gittinger <cg@exept.de>
parents:
2007
diff
changeset
|
67 |
#(1 2 3 4) asOrderedCollection inspect |
52bf8b8afd3b
separated allowFollow from isStandAlone flag
Claus Gittinger <cg@exept.de>
parents:
2007
diff
changeset
|
68 |
#(1 2 3 4) asOrderedCollection basicInspect |
52bf8b8afd3b
separated allowFollow from isStandAlone flag
Claus Gittinger <cg@exept.de>
parents:
2007
diff
changeset
|
69 |
(Array new:10000) inspect |
52bf8b8afd3b
separated allowFollow from isStandAlone flag
Claus Gittinger <cg@exept.de>
parents:
2007
diff
changeset
|
70 |
(Image fromFile:'bitmaps/claus.gif') inspect |
52bf8b8afd3b
separated allowFollow from isStandAlone flag
Claus Gittinger <cg@exept.de>
parents:
2007
diff
changeset
|
71 |
(Image fromFile:'bitmaps/claus.gif') basicInspect |
52bf8b8afd3b
separated allowFollow from isStandAlone flag
Claus Gittinger <cg@exept.de>
parents:
2007
diff
changeset
|
72 |
(Image fromFile:'bitmaps/SBrowser.xbm') inspect |
52bf8b8afd3b
separated allowFollow from isStandAlone flag
Claus Gittinger <cg@exept.de>
parents:
2007
diff
changeset
|
73 |
(Image fromFile:'bitmaps/SBrowser.xbm') basicInspect |
446 | 74 |
|
2008
52bf8b8afd3b
separated allowFollow from isStandAlone flag
Claus Gittinger <cg@exept.de>
parents:
2007
diff
changeset
|
75 |
InspectorView openOn:Display |
52bf8b8afd3b
separated allowFollow from isStandAlone flag
Claus Gittinger <cg@exept.de>
parents:
2007
diff
changeset
|
76 |
InspectorView openOn:Display monitor:'shiftDown' |
52bf8b8afd3b
separated allowFollow from isStandAlone flag
Claus Gittinger <cg@exept.de>
parents:
2007
diff
changeset
|
77 |
|
52bf8b8afd3b
separated allowFollow from isStandAlone flag
Claus Gittinger <cg@exept.de>
parents:
2007
diff
changeset
|
78 |
The InspectorView can also be used as a subComponent within another view. |
52bf8b8afd3b
separated allowFollow from isStandAlone flag
Claus Gittinger <cg@exept.de>
parents:
2007
diff
changeset
|
79 |
In this case, the isStandAlone flag should be cleared, to prevent the |
52bf8b8afd3b
separated allowFollow from isStandAlone flag
Claus Gittinger <cg@exept.de>
parents:
2007
diff
changeset
|
80 |
inspector from changing the topViews window label. |
510 | 81 |
|
2235
ce49947e61f7
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
2193
diff
changeset
|
82 |
Notice: |
ce49947e61f7
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
2193
diff
changeset
|
83 |
the instvars 'inspectedObject' and 'selectedLine' have been |
ce49947e61f7
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
2193
diff
changeset
|
84 |
renamed to 'object' and 'selectionIndex' for squeak compatibility; |
ce49947e61f7
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
2193
diff
changeset
|
85 |
however, the old vars are kept (in sync) for a while, to allow for |
ce49947e61f7
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
2193
diff
changeset
|
86 |
smooth migration. |
ce49947e61f7
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
2193
diff
changeset
|
87 |
|
6940 | 88 |
Controlling the contents from the inspected object. |
89 |
||
90 |
By redefining inspectorExtraAttributes or inspectorExtraNamedFields, the inspected |
|
91 |
object can add items to the list of fields as ashown in the left list-view of the inspector. |
|
92 |
These methods are meant to return a sequencable Collection of Associations, which represent |
|
93 |
of pseudo slot-name, slot-value pairs. |
|
94 |
In the list, extra attributes are shown with a dash (-), extra named fields are marked with a tick (`). |
|
95 |
These are added (read only) to the list. |
|
96 |
||
510 | 97 |
[author:] |
2008
52bf8b8afd3b
separated allowFollow from isStandAlone flag
Claus Gittinger <cg@exept.de>
parents:
2007
diff
changeset
|
98 |
Claus Gittinger |
29 | 99 |
" |
100 |
! ! |
|
0 | 101 |
|
871 | 102 |
!InspectorView class methodsFor:'instance creation'! |
0 | 103 |
|
200 | 104 |
for:anObject |
105 |
"create and launch a new inspector for anObject. |
|
106 |
This protocol is a historic leftover - this method will vanish." |
|
107 |
||
108 |
^ self openOn:anObject |
|
109 |
! |
|
110 |
||
111 |
inspect:anObject |
|
112 |
"create and launch a new inspector for anObject. |
|
113 |
This protocol is a historic leftover - this method will vanish." |
|
114 |
||
115 |
^ self openOn:anObject |
|
116 |
! |
|
117 |
||
0 | 118 |
openOn:anObject |
119 |
"create and launch a new inspector for anObject" |
|
120 |
||
416
fd30ab6185c7
added startup-with-monitor method
Claus Gittinger <cg@exept.de>
parents:
383
diff
changeset
|
121 |
^ self openOn:anObject monitor:nil |
fd30ab6185c7
added startup-with-monitor method
Claus Gittinger <cg@exept.de>
parents:
383
diff
changeset
|
122 |
|
fd30ab6185c7
added startup-with-monitor method
Claus Gittinger <cg@exept.de>
parents:
383
diff
changeset
|
123 |
" |
fd30ab6185c7
added startup-with-monitor method
Claus Gittinger <cg@exept.de>
parents:
383
diff
changeset
|
124 |
InspectorView openOn:(5 @ 7) |
fd30ab6185c7
added startup-with-monitor method
Claus Gittinger <cg@exept.de>
parents:
383
diff
changeset
|
125 |
InspectorView openOn:(Array new:400) |
fd30ab6185c7
added startup-with-monitor method
Claus Gittinger <cg@exept.de>
parents:
383
diff
changeset
|
126 |
DictionaryInspectorView openOn:(IdentityDictionary new) |
fd30ab6185c7
added startup-with-monitor method
Claus Gittinger <cg@exept.de>
parents:
383
diff
changeset
|
127 |
" |
fd30ab6185c7
added startup-with-monitor method
Claus Gittinger <cg@exept.de>
parents:
383
diff
changeset
|
128 |
|
fd30ab6185c7
added startup-with-monitor method
Claus Gittinger <cg@exept.de>
parents:
383
diff
changeset
|
129 |
"Modified: 1.3.1996 / 19:31:03 / cg" |
fd30ab6185c7
added startup-with-monitor method
Claus Gittinger <cg@exept.de>
parents:
383
diff
changeset
|
130 |
! |
fd30ab6185c7
added startup-with-monitor method
Claus Gittinger <cg@exept.de>
parents:
383
diff
changeset
|
131 |
|
fd30ab6185c7
added startup-with-monitor method
Claus Gittinger <cg@exept.de>
parents:
383
diff
changeset
|
132 |
openOn:anObject monitor:anInstVarName |
fd30ab6185c7
added startup-with-monitor method
Claus Gittinger <cg@exept.de>
parents:
383
diff
changeset
|
133 |
"create and launch a new inspector for anObject. |
2008
52bf8b8afd3b
separated allowFollow from isStandAlone flag
Claus Gittinger <cg@exept.de>
parents:
2007
diff
changeset
|
134 |
If anInstVarName is nonNil, let the inspector monitor it |
52bf8b8afd3b
separated allowFollow from isStandAlone flag
Claus Gittinger <cg@exept.de>
parents:
2007
diff
changeset
|
135 |
(use an integer-printString as name, for indexed instVars)." |
416
fd30ab6185c7
added startup-with-monitor method
Claus Gittinger <cg@exept.de>
parents:
383
diff
changeset
|
136 |
|
105 | 137 |
|topView inspectorView| |
0 | 138 |
|
1895
8b51d61d9c0a
added follow & back menu items.
Claus Gittinger <cg@exept.de>
parents:
1873
diff
changeset
|
139 |
topView := StandardSystemView new. |
8b51d61d9c0a
added follow & back menu items.
Claus Gittinger <cg@exept.de>
parents:
1873
diff
changeset
|
140 |
topView icon:self defaultIcon. |
2147
afc85f49fc18
removed minExtent - let topView decide.
Claus Gittinger <cg@exept.de>
parents:
2117
diff
changeset
|
141 |
"/ topView minExtent:(100 @ 100). |
2271
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
142 |
topView label:'Inspector'. |
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
143 |
topView iconLabel:'Inspector'. |
0 | 144 |
|
7867 | 145 |
topView extent:(self defaultTopViewExtent). |
146 |
topView objectAttributeAt:#rememberExtent put:true. |
|
0 | 147 |
|
148 |
inspectorView := self origin:(0.0 @ 0.0) |
|
2007 | 149 |
corner:(1.0 @ 1.0) |
150 |
in:topView. |
|
0 | 151 |
|
3 | 152 |
"kludge: must realize first, to be able to set menu again" |
352 | 153 |
topView openAndWait. |
871 | 154 |
topView windowGroup |
2007 | 155 |
focusSequence:(Array |
156 |
with:inspectorView listView |
|
157 |
with:inspectorView workspace). |
|
158 |
inspectorView allowFollow:true. |
|
2008
52bf8b8afd3b
separated allowFollow from isStandAlone flag
Claus Gittinger <cg@exept.de>
parents:
2007
diff
changeset
|
159 |
inspectorView isStandaloneInspector:true. |
0 | 160 |
inspectorView inspect:anObject. |
416
fd30ab6185c7
added startup-with-monitor method
Claus Gittinger <cg@exept.de>
parents:
383
diff
changeset
|
161 |
|
fd30ab6185c7
added startup-with-monitor method
Claus Gittinger <cg@exept.de>
parents:
383
diff
changeset
|
162 |
anInstVarName notNil ifTrue:[ |
2007 | 163 |
inspectorView monitor:anInstVarName |
416
fd30ab6185c7
added startup-with-monitor method
Claus Gittinger <cg@exept.de>
parents:
383
diff
changeset
|
164 |
]. |
fd30ab6185c7
added startup-with-monitor method
Claus Gittinger <cg@exept.de>
parents:
383
diff
changeset
|
165 |
|
69 | 166 |
^ inspectorView |
0 | 167 |
|
29 | 168 |
" |
416
fd30ab6185c7
added startup-with-monitor method
Claus Gittinger <cg@exept.de>
parents:
383
diff
changeset
|
169 |
|m| |
fd30ab6185c7
added startup-with-monitor method
Claus Gittinger <cg@exept.de>
parents:
383
diff
changeset
|
170 |
|
fd30ab6185c7
added startup-with-monitor method
Claus Gittinger <cg@exept.de>
parents:
383
diff
changeset
|
171 |
m := 1 asValue. |
fd30ab6185c7
added startup-with-monitor method
Claus Gittinger <cg@exept.de>
parents:
383
diff
changeset
|
172 |
InspectorView openOn:m monitor:'value'. |
871 | 173 |
|
174 |
2 to:10 do:[:i | |
|
2007 | 175 |
Delay waitForSeconds:1. |
176 |
m value:i |
|
871 | 177 |
] |
416
fd30ab6185c7
added startup-with-monitor method
Claus Gittinger <cg@exept.de>
parents:
383
diff
changeset
|
178 |
" |
fd30ab6185c7
added startup-with-monitor method
Claus Gittinger <cg@exept.de>
parents:
383
diff
changeset
|
179 |
|
29 | 180 |
" |
416
fd30ab6185c7
added startup-with-monitor method
Claus Gittinger <cg@exept.de>
parents:
383
diff
changeset
|
181 |
|o| |
fd30ab6185c7
added startup-with-monitor method
Claus Gittinger <cg@exept.de>
parents:
383
diff
changeset
|
182 |
|
fd30ab6185c7
added startup-with-monitor method
Claus Gittinger <cg@exept.de>
parents:
383
diff
changeset
|
183 |
o := Array with:1 with:2 with:3. |
fd30ab6185c7
added startup-with-monitor method
Claus Gittinger <cg@exept.de>
parents:
383
diff
changeset
|
184 |
InspectorView openOn:o monitor:'2'. |
fd30ab6185c7
added startup-with-monitor method
Claus Gittinger <cg@exept.de>
parents:
383
diff
changeset
|
185 |
Delay waitForSeconds:1. |
fd30ab6185c7
added startup-with-monitor method
Claus Gittinger <cg@exept.de>
parents:
383
diff
changeset
|
186 |
o at:2 put:20 |
fd30ab6185c7
added startup-with-monitor method
Claus Gittinger <cg@exept.de>
parents:
383
diff
changeset
|
187 |
" |
fd30ab6185c7
added startup-with-monitor method
Claus Gittinger <cg@exept.de>
parents:
383
diff
changeset
|
188 |
|
7867 | 189 |
"Created: / 01-03-1996 / 19:30:50 / cg" |
190 |
"Modified: / 23-10-2007 / 19:08:21 / cg" |
|
2235
ce49947e61f7
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
2193
diff
changeset
|
191 |
! |
ce49947e61f7
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
2193
diff
changeset
|
192 |
|
ce49947e61f7
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
2193
diff
changeset
|
193 |
openOn:anObject withEvalPane:withEvalPane |
ce49947e61f7
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
2193
diff
changeset
|
194 |
^ self openOn:anObject |
ce49947e61f7
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
2193
diff
changeset
|
195 |
! |
ce49947e61f7
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
2193
diff
changeset
|
196 |
|
ce49947e61f7
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
2193
diff
changeset
|
197 |
openOn:anObject withEvalPane:withEvalPane withLabel:aLabel |
ce49947e61f7
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
2193
diff
changeset
|
198 |
^ self openOn:anObject |
73 | 199 |
! ! |
200 |
||
871 | 201 |
!InspectorView class methodsFor:'defaults'! |
73 | 202 |
|
1873
5fd55aa184d4
added redefinable #defaultExtent method.
Claus Gittinger <cg@exept.de>
parents:
1855
diff
changeset
|
203 |
defaultExtent |
5fd55aa184d4
added redefinable #defaultExtent method.
Claus Gittinger <cg@exept.de>
parents:
1855
diff
changeset
|
204 |
^ (Screen current extent // 3) |
5fd55aa184d4
added redefinable #defaultExtent method.
Claus Gittinger <cg@exept.de>
parents:
1855
diff
changeset
|
205 |
|
5fd55aa184d4
added redefinable #defaultExtent method.
Claus Gittinger <cg@exept.de>
parents:
1855
diff
changeset
|
206 |
"Created: / 7.9.1998 / 13:47:45 / cg" |
5fd55aa184d4
added redefinable #defaultExtent method.
Claus Gittinger <cg@exept.de>
parents:
1855
diff
changeset
|
207 |
"Modified: / 7.9.1998 / 14:15:38 / cg" |
5fd55aa184d4
added redefinable #defaultExtent method.
Claus Gittinger <cg@exept.de>
parents:
1855
diff
changeset
|
208 |
! |
5fd55aa184d4
added redefinable #defaultExtent method.
Claus Gittinger <cg@exept.de>
parents:
1855
diff
changeset
|
209 |
|
73 | 210 |
defaultIcon |
1146 | 211 |
"return the browsers default window icon" |
212 |
||
7835 | 213 |
<resource: #programImage> |
7629 | 214 |
<resource: #style (#INSPECTOR_ICON #INSPECTOR_ICON_FILE)> |
1146 | 215 |
|
7629 | 216 |
|nm i resources| |
1146 | 217 |
|
218 |
(i := DefaultIcon) isNil ifTrue:[ |
|
7629 | 219 |
resources := self classResources. |
220 |
i := resources at:#INSPECTOR_ICON default:nil. |
|
2338 | 221 |
i isNil ifTrue:[ |
7629 | 222 |
nm := resources at:#INSPECTOR_ICON_FILE default:'Inspector.xbm'. |
2475 | 223 |
i := Smalltalk imageFromFileNamed:nm forClass:self. |
2338 | 224 |
i isNil ifTrue:[ |
2454
114111038a2b
try my bitmaps in package directory
Claus Gittinger <cg@exept.de>
parents:
2447
diff
changeset
|
225 |
i := StandardSystemView defaultIcon |
2338 | 226 |
] |
227 |
]. |
|
228 |
i notNil ifTrue:[ |
|
229 |
DefaultIcon := i := i onDevice:Display |
|
230 |
] |
|
73 | 231 |
]. |
1146 | 232 |
^ i |
874 | 233 |
|
7629 | 234 |
" |
235 |
DefaultIcon := nil |
|
236 |
" |
|
7835 | 237 |
|
238 |
"Modified: / 17-09-2007 / 11:36:17 / cg" |
|
7867 | 239 |
! |
240 |
||
241 |
defaultTopViewExtent |
|
242 |
^ LastExtent ? self defaultExtent |
|
243 |
||
244 |
"Created: / 23-10-2007 / 19:04:13 / cg" |
|
245 |
! |
|
246 |
||
247 |
rememberLastExtent:anExtent |
|
248 |
LastExtent := anExtent |
|
249 |
||
250 |
"Created: / 23-10-2007 / 19:10:02 / cg" |
|
73 | 251 |
! ! |
252 |
||
2598 | 253 |
!InspectorView class methodsFor:'queries-plugin'! |
254 |
||
255 |
aspectSelectors |
|
256 |
^ #( inspectedObjectHolder ) |
|
257 |
||
258 |
"Modified: / 10.2.2000 / 12:25:28 / cg" |
|
259 |
! ! |
|
260 |
||
73 | 261 |
!InspectorView methodsFor:'accessing'! |
262 |
||
2007 | 263 |
allowFollow:aBoolean |
2271
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
264 |
"enable/disable the follow menu item; |
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
265 |
This is disabled for inspectors which are embedded in the debugger" |
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
266 |
|
2007 | 267 |
allowFollow := aBoolean |
268 |
! |
|
269 |
||
4095
5bd36b14723d
labels; added suppressPseudoVars & dereferenceValueHolders
Claus Gittinger <cg@exept.de>
parents:
3884
diff
changeset
|
270 |
dereferenceValueHolders:aBoolean |
5bd36b14723d
labels; added suppressPseudoVars & dereferenceValueHolders
Claus Gittinger <cg@exept.de>
parents:
3884
diff
changeset
|
271 |
dereferenceValueHolders := aBoolean |
5bd36b14723d
labels; added suppressPseudoVars & dereferenceValueHolders
Claus Gittinger <cg@exept.de>
parents:
3884
diff
changeset
|
272 |
! |
5bd36b14723d
labels; added suppressPseudoVars & dereferenceValueHolders
Claus Gittinger <cg@exept.de>
parents:
3884
diff
changeset
|
273 |
|
5bd36b14723d
labels; added suppressPseudoVars & dereferenceValueHolders
Claus Gittinger <cg@exept.de>
parents:
3884
diff
changeset
|
274 |
fieldListLabel:aString |
5bd36b14723d
labels; added suppressPseudoVars & dereferenceValueHolders
Claus Gittinger <cg@exept.de>
parents:
3884
diff
changeset
|
275 |
labelView label:aString |
5bd36b14723d
labels; added suppressPseudoVars & dereferenceValueHolders
Claus Gittinger <cg@exept.de>
parents:
3884
diff
changeset
|
276 |
|
5bd36b14723d
labels; added suppressPseudoVars & dereferenceValueHolders
Claus Gittinger <cg@exept.de>
parents:
3884
diff
changeset
|
277 |
"Created: 28.6.1996 / 15:30:26 / cg" |
5bd36b14723d
labels; added suppressPseudoVars & dereferenceValueHolders
Claus Gittinger <cg@exept.de>
parents:
3884
diff
changeset
|
278 |
! |
5bd36b14723d
labels; added suppressPseudoVars & dereferenceValueHolders
Claus Gittinger <cg@exept.de>
parents:
3884
diff
changeset
|
279 |
|
644
aab7d4f7c8c3
allow hiding self; added a label
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
280 |
hideReceiver:aBoolean |
2271
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
281 |
"hide/show the self-entry for the inspected object; |
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
282 |
This is hidden for context inspectors in the debugger" |
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
283 |
|
644
aab7d4f7c8c3
allow hiding self; added a label
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
284 |
hideReceiver := aBoolean |
aab7d4f7c8c3
allow hiding self; added a label
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
285 |
|
aab7d4f7c8c3
allow hiding self; added a label
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
286 |
"Created: 28.6.1996 / 15:08:32 / cg" |
aab7d4f7c8c3
allow hiding self; added a label
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
287 |
! |
aab7d4f7c8c3
allow hiding self; added a label
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
288 |
|
73 | 289 |
inspect:anObject |
290 |
"define the object to be inspected" |
|
291 |
||
292 |
|aList sameObject| |
|
293 |
||
2996
2230855f6283
Show 'self for an UndefinedObject
Stefan Vogel <sv@exept.de>
parents:
2850
diff
changeset
|
294 |
sameObject := anObject == inspectedObject and:[inspectedObject notNil]. |
2235
ce49947e61f7
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
2193
diff
changeset
|
295 |
inspectedObject := object := anObject. |
73 | 296 |
|
1770
5cb6d7232aaa
re-inspecting the same object suppresses list update;
Claus Gittinger <cg@exept.de>
parents:
1743
diff
changeset
|
297 |
sameObject ifFalse:[ |
2007 | 298 |
hasMore := false. |
2996
2230855f6283
Show 'self for an UndefinedObject
Stefan Vogel <sv@exept.de>
parents:
2850
diff
changeset
|
299 |
aList := self fieldList. |
2007 | 300 |
hasMore ifTrue:[ |
301 |
aList add:' ... ' |
|
302 |
]. |
|
73 | 303 |
]. |
304 |
||
305 |
sameObject ifTrue:[ |
|
1770
5cb6d7232aaa
re-inspecting the same object suppresses list update;
Claus Gittinger <cg@exept.de>
parents:
1743
diff
changeset
|
306 |
"/ listView setContents:aList. |
73 | 307 |
] ifFalse:[ |
2007 | 308 |
listView contents:aList. |
1895
8b51d61d9c0a
added follow & back menu items.
Claus Gittinger <cg@exept.de>
parents:
1873
diff
changeset
|
309 |
|
2007 | 310 |
workspace contents:nil. |
311 |
self setDoItAction. |
|
1770
5cb6d7232aaa
re-inspecting the same object suppresses list update;
Claus Gittinger <cg@exept.de>
parents:
1743
diff
changeset
|
312 |
|
73 | 313 |
]. |
2284 | 314 |
selectionIndex := selectedLine := nil. |
315 |
||
316 |
isStandaloneInspector == true ifTrue:[ |
|
317 |
self topView |
|
318 |
label:(self labelFor:anObject); |
|
319 |
iconLabel:(self labelNameFor:anObject). |
|
320 |
] |
|
73 | 321 |
|
7887
be186ae12782
dont clobber the current selection on realize
Claus Gittinger <cg@exept.de>
parents:
7867
diff
changeset
|
322 |
"Modified: / 05-11-2007 / 20:09:14 / cg" |
1895
8b51d61d9c0a
added follow & back menu items.
Claus Gittinger <cg@exept.de>
parents:
1873
diff
changeset
|
323 |
! |
8b51d61d9c0a
added follow & back menu items.
Claus Gittinger <cg@exept.de>
parents:
1873
diff
changeset
|
324 |
|
8b51d61d9c0a
added follow & back menu items.
Claus Gittinger <cg@exept.de>
parents:
1873
diff
changeset
|
325 |
isStandaloneInspector:aBoolean |
2007 | 326 |
"obsolete now" |
327 |
||
2008
52bf8b8afd3b
separated allowFollow from isStandAlone flag
Claus Gittinger <cg@exept.de>
parents:
2007
diff
changeset
|
328 |
isStandaloneInspector := aBoolean |
52bf8b8afd3b
separated allowFollow from isStandAlone flag
Claus Gittinger <cg@exept.de>
parents:
2007
diff
changeset
|
329 |
|
52bf8b8afd3b
separated allowFollow from isStandAlone flag
Claus Gittinger <cg@exept.de>
parents:
2007
diff
changeset
|
330 |
"Modified: / 12.2.1999 / 16:01:44 / cg" |
29 | 331 |
! |
332 |
||
644
aab7d4f7c8c3
allow hiding self; added a label
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
333 |
label:aString |
4106 | 334 |
"set the fieldListLabel - obsolete; collides with inherited label-functionality" |
335 |
||
5845 | 336 |
<resource:#obsolete> |
4106 | 337 |
self obsoleteMethodWarning:'use fieldListLabel:'. |
338 |
self fieldListLabel:aString. |
|
339 |
super label:aString. |
|
644
aab7d4f7c8c3
allow hiding self; added a label
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
340 |
|
aab7d4f7c8c3
allow hiding self; added a label
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
341 |
"Created: 28.6.1996 / 15:30:26 / cg" |
aab7d4f7c8c3
allow hiding self; added a label
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
342 |
! |
aab7d4f7c8c3
allow hiding self; added a label
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
343 |
|
73 | 344 |
listView |
345 |
^ listView |
|
352 | 346 |
! |
347 |
||
2193
3d7b1044e8c8
fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents:
2188
diff
changeset
|
348 |
reinspect |
3d7b1044e8c8
fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents:
2188
diff
changeset
|
349 |
"update display for a changed inspectedObject" |
3d7b1044e8c8
fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents:
2188
diff
changeset
|
350 |
|
3d7b1044e8c8
fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents:
2188
diff
changeset
|
351 |
|aList| |
3d7b1044e8c8
fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents:
2188
diff
changeset
|
352 |
|
3d7b1044e8c8
fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents:
2188
diff
changeset
|
353 |
hasMore := false. |
3d7b1044e8c8
fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents:
2188
diff
changeset
|
354 |
aList := self fieldList. |
3d7b1044e8c8
fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents:
2188
diff
changeset
|
355 |
hasMore ifTrue:[ |
3d7b1044e8c8
fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents:
2188
diff
changeset
|
356 |
aList add:' ... ' |
3d7b1044e8c8
fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents:
2188
diff
changeset
|
357 |
]. |
3d7b1044e8c8
fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents:
2188
diff
changeset
|
358 |
|
3d7b1044e8c8
fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents:
2188
diff
changeset
|
359 |
listView contents:aList. |
3d7b1044e8c8
fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents:
2188
diff
changeset
|
360 |
|
2271
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
361 |
"/ workspace contents:nil. |
2193
3d7b1044e8c8
fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents:
2188
diff
changeset
|
362 |
self setDoItAction. |
3d7b1044e8c8
fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents:
2188
diff
changeset
|
363 |
|
2235
ce49947e61f7
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
2193
diff
changeset
|
364 |
selectionIndex := selectedLine := nil |
2193
3d7b1044e8c8
fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents:
2188
diff
changeset
|
365 |
! |
3d7b1044e8c8
fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents:
2188
diff
changeset
|
366 |
|
4095
5bd36b14723d
labels; added suppressPseudoVars & dereferenceValueHolders
Claus Gittinger <cg@exept.de>
parents:
3884
diff
changeset
|
367 |
suppressPseudoSlots:aBoolean |
5bd36b14723d
labels; added suppressPseudoVars & dereferenceValueHolders
Claus Gittinger <cg@exept.de>
parents:
3884
diff
changeset
|
368 |
suppressPseudoSlots := aBoolean |
5bd36b14723d
labels; added suppressPseudoVars & dereferenceValueHolders
Claus Gittinger <cg@exept.de>
parents:
3884
diff
changeset
|
369 |
! |
5bd36b14723d
labels; added suppressPseudoVars & dereferenceValueHolders
Claus Gittinger <cg@exept.de>
parents:
3884
diff
changeset
|
370 |
|
352 | 371 |
workspace |
372 |
^ workspace |
|
52 | 373 |
! ! |
374 |
||
2724 | 375 |
!InspectorView methodsFor:'accessing-channels'! |
2598 | 376 |
|
377 |
inspectedObjectHolder |
|
378 |
inspectedObjectHolder isNil ifTrue:[ |
|
379 |
inspectedObjectHolder := ValueHolder new. |
|
380 |
inspectedObjectHolder addDependent:self. |
|
381 |
]. |
|
382 |
^ inspectedObjectHolder |
|
383 |
||
384 |
"Created: / 10.2.2000 / 13:33:16 / cg" |
|
385 |
"Modified: / 10.2.2000 / 13:34:23 / cg" |
|
386 |
! |
|
387 |
||
388 |
inspectedObjectHolder:aValueHolder |
|
389 |
inspectedObjectHolder notNil ifTrue:[ |
|
390 |
inspectedObjectHolder removeDependent:self. |
|
391 |
]. |
|
392 |
inspectedObjectHolder := aValueHolder. |
|
393 |
inspectedObjectHolder notNil ifTrue:[ |
|
394 |
inspectedObjectHolder addDependent:self. |
|
395 |
]. |
|
396 |
||
397 |
"Created: / 10.2.2000 / 13:34:53 / cg" |
|
398 |
! ! |
|
399 |
||
400 |
!InspectorView methodsFor:'change & update'! |
|
401 |
||
402 |
update:something with:aParameter from:changedObject |
|
403 |
"Invoked when one of my dependees sends a change notification." |
|
404 |
||
405 |
|oldSelection| |
|
406 |
||
407 |
changedObject == inspectedObject ifTrue:[ |
|
408 |
oldSelection := listView selection. |
|
409 |
self inspect:inspectedObject. |
|
410 |
oldSelection notNil ifTrue:[ |
|
411 |
self showSelection:oldSelection |
|
412 |
] |
|
413 |
]. |
|
414 |
||
415 |
changedObject == inspectedObjectHolder ifTrue:[ |
|
416 |
self inspect:(inspectedObjectHolder value) |
|
417 |
]. |
|
418 |
||
419 |
super update:something with:aParameter from:changedObject |
|
420 |
||
421 |
"Created: / 10.2.2000 / 13:46:38 / cg" |
|
422 |
"Modified: / 10.2.2000 / 13:48:18 / cg" |
|
423 |
! ! |
|
424 |
||
7297 | 425 |
!InspectorView methodsFor:'drag & drop'! |
426 |
||
427 |
getDisplayObjects |
|
428 |
||
429 |
^List with:self selection printString |
|
430 |
||
431 |
"Created: / 16-08-2005 / 21:54:52 / janfrog" |
|
432 |
"Modified: / 18-09-2006 / 21:11:16 / cg" |
|
433 |
! |
|
434 |
||
435 |
getDropObjects |
|
436 |
||
437 |
^List with:(DropObject new:self selection). |
|
438 |
||
439 |
"Created: / 16-08-2005 / 21:49:23 / janfrog" |
|
440 |
"Modified: / 18-09-2006 / 21:11:31 / cg" |
|
441 |
! ! |
|
442 |
||
8025 | 443 |
!InspectorView methodsFor:'event handling'! |
444 |
||
445 |
keyPress:key x:x y:y |
|
446 |
"handle special keys" |
|
447 |
||
448 |
<resource: #keyboard (#BrowseIt #InspectIt)> |
|
449 |
||
450 |
self selection notNil ifTrue:[ |
|
451 |
(key == #BrowseIt) ifTrue:[ |
|
452 |
self browse. |
|
453 |
^ self. |
|
454 |
]. |
|
455 |
(key == #InspectIt) ifTrue:[ |
|
456 |
self doInspect. |
|
457 |
^ self. |
|
458 |
]. |
|
459 |
]. |
|
460 |
||
461 |
"all my other input is passed on to the workspace-field" |
|
462 |
x notNil ifTrue:[ |
|
463 |
"/ not already delegated |
|
464 |
workspace keyPress:key x:-1 y:-1 |
|
465 |
]. |
|
466 |
! ! |
|
467 |
||
2587
b6838cdb1f14
added show-stream-contents menu item
Claus Gittinger <cg@exept.de>
parents:
2580
diff
changeset
|
468 |
!InspectorView methodsFor:'initialization & release'! |
2117 | 469 |
|
470 |
destroy |
|
7867 | 471 |
(self topView objectAttributeAt:#rememberExtent) == true ifTrue:[ |
472 |
self class rememberLastExtent:(self topView extent). |
|
473 |
]. |
|
474 |
||
2235
ce49947e61f7
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
2193
diff
changeset
|
475 |
inspectedObject := object := nil. |
2117 | 476 |
monitorProcess notNil ifTrue:[ |
2235
ce49947e61f7
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
2193
diff
changeset
|
477 |
monitorProcess terminate |
2117 | 478 |
]. |
479 |
super destroy |
|
7867 | 480 |
|
481 |
"Modified: / 23-10-2007 / 19:11:04 / cg" |
|
2117 | 482 |
! |
73 | 483 |
|
484 |
initialize |
|
644
aab7d4f7c8c3
allow hiding self; added a label
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
485 |
|v panel helpView labelView2| |
73 | 486 |
|
487 |
super initialize. |
|
488 |
||
3318
46c3347385f4
preps to allow for displayString message to be configured
Claus Gittinger <cg@exept.de>
parents:
3199
diff
changeset
|
489 |
displayStringMessage := #displayString. |
644
aab7d4f7c8c3
allow hiding self; added a label
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
490 |
hideReceiver := false. |
1634
216a4254e634
added 'hex integers' toggle to menu.
Claus Gittinger <cg@exept.de>
parents:
1597
diff
changeset
|
491 |
showHex := false. |
2007 | 492 |
allowFollow := false. |
2008
52bf8b8afd3b
separated allowFollow from isStandAlone flag
Claus Gittinger <cg@exept.de>
parents:
2007
diff
changeset
|
493 |
isStandaloneInspector := false. |
644
aab7d4f7c8c3
allow hiding self; added a label
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
494 |
|
73 | 495 |
panel := VariableHorizontalPanel |
1991
dfbb30988edd
no miniScrollers; no autoHide
Claus Gittinger <cg@exept.de>
parents:
1930
diff
changeset
|
496 |
origin:(0.0 @ 0.0) |
dfbb30988edd
no miniScrollers; no autoHide
Claus Gittinger <cg@exept.de>
parents:
1930
diff
changeset
|
497 |
corner:(1.0 @ 1.0) |
dfbb30988edd
no miniScrollers; no autoHide
Claus Gittinger <cg@exept.de>
parents:
1930
diff
changeset
|
498 |
in:self. |
644
aab7d4f7c8c3
allow hiding self; added a label
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
499 |
|
aab7d4f7c8c3
allow hiding self; added a label
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
500 |
helpView := View origin:(0.0 @ 0.0) corner:(0.3 @ 1.0) in:panel. |
aab7d4f7c8c3
allow hiding self; added a label
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
501 |
helpView level:0; borderWidth:0. |
aab7d4f7c8c3
allow hiding self; added a label
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
502 |
|
aab7d4f7c8c3
allow hiding self; added a label
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
503 |
labelView := Label origin:0.0@0.0 corner:1.0@0.0 in:helpView. |
647 | 504 |
labelView label:(self defaultLabel). |
644
aab7d4f7c8c3
allow hiding self; added a label
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
505 |
labelView bottomInset:(labelView preferredExtent y negated). |
73 | 506 |
|
507 |
v := HVScrollableView |
|
1991
dfbb30988edd
no miniScrollers; no autoHide
Claus Gittinger <cg@exept.de>
parents:
1930
diff
changeset
|
508 |
for:SelectionInListView |
dfbb30988edd
no miniScrollers; no autoHide
Claus Gittinger <cg@exept.de>
parents:
1930
diff
changeset
|
509 |
miniScrollerH:true |
dfbb30988edd
no miniScrollers; no autoHide
Claus Gittinger <cg@exept.de>
parents:
1930
diff
changeset
|
510 |
miniScrollerV:false |
dfbb30988edd
no miniScrollers; no autoHide
Claus Gittinger <cg@exept.de>
parents:
1930
diff
changeset
|
511 |
in:helpView. |
dfbb30988edd
no miniScrollers; no autoHide
Claus Gittinger <cg@exept.de>
parents:
1930
diff
changeset
|
512 |
"/ v autoHideScrollBars:true. |
644
aab7d4f7c8c3
allow hiding self; added a label
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
513 |
v origin:(0.0 @ 0.0) corner:(1.0 @ 1.0). |
aab7d4f7c8c3
allow hiding self; added a label
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
514 |
v topInset:(labelView preferredExtent y). |
73 | 515 |
|
516 |
listView := v scrolledView. |
|
517 |
listView action:[:lineNr | self showSelection:lineNr]. |
|
518 |
listView doubleClickAction:[:lineNr | self doInspect]. |
|
519 |
listView ignoreReselect:false. |
|
98 | 520 |
listView menuHolder:self; menuPerformer:self; menuMessage:#fieldMenu. |
7297 | 521 |
self initializeDragAndDrop. |
73 | 522 |
|
644
aab7d4f7c8c3
allow hiding self; added a label
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
523 |
helpView := View origin:(0.3 @ 0.0) corner:(1.0 @ 1.0) in:panel. |
aab7d4f7c8c3
allow hiding self; added a label
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
524 |
helpView level:0; borderWidth:0. |
aab7d4f7c8c3
allow hiding self; added a label
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
525 |
|
aab7d4f7c8c3
allow hiding self; added a label
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
526 |
labelView2 := Label origin:0.0@0.0 corner:1.0@0.0 in:helpView. |
aab7d4f7c8c3
allow hiding self; added a label
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
527 |
labelView2 label:''. |
aab7d4f7c8c3
allow hiding self; added a label
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
528 |
labelView2 bottomInset:(labelView preferredExtent y negated). |
aab7d4f7c8c3
allow hiding self; added a label
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
529 |
|
73 | 530 |
v := HVScrollableView |
1991
dfbb30988edd
no miniScrollers; no autoHide
Claus Gittinger <cg@exept.de>
parents:
1930
diff
changeset
|
531 |
for:CodeView |
dfbb30988edd
no miniScrollers; no autoHide
Claus Gittinger <cg@exept.de>
parents:
1930
diff
changeset
|
532 |
miniScrollerH:true |
dfbb30988edd
no miniScrollers; no autoHide
Claus Gittinger <cg@exept.de>
parents:
1930
diff
changeset
|
533 |
miniScrollerV:false |
dfbb30988edd
no miniScrollers; no autoHide
Claus Gittinger <cg@exept.de>
parents:
1930
diff
changeset
|
534 |
in:helpView. |
dfbb30988edd
no miniScrollers; no autoHide
Claus Gittinger <cg@exept.de>
parents:
1930
diff
changeset
|
535 |
"/ v autoHideScrollBars:true. |
644
aab7d4f7c8c3
allow hiding self; added a label
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
536 |
v origin:(0.0 @ 0.0) corner:(1.0 @ 1.0). |
aab7d4f7c8c3
allow hiding self; added a label
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
537 |
v topInset:(labelView2 preferredExtent y). |
73 | 538 |
workspace := v scrolledView. |
539 |
||
3608 | 540 |
self setAcceptAction. |
73 | 541 |
|
542 |
nShown := 100. |
|
543 |
hasMore := false. |
|
644
aab7d4f7c8c3
allow hiding self; added a label
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
544 |
|
7297 | 545 |
"Modified: / 16-08-2005 / 21:54:04 / janfrog" |
546 |
"Modified: / 18-09-2006 / 21:12:42 / cg" |
|
547 |
! |
|
548 |
||
549 |
initializeDragAndDrop |
|
550 |
||
551 |
| source | |
|
552 |
source := DropSource |
|
553 |
receiver:self |
|
554 |
argument:nil |
|
555 |
dropObjectSelector:#getDropObjects |
|
556 |
displayObjectSelector:#getDisplayObjects |
|
557 |
dropFeedBackSelector:nil. |
|
558 |
||
559 |
listView dropSource:source. |
|
560 |
||
561 |
"Created: / 16-08-2005 / 21:51:43 / janfrog" |
|
562 |
"Modified: / 18-09-2006 / 21:13:05 / cg" |
|
200 | 563 |
! |
564 |
||
593 | 565 |
realize |
566 |
"delayed setup of lists till first map-time - |
|
200 | 567 |
this makes startup of inspectors a bit faster" |
568 |
||
569 |
|o| |
|
570 |
||
593 | 571 |
super realize. |
7887
be186ae12782
dont clobber the current selection on realize
Claus Gittinger <cg@exept.de>
parents:
7867
diff
changeset
|
572 |
"/ cg: I dont remember what this was needed for (is it still?) |
be186ae12782
dont clobber the current selection on realize
Claus Gittinger <cg@exept.de>
parents:
7867
diff
changeset
|
573 |
false "inspectedObject notNil" ifTrue:[ |
2235
ce49947e61f7
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
2193
diff
changeset
|
574 |
" |
ce49947e61f7
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
2193
diff
changeset
|
575 |
kludge to trick inspect:, which ignores setting the |
ce49947e61f7
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
2193
diff
changeset
|
576 |
same object again ... |
ce49947e61f7
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
2193
diff
changeset
|
577 |
" |
ce49947e61f7
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
2193
diff
changeset
|
578 |
o := inspectedObject. |
ce49947e61f7
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
2193
diff
changeset
|
579 |
inspectedObject := object := nil. |
ce49947e61f7
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
2193
diff
changeset
|
580 |
self inspect:o |
383 | 581 |
] |
593 | 582 |
|
7887
be186ae12782
dont clobber the current selection on realize
Claus Gittinger <cg@exept.de>
parents:
7867
diff
changeset
|
583 |
"Created: / 30-05-1996 / 09:38:37 / cg" |
be186ae12782
dont clobber the current selection on realize
Claus Gittinger <cg@exept.de>
parents:
7867
diff
changeset
|
584 |
"Modified: / 05-11-2007 / 20:11:44 / cg" |
2117 | 585 |
! |
586 |
||
587 |
release |
|
588 |
"release inpected object. This is normally not needed, |
|
589 |
since the garbage collector will find this memory alone. |
|
590 |
However, if some applications keeps invisible inspectors around |
|
591 |
(for example, the debugger does this), the inspected object |
|
592 |
would be kept from being freed or freed very late." |
|
593 |
||
594 |
" |
|
595 |
inspectedObject notNil ifTrue:[ |
|
2235
ce49947e61f7
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
2193
diff
changeset
|
596 |
inspectedObject removeDependent:self |
2117 | 597 |
]. |
598 |
" |
|
2235
ce49947e61f7
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
2193
diff
changeset
|
599 |
inspectedObject := object := nil. |
2117 | 600 |
self setDoItAction. "/ to release ref to inspectedObject in doItBlock |
601 |
workspace contents:nil. |
|
602 |
listView contents:nil. |
|
603 |
||
604 |
super release. |
|
605 |
||
606 |
"Modified: 11.6.1997 / 13:20:39 / cg" |
|
98 | 607 |
! ! |
608 |
||
609 |
!InspectorView methodsFor:'menu'! |
|
73 | 610 |
|
611 |
fieldMenu |
|
1040 | 612 |
"return the menu for the field-list" |
613 |
||
1235
13610578a5d2
resource flag: #menu -> #programMenu
Claus Gittinger <cg@exept.de>
parents:
1185
diff
changeset
|
614 |
<resource: #programMenu> |
1040 | 615 |
|
3526 | 616 |
|items m sel| |
1597
48629e1fc7b6
use new menu-creation message in PopUpMenu.
Claus Gittinger <cg@exept.de>
parents:
1570
diff
changeset
|
617 |
|
48629e1fc7b6
use new menu-creation message in PopUpMenu.
Claus Gittinger <cg@exept.de>
parents:
1570
diff
changeset
|
618 |
items := #( |
3198 | 619 |
('Copy Name or Key' #doCopyKey ) |
2085 | 620 |
('-') |
3198 | 621 |
('Inspect' #doInspect ) |
622 |
('BasicInspect' #doBasicInspect ) |
|
4197 | 623 |
('Inspect Hierarchical' #doNewInspect ) |
7951 | 624 |
('-') |
625 |
('Owners' #showOwners ) |
|
4197 | 626 |
('Ref Chains' #showReferences ) |
2085 | 627 |
('-') |
3198 | 628 |
('Browse' #browse ) |
3199 | 629 |
"/ ('Browse class hierarchy' #browseClassHierarchy ) |
630 |
"/ ('Browse full class protocol' #browseFullClassProtocol) |
|
2579 | 631 |
). |
2587
b6838cdb1f14
added show-stream-contents menu item
Claus Gittinger <cg@exept.de>
parents:
2580
diff
changeset
|
632 |
|
b6838cdb1f14
added show-stream-contents menu item
Claus Gittinger <cg@exept.de>
parents:
2580
diff
changeset
|
633 |
sel := self selection. |
6491 | 634 |
|
2587
b6838cdb1f14
added show-stream-contents menu item
Claus Gittinger <cg@exept.de>
parents:
2580
diff
changeset
|
635 |
(sel isBlock or:[sel isContext]) ifTrue:[ |
2579 | 636 |
items := items , #( |
4197 | 637 |
('Browse Blocks Home' #browseHome) |
2579 | 638 |
). |
639 |
]. |
|
4197 | 640 |
(inspectedObject isMethod or:[sel isMethod]) ifTrue:[ |
641 |
items := items , #( |
|
642 |
('Browse Methods Class' #browseMethodsClass) |
|
643 |
). |
|
644 |
]. |
|
8065
1fa2c55f1cf9
changed #fieldMenu - avoid debugger
Stefan Vogel <sv@exept.de>
parents:
8025
diff
changeset
|
645 |
(selectionIndex notNil and:[(self fieldList at:selectionIndex ifAbsent:nil) = '-dependents']) ifTrue:[ |
7975 | 646 |
items := items , #( |
647 |
('Browse Update Methods' #browseUpdateMethods) |
|
648 |
). |
|
649 |
]. |
|
650 |
||
7639 | 651 |
items := items , (self optionalStreamSelectionItems). |
652 |
items := items , (self optionalFilenameSelectionItems). |
|
653 |
||
2579 | 654 |
items := items , #( |
2085 | 655 |
('-') |
4197 | 656 |
('Trap Message...' #doTrap ) |
657 |
('Trap all Messages' #doTrapAll ) |
|
658 |
('Trace all Messages' #doTraceAll ) |
|
659 |
('Untrace/Untrap' #doUntrace ) |
|
2850 | 660 |
"/ ('-') |
3198 | 661 |
"/ ('Trap change to instVar' #doTrapInstVarChange ) |
662 |
"/ ('Trap change to any instVar' #doTrapAnyInstVarChange ) |
|
2007 | 663 |
). |
1895
8b51d61d9c0a
added follow & back menu items.
Claus Gittinger <cg@exept.de>
parents:
1873
diff
changeset
|
664 |
|
2007 | 665 |
allowFollow ifTrue:[ |
666 |
items := #( |
|
3198 | 667 |
('Follow' #doFollow ) |
668 |
('Back' #doBack ) |
|
2007 | 669 |
('-') |
670 |
) |
|
671 |
, |
|
672 |
items. |
|
1895
8b51d61d9c0a
added follow & back menu items.
Claus Gittinger <cg@exept.de>
parents:
1873
diff
changeset
|
673 |
]. |
73 | 674 |
|
675 |
hasMore ifTrue:[ |
|
2007 | 676 |
items := items , #( |
677 |
('-') |
|
4197 | 678 |
('Show More' #showMore ) |
2007 | 679 |
) |
73 | 680 |
]. |
681 |
||
93 | 682 |
monitorProcess isNil ifTrue:[ |
2007 | 683 |
items := items , #( |
684 |
('-') |
|
4197 | 685 |
('Start Monitor' #doStartMonitor ) |
2007 | 686 |
). |
93 | 687 |
] ifFalse:[ |
2007 | 688 |
items := items , #( |
689 |
('-') |
|
4197 | 690 |
('Stop Monitor' #doStopMonitor ) |
2007 | 691 |
). |
93 | 692 |
]. |
693 |
||
7639 | 694 |
items := items , (self numberBaseItems). |
1634
216a4254e634
added 'hex integers' toggle to menu.
Claus Gittinger <cg@exept.de>
parents:
1597
diff
changeset
|
695 |
|
472
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
696 |
m := PopUpMenu |
2007 | 697 |
itemList:items |
698 |
resources:resources. |
|
472
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
699 |
|
2235
ce49947e61f7
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
2193
diff
changeset
|
700 |
selectionIndex isNil ifTrue:[ |
2007 | 701 |
m disableAll:#(doFollow doInspect doBasicInspect doNewInspect |
702 |
browse browseClassHierarchy browseFullClassProtocol |
|
2271
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
703 |
doStartMonitor doCopyKey doCopyKey) |
1895
8b51d61d9c0a
added follow & back menu items.
Claus Gittinger <cg@exept.de>
parents:
1873
diff
changeset
|
704 |
]. |
2235
ce49947e61f7
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
2193
diff
changeset
|
705 |
(selectionIndex == 1) ifTrue:[ |
2271
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
706 |
m disableAll:#(doFollow doCopyKey) |
472
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
707 |
]. |
7975 | 708 |
|
1895
8b51d61d9c0a
added follow & back menu items.
Claus Gittinger <cg@exept.de>
parents:
1873
diff
changeset
|
709 |
inspectHistory size == 0 ifTrue:[ |
2007 | 710 |
m disable:#doBack |
1895
8b51d61d9c0a
added follow & back menu items.
Claus Gittinger <cg@exept.de>
parents:
1873
diff
changeset
|
711 |
]. |
6491 | 712 |
sel class hasImmediateInstances ifTrue:[ |
2580 | 713 |
m disableAll:#(showReferences doNewInspect) |
714 |
]. |
|
3199 | 715 |
sel inspectorClass == self class ifFalse:[ |
716 |
m disable:#doFollow |
|
717 |
]. |
|
4197 | 718 |
sel isMethod ifFalse:[ |
719 |
m disable:#browseMethodsClass |
|
720 |
]. |
|
3199 | 721 |
|
472
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
722 |
^ m |
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
723 |
|
7639 | 724 |
"Modified: / 09-02-2007 / 16:11:08 / cg" |
725 |
! |
|
726 |
||
727 |
numberBaseItems |
|
728 |
showHex ifTrue:[ |
|
729 |
^ #( |
|
730 |
('-') |
|
731 |
('Decimal Integers' #toggleHex ) |
|
732 |
) |
|
733 |
] ifFalse:[ |
|
734 |
^ #( |
|
735 |
('-') |
|
736 |
('Hex Integers' #toggleHex ) |
|
737 |
) |
|
738 |
]. |
|
739 |
||
740 |
"Created: / 09-02-2007 / 16:07:31 / cg" |
|
741 |
! |
|
742 |
||
743 |
optionalFilenameSelectionItems |
|
744 |
|sel| |
|
745 |
||
746 |
sel := self selection. |
|
747 |
(inspectedObject isFilename or:[sel isFilename]) ifTrue:[ |
|
748 |
^ #( |
|
749 |
('Open FileBrowser' #openFileBrowser) |
|
750 |
). |
|
751 |
]. |
|
752 |
^ #() |
|
753 |
||
754 |
"Created: / 09-02-2007 / 16:10:30 / cg" |
|
755 |
! |
|
756 |
||
757 |
optionalStreamSelectionItems |
|
758 |
|sel| |
|
759 |
||
760 |
sel := self selection. |
|
761 |
||
762 |
(sel isStream and:[self isExternalStream not]) ifTrue:[ |
|
763 |
^ #( |
|
764 |
('-') |
|
765 |
('Show Stream Contents' #showStreamContents) |
|
766 |
). |
|
767 |
]. |
|
768 |
^ #() |
|
769 |
||
770 |
"Created: / 09-02-2007 / 16:09:15 / cg" |
|
472
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
771 |
! ! |
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
772 |
|
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
773 |
!InspectorView methodsFor:'menu actions'! |
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
774 |
|
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
775 |
browse |
2235
ce49947e61f7
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
2193
diff
changeset
|
776 |
|cls| |
527 | 777 |
|
8025 | 778 |
cls := (self selection ? object) class. |
527 | 779 |
cls browserClass openInClass:cls selector:nil |
780 |
||
1930 | 781 |
"Created: / 14.12.1995 / 19:15:50 / cg" |
782 |
"Modified: / 14.10.1998 / 15:32:10 / cg" |
|
527 | 783 |
! |
784 |
||
785 |
browseClass |
|
2235
ce49947e61f7
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
2193
diff
changeset
|
786 |
|cls| |
472
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
787 |
|
8025 | 788 |
cls := (self selection ? object) class. |
527 | 789 |
cls browserClass browseClass:cls |
472
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
790 |
|
527 | 791 |
"Modified: 3.5.1996 / 12:39:32 / cg" |
472
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
792 |
! |
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
793 |
|
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
794 |
browseClassHierarchy |
2235
ce49947e61f7
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
2193
diff
changeset
|
795 |
|cls| |
472
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
796 |
|
8025 | 797 |
cls := (self selection ? object) class. |
527 | 798 |
cls browserClass browseClassHierarchy:cls |
799 |
||
800 |
"Modified: 3.5.1996 / 12:40:04 / cg" |
|
472
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
801 |
! |
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
802 |
|
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
803 |
browseFullClassProtocol |
2235
ce49947e61f7
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
2193
diff
changeset
|
804 |
|cls| |
472
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
805 |
|
8025 | 806 |
cls := (self selection ? object) class. |
527 | 807 |
cls browserClass browseFullClassProtocol:cls |
808 |
||
809 |
"Modified: 3.5.1996 / 12:40:17 / cg" |
|
472
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
810 |
! |
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
811 |
|
2579 | 812 |
browseHome |
813 |
|sel mthd| |
|
814 |
||
8025 | 815 |
sel := self selection ? object. |
2579 | 816 |
sel isBlock ifTrue:[ |
817 |
mthd := sel homeMethod |
|
818 |
] ifFalse:[ |
|
819 |
sel isContext ifTrue:[ |
|
820 |
mthd := sel method. |
|
821 |
] |
|
822 |
]. |
|
823 |
mthd isNil ifTrue:[ |
|
824 |
^ self warn:'Sorry - cannot figure out home method.' |
|
825 |
]. |
|
826 |
mthd class browserClass |
|
827 |
openInClass:mthd mclass selector:mthd selector |
|
828 |
! |
|
829 |
||
4197 | 830 |
browseMethodsClass |
831 |
|mthd| |
|
832 |
||
833 |
mthd := self selection. |
|
834 |
mthd mclass browserClass |
|
835 |
openInClass:mthd mclass selector:mthd selector |
|
836 |
! |
|
837 |
||
7975 | 838 |
browseUpdateMethods |
839 |
|deps methods| |
|
840 |
||
841 |
deps := self selection. |
|
842 |
methods := Set new. |
|
843 |
deps do:[:each | |
|
844 |
|implClass| |
|
845 |
||
846 |
implClass := each class whichClassImplements:#'update:with:from:'. |
|
847 |
implClass notNil ifTrue:[ |
|
848 |
methods add:(implClass compiledMethodAt:#'update:with:from:') |
|
849 |
] |
|
850 |
]. |
|
851 |
methods isEmpty ifTrue:[^ self]. |
|
852 |
||
853 |
methods first mclass browserClass |
|
854 |
browseMethods:methods |
|
855 |
title:'Update Method(s) of dependent(s)' |
|
856 |
! |
|
857 |
||
1895
8b51d61d9c0a
added follow & back menu items.
Claus Gittinger <cg@exept.de>
parents:
1873
diff
changeset
|
858 |
doBack |
8b51d61d9c0a
added follow & back menu items.
Claus Gittinger <cg@exept.de>
parents:
1873
diff
changeset
|
859 |
"user selected back-menu entry" |
8b51d61d9c0a
added follow & back menu items.
Claus Gittinger <cg@exept.de>
parents:
1873
diff
changeset
|
860 |
|
8b51d61d9c0a
added follow & back menu items.
Claus Gittinger <cg@exept.de>
parents:
1873
diff
changeset
|
861 |
|objectToInspect| |
8b51d61d9c0a
added follow & back menu items.
Claus Gittinger <cg@exept.de>
parents:
1873
diff
changeset
|
862 |
|
8b51d61d9c0a
added follow & back menu items.
Claus Gittinger <cg@exept.de>
parents:
1873
diff
changeset
|
863 |
inspectHistory size > 0 ifTrue:[ |
6851 | 864 |
objectToInspect := inspectHistory removeLast. |
865 |
inspectHistory size == 0 ifTrue:[ |
|
866 |
inspectHistory := nil |
|
867 |
]. |
|
868 |
self inspect:objectToInspect. |
|
1895
8b51d61d9c0a
added follow & back menu items.
Claus Gittinger <cg@exept.de>
parents:
1873
diff
changeset
|
869 |
] |
8b51d61d9c0a
added follow & back menu items.
Claus Gittinger <cg@exept.de>
parents:
1873
diff
changeset
|
870 |
|
8b51d61d9c0a
added follow & back menu items.
Claus Gittinger <cg@exept.de>
parents:
1873
diff
changeset
|
871 |
"Created: / 22.9.1998 / 18:22:01 / cg" |
8b51d61d9c0a
added follow & back menu items.
Claus Gittinger <cg@exept.de>
parents:
1873
diff
changeset
|
872 |
"Modified: / 22.9.1998 / 18:22:28 / cg" |
8b51d61d9c0a
added follow & back menu items.
Claus Gittinger <cg@exept.de>
parents:
1873
diff
changeset
|
873 |
! |
8b51d61d9c0a
added follow & back menu items.
Claus Gittinger <cg@exept.de>
parents:
1873
diff
changeset
|
874 |
|
1930 | 875 |
doBasicInspect |
876 |
"user selected inspect-menu entry" |
|
877 |
||
878 |
self doInspect:true |
|
879 |
! |
|
880 |
||
1895
8b51d61d9c0a
added follow & back menu items.
Claus Gittinger <cg@exept.de>
parents:
1873
diff
changeset
|
881 |
doFollow |
8b51d61d9c0a
added follow & back menu items.
Claus Gittinger <cg@exept.de>
parents:
1873
diff
changeset
|
882 |
"user selected follow-menu entry" |
8b51d61d9c0a
added follow & back menu items.
Claus Gittinger <cg@exept.de>
parents:
1873
diff
changeset
|
883 |
|
8b51d61d9c0a
added follow & back menu items.
Claus Gittinger <cg@exept.de>
parents:
1873
diff
changeset
|
884 |
|objectToInspect| |
8b51d61d9c0a
added follow & back menu items.
Claus Gittinger <cg@exept.de>
parents:
1873
diff
changeset
|
885 |
|
2235
ce49947e61f7
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
2193
diff
changeset
|
886 |
selectionIndex notNil ifTrue:[ |
ce49947e61f7
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
2193
diff
changeset
|
887 |
objectToInspect := self selection. |
ce49947e61f7
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
2193
diff
changeset
|
888 |
inspectHistory isNil ifTrue:[ |
ce49947e61f7
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
2193
diff
changeset
|
889 |
inspectHistory := OrderedCollection new |
ce49947e61f7
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
2193
diff
changeset
|
890 |
]. |
ce49947e61f7
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
2193
diff
changeset
|
891 |
inspectHistory addLast:inspectedObject. |
ce49947e61f7
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
2193
diff
changeset
|
892 |
self inspect:objectToInspect. |
1895
8b51d61d9c0a
added follow & back menu items.
Claus Gittinger <cg@exept.de>
parents:
1873
diff
changeset
|
893 |
] |
8b51d61d9c0a
added follow & back menu items.
Claus Gittinger <cg@exept.de>
parents:
1873
diff
changeset
|
894 |
|
8b51d61d9c0a
added follow & back menu items.
Claus Gittinger <cg@exept.de>
parents:
1873
diff
changeset
|
895 |
"Created: / 22.9.1998 / 18:21:08 / cg" |
8b51d61d9c0a
added follow & back menu items.
Claus Gittinger <cg@exept.de>
parents:
1873
diff
changeset
|
896 |
"Modified: / 22.9.1998 / 18:22:23 / cg" |
8b51d61d9c0a
added follow & back menu items.
Claus Gittinger <cg@exept.de>
parents:
1873
diff
changeset
|
897 |
! |
8b51d61d9c0a
added follow & back menu items.
Claus Gittinger <cg@exept.de>
parents:
1873
diff
changeset
|
898 |
|
472
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
899 |
doInspect |
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
900 |
"user selected inspect-menu entry" |
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
901 |
|
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
902 |
self doInspect:false |
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
903 |
! |
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
904 |
|
1365 | 905 |
doNewInspect |
906 |
self doInspect:#new |
|
907 |
||
908 |
"Created: / 31.10.1997 / 12:45:38 / cg" |
|
909 |
"Modified: / 31.10.1997 / 12:47:11 / cg" |
|
910 |
! |
|
911 |
||
472
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
912 |
doStartMonitor |
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
913 |
"start a monitoring process" |
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
914 |
|
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
915 |
monitorProcess isNil ifTrue:[ |
2235
ce49947e61f7
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
2193
diff
changeset
|
916 |
monitorProcess := |
ce49947e61f7
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
2193
diff
changeset
|
917 |
[ |
ce49947e61f7
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
2193
diff
changeset
|
918 |
|sel| |
295
92bcaa9996ae
minor changes for ContextInspector required
Claus Gittinger <cg@exept.de>
parents:
268
diff
changeset
|
919 |
|
2235
ce49947e61f7
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
2193
diff
changeset
|
920 |
[true] whileTrue:[ |
ce49947e61f7
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
2193
diff
changeset
|
921 |
(sel := selectionIndex) notNil ifTrue:[ |
ce49947e61f7
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
2193
diff
changeset
|
922 |
self showSelection:sel |
ce49947e61f7
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
2193
diff
changeset
|
923 |
]. |
ce49947e61f7
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
2193
diff
changeset
|
924 |
(Delay forSeconds:0.5) wait |
ce49947e61f7
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
2193
diff
changeset
|
925 |
] |
ce49947e61f7
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
2193
diff
changeset
|
926 |
] forkAt:Processor userBackgroundPriority |
472
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
927 |
] |
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
928 |
|
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
929 |
"Modified: 12.4.1996 / 14:20:06 / cg" |
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
930 |
! |
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
931 |
|
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
932 |
doStopMonitor |
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
933 |
"stop the monitor" |
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
934 |
|
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
935 |
monitorProcess terminate. |
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
936 |
monitorProcess := nil |
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
937 |
! |
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
938 |
|
2800 | 939 |
doTraceAll |
472
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
940 |
"place a trace on all messages sent to the inspected object" |
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
941 |
|
1597
48629e1fc7b6
use new menu-creation message in PopUpMenu.
Claus Gittinger <cg@exept.de>
parents:
1570
diff
changeset
|
942 |
self topView withWaitCursorDo:[MessageTracer traceAll:inspectedObject on:Transcript] |
472
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
943 |
! |
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
944 |
|
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
945 |
doTrap |
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
946 |
"place a trap on a message sent to the inspected object" |
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
947 |
|
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
948 |
|string selector| |
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
949 |
|
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
950 |
string := Dialog request:'Selector to trap on:' onCancel:nil. |
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
951 |
|
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
952 |
string notNil ifTrue:[ |
6851 | 953 |
selector := string asSymbolIfInterned. |
901 | 954 |
|
6851 | 955 |
selector isNil ifTrue:[ |
956 |
self warn:'no such selector' |
|
957 |
] ifFalse:[ |
|
958 |
self topView withWaitCursorDo:[MessageTracer trap:inspectedObject |
|
959 |
selector:selector] |
|
960 |
] |
|
472
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
961 |
] |
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
962 |
|
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
963 |
"Modified: 12.4.1996 / 14:07:01 / cg" |
901 | 964 |
|
965 |
||
472
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
966 |
! |
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
967 |
|
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
968 |
doTrapAll |
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
969 |
"place a trap on all messages sent to the inspected object" |
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
970 |
|
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
971 |
self topView withWaitCursorDo:[MessageTracer trapAll:inspectedObject] |
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
972 |
! |
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
973 |
|
2850 | 974 |
doTrapAnyInstVarChange |
975 |
"place a trap which is triggered if any instVar of the inspected object is changed" |
|
976 |
||
977 |
self topView withWaitCursorDo:[ |
|
978 |
MessageTracer trapModificationsIn:inspectedObject |
|
979 |
] |
|
980 |
! |
|
981 |
||
982 |
doTrapInstVarChange |
|
983 |
"place a trap which is triggered if the selected instVar of the inspected object is changed" |
|
984 |
||
985 |
self topView withWaitCursorDo:[ |
|
986 |
|idx| |
|
987 |
||
988 |
"/ a named instVar ? |
|
989 |
idx := self instVarIndexForLine:selectionIndex. |
|
990 |
idx isNil ifTrue:[ |
|
991 |
self warn:'select an instance variable first.'. |
|
992 |
^ self. |
|
993 |
]. |
|
994 |
MessageTracer |
|
995 |
trapModificationsOf:(inspectedObject class allInstVarNames at:idx) |
|
996 |
in:inspectedObject |
|
997 |
] |
|
998 |
! |
|
999 |
||
472
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
1000 |
doUntrace |
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
1001 |
"remove traps/traces" |
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
1002 |
|
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
1003 |
MessageTracer untrace:inspectedObject |
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
1004 |
! |
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
1005 |
|
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
1006 |
inspectOwners |
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
1007 |
"open an inspector on owners of the inspectedObject. |
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
1008 |
(this is a secret function)" |
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
1009 |
|
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
1010 |
self withCursor:(Cursor questionMark) do:[ |
6851 | 1011 |
|owners dict| |
472
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
1012 |
|
6851 | 1013 |
owners := (ObjectMemory whoReferences:inspectedObject) asOrderedCollection. |
1014 |
owners size > 500 ifTrue:[ |
|
1015 |
(self confirm:'there are ' , owners size printString , ' owners.\\Do you really want to see them all ?' withCRs) |
|
1016 |
ifFalse:[^ self] |
|
1017 |
]. |
|
1018 |
dict := IdentityDictionary new. |
|
1019 |
owners do:[:owner | |
|
1020 |
|set names oClass| |
|
472
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
1021 |
|
6851 | 1022 |
owner ~~ self ifTrue:[ |
1023 |
set := Set new. |
|
1024 |
names := owner class allInstVarNames. |
|
1025 |
oClass := owner class. |
|
1026 |
1 to:oClass instSize do:[:i | |
|
1027 |
(owner instVarAt:i) == inspectedObject ifTrue:[ |
|
1028 |
set add:(names at:i). |
|
1029 |
]. |
|
1030 |
]. |
|
1031 |
oClass isVariable ifTrue:[ |
|
1032 |
oClass isPointers ifTrue:[ |
|
1033 |
1 to:owner basicSize do:[:i | |
|
1034 |
(owner basicAt:i) == inspectedObject ifTrue:[ |
|
1035 |
set add:i |
|
1036 |
] |
|
1037 |
] |
|
1038 |
] |
|
1039 |
]. |
|
1040 |
dict at:owner put:set |
|
1041 |
]. |
|
1042 |
]. |
|
1043 |
dict inspect |
|
472
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
1044 |
] |
2587
b6838cdb1f14
added show-stream-contents menu item
Claus Gittinger <cg@exept.de>
parents:
2580
diff
changeset
|
1045 |
! |
b6838cdb1f14
added show-stream-contents menu item
Claus Gittinger <cg@exept.de>
parents:
2580
diff
changeset
|
1046 |
|
6283
7fa17d36a91c
+openFileBrowser (when inspeting a filename)
Claus Gittinger <cg@exept.de>
parents:
6130
diff
changeset
|
1047 |
openFileBrowser |
7fa17d36a91c
+openFileBrowser (when inspeting a filename)
Claus Gittinger <cg@exept.de>
parents:
6130
diff
changeset
|
1048 |
|fn| |
7fa17d36a91c
+openFileBrowser (when inspeting a filename)
Claus Gittinger <cg@exept.de>
parents:
6130
diff
changeset
|
1049 |
|
7fa17d36a91c
+openFileBrowser (when inspeting a filename)
Claus Gittinger <cg@exept.de>
parents:
6130
diff
changeset
|
1050 |
fn := self selection. |
7fa17d36a91c
+openFileBrowser (when inspeting a filename)
Claus Gittinger <cg@exept.de>
parents:
6130
diff
changeset
|
1051 |
(UserPreferences current fileBrowserClass) openOnFileNamed:fn. |
7fa17d36a91c
+openFileBrowser (when inspeting a filename)
Claus Gittinger <cg@exept.de>
parents:
6130
diff
changeset
|
1052 |
! |
7fa17d36a91c
+openFileBrowser (when inspeting a filename)
Claus Gittinger <cg@exept.de>
parents:
6130
diff
changeset
|
1053 |
|
7951 | 1054 |
showOwners |
1055 |
|o| |
|
1056 |
||
1057 |
o := self selection. |
|
1058 |
self withCursor:(Cursor questionMark) do:[ |
|
1059 |
|owners dict| |
|
1060 |
||
1061 |
owners := (ObjectMemory whoReferences:o). |
|
1062 |
owners isEmptyOrNil ifTrue:[ |
|
1063 |
self information:'No owners found.'. |
|
1064 |
^ self |
|
1065 |
]. |
|
1066 |
owners := owners asOrderedCollection. |
|
1067 |
" |
|
1068 |
skip weakArrays ... (they dont count) |
|
1069 |
" |
|
1070 |
owners := owners reject:[:owner | owner isMemberOf:WeakArray]. |
|
1071 |
owners inspect. |
|
1072 |
"/ inspector := DictionaryInspectorView openOn:dict. |
|
1073 |
"/ inspector listView doubleClickAction:[:lineNr | inspector doInspectKey]. |
|
1074 |
] |
|
1075 |
||
1076 |
"Modified: 15.10.1996 / 22:09:38 / cg" |
|
1077 |
! |
|
1078 |
||
1079 |
showReferences |
|
1080 |
"user selected references-menu entry" |
|
1081 |
||
1082 |
self selection class hasImmediateInstances ifTrue:[ |
|
1083 |
^ self warn:'Sorry - cannot show references to immediate objects' |
|
1084 |
]. |
|
1085 |
ObjectMemory displayRefChainTo:(self selection) |
|
1086 |
||
1087 |
"Modified: / 30.7.1998 / 14:03:16 / cg" |
|
1088 |
! |
|
1089 |
||
2587
b6838cdb1f14
added show-stream-contents menu item
Claus Gittinger <cg@exept.de>
parents:
2580
diff
changeset
|
1090 |
showStreamContents |
b6838cdb1f14
added show-stream-contents menu item
Claus Gittinger <cg@exept.de>
parents:
2580
diff
changeset
|
1091 |
|sel| |
b6838cdb1f14
added show-stream-contents menu item
Claus Gittinger <cg@exept.de>
parents:
2580
diff
changeset
|
1092 |
|
b6838cdb1f14
added show-stream-contents menu item
Claus Gittinger <cg@exept.de>
parents:
2580
diff
changeset
|
1093 |
sel := self selection. |
b6838cdb1f14
added show-stream-contents menu item
Claus Gittinger <cg@exept.de>
parents:
2580
diff
changeset
|
1094 |
(sel isStream and:[sel isExternalStream not]) ifTrue:[ |
b6838cdb1f14
added show-stream-contents menu item
Claus Gittinger <cg@exept.de>
parents:
2580
diff
changeset
|
1095 |
workspace replace:(sel contents printString) |
b6838cdb1f14
added show-stream-contents menu item
Claus Gittinger <cg@exept.de>
parents:
2580
diff
changeset
|
1096 |
]. |
b6838cdb1f14
added show-stream-contents menu item
Claus Gittinger <cg@exept.de>
parents:
2580
diff
changeset
|
1097 |
|
b6838cdb1f14
added show-stream-contents menu item
Claus Gittinger <cg@exept.de>
parents:
2580
diff
changeset
|
1098 |
"Created: / 6.2.2000 / 13:46:37 / cg" |
b6838cdb1f14
added show-stream-contents menu item
Claus Gittinger <cg@exept.de>
parents:
2580
diff
changeset
|
1099 |
"Modified: / 6.2.2000 / 13:47:37 / cg" |
73 | 1100 |
! ! |
1101 |
||
200 | 1102 |
!InspectorView methodsFor:'private'! |
1103 |
||
2271
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
1104 |
baseInspectedObjectClass |
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
1105 |
^ Object |
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
1106 |
|
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
1107 |
|
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
1108 |
! |
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
1109 |
|
4984 | 1110 |
basicDisplayStringForValue:someValue |
1111 |
"return the values displayString" |
|
1112 |
||
7887
be186ae12782
dont clobber the current selection on realize
Claus Gittinger <cg@exept.de>
parents:
7867
diff
changeset
|
1113 |
|s| |
4984 | 1114 |
|
1115 |
Error handle:[:ex | |
|
1116 |
s := someValue classNameWithArticle. |
|
1117 |
displayStringMessage == #displayString ifTrue:[ |
|
1118 |
s := s , ' "error in displayString: ' , ex description , '"' |
|
1119 |
] ifFalse:[ |
|
1120 |
s := s , ' "error in displayString (' , displayStringMessage , '): ' , ex description , '"' |
|
1121 |
] |
|
1122 |
] do:[ |
|
1123 |
showHex ifTrue:[ |
|
1124 |
someValue isInteger ifTrue:[ |
|
1125 |
^ '16r' , someValue hexPrintString |
|
1126 |
]. |
|
1127 |
(someValue isMemberOf:ByteArray) ifTrue:[ |
|
1128 |
^ String streamContents:[:s | inspectedObject asByteArray printOn:s base:16 showRadix:true] |
|
1129 |
"/ s := '' writeStream. |
|
1130 |
"/ s nextPutAll:'#['. |
|
1131 |
"/ someValue keysAndValuesDo:[:i :byte | |
|
1132 |
"/ i ~~ 1 ifTrue:[ |
|
1133 |
"/ s space |
|
1134 |
"/ ]. |
|
1135 |
"/ s nextPutAll:'16r'. |
|
1136 |
"/ s nextPutAll:(byte hexPrintString leftPaddedTo:2 with:$0). |
|
1137 |
"/ ]. |
|
1138 |
"/ s nextPutAll:']'. |
|
1139 |
"/ s := s contents |
|
1140 |
] |
|
1141 |
]. |
|
1142 |
||
1143 |
"/ displayStringMessage := #classNameWithArticle |
|
1144 |
"/ displayStringMessage := #displayString |
|
1145 |
"/ displayStringMessage := #printString |
|
7808
b37939de6d0b
do #printString inline to avoid #perform.
Claus Gittinger <cg@exept.de>
parents:
7639
diff
changeset
|
1146 |
"/ mhmh - avoid sending #perform: (bad for proxy objects which pass it to somewhere..) |
b37939de6d0b
do #printString inline to avoid #perform.
Claus Gittinger <cg@exept.de>
parents:
7639
diff
changeset
|
1147 |
displayStringMessage == #displayString ifTrue:[ |
b37939de6d0b
do #printString inline to avoid #perform.
Claus Gittinger <cg@exept.de>
parents:
7639
diff
changeset
|
1148 |
s := someValue displayString. |
b37939de6d0b
do #printString inline to avoid #perform.
Claus Gittinger <cg@exept.de>
parents:
7639
diff
changeset
|
1149 |
] ifFalse:[ |
b37939de6d0b
do #printString inline to avoid #perform.
Claus Gittinger <cg@exept.de>
parents:
7639
diff
changeset
|
1150 |
displayStringMessage == #printString ifTrue:[ |
b37939de6d0b
do #printString inline to avoid #perform.
Claus Gittinger <cg@exept.de>
parents:
7639
diff
changeset
|
1151 |
s := someValue printString. |
b37939de6d0b
do #printString inline to avoid #perform.
Claus Gittinger <cg@exept.de>
parents:
7639
diff
changeset
|
1152 |
] ifFalse:[ |
b37939de6d0b
do #printString inline to avoid #perform.
Claus Gittinger <cg@exept.de>
parents:
7639
diff
changeset
|
1153 |
displayStringMessage == #storeString ifTrue:[ |
b37939de6d0b
do #printString inline to avoid #perform.
Claus Gittinger <cg@exept.de>
parents:
7639
diff
changeset
|
1154 |
s := someValue storeString. |
b37939de6d0b
do #printString inline to avoid #perform.
Claus Gittinger <cg@exept.de>
parents:
7639
diff
changeset
|
1155 |
] ifFalse:[ |
b37939de6d0b
do #printString inline to avoid #perform.
Claus Gittinger <cg@exept.de>
parents:
7639
diff
changeset
|
1156 |
s := someValue perform:displayStringMessage. |
b37939de6d0b
do #printString inline to avoid #perform.
Claus Gittinger <cg@exept.de>
parents:
7639
diff
changeset
|
1157 |
]. |
b37939de6d0b
do #printString inline to avoid #perform.
Claus Gittinger <cg@exept.de>
parents:
7639
diff
changeset
|
1158 |
]. |
b37939de6d0b
do #printString inline to avoid #perform.
Claus Gittinger <cg@exept.de>
parents:
7639
diff
changeset
|
1159 |
]. |
4984 | 1160 |
]. |
1161 |
^ s. |
|
1162 |
||
7887
be186ae12782
dont clobber the current selection on realize
Claus Gittinger <cg@exept.de>
parents:
7867
diff
changeset
|
1163 |
"Modified: / 05-11-2007 / 20:07:21 / cg" |
4984 | 1164 |
! |
1165 |
||
647 | 1166 |
defaultLabel |
4095
5bd36b14723d
labels; added suppressPseudoVars & dereferenceValueHolders
Claus Gittinger <cg@exept.de>
parents:
3884
diff
changeset
|
1167 |
^ 'InstVars' |
647 | 1168 |
|
1169 |
"Modified: 28.6.1996 / 16:04:53 / cg" |
|
1170 |
! |
|
1171 |
||
6850 | 1172 |
derivedFieldNames |
7297 | 1173 |
|d| |
1174 |
||
1175 |
d := self derivedFields. |
|
1176 |
(d isKindOf:Dictionary) ifTrue:[ |
|
1177 |
^ d keys asSortedCollection. |
|
1178 |
]. |
|
1179 |
^ d collect:[:eachEntry | |
|
6850 | 1180 |
|nm| |
1181 |
||
1182 |
nm := (eachEntry isAssociation) |
|
1183 |
ifTrue:[ eachEntry key ] |
|
1184 |
ifFalse:[ eachEntry first ]. |
|
1185 |
'-',nm |
|
1186 |
] |
|
1187 |
||
1188 |
"Created: / 03-08-2006 / 15:02:54 / cg" |
|
7297 | 1189 |
"Modified: / 18-09-2006 / 21:18:57 / cg" |
6850 | 1190 |
! |
1191 |
||
6823 | 1192 |
derivedFields |
7054 | 1193 |
"the check below is not sufficient - if someone catches messages, for example. |
1194 |
Therefore, we do a manual lookup here:" |
|
1195 |
(object class whichClassImplements:#inspectorExtraAttributes) isNil ifTrue:[ |
|
1196 |
^ #() |
|
1197 |
]. |
|
6823 | 1198 |
^ [object inspectorExtraAttributes] |
1199 |
on: MessageNotUnderstood |
|
6850 | 1200 |
do: [:ex | ex return: #() ] |
6823 | 1201 |
|
1202 |
"Created: / 17-07-2006 / 11:02:32 / cg" |
|
7054 | 1203 |
"Modified: / 29-08-2006 / 13:03:31 / cg" |
6823 | 1204 |
! |
1205 |
||
3874
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1206 |
displayStringForValue:someValue |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1207 |
"return the values displayString" |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1208 |
|
7297 | 1209 |
|sel radix extraAttributes| |
3874
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1210 |
|
7887
be186ae12782
dont clobber the current selection on realize
Claus Gittinger <cg@exept.de>
parents:
7867
diff
changeset
|
1211 |
selectionIndex notNil ifTrue:[ |
be186ae12782
dont clobber the current selection on realize
Claus Gittinger <cg@exept.de>
parents:
7867
diff
changeset
|
1212 |
sel := listView at:selectionIndex. |
3874
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1213 |
|
7887
be186ae12782
dont clobber the current selection on realize
Claus Gittinger <cg@exept.de>
parents:
7867
diff
changeset
|
1214 |
extraAttributes := inspectedObject inspectorExtraAttributes. |
be186ae12782
dont clobber the current selection on realize
Claus Gittinger <cg@exept.de>
parents:
7867
diff
changeset
|
1215 |
(extraAttributes notNil and:[extraAttributes includesKey:sel]) ifTrue:[ |
be186ae12782
dont clobber the current selection on realize
Claus Gittinger <cg@exept.de>
parents:
7867
diff
changeset
|
1216 |
^ (extraAttributes at:sel) value printString |
be186ae12782
dont clobber the current selection on realize
Claus Gittinger <cg@exept.de>
parents:
7867
diff
changeset
|
1217 |
]. |
3874
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1218 |
|
7887
be186ae12782
dont clobber the current selection on realize
Claus Gittinger <cg@exept.de>
parents:
7867
diff
changeset
|
1219 |
(sel startsWith:'-all inst vars') ifTrue:[ |
be186ae12782
dont clobber the current selection on realize
Claus Gittinger <cg@exept.de>
parents:
7867
diff
changeset
|
1220 |
^ self stringWithAllInstVarValues |
be186ae12782
dont clobber the current selection on realize
Claus Gittinger <cg@exept.de>
parents:
7867
diff
changeset
|
1221 |
]. |
be186ae12782
dont clobber the current selection on realize
Claus Gittinger <cg@exept.de>
parents:
7867
diff
changeset
|
1222 |
(sel startsWith:'-all indexed vars') ifTrue:[ |
be186ae12782
dont clobber the current selection on realize
Claus Gittinger <cg@exept.de>
parents:
7867
diff
changeset
|
1223 |
^ self stringWithAllIndexedVarValues |
be186ae12782
dont clobber the current selection on realize
Claus Gittinger <cg@exept.de>
parents:
7867
diff
changeset
|
1224 |
]. |
3874
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1225 |
]. |
4984 | 1226 |
^ self basicDisplayStringForValue:someValue |
6850 | 1227 |
|
7887
be186ae12782
dont clobber the current selection on realize
Claus Gittinger <cg@exept.de>
parents:
7867
diff
changeset
|
1228 |
"Modified: / 05-11-2007 / 20:06:44 / cg" |
6850 | 1229 |
! |
1230 |
||
1231 |
extraNamedFieldNames |
|
1232 |
^ self extraNamedFields |
|
1233 |
collect:[:eachEntry | |
|
1234 |
|nm| |
|
1235 |
||
1236 |
nm := (eachEntry isAssociation) |
|
1237 |
ifTrue:[ eachEntry key ] |
|
1238 |
ifFalse:[ eachEntry first ]. |
|
1239 |
'`',nm |
|
1240 |
] |
|
1241 |
||
1242 |
"Modified: / 03-08-2006 / 15:17:19 / cg" |
|
1243 |
! |
|
1244 |
||
1245 |
extraNamedFields |
|
6940 | 1246 |
"by redefining inspectorExtraNamedFields to return an array of |
1247 |
pseudo-fieldName->value associations, the inspectors left list can be extended" |
|
1248 |
||
7054 | 1249 |
"the check below is not sufficient - if someone catches messages, for example. |
1250 |
Therefore, we do a manual lookup here:" |
|
1251 |
(object class whichClassImplements:#inspectorExtraNamedFields) isNil ifTrue:[ |
|
1252 |
^ #() |
|
1253 |
]. |
|
6850 | 1254 |
^ [object inspectorExtraNamedFields] |
1255 |
on: MessageNotUnderstood |
|
6940 | 1256 |
do: [:ex | ex return: #() ] |
6850 | 1257 |
|
1258 |
"Created: / 03-08-2006 / 13:34:18 / cg" |
|
7054 | 1259 |
"Modified: / 29-08-2006 / 13:03:57 / cg" |
6850 | 1260 |
! |
1261 |
||
1262 |
extraNamedVarIndexForLine:lineNr |
|
1263 |
"helper - return the index for a named instVar; |
|
1264 |
nil, if self or a keyed instvar is selected." |
|
1265 |
||
1266 |
|idx nNamedInstvarsShown nExtraNamedInstvarsShown cls baseCls firstRealIndex line| |
|
1267 |
||
1268 |
lineNr isNil ifTrue:[^ nil]. |
|
1269 |
firstRealIndex := 1. |
|
1270 |
||
1271 |
idx := lineNr. |
|
1272 |
self hasSelfEntry ifTrue:[ |
|
1273 |
(lineNr == 1 or:[lineNr isNil]) ifTrue:[ |
|
1274 |
^ nil "/ self selected |
|
1275 |
]. |
|
1276 |
idx := idx - 1. |
|
1277 |
firstRealIndex := 2. |
|
1278 |
]. |
|
1279 |
||
1280 |
[line := listView at:firstRealIndex. |
|
1281 |
(line startsWith:'-') and:[line size < 2 or:[line second isDigit not]]] whileTrue:[ |
|
1282 |
firstRealIndex := firstRealIndex + 1. |
|
1283 |
idx := idx - 1. |
|
1284 |
]. |
|
1285 |
||
1286 |
cls := inspectedObject class. |
|
1287 |
baseCls := self baseInspectedObjectClass. |
|
1288 |
||
1289 |
nNamedInstvarsShown := cls instSize. |
|
1290 |
"/ only the namedInstvars below baseInspectedObjectClass |
|
1291 |
"/ are shown ... |
|
1292 |
(cls == baseCls or:[cls isSubclassOf:baseCls]) ifTrue:[ |
|
1293 |
nNamedInstvarsShown := nNamedInstvarsShown - baseCls instSize. |
|
1294 |
]. |
|
1295 |
||
1296 |
idx := idx - nNamedInstvarsShown. |
|
1297 |
idx < 1 ifTrue:[ |
|
1298 |
^ nil. |
|
1299 |
]. |
|
1300 |
||
1301 |
nExtraNamedInstvarsShown := self extraNamedFields size. |
|
1302 |
idx <= nExtraNamedInstvarsShown ifTrue:[ |
|
1303 |
^ idx. |
|
1304 |
]. |
|
1305 |
||
1306 |
^ nil "/ indexed instvar or other selected |
|
1307 |
||
1308 |
"Created: / 03-08-2006 / 13:45:14 / cg" |
|
1309 |
"Modified: / 04-08-2006 / 11:45:29 / cg" |
|
3874
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1310 |
! |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1311 |
|
200 | 1312 |
fieldList |
1313 |
"return a list of names to show in the selectionList. |
|
1314 |
Leave hasMore as true, if a '...' entry should be added." |
|
1315 |
||
6840 | 1316 |
|derivedFieldList namedFieldList fieldList cls indexedList extraNamedFieldList| |
200 | 1317 |
|
3338 | 1318 |
inspectedObject isNil ifTrue:[ |
4095
5bd36b14723d
labels; added suppressPseudoVars & dereferenceValueHolders
Claus Gittinger <cg@exept.de>
parents:
3884
diff
changeset
|
1319 |
^ self hasSelfEntry ifFalse:[ #() ] ifTrue:[ #('-self') ] |
3338 | 1320 |
]. |
2271
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
1321 |
|
7297 | 1322 |
cls := inspectedObject class. |
1323 |
||
2275 | 1324 |
self topView withWaitCursorDo:[ |
6823 | 1325 |
namedFieldList := self namedFieldList. |
3868 | 1326 |
indexedList := self indexedFieldList. |
6840 | 1327 |
extraNamedFieldList := OrderedCollection new. |
3349 | 1328 |
|
4095
5bd36b14723d
labels; added suppressPseudoVars & dereferenceValueHolders
Claus Gittinger <cg@exept.de>
parents:
3884
diff
changeset
|
1329 |
self hasSelfEntry ifTrue:[ |
5bd36b14723d
labels; added suppressPseudoVars & dereferenceValueHolders
Claus Gittinger <cg@exept.de>
parents:
3884
diff
changeset
|
1330 |
self suppressPseudoSlots ifFalse:[ |
6823 | 1331 |
derivedFieldList := OrderedCollection new. |
1332 |
derivedFieldList add:'-self'. |
|
1333 |
derivedFieldList add:'-hash'. |
|
1334 |
derivedFieldList add:'-identityHash'. |
|
1335 |
||
1336 |
cls hasImmediateInstances ifFalse:[ |
|
1337 |
derivedFieldList add:'-dependents'. |
|
4095
5bd36b14723d
labels; added suppressPseudoVars & dereferenceValueHolders
Claus Gittinger <cg@exept.de>
parents:
3884
diff
changeset
|
1338 |
]. |
5bd36b14723d
labels; added suppressPseudoVars & dereferenceValueHolders
Claus Gittinger <cg@exept.de>
parents:
3884
diff
changeset
|
1339 |
cls instSize > 0 ifTrue:[ |
6823 | 1340 |
derivedFieldList add:'-all inst vars'. |
1341 |
]. |
|
1342 |
(indexedList notNil and:[self showAllIndexedVarsInFieldList]) ifTrue:[ |
|
1343 |
derivedFieldList add:'-all indexed vars'. |
|
4095
5bd36b14723d
labels; added suppressPseudoVars & dereferenceValueHolders
Claus Gittinger <cg@exept.de>
parents:
3884
diff
changeset
|
1344 |
]. |
6823 | 1345 |
|
6850 | 1346 |
derivedFieldList addAll:(self derivedFieldNames). |
7297 | 1347 |
extraNamedFieldList addAll:(self extraNamedFieldNames). |
3608 | 1348 |
]. |
3525 | 1349 |
]. |
531 | 1350 |
|
6823 | 1351 |
fieldList := OrderedCollection new. |
1352 |
derivedFieldList notNil ifTrue:[fieldList addAll:derivedFieldList]. |
|
1353 |
namedFieldList notNil ifTrue:[fieldList addAll:namedFieldList]. |
|
6840 | 1354 |
extraNamedFieldList notNil ifTrue:[fieldList addAll:extraNamedFieldList]. |
6823 | 1355 |
indexedList notNil ifTrue:[fieldList addAll:indexedList]. |
200 | 1356 |
]. |
6823 | 1357 |
^ fieldList |
531 | 1358 |
|
7297 | 1359 |
"Modified: / 18-09-2006 / 21:16:03 / cg" |
200 | 1360 |
! |
1361 |
||
295
92bcaa9996ae
minor changes for ContextInspector required
Claus Gittinger <cg@exept.de>
parents:
268
diff
changeset
|
1362 |
hasSelfEntry |
4095
5bd36b14723d
labels; added suppressPseudoVars & dereferenceValueHolders
Claus Gittinger <cg@exept.de>
parents:
3884
diff
changeset
|
1363 |
^ hideReceiver not and:[self suppressPseudoSlots not] |
295
92bcaa9996ae
minor changes for ContextInspector required
Claus Gittinger <cg@exept.de>
parents:
268
diff
changeset
|
1364 |
|
92bcaa9996ae
minor changes for ContextInspector required
Claus Gittinger <cg@exept.de>
parents:
268
diff
changeset
|
1365 |
"Created: 14.12.1995 / 19:30:03 / cg" |
644
aab7d4f7c8c3
allow hiding self; added a label
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
1366 |
"Modified: 28.6.1996 / 15:13:41 / cg" |
295
92bcaa9996ae
minor changes for ContextInspector required
Claus Gittinger <cg@exept.de>
parents:
268
diff
changeset
|
1367 |
! |
92bcaa9996ae
minor changes for ContextInspector required
Claus Gittinger <cg@exept.de>
parents:
268
diff
changeset
|
1368 |
|
3874
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1369 |
indexList |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1370 |
"return a list of indexes to show in the selectionList. |
2271
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
1371 |
Set hasMore to true, if a '...' entry should be added." |
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
1372 |
|
3526 | 1373 |
| n cls| |
2271
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
1374 |
|
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
1375 |
cls := inspectedObject class. |
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
1376 |
|
3868 | 1377 |
cls isVariable ifFalse:[^ nil ]. |
2271
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
1378 |
|
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
1379 |
n := inspectedObject basicSize. |
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
1380 |
(n > nShown) ifTrue:[ |
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
1381 |
n := nShown. |
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
1382 |
hasMore := true. |
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
1383 |
]. |
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
1384 |
|
3874
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1385 |
^ (1 to:n) |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1386 |
! |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1387 |
|
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1388 |
indexedFieldList |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1389 |
"return a list of indexed-variable names to show in the selectionList. |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1390 |
Set hasMore to true, if a '...' entry should be added." |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1391 |
|
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1392 |
|l| |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1393 |
|
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1394 |
l := self indexList. |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1395 |
l isNil ifTrue:[^ nil ]. |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1396 |
^ l collect:[:i | i printString]. |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1397 |
! |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1398 |
|
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1399 |
indexedValueAtIndex:idx |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1400 |
^ inspectedObject basicAt:idx |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1401 |
! |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1402 |
|
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1403 |
indexedValueAtIndex:idx put:newValue |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1404 |
inspectedObject basicAt:idx put:newValue |
2271
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
1405 |
! |
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
1406 |
|
3884 | 1407 |
indexedValueAtKey:key |
4314 | 1408 |
"/ kludge |
1409 |
inspectedObject isLimitedPrecisionReal ifTrue:[ |
|
1410 |
^ inspectedObject basicAt:key |
|
1411 |
]. |
|
3884 | 1412 |
^ inspectedObject at:key |
1413 |
! |
|
1414 |
||
2193
3d7b1044e8c8
fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents:
2188
diff
changeset
|
1415 |
instVarIndexForLine:lineNr |
3d7b1044e8c8
fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents:
2188
diff
changeset
|
1416 |
"helper - return the index for a named instVar; |
3d7b1044e8c8
fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents:
2188
diff
changeset
|
1417 |
nil, if self or a keyed instvar is selected." |
3d7b1044e8c8
fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents:
2188
diff
changeset
|
1418 |
|
5421
86a6077b131d
Fix for negative numbers as keys in a Dictionary
Stefan Vogel <sv@exept.de>
parents:
5134
diff
changeset
|
1419 |
|idx nNamedInstvarsShown cls baseCls firstRealIndex line| |
2193
3d7b1044e8c8
fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents:
2188
diff
changeset
|
1420 |
|
3d7b1044e8c8
fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents:
2188
diff
changeset
|
1421 |
lineNr isNil ifTrue:[^ nil]. |
3349 | 1422 |
firstRealIndex := 1. |
2193
3d7b1044e8c8
fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents:
2188
diff
changeset
|
1423 |
|
3d7b1044e8c8
fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents:
2188
diff
changeset
|
1424 |
idx := lineNr. |
4095
5bd36b14723d
labels; added suppressPseudoVars & dereferenceValueHolders
Claus Gittinger <cg@exept.de>
parents:
3884
diff
changeset
|
1425 |
self hasSelfEntry ifTrue:[ |
2193
3d7b1044e8c8
fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents:
2188
diff
changeset
|
1426 |
(lineNr == 1 or:[lineNr isNil]) ifTrue:[ |
3d7b1044e8c8
fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents:
2188
diff
changeset
|
1427 |
^ nil "/ self selected |
3d7b1044e8c8
fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents:
2188
diff
changeset
|
1428 |
]. |
3d7b1044e8c8
fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents:
2188
diff
changeset
|
1429 |
idx := idx - 1. |
3349 | 1430 |
firstRealIndex := 2. |
1431 |
]. |
|
1432 |
||
5421
86a6077b131d
Fix for negative numbers as keys in a Dictionary
Stefan Vogel <sv@exept.de>
parents:
5134
diff
changeset
|
1433 |
[line := listView at:firstRealIndex. |
86a6077b131d
Fix for negative numbers as keys in a Dictionary
Stefan Vogel <sv@exept.de>
parents:
5134
diff
changeset
|
1434 |
(line startsWith:'-') and:[line size < 2 or:[line second isDigit not]]] whileTrue:[ |
3349 | 1435 |
firstRealIndex := firstRealIndex + 1. |
1436 |
idx := idx - 1. |
|
2193
3d7b1044e8c8
fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents:
2188
diff
changeset
|
1437 |
]. |
3d7b1044e8c8
fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents:
2188
diff
changeset
|
1438 |
|
2447 | 1439 |
cls := inspectedObject class. |
1440 |
baseCls := self baseInspectedObjectClass. |
|
1441 |
||
1442 |
nNamedInstvarsShown := cls instSize. |
|
2271
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
1443 |
"/ only the namedInstvars below baseInspectedObjectClass |
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
1444 |
"/ are shown ... |
2447 | 1445 |
(cls == baseCls or:[cls isSubclassOf:baseCls]) ifTrue:[ |
1446 |
nNamedInstvarsShown := nNamedInstvarsShown - baseCls instSize. |
|
1447 |
]. |
|
2271
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
1448 |
|
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
1449 |
idx <= nNamedInstvarsShown ifTrue:[ |
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
1450 |
^ idx + self baseInspectedObjectClass instSize. |
2193
3d7b1044e8c8
fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents:
2188
diff
changeset
|
1451 |
]. |
2271
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
1452 |
^ nil "/ indexed instvar or other selected |
2193
3d7b1044e8c8
fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents:
2188
diff
changeset
|
1453 |
|
3349 | 1454 |
"Modified: / 31.10.2001 / 09:20:20 / cg" |
2193
3d7b1044e8c8
fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents:
2188
diff
changeset
|
1455 |
! |
3d7b1044e8c8
fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents:
2188
diff
changeset
|
1456 |
|
3d7b1044e8c8
fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents:
2188
diff
changeset
|
1457 |
keyIndexForLine:lineNr |
3d7b1044e8c8
fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents:
2188
diff
changeset
|
1458 |
"helper - return the index of the key-list; |
3d7b1044e8c8
fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents:
2188
diff
changeset
|
1459 |
nil, if self or a namedInstVar is selected." |
3d7b1044e8c8
fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents:
2188
diff
changeset
|
1460 |
|
6840 | 1461 |
|idx nNamedInstvarsShown nExtraNamedInstvarsShown cls baseCls firstRealIndex line| |
2193
3d7b1044e8c8
fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents:
2188
diff
changeset
|
1462 |
|
3d7b1044e8c8
fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents:
2188
diff
changeset
|
1463 |
lineNr isNil ifTrue:[^ nil]. |
3d7b1044e8c8
fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents:
2188
diff
changeset
|
1464 |
|
3349 | 1465 |
firstRealIndex := 1. |
2193
3d7b1044e8c8
fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents:
2188
diff
changeset
|
1466 |
idx := lineNr. |
4095
5bd36b14723d
labels; added suppressPseudoVars & dereferenceValueHolders
Claus Gittinger <cg@exept.de>
parents:
3884
diff
changeset
|
1467 |
self hasSelfEntry ifTrue:[ |
2193
3d7b1044e8c8
fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents:
2188
diff
changeset
|
1468 |
(lineNr == 1 or:[lineNr isNil]) ifTrue:[ |
3d7b1044e8c8
fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents:
2188
diff
changeset
|
1469 |
^ nil "/ self selected |
3d7b1044e8c8
fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents:
2188
diff
changeset
|
1470 |
]. |
3d7b1044e8c8
fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents:
2188
diff
changeset
|
1471 |
idx := idx - 1. |
3349 | 1472 |
firstRealIndex := firstRealIndex + 1. |
1473 |
]. |
|
1474 |
||
5421
86a6077b131d
Fix for negative numbers as keys in a Dictionary
Stefan Vogel <sv@exept.de>
parents:
5134
diff
changeset
|
1475 |
[line := listView at:firstRealIndex. |
5881
ef6791c315ab
oops - out of bounds error fixed
Claus Gittinger <cg@exept.de>
parents:
5845
diff
changeset
|
1476 |
line notNil |
ef6791c315ab
oops - out of bounds error fixed
Claus Gittinger <cg@exept.de>
parents:
5845
diff
changeset
|
1477 |
and:[(line startsWith:'-') and:[line size < 2 or:[line second isDigit not]]] |
ef6791c315ab
oops - out of bounds error fixed
Claus Gittinger <cg@exept.de>
parents:
5845
diff
changeset
|
1478 |
] whileTrue:[ |
3349 | 1479 |
firstRealIndex := firstRealIndex + 1. |
1480 |
idx := idx - 1. |
|
2193
3d7b1044e8c8
fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents:
2188
diff
changeset
|
1481 |
]. |
3d7b1044e8c8
fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents:
2188
diff
changeset
|
1482 |
|
2447 | 1483 |
cls := inspectedObject class. |
1484 |
baseCls := self baseInspectedObjectClass. |
|
1485 |
||
1486 |
nNamedInstvarsShown := cls instSize. |
|
2271
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
1487 |
"/ only the namedInstvars below baseInspectedObjectClass |
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
1488 |
"/ are shown ... |
2447 | 1489 |
(cls == baseCls or:[cls isSubclassOf:baseCls]) ifTrue:[ |
1490 |
nNamedInstvarsShown := nNamedInstvarsShown - baseCls instSize. |
|
1491 |
]. |
|
6850 | 1492 |
nExtraNamedInstvarsShown := self extraNamedFields size. |
2271
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
1493 |
|
6840 | 1494 |
idx <= (nNamedInstvarsShown+nExtraNamedInstvarsShown) ifTrue:[ |
2271
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
1495 |
^ nil "/ named instVar selected. |
2193
3d7b1044e8c8
fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents:
2188
diff
changeset
|
1496 |
]. |
6840 | 1497 |
^ idx - (nNamedInstvarsShown+nExtraNamedInstvarsShown). |
2193
3d7b1044e8c8
fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents:
2188
diff
changeset
|
1498 |
|
6850 | 1499 |
"Modified: / 04-08-2006 / 11:45:42 / cg" |
2271
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
1500 |
! |
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
1501 |
|
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
1502 |
namedFieldList |
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
1503 |
"return a list of instVar names to show in the selectionList." |
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
1504 |
|
2447 | 1505 |
|aList cls baseCls| |
2271
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
1506 |
|
2447 | 1507 |
cls := inspectedObject class. |
1508 |
baseCls := self baseInspectedObjectClass. |
|
1509 |
||
3351 | 1510 |
aList := OrderedCollection new. |
3338 | 1511 |
|
3351 | 1512 |
aList addAll:(cls allInstVarNames). |
1513 |
(cls == baseCls or:[cls isSubclassOf:baseCls]) ifTrue:[ |
|
1514 |
"/ hide some stuff |
|
1515 |
aList := aList copyFrom:(self baseInspectedObjectClass instSize + 1). |
|
1516 |
]. |
|
1517 |
||
2271
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
1518 |
^ aList |
3349 | 1519 |
|
7297 | 1520 |
"Modified: / 18-09-2006 / 21:35:30 / cg" |
6372 | 1521 |
! |
1522 |
||
3608 | 1523 |
setAcceptAction |
1524 |
"set the codeViews accept action" |
|
1525 |
||
1526 |
|acceptAction sel| |
|
1527 |
||
1528 |
acceptAction := [:theText | self doAccept:theText asString]. |
|
1529 |
||
1530 |
(selectionIndex isNil |
|
1531 |
or:[ inspectedObject class hasImmediateInstances]) |
|
1532 |
ifTrue:[ |
|
1533 |
acceptAction := nil. |
|
1534 |
] ifFalse:[ |
|
1535 |
sel := listView at:selectionIndex. |
|
1536 |
||
3868 | 1537 |
(sel startsWith:'-all') ifTrue:[ |
3608 | 1538 |
acceptAction := nil. |
1539 |
]. |
|
1540 |
(sel startsWith:'-hash') ifTrue:[ |
|
1541 |
acceptAction := nil. |
|
1542 |
]. |
|
1543 |
(sel startsWith:'-identityHash') ifTrue:[ |
|
1544 |
acceptAction := nil. |
|
1545 |
]. |
|
3634 | 1546 |
(sel startsWith:'-dependents') ifTrue:[ |
1547 |
acceptAction := nil. |
|
1548 |
]. |
|
5134 | 1549 |
(sel startsWith:'-source') ifTrue:[ |
1550 |
acceptAction := nil. |
|
1551 |
]. |
|
3608 | 1552 |
]. |
1553 |
||
1554 |
workspace acceptAction:acceptAction. |
|
1555 |
! |
|
1556 |
||
200 | 1557 |
setDoItAction |
542 | 1558 |
"set the codeViews doit action" |
1559 |
||
1560 |
workspace |
|
6851 | 1561 |
doItAction:[:theCode | |
1562 |
|evaluator| |
|
200 | 1563 |
|
6851 | 1564 |
(evaluator := inspectedObject class evaluatorClass) |
1565 |
notNil ifTrue:[ |
|
1566 |
evaluator |
|
1567 |
evaluate:theCode |
|
1568 |
in:nil |
|
1569 |
receiver:inspectedObject |
|
1570 |
notifying:workspace |
|
1571 |
logged:true |
|
1572 |
ifFail:nil |
|
1573 |
] ifFalse:[ |
|
1574 |
'objects class provides no evaluator' |
|
1575 |
] |
|
1576 |
]. |
|
542 | 1577 |
|
1270
3dc841708edd
disable accept/doIt, if instances class provides no evaluator
Claus Gittinger <cg@exept.de>
parents:
1235
diff
changeset
|
1578 |
inspectedObject class evaluatorClass isNil ifTrue:[ |
6851 | 1579 |
workspace doItAction:nil. |
1580 |
workspace acceptAction:nil. |
|
1270
3dc841708edd
disable accept/doIt, if instances class provides no evaluator
Claus Gittinger <cg@exept.de>
parents:
1235
diff
changeset
|
1581 |
] |
3dc841708edd
disable accept/doIt, if instances class provides no evaluator
Claus Gittinger <cg@exept.de>
parents:
1235
diff
changeset
|
1582 |
|
3dc841708edd
disable accept/doIt, if instances class provides no evaluator
Claus Gittinger <cg@exept.de>
parents:
1235
diff
changeset
|
1583 |
"Modified: 1.8.1997 / 21:47:09 / cg" |
200 | 1584 |
! |
1585 |
||
3884 | 1586 |
showAllIndexedVarsInFieldList |
1587 |
^ true |
|
1588 |
! |
|
1589 |
||
200 | 1590 |
showMore |
1855
24108d2b3374
oops - fixed showMore handling
Claus Gittinger <cg@exept.de>
parents:
1770
diff
changeset
|
1591 |
|o| |
24108d2b3374
oops - fixed showMore handling
Claus Gittinger <cg@exept.de>
parents:
1770
diff
changeset
|
1592 |
|
200 | 1593 |
hasMore ifTrue:[ |
2235
ce49947e61f7
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
2193
diff
changeset
|
1594 |
nShown := nShown * 2. |
ce49947e61f7
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
2193
diff
changeset
|
1595 |
"/ force update (which is otherwise ignored) |
ce49947e61f7
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
2193
diff
changeset
|
1596 |
o := inspectedObject. |
ce49947e61f7
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
2193
diff
changeset
|
1597 |
inspectedObject := object := nil. |
ce49947e61f7
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
2193
diff
changeset
|
1598 |
self inspect:o |
200 | 1599 |
] |
1855
24108d2b3374
oops - fixed showMore handling
Claus Gittinger <cg@exept.de>
parents:
1770
diff
changeset
|
1600 |
|
24108d2b3374
oops - fixed showMore handling
Claus Gittinger <cg@exept.de>
parents:
1770
diff
changeset
|
1601 |
"Modified: / 26.8.1998 / 19:05:25 / cg" |
1739 | 1602 |
! |
1603 |
||
200 | 1604 |
showSelection:lineNr |
1605 |
"user clicked on an instvar - show value in workspace" |
|
1606 |
||
3526 | 1607 |
|val| |
200 | 1608 |
|
1609 |
(hasMore and:[lineNr == listView list size]) ifTrue:[ |
|
2193
3d7b1044e8c8
fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents:
2188
diff
changeset
|
1610 |
"clicked on the '...' entry" |
3d7b1044e8c8
fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents:
2188
diff
changeset
|
1611 |
self showMore. |
3d7b1044e8c8
fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents:
2188
diff
changeset
|
1612 |
listView setSelection:lineNr. |
200 | 1613 |
]. |
1614 |
||
4095
5bd36b14723d
labels; added suppressPseudoVars & dereferenceValueHolders
Claus Gittinger <cg@exept.de>
parents:
3884
diff
changeset
|
1615 |
self hasSelfEntry ifTrue:[ |
2193
3d7b1044e8c8
fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents:
2188
diff
changeset
|
1616 |
(self hasSelfEntry and:[lineNr == 1]) ifTrue:[ |
3d7b1044e8c8
fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents:
2188
diff
changeset
|
1617 |
"selecting self also does a re-set, this allows updating the list" |
3d7b1044e8c8
fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents:
2188
diff
changeset
|
1618 |
self reinspect. |
3d7b1044e8c8
fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents:
2188
diff
changeset
|
1619 |
]. |
200 | 1620 |
]. |
2235
ce49947e61f7
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
2193
diff
changeset
|
1621 |
selectionIndex := selectedLine := lineNr. |
ce49947e61f7
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
2193
diff
changeset
|
1622 |
val := self selection. |
200 | 1623 |
self showValue:val. |
295
92bcaa9996ae
minor changes for ContextInspector required
Claus Gittinger <cg@exept.de>
parents:
268
diff
changeset
|
1624 |
|
3608 | 1625 |
self setAcceptAction. |
1626 |
||
6850 | 1627 |
"Modified: / 03-08-2006 / 14:26:22 / cg" |
200 | 1628 |
! |
1629 |
||
1630 |
showValue:someValue |
|
1631 |
"user clicked on an entry - show value in workspace" |
|
1632 |
||
3338 | 1633 |
|s| |
1634
216a4254e634
added 'hex integers' toggle to menu.
Claus Gittinger <cg@exept.de>
parents:
1597
diff
changeset
|
1634 |
|
3338 | 1635 |
self topView withWaitCursorDo:[ |
1636 |
s := self displayStringForValue:someValue. |
|
7626
9a2b4d6855a2
avoid flicker when monitoring
Claus Gittinger <cg@exept.de>
parents:
7297
diff
changeset
|
1637 |
s = workspace selectionAsString ifFalse:[ |
9a2b4d6855a2
avoid flicker when monitoring
Claus Gittinger <cg@exept.de>
parents:
7297
diff
changeset
|
1638 |
workspace replace:s. |
9a2b4d6855a2
avoid flicker when monitoring
Claus Gittinger <cg@exept.de>
parents:
7297
diff
changeset
|
1639 |
]. |
200 | 1640 |
]. |
7626
9a2b4d6855a2
avoid flicker when monitoring
Claus Gittinger <cg@exept.de>
parents:
7297
diff
changeset
|
1641 |
|
9a2b4d6855a2
avoid flicker when monitoring
Claus Gittinger <cg@exept.de>
parents:
7297
diff
changeset
|
1642 |
"Modified: / 06-02-2007 / 14:26:47 / cg" |
1634
216a4254e634
added 'hex integers' toggle to menu.
Claus Gittinger <cg@exept.de>
parents:
1597
diff
changeset
|
1643 |
! |
216a4254e634
added 'hex integers' toggle to menu.
Claus Gittinger <cg@exept.de>
parents:
1597
diff
changeset
|
1644 |
|
3868 | 1645 |
stringWithAllIndexedVarValues |
3874
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1646 |
|nIdx s names maxLen varString padLeft| |
3868 | 1647 |
|
1648 |
nIdx := inspectedObject size. |
|
1649 |
||
1650 |
s := '' writeStream. |
|
3874
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1651 |
names := self indexList. |
4999 | 1652 |
names size > 0 ifTrue:[ |
1653 |
maxLen := (names collect:[:eachName | eachName printString size]) max. |
|
1654 |
padLeft := names conform:[:eachIdx | eachIdx isInteger]. |
|
1655 |
||
1656 |
names do:[:eachIdx | |
|
1657 |
|val| |
|
3874
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1658 |
|
4999 | 1659 |
padLeft ifTrue:[ |
1660 |
s nextPutAll:(eachIdx printStringLeftPaddedTo:maxLen). |
|
1661 |
] ifFalse:[ |
|
1662 |
s nextPutAll:((eachIdx printString , ' ') paddedTo:maxLen+1 with:$.). |
|
1663 |
]. |
|
3874
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1664 |
|
4999 | 1665 |
s nextPutAll:' : '. |
1666 |
val := self indexedValueAtKey:eachIdx. |
|
3874
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1667 |
|
4999 | 1668 |
varString := self basicDisplayStringForValue:val. |
1669 |
(varString includes:Character cr) ifTrue:[ |
|
1670 |
varString := varString copyTo:(varString indexOf:Character cr)-1. |
|
1671 |
varString := varString , '...'. |
|
1672 |
]. |
|
1673 |
s nextPutLine:varString. |
|
3868 | 1674 |
]. |
1675 |
]. |
|
1676 |
nShown < nIdx ifTrue:[ |
|
1677 |
s nextPutLine:' ...'. |
|
1678 |
]. |
|
1679 |
^ s contents |
|
1680 |
! |
|
1681 |
||
3608 | 1682 |
stringWithAllInstVarValues |
1683 |
|s names maxLen varString| |
|
1684 |
||
5669
10e2da1659cf
care for non-8bit strings in instvars (when printing)
Claus Gittinger <cg@exept.de>
parents:
5648
diff
changeset
|
1685 |
s := WriteStream on:Unicode32String new. |
3608 | 1686 |
names := inspectedObject class allInstVarNames. |
1687 |
maxLen := (names collect:[:eachName | eachName size]) max. |
|
5498 | 1688 |
names keysAndValuesDo:[:eachInstVarIndex :eachInstVarName | |
3608 | 1689 |
s nextPutAll:((eachInstVarName , ' ') paddedTo:maxLen+1 with:$.). |
1690 |
s nextPutAll:' : '. |
|
5498 | 1691 |
varString := self basicDisplayStringForValue:(inspectedObject instVarAt:eachInstVarIndex). |
3608 | 1692 |
(varString includes:Character cr) ifTrue:[ |
1693 |
varString := varString copyTo:(varString indexOf:Character cr)-1. |
|
1694 |
varString := varString , '...'. |
|
1695 |
]. |
|
1696 |
s nextPutAll:varString. |
|
1697 |
s cr. |
|
1698 |
]. |
|
5669
10e2da1659cf
care for non-8bit strings in instvars (when printing)
Claus Gittinger <cg@exept.de>
parents:
5648
diff
changeset
|
1699 |
^ s contents asSingleByteStringIfPossible |
3608 | 1700 |
! |
1701 |
||
200 | 1702 |
valueAtLine:lineNr |
1703 |
"helper - return the value of the selected entry" |
|
1704 |
||
6850 | 1705 |
|idx l val| |
200 | 1706 |
|
4095
5bd36b14723d
labels; added suppressPseudoVars & dereferenceValueHolders
Claus Gittinger <cg@exept.de>
parents:
3884
diff
changeset
|
1707 |
(self hasSelfEntry |
2271
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
1708 |
and:[lineNr == 1 or:[lineNr isNil]]) ifTrue:[ |
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
1709 |
^ inspectedObject |
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
1710 |
]. |
2235
ce49947e61f7
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
2193
diff
changeset
|
1711 |
|
3645 | 1712 |
((l := listView at:lineNr) startsWith:$-) ifTrue:[ |
5421
86a6077b131d
Fix for negative numbers as keys in a Dictionary
Stefan Vogel <sv@exept.de>
parents:
5134
diff
changeset
|
1713 |
(l ~= '-' and:[(l at:2) isDigit not "negative number"]) ifTrue:[ |
3645 | 1714 |
^ self valueForSpecialLine:(listView at:lineNr) |
1715 |
]. |
|
3338 | 1716 |
]. |
1717 |
||
2271
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
1718 |
"/ a named instVar ? |
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
1719 |
idx := self instVarIndexForLine:lineNr. |
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
1720 |
idx notNil ifTrue:[ |
3432
087493c18c74
class based exceptions - no longer need to send #breakPointSÃgnal
Claus Gittinger <cg@exept.de>
parents:
3428
diff
changeset
|
1721 |
BreakPointInterrupt catch:[ |
2800 | 1722 |
^ inspectedObject instVarAt:idx |
1723 |
] |
|
2271
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
1724 |
]. |
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
1725 |
|
6840 | 1726 |
"/ an extra named field ? |
1727 |
idx := self extraNamedVarIndexForLine:lineNr. |
|
1728 |
idx notNil ifTrue:[ |
|
1729 |
BreakPointInterrupt catch:[ |
|
6850 | 1730 |
val := ((self extraNamedFields) at:idx) value. |
1731 |
val isBlock ifTrue:[ val := val value ]. |
|
1732 |
^ val |
|
6840 | 1733 |
] |
1734 |
]. |
|
1735 |
||
2271
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
1736 |
"/ an indexed instVar ? |
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
1737 |
idx := self keyIndexForLine:lineNr. |
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
1738 |
idx notNil ifTrue:[ |
3432
087493c18c74
class based exceptions - no longer need to send #breakPointSÃgnal
Claus Gittinger <cg@exept.de>
parents:
3428
diff
changeset
|
1739 |
BreakPointInterrupt catch:[ |
2800 | 1740 |
^ self indexedValueAtIndex:idx. |
1741 |
] |
|
200 | 1742 |
]. |
644
aab7d4f7c8c3
allow hiding self; added a label
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
1743 |
|
2271
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
1744 |
"/ nope |
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
1745 |
^ nil |
613 | 1746 |
|
6850 | 1747 |
"Modified: / 03-08-2006 / 14:05:30 / cg" |
2271
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
1748 |
! |
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
1749 |
|
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
1750 |
valueAtLine:lineNr put:newValue |
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
1751 |
|idx| |
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
1752 |
|
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
1753 |
idx := self instVarIndexForLine:selectionIndex. |
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
1754 |
idx notNil ifTrue:[ |
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
1755 |
inspectedObject instVarAt:idx put:newValue. |
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
1756 |
] ifFalse:[ |
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
1757 |
idx := self keyIndexForLine:selectionIndex. |
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
1758 |
idx notNil ifTrue:[ |
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
1759 |
self indexedValueAtIndex:idx put:newValue. |
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
1760 |
] ifFalse:[ |
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
1761 |
^ self "/ self selected - dont store |
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
1762 |
] |
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
1763 |
]. |
3349 | 1764 |
! |
1765 |
||
1766 |
valueForSpecialLine:line |
|
7297 | 1767 |
|idx fieldEntry val extraAttributes| |
1768 |
||
1769 |
extraAttributes := inspectedObject inspectorExtraAttributes. |
|
1770 |
(extraAttributes includesKey:line) ifTrue:[ |
|
1771 |
^ (extraAttributes at:line) value |
|
1772 |
]. |
|
6823 | 1773 |
|
6850 | 1774 |
idx := self derivedFieldNames indexOf:line. |
1775 |
idx ~~ 0 ifTrue:[ |
|
1776 |
fieldEntry := self derivedFields at:idx. |
|
1777 |
] ifFalse:[ |
|
1778 |
idx := self extraNamedFieldNames indexOf:line. |
|
1779 |
idx ~~ 0 ifTrue:[ |
|
1780 |
fieldEntry := self extraNamedFields at:idx. |
|
1781 |
]. |
|
6840 | 1782 |
]. |
6823 | 1783 |
fieldEntry notNil ifTrue:[ |
6850 | 1784 |
fieldEntry isAssociation ifTrue:[ |
1785 |
^ fieldEntry value |
|
1786 |
]. |
|
1787 |
^ fieldEntry at:2. |
|
6823 | 1788 |
]. |
1789 |
||
3525 | 1790 |
(line startsWith:'-self') ifTrue:[ |
1791 |
^ inspectedObject |
|
1792 |
]. |
|
1793 |
(line startsWith:'-hash') ifTrue:[ |
|
1794 |
^ inspectedObject hash |
|
1795 |
]. |
|
1796 |
(line startsWith:'-identityHash') ifTrue:[ |
|
1797 |
^ inspectedObject identityHash |
|
1798 |
]. |
|
3634 | 1799 |
(line startsWith:'-dependents') ifTrue:[ |
1800 |
^ inspectedObject dependents |
|
1801 |
]. |
|
3868 | 1802 |
(line startsWith:'-all') ifTrue:[ |
3608 | 1803 |
^ inspectedObject |
1804 |
]. |
|
1805 |
||
3526 | 1806 |
self error:'unknown special line'. |
3349 | 1807 |
|
6823 | 1808 |
"Created: / 31-10-2001 / 09:17:45 / cg" |
7297 | 1809 |
"Modified: / 18-09-2006 / 21:34:54 / cg" |
200 | 1810 |
! ! |
1811 |
||
3874
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1812 |
!InspectorView methodsFor:'queries'! |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1813 |
|
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1814 |
canInspect:anObject |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1815 |
^ anObject inspectorClass == self class |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1816 |
! |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1817 |
|
5925 | 1818 |
compilerClass |
1819 |
^ inspectedObject class compilerClass |
|
1820 |
! |
|
1821 |
||
4095
5bd36b14723d
labels; added suppressPseudoVars & dereferenceValueHolders
Claus Gittinger <cg@exept.de>
parents:
3884
diff
changeset
|
1822 |
dereferenceValueHolders |
5bd36b14723d
labels; added suppressPseudoVars & dereferenceValueHolders
Claus Gittinger <cg@exept.de>
parents:
3884
diff
changeset
|
1823 |
^ dereferenceValueHolders ? false |
5bd36b14723d
labels; added suppressPseudoVars & dereferenceValueHolders
Claus Gittinger <cg@exept.de>
parents:
3884
diff
changeset
|
1824 |
! |
5bd36b14723d
labels; added suppressPseudoVars & dereferenceValueHolders
Claus Gittinger <cg@exept.de>
parents:
3884
diff
changeset
|
1825 |
|
3874
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1826 |
labelFor:anObject |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1827 |
"return the windowLabel to use in my topView, when inspecting anObject." |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1828 |
|
5913 | 1829 |
|lbl id| |
3874
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1830 |
|
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1831 |
(self class == InspectorView |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1832 |
and:[anObject inspectorClass ~~ InspectorView]) ifTrue:[ |
6130 | 1833 |
lbl := 'BasicInspector on: ' |
3874
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1834 |
] ifFalse:[ |
6130 | 1835 |
lbl := 'Inspector on: ' |
5958 | 1836 |
]. |
1837 |
(anObject isImmediate |
|
1838 |
or:[anObject isBoolean]) ifFalse:[ |
|
6130 | 1839 |
lbl := lbl , '<%2> ' |
5913 | 1840 |
]. |
6130 | 1841 |
lbl := lbl , '%1'. |
5913 | 1842 |
|
1843 |
IdDictionary isNil ifTrue:[ |
|
1844 |
IdDictionary := WeakIdentityDictionary new. |
|
3874
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1845 |
]. |
5913 | 1846 |
[ |
1847 |
id := IdDictionary |
|
1848 |
at:anObject |
|
1849 |
ifAbsentPut:[ |
|
1850 |
|nextID| |
|
1851 |
||
1852 |
nextID := NextSequentialID ? 0. |
|
1853 |
NextSequentialID := nextID + 1. |
|
1854 |
nextID |
|
1855 |
]. |
|
1856 |
] valueUninterruptably. |
|
1857 |
||
3874
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1858 |
^ self class classResources |
5913 | 1859 |
string:lbl |
1860 |
with:(self labelNameFor:anObject) |
|
1861 |
with:id |
|
3874
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1862 |
! |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1863 |
|
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1864 |
labelNameFor:anObject |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1865 |
"return the iconLabel to use in my topView, when inspecting anObject. |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1866 |
Simply returns the className or name of anObjects class" |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1867 |
|
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1868 |
|s| |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1869 |
|
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1870 |
anObject isClass ifTrue:[ |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1871 |
s := anObject displayString |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1872 |
] ifFalse:[ |
5958 | 1873 |
((anObject class == SmallInteger) |
1874 |
or:[anObject isBoolean]) ifTrue:[ |
|
1875 |
s := anObject printString , ', ' , anObject classNameWithArticle |
|
1876 |
] ifFalse:[ |
|
1877 |
s := anObject classNameWithArticle |
|
1878 |
]. |
|
3874
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1879 |
]. |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1880 |
s isNil ifTrue:[ |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1881 |
anObject isBehavior ifTrue:[ |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1882 |
^ 'someBehavior' |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1883 |
]. |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1884 |
^ 'something' |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1885 |
]. |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1886 |
^ s |
5958 | 1887 |
|
1888 |
" |
|
1889 |
1234 inspect |
|
1890 |
true inspect |
|
1891 |
$a inspect |
|
1892 |
" |
|
3874
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1893 |
! |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1894 |
|
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1895 |
selectedKeyName |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1896 |
selectionIndex notNil ifTrue:[ |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1897 |
^ listView listAt:selectionIndex. |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1898 |
]. |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1899 |
^ nil |
4095
5bd36b14723d
labels; added suppressPseudoVars & dereferenceValueHolders
Claus Gittinger <cg@exept.de>
parents:
3884
diff
changeset
|
1900 |
! |
5bd36b14723d
labels; added suppressPseudoVars & dereferenceValueHolders
Claus Gittinger <cg@exept.de>
parents:
3884
diff
changeset
|
1901 |
|
5bd36b14723d
labels; added suppressPseudoVars & dereferenceValueHolders
Claus Gittinger <cg@exept.de>
parents:
3884
diff
changeset
|
1902 |
suppressPseudoSlots |
5bd36b14723d
labels; added suppressPseudoVars & dereferenceValueHolders
Claus Gittinger <cg@exept.de>
parents:
3884
diff
changeset
|
1903 |
^ suppressPseudoSlots ? false |
3874
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1904 |
! ! |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1905 |
|
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1906 |
!InspectorView methodsFor:'user interaction'! |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1907 |
|
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1908 |
doAccept:theText |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1909 |
|sel newValue| |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1910 |
|
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1911 |
sel := listView at:selectionIndex. |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1912 |
(sel startsWith:'-all') ifTrue:[ |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1913 |
workspace flash. |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1914 |
^ self. |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1915 |
]. |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1916 |
|
4642
ee63c37d9d3c
Convert Object>>errorSignal -> Error
Stefan Vogel <sv@exept.de>
parents:
4314
diff
changeset
|
1917 |
Error handle:[:ex | |
3874
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1918 |
workspace flash |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1919 |
] do:[ |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1920 |
newValue := inspectedObject class evaluatorClass |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1921 |
evaluate:theText |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1922 |
receiver:inspectedObject |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1923 |
notifying:workspace. |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1924 |
|
4095
5bd36b14723d
labels; added suppressPseudoVars & dereferenceValueHolders
Claus Gittinger <cg@exept.de>
parents:
3884
diff
changeset
|
1925 |
self dereferenceValueHolders ifTrue:[ |
5bd36b14723d
labels; added suppressPseudoVars & dereferenceValueHolders
Claus Gittinger <cg@exept.de>
parents:
3884
diff
changeset
|
1926 |
(self valueAtLine:selectionIndex) value:newValue |
5bd36b14723d
labels; added suppressPseudoVars & dereferenceValueHolders
Claus Gittinger <cg@exept.de>
parents:
3884
diff
changeset
|
1927 |
] ifFalse:[ |
5bd36b14723d
labels; added suppressPseudoVars & dereferenceValueHolders
Claus Gittinger <cg@exept.de>
parents:
3884
diff
changeset
|
1928 |
self valueAtLine:selectionIndex put:newValue. |
5bd36b14723d
labels; added suppressPseudoVars & dereferenceValueHolders
Claus Gittinger <cg@exept.de>
parents:
3884
diff
changeset
|
1929 |
] |
3874
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1930 |
] |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1931 |
! |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1932 |
|
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1933 |
doCopyKey |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1934 |
"put the instVar-name into the text-copy-buffer" |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1935 |
|
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1936 |
|nm| |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1937 |
|
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1938 |
selectionIndex notNil ifTrue:[ |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1939 |
nm := listView listAt:selectionIndex. |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1940 |
nm notNil ifTrue:[ |
6034 | 1941 |
self setClipboardText:(nm asString) |
3874
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1942 |
] |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1943 |
] |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1944 |
! |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1945 |
|
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1946 |
doInspect:basic |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1947 |
"user selected inspect-menu entry" |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1948 |
|
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1949 |
|objectToInspect| |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1950 |
|
8025 | 1951 |
objectToInspect := self selection ? object. |
1952 |
objectToInspect notNil ifTrue:[ |
|
3874
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1953 |
basic == #new ifTrue:[ |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1954 |
NewInspector::NewInspectorView inspect:objectToInspect |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1955 |
] ifFalse:[ |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1956 |
basic ifTrue:[ |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1957 |
objectToInspect basicInspect |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1958 |
] ifFalse:[ |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1959 |
objectToInspect inspect |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1960 |
] |
8025 | 1961 |
]. |
1962 |
]. |
|
3874
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1963 |
|
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1964 |
"Modified: / 31.10.1997 / 12:46:53 / cg" |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1965 |
! |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1966 |
|
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1967 |
doUpdate |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1968 |
self reinspect |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1969 |
! |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1970 |
|
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1971 |
monitor:anInstVarName |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1972 |
"start a monitoring process, showing the given instVar |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1973 |
in regular intervals." |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1974 |
|
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1975 |
|ivName| |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1976 |
|
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1977 |
(ivName := anInstVarName) isInteger ifTrue:[ |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1978 |
ivName := anInstVarName printString |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1979 |
]. |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1980 |
listView selectElement:ivName. |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1981 |
self doStartMonitor |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1982 |
|
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1983 |
"Created: / 1.3.1996 / 19:31:45 / cg" |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1984 |
"Modified: / 12.2.1999 / 16:05:47 / cg" |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1985 |
! |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1986 |
|
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1987 |
selection |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1988 |
"helper - return the value of the selected entry" |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1989 |
|
6850 | 1990 |
|val| |
1991 |
||
7904 | 1992 |
selectionIndex isNil ifTrue:[^ nil]. |
1993 |
||
6850 | 1994 |
val := self valueAtLine:selectionIndex. |
1995 |
self dereferenceValueHolders ifTrue:[ |
|
1996 |
"workspace-variable-inspection" |
|
1997 |
val := val value |
|
1998 |
]. |
|
1999 |
^ val |
|
2000 |
||
2001 |
"Modified: / 03-08-2006 / 14:27:02 / cg" |
|
3874
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2002 |
! |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2003 |
|
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2004 |
showLast |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2005 |
"user clicked on an instvar - show value in workspace" |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2006 |
|
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2007 |
|lastIdx| |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2008 |
|
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2009 |
lastIdx := listView list size. |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2010 |
lastIdx ~~ 0 ifTrue:[ |
6851 | 2011 |
self showSelection:lastIdx. |
2012 |
listView selection:lastIdx. |
|
3874
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2013 |
] |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2014 |
|
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2015 |
"Created: 28.6.1996 / 15:06:38 / cg" |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2016 |
"Modified: 18.3.1997 / 18:22:54 / cg" |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2017 |
! |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2018 |
|
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2019 |
toggleHex |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2020 |
|sel| |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2021 |
|
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2022 |
showHex := showHex not. |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2023 |
sel := listView selection. |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2024 |
sel notNil ifTrue:[ |
6851 | 2025 |
self showSelection:sel |
3874
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2026 |
] |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2027 |
|
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2028 |
"Created: / 7.5.1998 / 01:54:52 / cg" |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2029 |
"Modified: / 7.5.1998 / 02:00:10 / cg" |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2030 |
! |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2031 |
|
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2032 |
tryToSelectKeyNamed:aString |
5558 | 2033 |
|list idx| |
3874
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2034 |
|
5558 | 2035 |
list := listView list. |
2036 |
list notNil ifTrue:[ |
|
2037 |
(idx := list indexOf:aString) ~= 0 ifTrue:[ |
|
2038 |
listView selection:idx |
|
2039 |
]. |
|
3874
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2040 |
]. |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2041 |
|
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2042 |
"Created: / 16.11.2001 / 13:48:51 / cg" |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2043 |
! ! |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2044 |
|
4268
0fe3e4a82ddf
more textView protocol (for Workspace)
Claus Gittinger <cg@exept.de>
parents:
4197
diff
changeset
|
2045 |
!InspectorView methodsFor:'workspace protocol'! |
0fe3e4a82ddf
more textView protocol (for Workspace)
Claus Gittinger <cg@exept.de>
parents:
4197
diff
changeset
|
2046 |
|
0fe3e4a82ddf
more textView protocol (for Workspace)
Claus Gittinger <cg@exept.de>
parents:
4197
diff
changeset
|
2047 |
modified:aBoolean |
0fe3e4a82ddf
more textView protocol (for Workspace)
Claus Gittinger <cg@exept.de>
parents:
4197
diff
changeset
|
2048 |
^ workspace modified:aBoolean |
0fe3e4a82ddf
more textView protocol (for Workspace)
Claus Gittinger <cg@exept.de>
parents:
4197
diff
changeset
|
2049 |
! |
0fe3e4a82ddf
more textView protocol (for Workspace)
Claus Gittinger <cg@exept.de>
parents:
4197
diff
changeset
|
2050 |
|
0fe3e4a82ddf
more textView protocol (for Workspace)
Claus Gittinger <cg@exept.de>
parents:
4197
diff
changeset
|
2051 |
saveAs:file doAppend:doAppend |
0fe3e4a82ddf
more textView protocol (for Workspace)
Claus Gittinger <cg@exept.de>
parents:
4197
diff
changeset
|
2052 |
workspace saveAs:file doAppend:doAppend |
0fe3e4a82ddf
more textView protocol (for Workspace)
Claus Gittinger <cg@exept.de>
parents:
4197
diff
changeset
|
2053 |
! ! |
0fe3e4a82ddf
more textView protocol (for Workspace)
Claus Gittinger <cg@exept.de>
parents:
4197
diff
changeset
|
2054 |
|
871 | 2055 |
!InspectorView class methodsFor:'documentation'! |
200 | 2056 |
|
2057 |
version |
|
8065
1fa2c55f1cf9
changed #fieldMenu - avoid debugger
Stefan Vogel <sv@exept.de>
parents:
8025
diff
changeset
|
2058 |
^ '$Header: /cvs/stx/stx/libtool/InspectorView.st,v 1.179 2008-04-09 17:03:41 stefan Exp $' |
200 | 2059 |
! ! |