author | Claus Gittinger <cg@exept.de> |
Thu, 08 Oct 2009 14:23:55 +0200 | |
changeset 8906 | d1dc7a6f512f |
parent 8868 | 1fd94adeda59 |
child 8907 | edd23189daa2 |
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 |
|
8452 | 132 |
openOn:anObject monitor:anInstVarNameOrNil |
416
fd30ab6185c7
added startup-with-monitor method
Claus Gittinger <cg@exept.de>
parents:
383
diff
changeset
|
133 |
"create and launch a new inspector for anObject. |
8452 | 134 |
If anInstVarNameOrNil is nonNil, let the inspector monitor it |
2008
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 |
|
8452 | 162 |
anInstVarNameOrNil notNil ifTrue:[ |
163 |
inspectorView monitor:anInstVarNameOrNil |
|
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 |
8452 | 290 |
"set/update the object to be inspected" |
73 | 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. |
|
73 | 312 |
]. |
2284 | 313 |
selectionIndex := selectedLine := nil. |
314 |
||
315 |
isStandaloneInspector == true ifTrue:[ |
|
8452 | 316 |
"/ not embedded (as in the debugger) |
2284 | 317 |
self topView |
318 |
label:(self labelFor:anObject); |
|
319 |
iconLabel:(self labelNameFor:anObject). |
|
8452 | 320 |
]. |
321 |
||
322 |
sameObject ifFalse:[ |
|
323 |
self setInitialSelection. |
|
324 |
]. |
|
73 | 325 |
|
7887
be186ae12782
dont clobber the current selection on realize
Claus Gittinger <cg@exept.de>
parents:
7867
diff
changeset
|
326 |
"Modified: / 05-11-2007 / 20:09:14 / cg" |
1895
8b51d61d9c0a
added follow & back menu items.
Claus Gittinger <cg@exept.de>
parents:
1873
diff
changeset
|
327 |
! |
8b51d61d9c0a
added follow & back menu items.
Claus Gittinger <cg@exept.de>
parents:
1873
diff
changeset
|
328 |
|
8b51d61d9c0a
added follow & back menu items.
Claus Gittinger <cg@exept.de>
parents:
1873
diff
changeset
|
329 |
isStandaloneInspector:aBoolean |
2007 | 330 |
"obsolete now" |
331 |
||
2008
52bf8b8afd3b
separated allowFollow from isStandAlone flag
Claus Gittinger <cg@exept.de>
parents:
2007
diff
changeset
|
332 |
isStandaloneInspector := aBoolean |
52bf8b8afd3b
separated allowFollow from isStandAlone flag
Claus Gittinger <cg@exept.de>
parents:
2007
diff
changeset
|
333 |
|
52bf8b8afd3b
separated allowFollow from isStandAlone flag
Claus Gittinger <cg@exept.de>
parents:
2007
diff
changeset
|
334 |
"Modified: / 12.2.1999 / 16:01:44 / cg" |
29 | 335 |
! |
336 |
||
644
aab7d4f7c8c3
allow hiding self; added a label
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
337 |
label:aString |
4106 | 338 |
"set the fieldListLabel - obsolete; collides with inherited label-functionality" |
339 |
||
5845 | 340 |
<resource:#obsolete> |
4106 | 341 |
self obsoleteMethodWarning:'use fieldListLabel:'. |
342 |
self fieldListLabel:aString. |
|
343 |
super label:aString. |
|
644
aab7d4f7c8c3
allow hiding self; added a label
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
344 |
|
aab7d4f7c8c3
allow hiding self; added a label
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
345 |
"Created: 28.6.1996 / 15:30:26 / cg" |
aab7d4f7c8c3
allow hiding self; added a label
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
346 |
! |
aab7d4f7c8c3
allow hiding self; added a label
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
347 |
|
73 | 348 |
listView |
349 |
^ listView |
|
352 | 350 |
! |
351 |
||
2193
3d7b1044e8c8
fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents:
2188
diff
changeset
|
352 |
reinspect |
3d7b1044e8c8
fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents:
2188
diff
changeset
|
353 |
"update display for a changed inspectedObject" |
3d7b1044e8c8
fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents:
2188
diff
changeset
|
354 |
|
3d7b1044e8c8
fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents:
2188
diff
changeset
|
355 |
|aList| |
3d7b1044e8c8
fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents:
2188
diff
changeset
|
356 |
|
3d7b1044e8c8
fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents:
2188
diff
changeset
|
357 |
hasMore := false. |
3d7b1044e8c8
fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents:
2188
diff
changeset
|
358 |
aList := self fieldList. |
3d7b1044e8c8
fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents:
2188
diff
changeset
|
359 |
hasMore ifTrue:[ |
3d7b1044e8c8
fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents:
2188
diff
changeset
|
360 |
aList add:' ... ' |
3d7b1044e8c8
fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents:
2188
diff
changeset
|
361 |
]. |
3d7b1044e8c8
fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents:
2188
diff
changeset
|
362 |
|
3d7b1044e8c8
fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents:
2188
diff
changeset
|
363 |
listView contents:aList. |
3d7b1044e8c8
fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents:
2188
diff
changeset
|
364 |
|
2271
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
365 |
"/ workspace contents:nil. |
2193
3d7b1044e8c8
fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents:
2188
diff
changeset
|
366 |
self setDoItAction. |
3d7b1044e8c8
fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents:
2188
diff
changeset
|
367 |
|
2235
ce49947e61f7
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
2193
diff
changeset
|
368 |
selectionIndex := selectedLine := nil |
2193
3d7b1044e8c8
fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents:
2188
diff
changeset
|
369 |
! |
3d7b1044e8c8
fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents:
2188
diff
changeset
|
370 |
|
4095
5bd36b14723d
labels; added suppressPseudoVars & dereferenceValueHolders
Claus Gittinger <cg@exept.de>
parents:
3884
diff
changeset
|
371 |
suppressPseudoSlots:aBoolean |
5bd36b14723d
labels; added suppressPseudoVars & dereferenceValueHolders
Claus Gittinger <cg@exept.de>
parents:
3884
diff
changeset
|
372 |
suppressPseudoSlots := aBoolean |
5bd36b14723d
labels; added suppressPseudoVars & dereferenceValueHolders
Claus Gittinger <cg@exept.de>
parents:
3884
diff
changeset
|
373 |
! |
5bd36b14723d
labels; added suppressPseudoVars & dereferenceValueHolders
Claus Gittinger <cg@exept.de>
parents:
3884
diff
changeset
|
374 |
|
352 | 375 |
workspace |
376 |
^ workspace |
|
52 | 377 |
! ! |
378 |
||
2724 | 379 |
!InspectorView methodsFor:'accessing-channels'! |
2598 | 380 |
|
381 |
inspectedObjectHolder |
|
382 |
inspectedObjectHolder isNil ifTrue:[ |
|
383 |
inspectedObjectHolder := ValueHolder new. |
|
384 |
inspectedObjectHolder addDependent:self. |
|
385 |
]. |
|
386 |
^ inspectedObjectHolder |
|
387 |
||
388 |
"Created: / 10.2.2000 / 13:33:16 / cg" |
|
389 |
"Modified: / 10.2.2000 / 13:34:23 / cg" |
|
390 |
! |
|
391 |
||
392 |
inspectedObjectHolder:aValueHolder |
|
393 |
inspectedObjectHolder notNil ifTrue:[ |
|
394 |
inspectedObjectHolder removeDependent:self. |
|
395 |
]. |
|
396 |
inspectedObjectHolder := aValueHolder. |
|
397 |
inspectedObjectHolder notNil ifTrue:[ |
|
398 |
inspectedObjectHolder addDependent:self. |
|
399 |
]. |
|
400 |
||
401 |
"Created: / 10.2.2000 / 13:34:53 / cg" |
|
402 |
! ! |
|
403 |
||
404 |
!InspectorView methodsFor:'change & update'! |
|
405 |
||
406 |
update:something with:aParameter from:changedObject |
|
407 |
"Invoked when one of my dependees sends a change notification." |
|
408 |
||
409 |
|oldSelection| |
|
410 |
||
411 |
changedObject == inspectedObject ifTrue:[ |
|
412 |
oldSelection := listView selection. |
|
413 |
self inspect:inspectedObject. |
|
414 |
oldSelection notNil ifTrue:[ |
|
415 |
self showSelection:oldSelection |
|
416 |
] |
|
417 |
]. |
|
418 |
||
419 |
changedObject == inspectedObjectHolder ifTrue:[ |
|
420 |
self inspect:(inspectedObjectHolder value) |
|
421 |
]. |
|
422 |
||
423 |
super update:something with:aParameter from:changedObject |
|
424 |
||
425 |
"Created: / 10.2.2000 / 13:46:38 / cg" |
|
426 |
"Modified: / 10.2.2000 / 13:48:18 / cg" |
|
427 |
! ! |
|
428 |
||
7297 | 429 |
!InspectorView methodsFor:'drag & drop'! |
430 |
||
431 |
getDisplayObjects |
|
432 |
||
433 |
^List with:self selection printString |
|
434 |
||
435 |
"Created: / 16-08-2005 / 21:54:52 / janfrog" |
|
436 |
"Modified: / 18-09-2006 / 21:11:16 / cg" |
|
437 |
! |
|
438 |
||
439 |
getDropObjects |
|
440 |
||
441 |
^List with:(DropObject new:self selection). |
|
442 |
||
443 |
"Created: / 16-08-2005 / 21:49:23 / janfrog" |
|
444 |
"Modified: / 18-09-2006 / 21:11:31 / cg" |
|
445 |
! ! |
|
446 |
||
8025 | 447 |
!InspectorView methodsFor:'event handling'! |
448 |
||
449 |
keyPress:key x:x y:y |
|
450 |
"handle special keys" |
|
451 |
||
452 |
<resource: #keyboard (#BrowseIt #InspectIt)> |
|
453 |
||
454 |
self selection notNil ifTrue:[ |
|
455 |
(key == #BrowseIt) ifTrue:[ |
|
456 |
self browse. |
|
457 |
^ self. |
|
458 |
]. |
|
459 |
(key == #InspectIt) ifTrue:[ |
|
460 |
self doInspect. |
|
461 |
^ self. |
|
462 |
]. |
|
463 |
]. |
|
464 |
||
465 |
"all my other input is passed on to the workspace-field" |
|
466 |
x notNil ifTrue:[ |
|
467 |
"/ not already delegated |
|
468 |
workspace keyPress:key x:-1 y:-1 |
|
469 |
]. |
|
470 |
! ! |
|
471 |
||
2587
b6838cdb1f14
added show-stream-contents menu item
Claus Gittinger <cg@exept.de>
parents:
2580
diff
changeset
|
472 |
!InspectorView methodsFor:'initialization & release'! |
2117 | 473 |
|
474 |
destroy |
|
7867 | 475 |
(self topView objectAttributeAt:#rememberExtent) == true ifTrue:[ |
476 |
self class rememberLastExtent:(self topView extent). |
|
477 |
]. |
|
478 |
||
2235
ce49947e61f7
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
2193
diff
changeset
|
479 |
inspectedObject := object := nil. |
2117 | 480 |
monitorProcess notNil ifTrue:[ |
2235
ce49947e61f7
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
2193
diff
changeset
|
481 |
monitorProcess terminate |
2117 | 482 |
]. |
483 |
super destroy |
|
7867 | 484 |
|
485 |
"Modified: / 23-10-2007 / 19:11:04 / cg" |
|
2117 | 486 |
! |
73 | 487 |
|
488 |
initialize |
|
644
aab7d4f7c8c3
allow hiding self; added a label
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
489 |
|v panel helpView labelView2| |
73 | 490 |
|
491 |
super initialize. |
|
492 |
||
3318
46c3347385f4
preps to allow for displayString message to be configured
Claus Gittinger <cg@exept.de>
parents:
3199
diff
changeset
|
493 |
displayStringMessage := #displayString. |
644
aab7d4f7c8c3
allow hiding self; added a label
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
494 |
hideReceiver := false. |
1634
216a4254e634
added 'hex integers' toggle to menu.
Claus Gittinger <cg@exept.de>
parents:
1597
diff
changeset
|
495 |
showHex := false. |
2007 | 496 |
allowFollow := false. |
2008
52bf8b8afd3b
separated allowFollow from isStandAlone flag
Claus Gittinger <cg@exept.de>
parents:
2007
diff
changeset
|
497 |
isStandaloneInspector := false. |
644
aab7d4f7c8c3
allow hiding self; added a label
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
498 |
|
73 | 499 |
panel := VariableHorizontalPanel |
1991
dfbb30988edd
no miniScrollers; no autoHide
Claus Gittinger <cg@exept.de>
parents:
1930
diff
changeset
|
500 |
origin:(0.0 @ 0.0) |
dfbb30988edd
no miniScrollers; no autoHide
Claus Gittinger <cg@exept.de>
parents:
1930
diff
changeset
|
501 |
corner:(1.0 @ 1.0) |
dfbb30988edd
no miniScrollers; no autoHide
Claus Gittinger <cg@exept.de>
parents:
1930
diff
changeset
|
502 |
in:self. |
644
aab7d4f7c8c3
allow hiding self; added a label
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
503 |
|
aab7d4f7c8c3
allow hiding self; added a label
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
504 |
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
|
505 |
helpView level:0; borderWidth:0. |
aab7d4f7c8c3
allow hiding self; added a label
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
506 |
|
aab7d4f7c8c3
allow hiding self; added a label
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
507 |
labelView := Label origin:0.0@0.0 corner:1.0@0.0 in:helpView. |
647 | 508 |
labelView label:(self defaultLabel). |
8159
f67ba8a288cd
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
8155
diff
changeset
|
509 |
labelView bottomInset:(labelView preferredHeight negated). |
73 | 510 |
|
511 |
v := HVScrollableView |
|
1991
dfbb30988edd
no miniScrollers; no autoHide
Claus Gittinger <cg@exept.de>
parents:
1930
diff
changeset
|
512 |
for:SelectionInListView |
dfbb30988edd
no miniScrollers; no autoHide
Claus Gittinger <cg@exept.de>
parents:
1930
diff
changeset
|
513 |
miniScrollerH:true |
dfbb30988edd
no miniScrollers; no autoHide
Claus Gittinger <cg@exept.de>
parents:
1930
diff
changeset
|
514 |
miniScrollerV:false |
dfbb30988edd
no miniScrollers; no autoHide
Claus Gittinger <cg@exept.de>
parents:
1930
diff
changeset
|
515 |
in:helpView. |
dfbb30988edd
no miniScrollers; no autoHide
Claus Gittinger <cg@exept.de>
parents:
1930
diff
changeset
|
516 |
"/ v autoHideScrollBars:true. |
644
aab7d4f7c8c3
allow hiding self; added a label
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
517 |
v origin:(0.0 @ 0.0) corner:(1.0 @ 1.0). |
8159
f67ba8a288cd
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
8155
diff
changeset
|
518 |
v topInset:(labelView preferredHeight). |
73 | 519 |
|
520 |
listView := v scrolledView. |
|
8653 | 521 |
listView action:[:lineNr | self selection:lineNr.]. |
73 | 522 |
listView doubleClickAction:[:lineNr | self doInspect]. |
523 |
listView ignoreReselect:false. |
|
98 | 524 |
listView menuHolder:self; menuPerformer:self; menuMessage:#fieldMenu. |
7297 | 525 |
self initializeDragAndDrop. |
73 | 526 |
|
644
aab7d4f7c8c3
allow hiding self; added a label
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
527 |
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
|
528 |
helpView level:0; borderWidth:0. |
aab7d4f7c8c3
allow hiding self; added a label
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
529 |
|
aab7d4f7c8c3
allow hiding self; added a label
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
530 |
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
|
531 |
labelView2 label:''. |
8159
f67ba8a288cd
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
8155
diff
changeset
|
532 |
labelView2 bottomInset:(labelView preferredHeight negated). |
644
aab7d4f7c8c3
allow hiding self; added a label
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
533 |
|
73 | 534 |
v := HVScrollableView |
1991
dfbb30988edd
no miniScrollers; no autoHide
Claus Gittinger <cg@exept.de>
parents:
1930
diff
changeset
|
535 |
for:CodeView |
dfbb30988edd
no miniScrollers; no autoHide
Claus Gittinger <cg@exept.de>
parents:
1930
diff
changeset
|
536 |
miniScrollerH:true |
dfbb30988edd
no miniScrollers; no autoHide
Claus Gittinger <cg@exept.de>
parents:
1930
diff
changeset
|
537 |
miniScrollerV:false |
dfbb30988edd
no miniScrollers; no autoHide
Claus Gittinger <cg@exept.de>
parents:
1930
diff
changeset
|
538 |
in:helpView. |
dfbb30988edd
no miniScrollers; no autoHide
Claus Gittinger <cg@exept.de>
parents:
1930
diff
changeset
|
539 |
"/ v autoHideScrollBars:true. |
644
aab7d4f7c8c3
allow hiding self; added a label
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
540 |
v origin:(0.0 @ 0.0) corner:(1.0 @ 1.0). |
8159
f67ba8a288cd
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
8155
diff
changeset
|
541 |
v topInset:(labelView2 preferredHeight). |
73 | 542 |
workspace := v scrolledView. |
543 |
||
3608 | 544 |
self setAcceptAction. |
73 | 545 |
|
546 |
nShown := 100. |
|
547 |
hasMore := false. |
|
644
aab7d4f7c8c3
allow hiding self; added a label
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
548 |
|
7297 | 549 |
"Modified: / 16-08-2005 / 21:54:04 / janfrog" |
550 |
"Modified: / 18-09-2006 / 21:12:42 / cg" |
|
551 |
! |
|
552 |
||
553 |
initializeDragAndDrop |
|
554 |
||
555 |
| source | |
|
556 |
source := DropSource |
|
557 |
receiver:self |
|
558 |
argument:nil |
|
559 |
dropObjectSelector:#getDropObjects |
|
560 |
displayObjectSelector:#getDisplayObjects |
|
561 |
dropFeedBackSelector:nil. |
|
562 |
||
563 |
listView dropSource:source. |
|
564 |
||
565 |
"Created: / 16-08-2005 / 21:51:43 / janfrog" |
|
566 |
"Modified: / 18-09-2006 / 21:13:05 / cg" |
|
200 | 567 |
! |
568 |
||
593 | 569 |
realize |
570 |
"delayed setup of lists till first map-time - |
|
200 | 571 |
this makes startup of inspectors a bit faster" |
572 |
||
573 |
|o| |
|
574 |
||
593 | 575 |
super realize. |
7887
be186ae12782
dont clobber the current selection on realize
Claus Gittinger <cg@exept.de>
parents:
7867
diff
changeset
|
576 |
"/ 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
|
577 |
false "inspectedObject notNil" ifTrue:[ |
2235
ce49947e61f7
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
2193
diff
changeset
|
578 |
" |
ce49947e61f7
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
2193
diff
changeset
|
579 |
kludge to trick inspect:, which ignores setting the |
ce49947e61f7
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
2193
diff
changeset
|
580 |
same object again ... |
ce49947e61f7
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
2193
diff
changeset
|
581 |
" |
ce49947e61f7
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
2193
diff
changeset
|
582 |
o := inspectedObject. |
ce49947e61f7
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
2193
diff
changeset
|
583 |
inspectedObject := object := nil. |
ce49947e61f7
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
2193
diff
changeset
|
584 |
self inspect:o |
383 | 585 |
] |
593 | 586 |
|
7887
be186ae12782
dont clobber the current selection on realize
Claus Gittinger <cg@exept.de>
parents:
7867
diff
changeset
|
587 |
"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
|
588 |
"Modified: / 05-11-2007 / 20:11:44 / cg" |
2117 | 589 |
! |
590 |
||
591 |
release |
|
592 |
"release inpected object. This is normally not needed, |
|
593 |
since the garbage collector will find this memory alone. |
|
594 |
However, if some applications keeps invisible inspectors around |
|
595 |
(for example, the debugger does this), the inspected object |
|
596 |
would be kept from being freed or freed very late." |
|
597 |
||
598 |
" |
|
599 |
inspectedObject notNil ifTrue:[ |
|
2235
ce49947e61f7
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
2193
diff
changeset
|
600 |
inspectedObject removeDependent:self |
2117 | 601 |
]. |
602 |
" |
|
2235
ce49947e61f7
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
2193
diff
changeset
|
603 |
inspectedObject := object := nil. |
2117 | 604 |
self setDoItAction. "/ to release ref to inspectedObject in doItBlock |
605 |
workspace contents:nil. |
|
606 |
listView contents:nil. |
|
607 |
||
608 |
super release. |
|
609 |
||
610 |
"Modified: 11.6.1997 / 13:20:39 / cg" |
|
8452 | 611 |
! |
612 |
||
613 |
setInitialSelection |
|
8868
1fd94adeda59
changed: #setInitialSelection
Claus Gittinger <cg@exept.de>
parents:
8800
diff
changeset
|
614 |
object isLazyValue ifFalse:[ |
1fd94adeda59
changed: #setInitialSelection
Claus Gittinger <cg@exept.de>
parents:
8800
diff
changeset
|
615 |
object isString ifTrue:[ |
1fd94adeda59
changed: #setInitialSelection
Claus Gittinger <cg@exept.de>
parents:
8800
diff
changeset
|
616 |
self showSelection:1 "/ the self-line |
1fd94adeda59
changed: #setInitialSelection
Claus Gittinger <cg@exept.de>
parents:
8800
diff
changeset
|
617 |
] |
8452 | 618 |
]. |
98 | 619 |
! ! |
620 |
||
621 |
!InspectorView methodsFor:'menu'! |
|
73 | 622 |
|
623 |
fieldMenu |
|
1040 | 624 |
"return the menu for the field-list" |
625 |
||
1235
13610578a5d2
resource flag: #menu -> #programMenu
Claus Gittinger <cg@exept.de>
parents:
1185
diff
changeset
|
626 |
<resource: #programMenu> |
1040 | 627 |
|
3526 | 628 |
|items m sel| |
1597
48629e1fc7b6
use new menu-creation message in PopUpMenu.
Claus Gittinger <cg@exept.de>
parents:
1570
diff
changeset
|
629 |
|
48629e1fc7b6
use new menu-creation message in PopUpMenu.
Claus Gittinger <cg@exept.de>
parents:
1570
diff
changeset
|
630 |
items := #( |
3198 | 631 |
('Copy Name or Key' #doCopyKey ) |
2085 | 632 |
('-') |
3198 | 633 |
('Inspect' #doInspect ) |
634 |
('BasicInspect' #doBasicInspect ) |
|
4197 | 635 |
('Inspect Hierarchical' #doNewInspect ) |
8800 | 636 |
). |
637 |
items := items , (self optionalViewSelectionItems). |
|
638 |
items := items , #( |
|
7951 | 639 |
('-') |
640 |
('Owners' #showOwners ) |
|
4197 | 641 |
('Ref Chains' #showReferences ) |
2085 | 642 |
('-') |
3198 | 643 |
('Browse' #browse ) |
3199 | 644 |
"/ ('Browse class hierarchy' #browseClassHierarchy ) |
645 |
"/ ('Browse full class protocol' #browseFullClassProtocol) |
|
2579 | 646 |
). |
2587
b6838cdb1f14
added show-stream-contents menu item
Claus Gittinger <cg@exept.de>
parents:
2580
diff
changeset
|
647 |
|
b6838cdb1f14
added show-stream-contents menu item
Claus Gittinger <cg@exept.de>
parents:
2580
diff
changeset
|
648 |
sel := self selection. |
6491 | 649 |
|
8799 | 650 |
items := items , (self optionalMethodOrBlockSelectionItems). |
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 |
]. |
|
8616 | 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 |
^ #( |
|
8090 | 749 |
('Open FileBrowser' #openFileBrowser) |
750 |
). |
|
7639 | 751 |
]. |
752 |
^ #() |
|
753 |
||
754 |
"Created: / 09-02-2007 / 16:10:30 / cg" |
|
755 |
! |
|
756 |
||
8799 | 757 |
optionalMethodOrBlockSelectionItems |
758 |
|sel items| |
|
759 |
||
760 |
sel := self selection. |
|
761 |
||
762 |
items := #(). |
|
763 |
(sel isBlock or:[sel isContext]) ifTrue:[ |
|
764 |
items := items , #( |
|
765 |
('Browse Blocks Home' #browseHome) |
|
766 |
). |
|
767 |
]. |
|
768 |
(inspectedObject isMethod or:[sel isMethod]) ifTrue:[ |
|
769 |
items := items , #( |
|
770 |
('Browse Methods Class' #browseMethodsClass) |
|
771 |
). |
|
772 |
]. |
|
773 |
(selectionIndex notNil |
|
774 |
and:[(self fieldList at:selectionIndex ifAbsent:nil) = '-dependents']) ifTrue:[ |
|
775 |
items := items , #( |
|
776 |
('Browse Update Methods' #browseUpdateMethods) |
|
777 |
). |
|
778 |
]. |
|
779 |
||
780 |
^ items |
|
781 |
! |
|
782 |
||
7639 | 783 |
optionalStreamSelectionItems |
784 |
|sel| |
|
785 |
||
786 |
sel := self selection. |
|
787 |
||
8090 | 788 |
sel isStream ifTrue:[ |
789 |
sel isFileStream ifTrue:[ |
|
790 |
^ #( |
|
791 |
('Open FileBrowser' #openFileBrowser) |
|
792 |
). |
|
793 |
]. |
|
794 |
sel isExternalStream not ifTrue:[ |
|
795 |
^ #( |
|
7639 | 796 |
('Show Stream Contents' #showStreamContents) |
797 |
). |
|
8090 | 798 |
]. |
7639 | 799 |
]. |
800 |
^ #() |
|
801 |
||
802 |
"Created: / 09-02-2007 / 16:09:15 / cg" |
|
8799 | 803 |
! |
804 |
||
805 |
optionalViewSelectionItems |
|
806 |
|sel| |
|
807 |
||
808 |
sel := self selection. |
|
809 |
||
810 |
sel isView ifTrue:[ |
|
811 |
^ #( |
|
812 |
('Show Widget Hierarchy' #openWidgetHierarchy) |
|
813 |
). |
|
814 |
]. |
|
815 |
^ #() |
|
472
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
816 |
! ! |
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
817 |
|
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
818 |
!InspectorView methodsFor:'menu actions'! |
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
819 |
|
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
820 |
browse |
2235
ce49947e61f7
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
2193
diff
changeset
|
821 |
|cls| |
527 | 822 |
|
8025 | 823 |
cls := (self selection ? object) class. |
527 | 824 |
cls browserClass openInClass:cls selector:nil |
825 |
||
1930 | 826 |
"Created: / 14.12.1995 / 19:15:50 / cg" |
827 |
"Modified: / 14.10.1998 / 15:32:10 / cg" |
|
527 | 828 |
! |
829 |
||
830 |
browseClass |
|
2235
ce49947e61f7
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
2193
diff
changeset
|
831 |
|cls| |
472
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
832 |
|
8025 | 833 |
cls := (self selection ? object) class. |
527 | 834 |
cls browserClass browseClass:cls |
472
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
835 |
|
527 | 836 |
"Modified: 3.5.1996 / 12:39:32 / cg" |
472
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
837 |
! |
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
838 |
|
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
839 |
browseClassHierarchy |
2235
ce49947e61f7
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
2193
diff
changeset
|
840 |
|cls| |
472
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
841 |
|
8025 | 842 |
cls := (self selection ? object) class. |
527 | 843 |
cls browserClass browseClassHierarchy:cls |
844 |
||
845 |
"Modified: 3.5.1996 / 12:40:04 / cg" |
|
472
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
846 |
! |
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
847 |
|
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
848 |
browseFullClassProtocol |
2235
ce49947e61f7
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
2193
diff
changeset
|
849 |
|cls| |
472
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
850 |
|
8025 | 851 |
cls := (self selection ? object) class. |
527 | 852 |
cls browserClass browseFullClassProtocol:cls |
853 |
||
854 |
"Modified: 3.5.1996 / 12:40:17 / cg" |
|
472
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
855 |
! |
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
856 |
|
2579 | 857 |
browseHome |
858 |
|sel mthd| |
|
859 |
||
8025 | 860 |
sel := self selection ? object. |
2579 | 861 |
sel isBlock ifTrue:[ |
862 |
mthd := sel homeMethod |
|
863 |
] ifFalse:[ |
|
864 |
sel isContext ifTrue:[ |
|
865 |
mthd := sel method. |
|
866 |
] |
|
867 |
]. |
|
868 |
mthd isNil ifTrue:[ |
|
869 |
^ self warn:'Sorry - cannot figure out home method.' |
|
870 |
]. |
|
871 |
mthd class browserClass |
|
872 |
openInClass:mthd mclass selector:mthd selector |
|
873 |
! |
|
874 |
||
4197 | 875 |
browseMethodsClass |
876 |
|mthd| |
|
877 |
||
878 |
mthd := self selection. |
|
879 |
mthd mclass browserClass |
|
880 |
openInClass:mthd mclass selector:mthd selector |
|
881 |
! |
|
882 |
||
7975 | 883 |
browseUpdateMethods |
884 |
|deps methods| |
|
885 |
||
886 |
deps := self selection. |
|
887 |
methods := Set new. |
|
888 |
deps do:[:each | |
|
889 |
|implClass| |
|
890 |
||
891 |
implClass := each class whichClassImplements:#'update:with:from:'. |
|
892 |
implClass notNil ifTrue:[ |
|
893 |
methods add:(implClass compiledMethodAt:#'update:with:from:') |
|
894 |
] |
|
895 |
]. |
|
896 |
methods isEmpty ifTrue:[^ self]. |
|
897 |
||
898 |
methods first mclass browserClass |
|
899 |
browseMethods:methods |
|
900 |
title:'Update Method(s) of dependent(s)' |
|
901 |
! |
|
902 |
||
1895
8b51d61d9c0a
added follow & back menu items.
Claus Gittinger <cg@exept.de>
parents:
1873
diff
changeset
|
903 |
doBack |
8b51d61d9c0a
added follow & back menu items.
Claus Gittinger <cg@exept.de>
parents:
1873
diff
changeset
|
904 |
"user selected back-menu entry" |
8b51d61d9c0a
added follow & back menu items.
Claus Gittinger <cg@exept.de>
parents:
1873
diff
changeset
|
905 |
|
8b51d61d9c0a
added follow & back menu items.
Claus Gittinger <cg@exept.de>
parents:
1873
diff
changeset
|
906 |
|objectToInspect| |
8b51d61d9c0a
added follow & back menu items.
Claus Gittinger <cg@exept.de>
parents:
1873
diff
changeset
|
907 |
|
8b51d61d9c0a
added follow & back menu items.
Claus Gittinger <cg@exept.de>
parents:
1873
diff
changeset
|
908 |
inspectHistory size > 0 ifTrue:[ |
6851 | 909 |
objectToInspect := inspectHistory removeLast. |
910 |
inspectHistory size == 0 ifTrue:[ |
|
911 |
inspectHistory := nil |
|
912 |
]. |
|
913 |
self inspect:objectToInspect. |
|
1895
8b51d61d9c0a
added follow & back menu items.
Claus Gittinger <cg@exept.de>
parents:
1873
diff
changeset
|
914 |
] |
8b51d61d9c0a
added follow & back menu items.
Claus Gittinger <cg@exept.de>
parents:
1873
diff
changeset
|
915 |
|
8b51d61d9c0a
added follow & back menu items.
Claus Gittinger <cg@exept.de>
parents:
1873
diff
changeset
|
916 |
"Created: / 22.9.1998 / 18:22:01 / cg" |
8b51d61d9c0a
added follow & back menu items.
Claus Gittinger <cg@exept.de>
parents:
1873
diff
changeset
|
917 |
"Modified: / 22.9.1998 / 18:22:28 / cg" |
8b51d61d9c0a
added follow & back menu items.
Claus Gittinger <cg@exept.de>
parents:
1873
diff
changeset
|
918 |
! |
8b51d61d9c0a
added follow & back menu items.
Claus Gittinger <cg@exept.de>
parents:
1873
diff
changeset
|
919 |
|
1930 | 920 |
doBasicInspect |
921 |
"user selected inspect-menu entry" |
|
922 |
||
923 |
self doInspect:true |
|
924 |
! |
|
925 |
||
1895
8b51d61d9c0a
added follow & back menu items.
Claus Gittinger <cg@exept.de>
parents:
1873
diff
changeset
|
926 |
doFollow |
8b51d61d9c0a
added follow & back menu items.
Claus Gittinger <cg@exept.de>
parents:
1873
diff
changeset
|
927 |
"user selected follow-menu entry" |
8b51d61d9c0a
added follow & back menu items.
Claus Gittinger <cg@exept.de>
parents:
1873
diff
changeset
|
928 |
|
8b51d61d9c0a
added follow & back menu items.
Claus Gittinger <cg@exept.de>
parents:
1873
diff
changeset
|
929 |
|objectToInspect| |
8b51d61d9c0a
added follow & back menu items.
Claus Gittinger <cg@exept.de>
parents:
1873
diff
changeset
|
930 |
|
2235
ce49947e61f7
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
2193
diff
changeset
|
931 |
selectionIndex notNil ifTrue:[ |
ce49947e61f7
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
2193
diff
changeset
|
932 |
objectToInspect := self selection. |
ce49947e61f7
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
2193
diff
changeset
|
933 |
inspectHistory isNil ifTrue:[ |
ce49947e61f7
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
2193
diff
changeset
|
934 |
inspectHistory := OrderedCollection new |
ce49947e61f7
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
2193
diff
changeset
|
935 |
]. |
ce49947e61f7
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
2193
diff
changeset
|
936 |
inspectHistory addLast:inspectedObject. |
ce49947e61f7
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
2193
diff
changeset
|
937 |
self inspect:objectToInspect. |
1895
8b51d61d9c0a
added follow & back menu items.
Claus Gittinger <cg@exept.de>
parents:
1873
diff
changeset
|
938 |
] |
8b51d61d9c0a
added follow & back menu items.
Claus Gittinger <cg@exept.de>
parents:
1873
diff
changeset
|
939 |
|
8b51d61d9c0a
added follow & back menu items.
Claus Gittinger <cg@exept.de>
parents:
1873
diff
changeset
|
940 |
"Created: / 22.9.1998 / 18:21:08 / cg" |
8b51d61d9c0a
added follow & back menu items.
Claus Gittinger <cg@exept.de>
parents:
1873
diff
changeset
|
941 |
"Modified: / 22.9.1998 / 18:22:23 / cg" |
8b51d61d9c0a
added follow & back menu items.
Claus Gittinger <cg@exept.de>
parents:
1873
diff
changeset
|
942 |
! |
8b51d61d9c0a
added follow & back menu items.
Claus Gittinger <cg@exept.de>
parents:
1873
diff
changeset
|
943 |
|
472
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
944 |
doInspect |
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
945 |
"user selected inspect-menu entry" |
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
946 |
|
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
947 |
self doInspect:false |
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
948 |
! |
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
949 |
|
1365 | 950 |
doNewInspect |
951 |
self doInspect:#new |
|
952 |
||
953 |
"Created: / 31.10.1997 / 12:45:38 / cg" |
|
954 |
"Modified: / 31.10.1997 / 12:47:11 / cg" |
|
955 |
! |
|
956 |
||
472
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
957 |
doStartMonitor |
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
958 |
"start a monitoring process" |
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
959 |
|
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
960 |
monitorProcess isNil ifTrue:[ |
2235
ce49947e61f7
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
2193
diff
changeset
|
961 |
monitorProcess := |
ce49947e61f7
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
2193
diff
changeset
|
962 |
[ |
ce49947e61f7
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
2193
diff
changeset
|
963 |
|sel| |
295
92bcaa9996ae
minor changes for ContextInspector required
Claus Gittinger <cg@exept.de>
parents:
268
diff
changeset
|
964 |
|
2235
ce49947e61f7
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
2193
diff
changeset
|
965 |
[true] whileTrue:[ |
ce49947e61f7
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
2193
diff
changeset
|
966 |
(sel := selectionIndex) notNil ifTrue:[ |
ce49947e61f7
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
2193
diff
changeset
|
967 |
self showSelection:sel |
ce49947e61f7
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
2193
diff
changeset
|
968 |
]. |
ce49947e61f7
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
2193
diff
changeset
|
969 |
(Delay forSeconds:0.5) wait |
ce49947e61f7
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
2193
diff
changeset
|
970 |
] |
ce49947e61f7
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
2193
diff
changeset
|
971 |
] forkAt:Processor userBackgroundPriority |
472
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 |
|
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
974 |
"Modified: 12.4.1996 / 14:20:06 / cg" |
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
975 |
! |
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
976 |
|
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
977 |
doStopMonitor |
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
978 |
"stop the monitor" |
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
979 |
|
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
980 |
monitorProcess terminate. |
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
981 |
monitorProcess := nil |
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
982 |
! |
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
983 |
|
2800 | 984 |
doTraceAll |
472
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
985 |
"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
|
986 |
|
1597
48629e1fc7b6
use new menu-creation message in PopUpMenu.
Claus Gittinger <cg@exept.de>
parents:
1570
diff
changeset
|
987 |
self topView withWaitCursorDo:[MessageTracer traceAll:inspectedObject on:Transcript] |
472
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
988 |
! |
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
989 |
|
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
990 |
doTrap |
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
991 |
"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
|
992 |
|
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
993 |
|string selector| |
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
994 |
|
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
995 |
string := Dialog request:'Selector to trap on:' onCancel:nil. |
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
996 |
|
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
997 |
string notNil ifTrue:[ |
6851 | 998 |
selector := string asSymbolIfInterned. |
901 | 999 |
|
6851 | 1000 |
selector isNil ifTrue:[ |
1001 |
self warn:'no such selector' |
|
1002 |
] ifFalse:[ |
|
1003 |
self topView withWaitCursorDo:[MessageTracer trap:inspectedObject |
|
1004 |
selector:selector] |
|
1005 |
] |
|
472
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
1006 |
] |
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
1007 |
|
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
1008 |
"Modified: 12.4.1996 / 14:07:01 / cg" |
901 | 1009 |
|
1010 |
||
472
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
1011 |
! |
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
1012 |
|
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
1013 |
doTrapAll |
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
1014 |
"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
|
1015 |
|
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
1016 |
self topView withWaitCursorDo:[MessageTracer trapAll:inspectedObject] |
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
1017 |
! |
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
1018 |
|
2850 | 1019 |
doTrapAnyInstVarChange |
1020 |
"place a trap which is triggered if any instVar of the inspected object is changed" |
|
1021 |
||
1022 |
self topView withWaitCursorDo:[ |
|
1023 |
MessageTracer trapModificationsIn:inspectedObject |
|
1024 |
] |
|
1025 |
! |
|
1026 |
||
1027 |
doTrapInstVarChange |
|
1028 |
"place a trap which is triggered if the selected instVar of the inspected object is changed" |
|
1029 |
||
1030 |
self topView withWaitCursorDo:[ |
|
1031 |
|idx| |
|
1032 |
||
1033 |
"/ a named instVar ? |
|
1034 |
idx := self instVarIndexForLine:selectionIndex. |
|
1035 |
idx isNil ifTrue:[ |
|
1036 |
self warn:'select an instance variable first.'. |
|
1037 |
^ self. |
|
1038 |
]. |
|
1039 |
MessageTracer |
|
1040 |
trapModificationsOf:(inspectedObject class allInstVarNames at:idx) |
|
1041 |
in:inspectedObject |
|
1042 |
] |
|
1043 |
! |
|
1044 |
||
472
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
1045 |
doUntrace |
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
1046 |
"remove traps/traces" |
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
1047 |
|
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
1048 |
MessageTracer untrace:inspectedObject |
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
1049 |
! |
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
1050 |
|
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
1051 |
inspectOwners |
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
1052 |
"open an inspector on owners of the inspectedObject. |
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
1053 |
(this is a secret function)" |
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
1054 |
|
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
1055 |
self withCursor:(Cursor questionMark) do:[ |
6851 | 1056 |
|owners dict| |
472
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
1057 |
|
6851 | 1058 |
owners := (ObjectMemory whoReferences:inspectedObject) asOrderedCollection. |
1059 |
owners size > 500 ifTrue:[ |
|
1060 |
(self confirm:'there are ' , owners size printString , ' owners.\\Do you really want to see them all ?' withCRs) |
|
1061 |
ifFalse:[^ self] |
|
1062 |
]. |
|
1063 |
dict := IdentityDictionary new. |
|
1064 |
owners do:[:owner | |
|
1065 |
|set names oClass| |
|
472
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
1066 |
|
6851 | 1067 |
owner ~~ self ifTrue:[ |
1068 |
set := Set new. |
|
1069 |
names := owner class allInstVarNames. |
|
1070 |
oClass := owner class. |
|
1071 |
1 to:oClass instSize do:[:i | |
|
1072 |
(owner instVarAt:i) == inspectedObject ifTrue:[ |
|
1073 |
set add:(names at:i). |
|
1074 |
]. |
|
1075 |
]. |
|
1076 |
oClass isVariable ifTrue:[ |
|
1077 |
oClass isPointers ifTrue:[ |
|
1078 |
1 to:owner basicSize do:[:i | |
|
1079 |
(owner basicAt:i) == inspectedObject ifTrue:[ |
|
1080 |
set add:i |
|
1081 |
] |
|
1082 |
] |
|
1083 |
] |
|
1084 |
]. |
|
1085 |
dict at:owner put:set |
|
1086 |
]. |
|
1087 |
]. |
|
1088 |
dict inspect |
|
472
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
1089 |
] |
2587
b6838cdb1f14
added show-stream-contents menu item
Claus Gittinger <cg@exept.de>
parents:
2580
diff
changeset
|
1090 |
! |
b6838cdb1f14
added show-stream-contents menu item
Claus Gittinger <cg@exept.de>
parents:
2580
diff
changeset
|
1091 |
|
6283
7fa17d36a91c
+openFileBrowser (when inspeting a filename)
Claus Gittinger <cg@exept.de>
parents:
6130
diff
changeset
|
1092 |
openFileBrowser |
7fa17d36a91c
+openFileBrowser (when inspeting a filename)
Claus Gittinger <cg@exept.de>
parents:
6130
diff
changeset
|
1093 |
|fn| |
7fa17d36a91c
+openFileBrowser (when inspeting a filename)
Claus Gittinger <cg@exept.de>
parents:
6130
diff
changeset
|
1094 |
|
7fa17d36a91c
+openFileBrowser (when inspeting a filename)
Claus Gittinger <cg@exept.de>
parents:
6130
diff
changeset
|
1095 |
fn := self selection. |
8155 | 1096 |
fn isStream ifTrue:[ |
1097 |
fn := fn pathName asFilename |
|
1098 |
]. |
|
6283
7fa17d36a91c
+openFileBrowser (when inspeting a filename)
Claus Gittinger <cg@exept.de>
parents:
6130
diff
changeset
|
1099 |
(UserPreferences current fileBrowserClass) openOnFileNamed:fn. |
7fa17d36a91c
+openFileBrowser (when inspeting a filename)
Claus Gittinger <cg@exept.de>
parents:
6130
diff
changeset
|
1100 |
! |
7fa17d36a91c
+openFileBrowser (when inspeting a filename)
Claus Gittinger <cg@exept.de>
parents:
6130
diff
changeset
|
1101 |
|
8799 | 1102 |
openWidgetHierarchy |
1103 |
|view| |
|
1104 |
||
1105 |
view := self selection. |
|
1106 |
view isView ifFalse:[^ self]. |
|
1107 |
||
1108 |
WindowTreeView openOn:view |
|
1109 |
! |
|
1110 |
||
7951 | 1111 |
showOwners |
1112 |
|o| |
|
1113 |
||
1114 |
o := self selection. |
|
1115 |
self withCursor:(Cursor questionMark) do:[ |
|
1116 |
|owners dict| |
|
1117 |
||
1118 |
owners := (ObjectMemory whoReferences:o). |
|
1119 |
owners isEmptyOrNil ifTrue:[ |
|
1120 |
self information:'No owners found.'. |
|
1121 |
^ self |
|
1122 |
]. |
|
1123 |
owners := owners asOrderedCollection. |
|
1124 |
" |
|
1125 |
skip weakArrays ... (they dont count) |
|
1126 |
" |
|
1127 |
owners := owners reject:[:owner | owner isMemberOf:WeakArray]. |
|
1128 |
owners inspect. |
|
1129 |
"/ inspector := DictionaryInspectorView openOn:dict. |
|
1130 |
"/ inspector listView doubleClickAction:[:lineNr | inspector doInspectKey]. |
|
1131 |
] |
|
1132 |
||
1133 |
"Modified: 15.10.1996 / 22:09:38 / cg" |
|
1134 |
! |
|
1135 |
||
1136 |
showReferences |
|
1137 |
"user selected references-menu entry" |
|
1138 |
||
1139 |
self selection class hasImmediateInstances ifTrue:[ |
|
1140 |
^ self warn:'Sorry - cannot show references to immediate objects' |
|
1141 |
]. |
|
1142 |
ObjectMemory displayRefChainTo:(self selection) |
|
1143 |
||
1144 |
"Modified: / 30.7.1998 / 14:03:16 / cg" |
|
1145 |
! |
|
1146 |
||
2587
b6838cdb1f14
added show-stream-contents menu item
Claus Gittinger <cg@exept.de>
parents:
2580
diff
changeset
|
1147 |
showStreamContents |
b6838cdb1f14
added show-stream-contents menu item
Claus Gittinger <cg@exept.de>
parents:
2580
diff
changeset
|
1148 |
|sel| |
b6838cdb1f14
added show-stream-contents menu item
Claus Gittinger <cg@exept.de>
parents:
2580
diff
changeset
|
1149 |
|
b6838cdb1f14
added show-stream-contents menu item
Claus Gittinger <cg@exept.de>
parents:
2580
diff
changeset
|
1150 |
sel := self selection. |
b6838cdb1f14
added show-stream-contents menu item
Claus Gittinger <cg@exept.de>
parents:
2580
diff
changeset
|
1151 |
(sel isStream and:[sel isExternalStream not]) ifTrue:[ |
b6838cdb1f14
added show-stream-contents menu item
Claus Gittinger <cg@exept.de>
parents:
2580
diff
changeset
|
1152 |
workspace replace:(sel contents printString) |
b6838cdb1f14
added show-stream-contents menu item
Claus Gittinger <cg@exept.de>
parents:
2580
diff
changeset
|
1153 |
]. |
b6838cdb1f14
added show-stream-contents menu item
Claus Gittinger <cg@exept.de>
parents:
2580
diff
changeset
|
1154 |
|
b6838cdb1f14
added show-stream-contents menu item
Claus Gittinger <cg@exept.de>
parents:
2580
diff
changeset
|
1155 |
"Created: / 6.2.2000 / 13:46:37 / cg" |
b6838cdb1f14
added show-stream-contents menu item
Claus Gittinger <cg@exept.de>
parents:
2580
diff
changeset
|
1156 |
"Modified: / 6.2.2000 / 13:47:37 / cg" |
73 | 1157 |
! ! |
1158 |
||
200 | 1159 |
!InspectorView methodsFor:'private'! |
1160 |
||
2271
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
1161 |
baseInspectedObjectClass |
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
1162 |
^ Object |
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
1163 |
|
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
1164 |
|
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
1165 |
! |
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
1166 |
|
647 | 1167 |
defaultLabel |
4095
5bd36b14723d
labels; added suppressPseudoVars & dereferenceValueHolders
Claus Gittinger <cg@exept.de>
parents:
3884
diff
changeset
|
1168 |
^ 'InstVars' |
647 | 1169 |
|
1170 |
"Modified: 28.6.1996 / 16:04:53 / cg" |
|
1171 |
! |
|
1172 |
||
6850 | 1173 |
derivedFieldNames |
7297 | 1174 |
|d| |
1175 |
||
1176 |
d := self derivedFields. |
|
1177 |
(d isKindOf:Dictionary) ifTrue:[ |
|
8699 | 1178 |
^ d keys asSortedCollection |
1179 |
collect:[:k | |
|
1180 |
(k startsWith:'-') |
|
1181 |
ifTrue:[ '-',(k copyFrom:2) allItalic] |
|
1182 |
ifFalse:[k] ]. |
|
7297 | 1183 |
]. |
1184 |
^ d collect:[:eachEntry | |
|
6850 | 1185 |
|nm| |
1186 |
||
1187 |
nm := (eachEntry isAssociation) |
|
1188 |
ifTrue:[ eachEntry key ] |
|
1189 |
ifFalse:[ eachEntry first ]. |
|
8699 | 1190 |
'-',nm allItalic |
6850 | 1191 |
] |
1192 |
||
1193 |
"Created: / 03-08-2006 / 15:02:54 / cg" |
|
7297 | 1194 |
"Modified: / 18-09-2006 / 21:18:57 / cg" |
6850 | 1195 |
! |
1196 |
||
6823 | 1197 |
derivedFields |
7054 | 1198 |
"the check below is not sufficient - if someone catches messages, for example. |
1199 |
Therefore, we do a manual lookup here:" |
|
1200 |
(object class whichClassImplements:#inspectorExtraAttributes) isNil ifTrue:[ |
|
1201 |
^ #() |
|
1202 |
]. |
|
6823 | 1203 |
^ [object inspectorExtraAttributes] |
1204 |
on: MessageNotUnderstood |
|
6850 | 1205 |
do: [:ex | ex return: #() ] |
6823 | 1206 |
|
1207 |
"Created: / 17-07-2006 / 11:02:32 / cg" |
|
7054 | 1208 |
"Modified: / 29-08-2006 / 13:03:31 / cg" |
6823 | 1209 |
! |
1210 |
||
6850 | 1211 |
extraNamedFieldNames |
1212 |
^ self extraNamedFields |
|
1213 |
collect:[:eachEntry | |
|
1214 |
|nm| |
|
1215 |
||
1216 |
nm := (eachEntry isAssociation) |
|
1217 |
ifTrue:[ eachEntry key ] |
|
1218 |
ifFalse:[ eachEntry first ]. |
|
1219 |
'`',nm |
|
1220 |
] |
|
1221 |
||
1222 |
"Modified: / 03-08-2006 / 15:17:19 / cg" |
|
1223 |
! |
|
1224 |
||
1225 |
extraNamedFields |
|
6940 | 1226 |
"by redefining inspectorExtraNamedFields to return an array of |
1227 |
pseudo-fieldName->value associations, the inspectors left list can be extended" |
|
1228 |
||
7054 | 1229 |
"the check below is not sufficient - if someone catches messages, for example. |
1230 |
Therefore, we do a manual lookup here:" |
|
1231 |
(object class whichClassImplements:#inspectorExtraNamedFields) isNil ifTrue:[ |
|
1232 |
^ #() |
|
1233 |
]. |
|
6850 | 1234 |
^ [object inspectorExtraNamedFields] |
1235 |
on: MessageNotUnderstood |
|
6940 | 1236 |
do: [:ex | ex return: #() ] |
6850 | 1237 |
|
1238 |
"Created: / 03-08-2006 / 13:34:18 / cg" |
|
7054 | 1239 |
"Modified: / 29-08-2006 / 13:03:57 / cg" |
6850 | 1240 |
! |
1241 |
||
1242 |
extraNamedVarIndexForLine:lineNr |
|
1243 |
"helper - return the index for a named instVar; |
|
1244 |
nil, if self or a keyed instvar is selected." |
|
1245 |
||
1246 |
|idx nNamedInstvarsShown nExtraNamedInstvarsShown cls baseCls firstRealIndex line| |
|
1247 |
||
1248 |
lineNr isNil ifTrue:[^ nil]. |
|
1249 |
firstRealIndex := 1. |
|
1250 |
||
1251 |
idx := lineNr. |
|
1252 |
self hasSelfEntry ifTrue:[ |
|
1253 |
(lineNr == 1 or:[lineNr isNil]) ifTrue:[ |
|
1254 |
^ nil "/ self selected |
|
1255 |
]. |
|
1256 |
idx := idx - 1. |
|
1257 |
firstRealIndex := 2. |
|
1258 |
]. |
|
1259 |
||
1260 |
[line := listView at:firstRealIndex. |
|
1261 |
(line startsWith:'-') and:[line size < 2 or:[line second isDigit not]]] whileTrue:[ |
|
1262 |
firstRealIndex := firstRealIndex + 1. |
|
1263 |
idx := idx - 1. |
|
1264 |
]. |
|
1265 |
||
1266 |
cls := inspectedObject class. |
|
1267 |
baseCls := self baseInspectedObjectClass. |
|
1268 |
||
1269 |
nNamedInstvarsShown := cls instSize. |
|
1270 |
"/ only the namedInstvars below baseInspectedObjectClass |
|
1271 |
"/ are shown ... |
|
1272 |
(cls == baseCls or:[cls isSubclassOf:baseCls]) ifTrue:[ |
|
1273 |
nNamedInstvarsShown := nNamedInstvarsShown - baseCls instSize. |
|
1274 |
]. |
|
1275 |
||
1276 |
idx := idx - nNamedInstvarsShown. |
|
1277 |
idx < 1 ifTrue:[ |
|
1278 |
^ nil. |
|
1279 |
]. |
|
1280 |
||
1281 |
nExtraNamedInstvarsShown := self extraNamedFields size. |
|
1282 |
idx <= nExtraNamedInstvarsShown ifTrue:[ |
|
1283 |
^ idx. |
|
1284 |
]. |
|
1285 |
||
1286 |
^ nil "/ indexed instvar or other selected |
|
1287 |
||
1288 |
"Created: / 03-08-2006 / 13:45:14 / cg" |
|
1289 |
"Modified: / 04-08-2006 / 11:45:29 / cg" |
|
3874
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1290 |
! |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1291 |
|
200 | 1292 |
fieldList |
1293 |
"return a list of names to show in the selectionList. |
|
1294 |
Leave hasMore as true, if a '...' entry should be added." |
|
1295 |
||
6840 | 1296 |
|derivedFieldList namedFieldList fieldList cls indexedList extraNamedFieldList| |
200 | 1297 |
|
3338 | 1298 |
inspectedObject isNil ifTrue:[ |
4095
5bd36b14723d
labels; added suppressPseudoVars & dereferenceValueHolders
Claus Gittinger <cg@exept.de>
parents:
3884
diff
changeset
|
1299 |
^ self hasSelfEntry ifFalse:[ #() ] ifTrue:[ #('-self') ] |
3338 | 1300 |
]. |
2271
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
1301 |
|
7297 | 1302 |
cls := inspectedObject class. |
1303 |
||
2275 | 1304 |
self topView withWaitCursorDo:[ |
6823 | 1305 |
namedFieldList := self namedFieldList. |
3868 | 1306 |
indexedList := self indexedFieldList. |
6840 | 1307 |
extraNamedFieldList := OrderedCollection new. |
3349 | 1308 |
|
4095
5bd36b14723d
labels; added suppressPseudoVars & dereferenceValueHolders
Claus Gittinger <cg@exept.de>
parents:
3884
diff
changeset
|
1309 |
self hasSelfEntry ifTrue:[ |
5bd36b14723d
labels; added suppressPseudoVars & dereferenceValueHolders
Claus Gittinger <cg@exept.de>
parents:
3884
diff
changeset
|
1310 |
self suppressPseudoSlots ifFalse:[ |
6823 | 1311 |
derivedFieldList := OrderedCollection new. |
8689 | 1312 |
derivedFieldList add:'-' , 'self' asText allItalic. |
8726 | 1313 |
derivedFieldList add:'-' , 'local messages' asText allItalic. |
1314 |
"/ derivedFieldList add:'-' , 'inherited messages' asText allItalic. |
|
1315 |
derivedFieldList add:'-' , 'all messages' asText allItalic. |
|
8689 | 1316 |
derivedFieldList add:'-' , 'hash' asText allItalic. |
1317 |
derivedFieldList add:'-' , 'identityHash' asText allItalic. |
|
6823 | 1318 |
|
1319 |
cls hasImmediateInstances ifFalse:[ |
|
8689 | 1320 |
derivedFieldList add:'-' , 'dependents' asText allItalic. |
4095
5bd36b14723d
labels; added suppressPseudoVars & dereferenceValueHolders
Claus Gittinger <cg@exept.de>
parents:
3884
diff
changeset
|
1321 |
]. |
5bd36b14723d
labels; added suppressPseudoVars & dereferenceValueHolders
Claus Gittinger <cg@exept.de>
parents:
3884
diff
changeset
|
1322 |
cls instSize > 0 ifTrue:[ |
8689 | 1323 |
derivedFieldList add:'-' , 'all inst vars' asText allItalic. |
6823 | 1324 |
]. |
8906 | 1325 |
(indexedList notEmptyOrNil and:[self showAllIndexedVarsInFieldList]) ifTrue:[ |
8689 | 1326 |
derivedFieldList add:'-' , 'all indexed vars' asText allItalic. |
4095
5bd36b14723d
labels; added suppressPseudoVars & dereferenceValueHolders
Claus Gittinger <cg@exept.de>
parents:
3884
diff
changeset
|
1327 |
]. |
6823 | 1328 |
|
6850 | 1329 |
derivedFieldList addAll:(self derivedFieldNames). |
7297 | 1330 |
extraNamedFieldList addAll:(self extraNamedFieldNames). |
3608 | 1331 |
]. |
3525 | 1332 |
]. |
531 | 1333 |
|
6823 | 1334 |
fieldList := OrderedCollection new. |
1335 |
derivedFieldList notNil ifTrue:[fieldList addAll:derivedFieldList]. |
|
1336 |
namedFieldList notNil ifTrue:[fieldList addAll:namedFieldList]. |
|
6840 | 1337 |
extraNamedFieldList notNil ifTrue:[fieldList addAll:extraNamedFieldList]. |
6823 | 1338 |
indexedList notNil ifTrue:[fieldList addAll:indexedList]. |
200 | 1339 |
]. |
6823 | 1340 |
^ fieldList |
531 | 1341 |
|
7297 | 1342 |
"Modified: / 18-09-2006 / 21:16:03 / cg" |
200 | 1343 |
! |
1344 |
||
295
92bcaa9996ae
minor changes for ContextInspector required
Claus Gittinger <cg@exept.de>
parents:
268
diff
changeset
|
1345 |
hasSelfEntry |
4095
5bd36b14723d
labels; added suppressPseudoVars & dereferenceValueHolders
Claus Gittinger <cg@exept.de>
parents:
3884
diff
changeset
|
1346 |
^ hideReceiver not and:[self suppressPseudoSlots not] |
295
92bcaa9996ae
minor changes for ContextInspector required
Claus Gittinger <cg@exept.de>
parents:
268
diff
changeset
|
1347 |
|
92bcaa9996ae
minor changes for ContextInspector required
Claus Gittinger <cg@exept.de>
parents:
268
diff
changeset
|
1348 |
"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
|
1349 |
"Modified: 28.6.1996 / 15:13:41 / cg" |
295
92bcaa9996ae
minor changes for ContextInspector required
Claus Gittinger <cg@exept.de>
parents:
268
diff
changeset
|
1350 |
! |
92bcaa9996ae
minor changes for ContextInspector required
Claus Gittinger <cg@exept.de>
parents:
268
diff
changeset
|
1351 |
|
3874
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1352 |
indexList |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1353 |
"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
|
1354 |
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
|
1355 |
|
3526 | 1356 |
| n cls| |
2271
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
1357 |
|
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
1358 |
cls := inspectedObject class. |
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
1359 |
|
3868 | 1360 |
cls isVariable ifFalse:[^ nil ]. |
2271
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
1361 |
|
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
1362 |
n := inspectedObject basicSize. |
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
1363 |
(n > nShown) ifTrue:[ |
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
1364 |
n := nShown. |
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
1365 |
hasMore := true. |
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
1366 |
]. |
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
1367 |
|
3874
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1368 |
^ (1 to:n) |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1369 |
! |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1370 |
|
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1371 |
indexedFieldList |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1372 |
"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
|
1373 |
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
|
1374 |
|
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1375 |
|l| |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1376 |
|
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1377 |
l := self indexList. |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1378 |
l isNil ifTrue:[^ nil ]. |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1379 |
^ l collect:[:i | i printString]. |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1380 |
! |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1381 |
|
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1382 |
indexedValueAtIndex:idx |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1383 |
^ inspectedObject basicAt:idx |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1384 |
! |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1385 |
|
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1386 |
indexedValueAtIndex:idx put:newValue |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1387 |
inspectedObject basicAt:idx put:newValue |
2271
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
1388 |
! |
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
1389 |
|
3884 | 1390 |
indexedValueAtKey:key |
4314 | 1391 |
"/ kludge |
1392 |
inspectedObject isLimitedPrecisionReal ifTrue:[ |
|
1393 |
^ inspectedObject basicAt:key |
|
1394 |
]. |
|
3884 | 1395 |
^ inspectedObject at:key |
1396 |
! |
|
1397 |
||
2193
3d7b1044e8c8
fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents:
2188
diff
changeset
|
1398 |
instVarIndexForLine:lineNr |
3d7b1044e8c8
fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents:
2188
diff
changeset
|
1399 |
"helper - return the index for a named instVar; |
3d7b1044e8c8
fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents:
2188
diff
changeset
|
1400 |
nil, if self or a keyed instvar is selected." |
3d7b1044e8c8
fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents:
2188
diff
changeset
|
1401 |
|
5421
86a6077b131d
Fix for negative numbers as keys in a Dictionary
Stefan Vogel <sv@exept.de>
parents:
5134
diff
changeset
|
1402 |
|idx nNamedInstvarsShown cls baseCls firstRealIndex line| |
2193
3d7b1044e8c8
fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents:
2188
diff
changeset
|
1403 |
|
3d7b1044e8c8
fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents:
2188
diff
changeset
|
1404 |
lineNr isNil ifTrue:[^ nil]. |
3349 | 1405 |
firstRealIndex := 1. |
2193
3d7b1044e8c8
fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents:
2188
diff
changeset
|
1406 |
|
3d7b1044e8c8
fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents:
2188
diff
changeset
|
1407 |
idx := lineNr. |
4095
5bd36b14723d
labels; added suppressPseudoVars & dereferenceValueHolders
Claus Gittinger <cg@exept.de>
parents:
3884
diff
changeset
|
1408 |
self hasSelfEntry ifTrue:[ |
2193
3d7b1044e8c8
fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents:
2188
diff
changeset
|
1409 |
(lineNr == 1 or:[lineNr isNil]) ifTrue:[ |
3d7b1044e8c8
fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents:
2188
diff
changeset
|
1410 |
^ nil "/ self selected |
3d7b1044e8c8
fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents:
2188
diff
changeset
|
1411 |
]. |
3d7b1044e8c8
fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents:
2188
diff
changeset
|
1412 |
idx := idx - 1. |
3349 | 1413 |
firstRealIndex := 2. |
1414 |
]. |
|
1415 |
||
5421
86a6077b131d
Fix for negative numbers as keys in a Dictionary
Stefan Vogel <sv@exept.de>
parents:
5134
diff
changeset
|
1416 |
[line := listView at:firstRealIndex. |
86a6077b131d
Fix for negative numbers as keys in a Dictionary
Stefan Vogel <sv@exept.de>
parents:
5134
diff
changeset
|
1417 |
(line startsWith:'-') and:[line size < 2 or:[line second isDigit not]]] whileTrue:[ |
3349 | 1418 |
firstRealIndex := firstRealIndex + 1. |
1419 |
idx := idx - 1. |
|
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 |
|
2447 | 1422 |
cls := inspectedObject class. |
1423 |
baseCls := self baseInspectedObjectClass. |
|
1424 |
||
1425 |
nNamedInstvarsShown := cls instSize. |
|
2271
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
1426 |
"/ only the namedInstvars below baseInspectedObjectClass |
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
1427 |
"/ are shown ... |
2447 | 1428 |
(cls == baseCls or:[cls isSubclassOf:baseCls]) ifTrue:[ |
1429 |
nNamedInstvarsShown := nNamedInstvarsShown - baseCls instSize. |
|
1430 |
]. |
|
2271
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
1431 |
|
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
1432 |
idx <= nNamedInstvarsShown ifTrue:[ |
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
1433 |
^ idx + self baseInspectedObjectClass instSize. |
2193
3d7b1044e8c8
fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents:
2188
diff
changeset
|
1434 |
]. |
2271
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
1435 |
^ nil "/ indexed instvar or other selected |
2193
3d7b1044e8c8
fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents:
2188
diff
changeset
|
1436 |
|
3349 | 1437 |
"Modified: / 31.10.2001 / 09:20:20 / cg" |
2193
3d7b1044e8c8
fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents:
2188
diff
changeset
|
1438 |
! |
3d7b1044e8c8
fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents:
2188
diff
changeset
|
1439 |
|
3d7b1044e8c8
fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents:
2188
diff
changeset
|
1440 |
keyIndexForLine:lineNr |
3d7b1044e8c8
fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents:
2188
diff
changeset
|
1441 |
"helper - return the index of the key-list; |
3d7b1044e8c8
fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents:
2188
diff
changeset
|
1442 |
nil, if self or a namedInstVar is selected." |
3d7b1044e8c8
fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents:
2188
diff
changeset
|
1443 |
|
6840 | 1444 |
|idx nNamedInstvarsShown nExtraNamedInstvarsShown cls baseCls firstRealIndex line| |
2193
3d7b1044e8c8
fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents:
2188
diff
changeset
|
1445 |
|
3d7b1044e8c8
fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents:
2188
diff
changeset
|
1446 |
lineNr isNil ifTrue:[^ nil]. |
3d7b1044e8c8
fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents:
2188
diff
changeset
|
1447 |
|
3349 | 1448 |
firstRealIndex := 1. |
2193
3d7b1044e8c8
fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents:
2188
diff
changeset
|
1449 |
idx := lineNr. |
4095
5bd36b14723d
labels; added suppressPseudoVars & dereferenceValueHolders
Claus Gittinger <cg@exept.de>
parents:
3884
diff
changeset
|
1450 |
self hasSelfEntry ifTrue:[ |
2193
3d7b1044e8c8
fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents:
2188
diff
changeset
|
1451 |
(lineNr == 1 or:[lineNr isNil]) ifTrue:[ |
3d7b1044e8c8
fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents:
2188
diff
changeset
|
1452 |
^ nil "/ self selected |
3d7b1044e8c8
fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents:
2188
diff
changeset
|
1453 |
]. |
3d7b1044e8c8
fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents:
2188
diff
changeset
|
1454 |
idx := idx - 1. |
3349 | 1455 |
firstRealIndex := firstRealIndex + 1. |
1456 |
]. |
|
1457 |
||
5421
86a6077b131d
Fix for negative numbers as keys in a Dictionary
Stefan Vogel <sv@exept.de>
parents:
5134
diff
changeset
|
1458 |
[line := listView at:firstRealIndex. |
5881
ef6791c315ab
oops - out of bounds error fixed
Claus Gittinger <cg@exept.de>
parents:
5845
diff
changeset
|
1459 |
line notNil |
ef6791c315ab
oops - out of bounds error fixed
Claus Gittinger <cg@exept.de>
parents:
5845
diff
changeset
|
1460 |
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
|
1461 |
] whileTrue:[ |
3349 | 1462 |
firstRealIndex := firstRealIndex + 1. |
1463 |
idx := idx - 1. |
|
2193
3d7b1044e8c8
fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents:
2188
diff
changeset
|
1464 |
]. |
3d7b1044e8c8
fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents:
2188
diff
changeset
|
1465 |
|
2447 | 1466 |
cls := inspectedObject class. |
1467 |
baseCls := self baseInspectedObjectClass. |
|
1468 |
||
1469 |
nNamedInstvarsShown := cls instSize. |
|
2271
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
1470 |
"/ only the namedInstvars below baseInspectedObjectClass |
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
1471 |
"/ are shown ... |
2447 | 1472 |
(cls == baseCls or:[cls isSubclassOf:baseCls]) ifTrue:[ |
1473 |
nNamedInstvarsShown := nNamedInstvarsShown - baseCls instSize. |
|
1474 |
]. |
|
6850 | 1475 |
nExtraNamedInstvarsShown := self extraNamedFields size. |
2271
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
1476 |
|
6840 | 1477 |
idx <= (nNamedInstvarsShown+nExtraNamedInstvarsShown) ifTrue:[ |
2271
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
1478 |
^ nil "/ named instVar selected. |
2193
3d7b1044e8c8
fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents:
2188
diff
changeset
|
1479 |
]. |
6840 | 1480 |
^ idx - (nNamedInstvarsShown+nExtraNamedInstvarsShown). |
2193
3d7b1044e8c8
fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents:
2188
diff
changeset
|
1481 |
|
6850 | 1482 |
"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
|
1483 |
! |
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
1484 |
|
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
1485 |
namedFieldList |
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
1486 |
"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
|
1487 |
|
2447 | 1488 |
|aList cls baseCls| |
2271
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
1489 |
|
2447 | 1490 |
cls := inspectedObject class. |
1491 |
baseCls := self baseInspectedObjectClass. |
|
1492 |
||
3351 | 1493 |
aList := OrderedCollection new. |
3338 | 1494 |
|
3351 | 1495 |
aList addAll:(cls allInstVarNames). |
1496 |
(cls == baseCls or:[cls isSubclassOf:baseCls]) ifTrue:[ |
|
1497 |
"/ hide some stuff |
|
1498 |
aList := aList copyFrom:(self baseInspectedObjectClass instSize + 1). |
|
1499 |
]. |
|
1500 |
||
2271
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
1501 |
^ aList |
3349 | 1502 |
|
7297 | 1503 |
"Modified: / 18-09-2006 / 21:35:30 / cg" |
6372 | 1504 |
! |
1505 |
||
3608 | 1506 |
setAcceptAction |
1507 |
"set the codeViews accept action" |
|
1508 |
||
1509 |
|acceptAction sel| |
|
1510 |
||
1511 |
acceptAction := [:theText | self doAccept:theText asString]. |
|
1512 |
||
1513 |
(selectionIndex isNil |
|
1514 |
or:[ inspectedObject class hasImmediateInstances]) |
|
1515 |
ifTrue:[ |
|
1516 |
acceptAction := nil. |
|
1517 |
] ifFalse:[ |
|
1518 |
sel := listView at:selectionIndex. |
|
1519 |
||
3868 | 1520 |
(sel startsWith:'-all') ifTrue:[ |
3608 | 1521 |
acceptAction := nil. |
1522 |
]. |
|
1523 |
(sel startsWith:'-hash') ifTrue:[ |
|
1524 |
acceptAction := nil. |
|
1525 |
]. |
|
1526 |
(sel startsWith:'-identityHash') ifTrue:[ |
|
1527 |
acceptAction := nil. |
|
1528 |
]. |
|
3634 | 1529 |
(sel startsWith:'-dependents') ifTrue:[ |
1530 |
acceptAction := nil. |
|
1531 |
]. |
|
5134 | 1532 |
(sel startsWith:'-source') ifTrue:[ |
1533 |
acceptAction := nil. |
|
1534 |
]. |
|
3608 | 1535 |
]. |
1536 |
||
1537 |
workspace acceptAction:acceptAction. |
|
1538 |
! |
|
1539 |
||
200 | 1540 |
setDoItAction |
542 | 1541 |
"set the codeViews doit action" |
1542 |
||
1543 |
workspace |
|
6851 | 1544 |
doItAction:[:theCode | |
1545 |
|evaluator| |
|
200 | 1546 |
|
6851 | 1547 |
(evaluator := inspectedObject class evaluatorClass) |
1548 |
notNil ifTrue:[ |
|
1549 |
evaluator |
|
1550 |
evaluate:theCode |
|
1551 |
in:nil |
|
1552 |
receiver:inspectedObject |
|
1553 |
notifying:workspace |
|
1554 |
logged:true |
|
1555 |
ifFail:nil |
|
1556 |
] ifFalse:[ |
|
1557 |
'objects class provides no evaluator' |
|
1558 |
] |
|
1559 |
]. |
|
542 | 1560 |
|
1270
3dc841708edd
disable accept/doIt, if instances class provides no evaluator
Claus Gittinger <cg@exept.de>
parents:
1235
diff
changeset
|
1561 |
inspectedObject class evaluatorClass isNil ifTrue:[ |
6851 | 1562 |
workspace doItAction:nil. |
1563 |
workspace acceptAction:nil. |
|
1270
3dc841708edd
disable accept/doIt, if instances class provides no evaluator
Claus Gittinger <cg@exept.de>
parents:
1235
diff
changeset
|
1564 |
] |
3dc841708edd
disable accept/doIt, if instances class provides no evaluator
Claus Gittinger <cg@exept.de>
parents:
1235
diff
changeset
|
1565 |
|
3dc841708edd
disable accept/doIt, if instances class provides no evaluator
Claus Gittinger <cg@exept.de>
parents:
1235
diff
changeset
|
1566 |
"Modified: 1.8.1997 / 21:47:09 / cg" |
200 | 1567 |
! |
1568 |
||
3884 | 1569 |
showAllIndexedVarsInFieldList |
1570 |
^ true |
|
1571 |
! |
|
1572 |
||
200 | 1573 |
showMore |
1855
24108d2b3374
oops - fixed showMore handling
Claus Gittinger <cg@exept.de>
parents:
1770
diff
changeset
|
1574 |
|o| |
24108d2b3374
oops - fixed showMore handling
Claus Gittinger <cg@exept.de>
parents:
1770
diff
changeset
|
1575 |
|
200 | 1576 |
hasMore ifTrue:[ |
2235
ce49947e61f7
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
2193
diff
changeset
|
1577 |
nShown := nShown * 2. |
ce49947e61f7
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
2193
diff
changeset
|
1578 |
"/ force update (which is otherwise ignored) |
ce49947e61f7
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
2193
diff
changeset
|
1579 |
o := inspectedObject. |
ce49947e61f7
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
2193
diff
changeset
|
1580 |
inspectedObject := object := nil. |
ce49947e61f7
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
2193
diff
changeset
|
1581 |
self inspect:o |
200 | 1582 |
] |
1855
24108d2b3374
oops - fixed showMore handling
Claus Gittinger <cg@exept.de>
parents:
1770
diff
changeset
|
1583 |
|
24108d2b3374
oops - fixed showMore handling
Claus Gittinger <cg@exept.de>
parents:
1770
diff
changeset
|
1584 |
"Modified: / 26.8.1998 / 19:05:25 / cg" |
1739 | 1585 |
! |
1586 |
||
3868 | 1587 |
stringWithAllIndexedVarValues |
3874
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1588 |
|nIdx s names maxLen varString padLeft| |
3868 | 1589 |
|
1590 |
nIdx := inspectedObject size. |
|
1591 |
||
8388 | 1592 |
s := CharacterWriteStream on:''. |
3874
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1593 |
names := self indexList. |
4999 | 1594 |
names size > 0 ifTrue:[ |
1595 |
maxLen := (names collect:[:eachName | eachName printString size]) max. |
|
1596 |
padLeft := names conform:[:eachIdx | eachIdx isInteger]. |
|
1597 |
||
1598 |
names do:[:eachIdx | |
|
1599 |
|val| |
|
3874
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1600 |
|
4999 | 1601 |
padLeft ifTrue:[ |
1602 |
s nextPutAll:(eachIdx printStringLeftPaddedTo:maxLen). |
|
1603 |
] ifFalse:[ |
|
1604 |
s nextPutAll:((eachIdx printString , ' ') paddedTo:maxLen+1 with:$.). |
|
1605 |
]. |
|
3874
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1606 |
|
4999 | 1607 |
s nextPutAll:' : '. |
1608 |
val := self indexedValueAtKey:eachIdx. |
|
3874
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1609 |
|
4999 | 1610 |
varString := self basicDisplayStringForValue:val. |
1611 |
(varString includes:Character cr) ifTrue:[ |
|
1612 |
varString := varString copyTo:(varString indexOf:Character cr)-1. |
|
1613 |
varString := varString , '...'. |
|
1614 |
]. |
|
1615 |
s nextPutLine:varString. |
|
3868 | 1616 |
]. |
1617 |
]. |
|
1618 |
nShown < nIdx ifTrue:[ |
|
1619 |
s nextPutLine:' ...'. |
|
1620 |
]. |
|
1621 |
^ s contents |
|
1622 |
! |
|
1623 |
||
3608 | 1624 |
stringWithAllInstVarValues |
1625 |
|s names maxLen varString| |
|
1626 |
||
8388 | 1627 |
s := CharacterWriteStream on:''. |
3608 | 1628 |
names := inspectedObject class allInstVarNames. |
1629 |
maxLen := (names collect:[:eachName | eachName size]) max. |
|
5498 | 1630 |
names keysAndValuesDo:[:eachInstVarIndex :eachInstVarName | |
3608 | 1631 |
s nextPutAll:((eachInstVarName , ' ') paddedTo:maxLen+1 with:$.). |
1632 |
s nextPutAll:' : '. |
|
5498 | 1633 |
varString := self basicDisplayStringForValue:(inspectedObject instVarAt:eachInstVarIndex). |
3608 | 1634 |
(varString includes:Character cr) ifTrue:[ |
1635 |
varString := varString copyTo:(varString indexOf:Character cr)-1. |
|
1636 |
varString := varString , '...'. |
|
1637 |
]. |
|
1638 |
s nextPutAll:varString. |
|
1639 |
s cr. |
|
1640 |
]. |
|
8388 | 1641 |
^ s contents |
3608 | 1642 |
! |
1643 |
||
8726 | 1644 |
stringWithMessages:which |
1645 |
|cls s messages | |
|
1646 |
||
1647 |
s := CharacterWriteStream on:''. |
|
1648 |
cls := inspectedObject class. |
|
1649 |
which == #local ifTrue:[ |
|
1650 |
messages := cls selectors. |
|
1651 |
] ifFalse:[ |
|
1652 |
which == #all ifTrue:[ |
|
1653 |
messages := cls allSelectors. |
|
1654 |
] ifFalse:[ |
|
1655 |
messages := cls allSelectors copy asSet removeAll:cls selectors; yourself. |
|
1656 |
]. |
|
1657 |
]. |
|
1658 |
||
1659 |
messages asOrderedCollection sort do:[:eachSelector | |
|
1660 |
s nextPutAll:eachSelector. |
|
1661 |
s cr. |
|
1662 |
]. |
|
1663 |
^ s contents |
|
1664 |
! |
|
1665 |
||
200 | 1666 |
valueAtLine:lineNr |
1667 |
"helper - return the value of the selected entry" |
|
1668 |
||
6850 | 1669 |
|idx l val| |
200 | 1670 |
|
4095
5bd36b14723d
labels; added suppressPseudoVars & dereferenceValueHolders
Claus Gittinger <cg@exept.de>
parents:
3884
diff
changeset
|
1671 |
(self hasSelfEntry |
2271
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
1672 |
and:[lineNr == 1 or:[lineNr isNil]]) ifTrue:[ |
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
1673 |
^ inspectedObject |
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
1674 |
]. |
2235
ce49947e61f7
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
2193
diff
changeset
|
1675 |
|
3645 | 1676 |
((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
|
1677 |
(l ~= '-' and:[(l at:2) isDigit not "negative number"]) ifTrue:[ |
3645 | 1678 |
^ self valueForSpecialLine:(listView at:lineNr) |
1679 |
]. |
|
3338 | 1680 |
]. |
1681 |
||
2271
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
1682 |
"/ a named instVar ? |
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
1683 |
idx := self instVarIndexForLine:lineNr. |
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
1684 |
idx notNil ifTrue:[ |
3432
087493c18c74
class based exceptions - no longer need to send #breakPointSÃgnal
Claus Gittinger <cg@exept.de>
parents:
3428
diff
changeset
|
1685 |
BreakPointInterrupt catch:[ |
2800 | 1686 |
^ inspectedObject instVarAt:idx |
1687 |
] |
|
2271
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
1688 |
]. |
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
1689 |
|
6840 | 1690 |
"/ an extra named field ? |
1691 |
idx := self extraNamedVarIndexForLine:lineNr. |
|
1692 |
idx notNil ifTrue:[ |
|
1693 |
BreakPointInterrupt catch:[ |
|
6850 | 1694 |
val := ((self extraNamedFields) at:idx) value. |
1695 |
val isBlock ifTrue:[ val := val value ]. |
|
1696 |
^ val |
|
6840 | 1697 |
] |
1698 |
]. |
|
1699 |
||
2271
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
1700 |
"/ an indexed instVar ? |
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
1701 |
idx := self keyIndexForLine:lineNr. |
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
1702 |
idx notNil ifTrue:[ |
3432
087493c18c74
class based exceptions - no longer need to send #breakPointSÃgnal
Claus Gittinger <cg@exept.de>
parents:
3428
diff
changeset
|
1703 |
BreakPointInterrupt catch:[ |
2800 | 1704 |
^ self indexedValueAtIndex:idx. |
1705 |
] |
|
200 | 1706 |
]. |
644
aab7d4f7c8c3
allow hiding self; added a label
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
1707 |
|
2271
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
1708 |
"/ nope |
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
1709 |
^ nil |
613 | 1710 |
|
6850 | 1711 |
"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
|
1712 |
! |
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
1713 |
|
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
1714 |
valueAtLine:lineNr put:newValue |
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
1715 |
|idx| |
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
1716 |
|
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
1717 |
idx := self instVarIndexForLine:selectionIndex. |
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
1718 |
idx notNil ifTrue:[ |
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
1719 |
inspectedObject instVarAt:idx put:newValue. |
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
1720 |
] ifFalse:[ |
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
1721 |
idx := self keyIndexForLine:selectionIndex. |
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
1722 |
idx notNil ifTrue:[ |
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
1723 |
self indexedValueAtIndex:idx put:newValue. |
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
1724 |
] ifFalse:[ |
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
1725 |
^ self "/ self selected - dont store |
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
1726 |
] |
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
1727 |
]. |
3349 | 1728 |
! |
1729 |
||
1730 |
valueForSpecialLine:line |
|
7297 | 1731 |
|idx fieldEntry val extraAttributes| |
1732 |
||
1733 |
extraAttributes := inspectedObject inspectorExtraAttributes. |
|
8664
c6afed1e4bfa
changed #valueForSpecialLine:
Claus Gittinger <cg@exept.de>
parents:
8653
diff
changeset
|
1734 |
(extraAttributes notNil and:[ extraAttributes includesKey:line ]) ifTrue:[ |
7297 | 1735 |
^ (extraAttributes at:line) value |
1736 |
]. |
|
6823 | 1737 |
|
6850 | 1738 |
idx := self derivedFieldNames indexOf:line. |
1739 |
idx ~~ 0 ifTrue:[ |
|
1740 |
fieldEntry := self derivedFields at:idx. |
|
1741 |
] ifFalse:[ |
|
1742 |
idx := self extraNamedFieldNames indexOf:line. |
|
1743 |
idx ~~ 0 ifTrue:[ |
|
1744 |
fieldEntry := self extraNamedFields at:idx. |
|
1745 |
]. |
|
6840 | 1746 |
]. |
6823 | 1747 |
fieldEntry notNil ifTrue:[ |
6850 | 1748 |
fieldEntry isAssociation ifTrue:[ |
1749 |
^ fieldEntry value |
|
1750 |
]. |
|
1751 |
^ fieldEntry at:2. |
|
6823 | 1752 |
]. |
1753 |
||
3525 | 1754 |
(line startsWith:'-self') ifTrue:[ |
1755 |
^ inspectedObject |
|
1756 |
]. |
|
1757 |
(line startsWith:'-hash') ifTrue:[ |
|
1758 |
^ inspectedObject hash |
|
1759 |
]. |
|
1760 |
(line startsWith:'-identityHash') ifTrue:[ |
|
1761 |
^ inspectedObject identityHash |
|
1762 |
]. |
|
3634 | 1763 |
(line startsWith:'-dependents') ifTrue:[ |
1764 |
^ inspectedObject dependents |
|
1765 |
]. |
|
3868 | 1766 |
(line startsWith:'-all') ifTrue:[ |
3608 | 1767 |
^ inspectedObject |
1768 |
]. |
|
8726 | 1769 |
(line startsWith:'-local messages') ifTrue:[ |
1770 |
^ inspectedObject |
|
1771 |
]. |
|
1772 |
(line startsWith:'-inherited messages') ifTrue:[ |
|
1773 |
^ inspectedObject |
|
1774 |
]. |
|
1775 |
(line startsWith:'-all messages') ifTrue:[ |
|
1776 |
^ inspectedObject |
|
1777 |
]. |
|
3608 | 1778 |
|
3526 | 1779 |
self error:'unknown special line'. |
3349 | 1780 |
|
6823 | 1781 |
"Created: / 31-10-2001 / 09:17:45 / cg" |
7297 | 1782 |
"Modified: / 18-09-2006 / 21:34:54 / cg" |
200 | 1783 |
! ! |
1784 |
||
3874
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1785 |
!InspectorView methodsFor:'queries'! |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1786 |
|
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1787 |
canInspect:anObject |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1788 |
^ anObject inspectorClass == self class |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1789 |
! |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1790 |
|
5925 | 1791 |
compilerClass |
1792 |
^ inspectedObject class compilerClass |
|
1793 |
! |
|
1794 |
||
4095
5bd36b14723d
labels; added suppressPseudoVars & dereferenceValueHolders
Claus Gittinger <cg@exept.de>
parents:
3884
diff
changeset
|
1795 |
dereferenceValueHolders |
5bd36b14723d
labels; added suppressPseudoVars & dereferenceValueHolders
Claus Gittinger <cg@exept.de>
parents:
3884
diff
changeset
|
1796 |
^ dereferenceValueHolders ? false |
5bd36b14723d
labels; added suppressPseudoVars & dereferenceValueHolders
Claus Gittinger <cg@exept.de>
parents:
3884
diff
changeset
|
1797 |
! |
5bd36b14723d
labels; added suppressPseudoVars & dereferenceValueHolders
Claus Gittinger <cg@exept.de>
parents:
3884
diff
changeset
|
1798 |
|
3874
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1799 |
labelFor:anObject |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1800 |
"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
|
1801 |
|
5913 | 1802 |
|lbl id| |
3874
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1803 |
|
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1804 |
(self class == InspectorView |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1805 |
and:[anObject inspectorClass ~~ InspectorView]) ifTrue:[ |
6130 | 1806 |
lbl := 'BasicInspector on: ' |
3874
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1807 |
] ifFalse:[ |
6130 | 1808 |
lbl := 'Inspector on: ' |
5958 | 1809 |
]. |
1810 |
(anObject isImmediate |
|
1811 |
or:[anObject isBoolean]) ifFalse:[ |
|
6130 | 1812 |
lbl := lbl , '<%2> ' |
5913 | 1813 |
]. |
6130 | 1814 |
lbl := lbl , '%1'. |
5913 | 1815 |
|
1816 |
IdDictionary isNil ifTrue:[ |
|
1817 |
IdDictionary := WeakIdentityDictionary new. |
|
3874
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1818 |
]. |
5913 | 1819 |
[ |
1820 |
id := IdDictionary |
|
1821 |
at:anObject |
|
1822 |
ifAbsentPut:[ |
|
1823 |
|nextID| |
|
1824 |
||
1825 |
nextID := NextSequentialID ? 0. |
|
1826 |
NextSequentialID := nextID + 1. |
|
1827 |
nextID |
|
1828 |
]. |
|
1829 |
] valueUninterruptably. |
|
1830 |
||
3874
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1831 |
^ self class classResources |
5913 | 1832 |
string:lbl |
1833 |
with:(self labelNameFor:anObject) |
|
1834 |
with:id |
|
3874
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1835 |
! |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1836 |
|
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1837 |
labelNameFor:anObject |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1838 |
"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
|
1839 |
Simply returns the className or name of anObjects class" |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1840 |
|
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1841 |
|s| |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1842 |
|
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1843 |
anObject isClass ifTrue:[ |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1844 |
s := anObject displayString |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1845 |
] ifFalse:[ |
5958 | 1846 |
((anObject class == SmallInteger) |
1847 |
or:[anObject isBoolean]) ifTrue:[ |
|
1848 |
s := anObject printString , ', ' , anObject classNameWithArticle |
|
1849 |
] ifFalse:[ |
|
1850 |
s := anObject classNameWithArticle |
|
1851 |
]. |
|
3874
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1852 |
]. |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1853 |
s isNil ifTrue:[ |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1854 |
anObject isBehavior ifTrue:[ |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1855 |
^ 'someBehavior' |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1856 |
]. |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1857 |
^ 'something' |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1858 |
]. |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1859 |
^ s |
5958 | 1860 |
|
1861 |
" |
|
1862 |
1234 inspect |
|
1863 |
true inspect |
|
1864 |
$a inspect |
|
1865 |
" |
|
3874
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1866 |
! |
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 |
selectedKeyName |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1869 |
selectionIndex notNil ifTrue:[ |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1870 |
^ listView listAt:selectionIndex. |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1871 |
]. |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1872 |
^ nil |
4095
5bd36b14723d
labels; added suppressPseudoVars & dereferenceValueHolders
Claus Gittinger <cg@exept.de>
parents:
3884
diff
changeset
|
1873 |
! |
5bd36b14723d
labels; added suppressPseudoVars & dereferenceValueHolders
Claus Gittinger <cg@exept.de>
parents:
3884
diff
changeset
|
1874 |
|
5bd36b14723d
labels; added suppressPseudoVars & dereferenceValueHolders
Claus Gittinger <cg@exept.de>
parents:
3884
diff
changeset
|
1875 |
suppressPseudoSlots |
5bd36b14723d
labels; added suppressPseudoVars & dereferenceValueHolders
Claus Gittinger <cg@exept.de>
parents:
3884
diff
changeset
|
1876 |
^ suppressPseudoSlots ? false |
3874
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1877 |
! ! |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1878 |
|
8653 | 1879 |
!InspectorView methodsFor:'selection'! |
1880 |
||
1881 |
basicDisplayStringForValue:someValue |
|
1882 |
"return the value's displayString to be pasted into the workspace." |
|
1883 |
||
1884 |
|s| |
|
1885 |
||
1886 |
Error handle:[:ex | |
|
1887 |
s := someValue classNameWithArticle. |
|
1888 |
displayStringMessage == #displayString ifTrue:[ |
|
1889 |
s := s , ' "error in displayString: ' , ex description , '"' |
|
1890 |
] ifFalse:[ |
|
1891 |
s := s , ' "error in displayString (' , displayStringMessage , '): ' , ex description , '"' |
|
1892 |
]. |
|
1893 |
^ s |
|
1894 |
] do:[ |
|
1895 |
showHex ifTrue:[ |
|
1896 |
"/ not everything can be shown in HEX |
|
1897 |
||
1898 |
someValue isInteger ifTrue:[ |
|
1899 |
^ '16r' , someValue hexPrintString |
|
1900 |
]. |
|
1901 |
(someValue isMemberOf:ByteArray) ifTrue:[ |
|
1902 |
s := WriteStream on:(String new:10). |
|
1903 |
s writeLimit:100000. |
|
1904 |
someValue printOn:s base:16 showRadix:true. |
|
1905 |
^ s contents |
|
1906 |
] |
|
1907 |
]. |
|
1908 |
||
1909 |
"/ displayStringMessage := #classNameWithArticle |
|
1910 |
"/ displayStringMessage := #displayString |
|
1911 |
"/ displayStringMessage := #printString |
|
1912 |
||
1913 |
s := WriteStream on:(String new:10). |
|
1914 |
s writeLimit:100000. |
|
1915 |
||
1916 |
"/ mhmh - avoid sending #perform: (bad for proxy objects which pass it to somewhere..) |
|
1917 |
displayStringMessage == #displayString ifTrue:[ |
|
1918 |
someValue displayOn:s. |
|
1919 |
"/ s := someValue displayString. |
|
1920 |
] ifFalse:[ |
|
1921 |
displayStringMessage == #printString ifTrue:[ |
|
1922 |
someValue printOn:s. |
|
1923 |
"/ s := someValue printString. |
|
1924 |
] ifFalse:[ |
|
1925 |
displayStringMessage == #storeString ifTrue:[ |
|
1926 |
someValue storeOn:s. |
|
1927 |
"/ s := someValue storeString. |
|
1928 |
] ifFalse:[ |
|
1929 |
^ someValue perform:displayStringMessage. |
|
1930 |
]. |
|
1931 |
]. |
|
1932 |
]. |
|
1933 |
^ s contents |
|
1934 |
]. |
|
1935 |
||
1936 |
"Modified: / 05-11-2007 / 20:07:21 / cg" |
|
1937 |
! |
|
1938 |
||
1939 |
displayStringForValue:someValue |
|
1940 |
"return the value's displayString to be pasted into the workspace." |
|
1941 |
||
1942 |
|sel extraAttributes| |
|
1943 |
||
1944 |
selectionIndex notNil ifTrue:[ |
|
1945 |
sel := listView at:selectionIndex. |
|
1946 |
||
1947 |
extraAttributes := inspectedObject inspectorExtraAttributes. |
|
1948 |
(extraAttributes notNil and:[extraAttributes includesKey:sel]) ifTrue:[ |
|
1949 |
^ (extraAttributes at:sel) value printString |
|
1950 |
]. |
|
1951 |
||
1952 |
(sel startsWith:'-all inst vars') ifTrue:[ |
|
1953 |
^ self stringWithAllInstVarValues |
|
1954 |
]. |
|
1955 |
(sel startsWith:'-all indexed vars') ifTrue:[ |
|
1956 |
^ self stringWithAllIndexedVarValues |
|
1957 |
]. |
|
8726 | 1958 |
(sel startsWith:'-all messages') ifTrue:[ |
1959 |
^ self stringWithMessages:#all |
|
1960 |
]. |
|
1961 |
(sel startsWith:'-local messages') ifTrue:[ |
|
1962 |
^ self stringWithMessages:#local |
|
1963 |
]. |
|
1964 |
(sel startsWith:'-inherited messages') ifTrue:[ |
|
1965 |
^ self stringWithMessages:#inherited |
|
1966 |
]. |
|
8653 | 1967 |
]. |
1968 |
^ self basicDisplayStringForValue:someValue |
|
1969 |
||
1970 |
"Modified: / 05-11-2007 / 20:06:44 / cg" |
|
1971 |
! |
|
1972 |
||
1973 |
selection:lineNr |
|
1974 |
self showSelection:lineNr |
|
1975 |
! |
|
1976 |
||
1977 |
showSelection:lineNr |
|
1978 |
"user clicked on an instvar - show value in workspace" |
|
1979 |
||
1980 |
|val| |
|
1981 |
||
1982 |
(hasMore and:[lineNr == listView list size]) ifTrue:[ |
|
1983 |
"clicked on the '...' entry" |
|
1984 |
self showMore. |
|
1985 |
listView setSelection:lineNr. |
|
1986 |
]. |
|
1987 |
||
1988 |
self hasSelfEntry ifTrue:[ |
|
1989 |
(self hasSelfEntry and:[lineNr == 1]) ifTrue:[ |
|
1990 |
"selecting self also does a re-set, this allows updating the list" |
|
1991 |
self reinspect. |
|
1992 |
]. |
|
1993 |
]. |
|
1994 |
selectionIndex := selectedLine := lineNr. |
|
1995 |
val := self selection. |
|
1996 |
self showValue:val. |
|
1997 |
||
1998 |
self setAcceptAction. |
|
1999 |
||
2000 |
"Modified: / 03-08-2006 / 14:26:22 / cg" |
|
2001 |
! |
|
2002 |
||
2003 |
showValue:someValue |
|
2004 |
"user clicked on an entry - show value in workspace" |
|
2005 |
||
2006 |
|s| |
|
2007 |
||
2008 |
self topView withWaitCursorDo:[ |
|
2009 |
s := self displayStringForValue:someValue. |
|
2010 |
s = workspace selectionAsString ifFalse:[ |
|
2011 |
workspace replace:s. |
|
2012 |
]. |
|
2013 |
]. |
|
2014 |
||
2015 |
"Modified: / 06-02-2007 / 14:26:47 / cg" |
|
2016 |
! ! |
|
2017 |
||
3874
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2018 |
!InspectorView methodsFor:'user interaction'! |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2019 |
|
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2020 |
doAccept:theText |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2021 |
|sel newValue| |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2022 |
|
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2023 |
sel := listView at:selectionIndex. |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2024 |
(sel startsWith:'-all') ifTrue:[ |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2025 |
workspace flash. |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2026 |
^ self. |
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 |
|
4642
ee63c37d9d3c
Convert Object>>errorSignal -> Error
Stefan Vogel <sv@exept.de>
parents:
4314
diff
changeset
|
2029 |
Error handle:[:ex | |
3874
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2030 |
workspace flash |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2031 |
] do:[ |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2032 |
newValue := inspectedObject class evaluatorClass |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2033 |
evaluate:theText |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2034 |
receiver:inspectedObject |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2035 |
notifying:workspace. |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2036 |
|
4095
5bd36b14723d
labels; added suppressPseudoVars & dereferenceValueHolders
Claus Gittinger <cg@exept.de>
parents:
3884
diff
changeset
|
2037 |
self dereferenceValueHolders ifTrue:[ |
5bd36b14723d
labels; added suppressPseudoVars & dereferenceValueHolders
Claus Gittinger <cg@exept.de>
parents:
3884
diff
changeset
|
2038 |
(self valueAtLine:selectionIndex) value:newValue |
5bd36b14723d
labels; added suppressPseudoVars & dereferenceValueHolders
Claus Gittinger <cg@exept.de>
parents:
3884
diff
changeset
|
2039 |
] ifFalse:[ |
5bd36b14723d
labels; added suppressPseudoVars & dereferenceValueHolders
Claus Gittinger <cg@exept.de>
parents:
3884
diff
changeset
|
2040 |
self valueAtLine:selectionIndex put:newValue. |
5bd36b14723d
labels; added suppressPseudoVars & dereferenceValueHolders
Claus Gittinger <cg@exept.de>
parents:
3884
diff
changeset
|
2041 |
] |
3874
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2042 |
] |
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 |
|
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2045 |
doCopyKey |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2046 |
"put the instVar-name into the text-copy-buffer" |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2047 |
|
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2048 |
|nm| |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2049 |
|
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2050 |
selectionIndex notNil ifTrue:[ |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2051 |
nm := listView listAt:selectionIndex. |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2052 |
nm notNil ifTrue:[ |
6034 | 2053 |
self setClipboardText:(nm asString) |
3874
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2054 |
] |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2055 |
] |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2056 |
! |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2057 |
|
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2058 |
doInspect:basic |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2059 |
"user selected inspect-menu entry" |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2060 |
|
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2061 |
|objectToInspect| |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2062 |
|
8025 | 2063 |
objectToInspect := self selection ? object. |
2064 |
objectToInspect notNil ifTrue:[ |
|
3874
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2065 |
basic == #new ifTrue:[ |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2066 |
NewInspector::NewInspectorView inspect:objectToInspect |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2067 |
] ifFalse:[ |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2068 |
basic ifTrue:[ |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2069 |
objectToInspect basicInspect |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2070 |
] ifFalse:[ |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2071 |
objectToInspect inspect |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2072 |
] |
8025 | 2073 |
]. |
2074 |
]. |
|
3874
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2075 |
|
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2076 |
"Modified: / 31.10.1997 / 12:46:53 / cg" |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2077 |
! |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2078 |
|
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2079 |
doUpdate |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2080 |
self reinspect |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2081 |
! |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2082 |
|
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2083 |
monitor:anInstVarName |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2084 |
"start a monitoring process, showing the given instVar |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2085 |
in regular intervals." |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2086 |
|
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2087 |
|ivName| |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2088 |
|
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2089 |
(ivName := anInstVarName) isInteger ifTrue:[ |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2090 |
ivName := anInstVarName printString |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2091 |
]. |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2092 |
listView selectElement:ivName. |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2093 |
self doStartMonitor |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2094 |
|
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2095 |
"Created: / 1.3.1996 / 19:31:45 / cg" |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2096 |
"Modified: / 12.2.1999 / 16:05:47 / cg" |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2097 |
! |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2098 |
|
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2099 |
selection |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2100 |
"helper - return the value of the selected entry" |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2101 |
|
6850 | 2102 |
|val| |
2103 |
||
7904 | 2104 |
selectionIndex isNil ifTrue:[^ nil]. |
2105 |
||
6850 | 2106 |
val := self valueAtLine:selectionIndex. |
2107 |
self dereferenceValueHolders ifTrue:[ |
|
2108 |
"workspace-variable-inspection" |
|
2109 |
val := val value |
|
2110 |
]. |
|
2111 |
^ val |
|
2112 |
||
2113 |
"Modified: / 03-08-2006 / 14:27:02 / cg" |
|
3874
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2114 |
! |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2115 |
|
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2116 |
showLast |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2117 |
"user clicked on an instvar - show value in workspace" |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2118 |
|
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2119 |
|lastIdx| |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2120 |
|
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2121 |
lastIdx := listView list size. |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2122 |
lastIdx ~~ 0 ifTrue:[ |
6851 | 2123 |
self showSelection:lastIdx. |
2124 |
listView selection:lastIdx. |
|
3874
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2125 |
] |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2126 |
|
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2127 |
"Created: 28.6.1996 / 15:06:38 / cg" |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2128 |
"Modified: 18.3.1997 / 18:22:54 / cg" |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2129 |
! |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2130 |
|
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2131 |
toggleHex |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2132 |
|sel| |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2133 |
|
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2134 |
showHex := showHex not. |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2135 |
sel := listView selection. |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2136 |
sel notNil ifTrue:[ |
6851 | 2137 |
self showSelection:sel |
3874
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2138 |
] |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2139 |
|
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2140 |
"Created: / 7.5.1998 / 01:54:52 / cg" |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2141 |
"Modified: / 7.5.1998 / 02:00:10 / cg" |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2142 |
! |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2143 |
|
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2144 |
tryToSelectKeyNamed:aString |
5558 | 2145 |
|list idx| |
3874
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2146 |
|
5558 | 2147 |
list := listView list. |
2148 |
list notNil ifTrue:[ |
|
2149 |
(idx := list indexOf:aString) ~= 0 ifTrue:[ |
|
2150 |
listView selection:idx |
|
2151 |
]. |
|
3874
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2152 |
]. |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2153 |
|
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2154 |
"Created: / 16.11.2001 / 13:48:51 / cg" |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2155 |
! ! |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2156 |
|
4268
0fe3e4a82ddf
more textView protocol (for Workspace)
Claus Gittinger <cg@exept.de>
parents:
4197
diff
changeset
|
2157 |
!InspectorView methodsFor:'workspace protocol'! |
0fe3e4a82ddf
more textView protocol (for Workspace)
Claus Gittinger <cg@exept.de>
parents:
4197
diff
changeset
|
2158 |
|
0fe3e4a82ddf
more textView protocol (for Workspace)
Claus Gittinger <cg@exept.de>
parents:
4197
diff
changeset
|
2159 |
modified:aBoolean |
0fe3e4a82ddf
more textView protocol (for Workspace)
Claus Gittinger <cg@exept.de>
parents:
4197
diff
changeset
|
2160 |
^ workspace modified:aBoolean |
0fe3e4a82ddf
more textView protocol (for Workspace)
Claus Gittinger <cg@exept.de>
parents:
4197
diff
changeset
|
2161 |
! |
0fe3e4a82ddf
more textView protocol (for Workspace)
Claus Gittinger <cg@exept.de>
parents:
4197
diff
changeset
|
2162 |
|
0fe3e4a82ddf
more textView protocol (for Workspace)
Claus Gittinger <cg@exept.de>
parents:
4197
diff
changeset
|
2163 |
saveAs:file doAppend:doAppend |
0fe3e4a82ddf
more textView protocol (for Workspace)
Claus Gittinger <cg@exept.de>
parents:
4197
diff
changeset
|
2164 |
workspace saveAs:file doAppend:doAppend |
0fe3e4a82ddf
more textView protocol (for Workspace)
Claus Gittinger <cg@exept.de>
parents:
4197
diff
changeset
|
2165 |
! ! |
0fe3e4a82ddf
more textView protocol (for Workspace)
Claus Gittinger <cg@exept.de>
parents:
4197
diff
changeset
|
2166 |
|
871 | 2167 |
!InspectorView class methodsFor:'documentation'! |
200 | 2168 |
|
2169 |
version |
|
8906 | 2170 |
^ '$Header: /cvs/stx/stx/libtool/InspectorView.st,v 1.195 2009-10-08 12:23:55 cg Exp $' |
8868
1fd94adeda59
changed: #setInitialSelection
Claus Gittinger <cg@exept.de>
parents:
8800
diff
changeset
|
2171 |
! |
1fd94adeda59
changed: #setInitialSelection
Claus Gittinger <cg@exept.de>
parents:
8800
diff
changeset
|
2172 |
|
1fd94adeda59
changed: #setInitialSelection
Claus Gittinger <cg@exept.de>
parents:
8800
diff
changeset
|
2173 |
version_CVS |
8906 | 2174 |
^ '$Header: /cvs/stx/stx/libtool/InspectorView.st,v 1.195 2009-10-08 12:23:55 cg Exp $' |
200 | 2175 |
! ! |