author | Claus Gittinger <cg@exept.de> |
Mon, 30 Jan 2012 16:58:17 +0100 | |
changeset 11230 | a29b30fcd694 |
parent 11228 | fda9e307094f |
child 11231 | bad616bf8ddd |
permissions | -rw-r--r-- |
0 | 1 |
" |
5 | 2 |
COPYRIGHT (c) 1989 by Claus Gittinger |
8908 | 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 |
8962 | 15 |
instanceVariableNames:'listView labelView workspace inspectedObject selectedLine nShown |
9557
14b8fe98a8ed
can now display values and indices in binary and hex.
Claus Gittinger <cg@exept.de>
parents:
9504
diff
changeset
|
16 |
hasMore monitorProcess hideReceiver integerDisplayRadix |
14b8fe98a8ed
can now display values and indices in binary and hex.
Claus Gittinger <cg@exept.de>
parents:
9504
diff
changeset
|
17 |
inspectHistory allowFollow isStandaloneInspector selectionIndex |
14b8fe98a8ed
can now display values and indices in binary and hex.
Claus Gittinger <cg@exept.de>
parents:
9504
diff
changeset
|
18 |
object inspectedObjectHolder displayStringMessage |
9630 | 19 |
suppressPseudoSlots dereferenceValueHolders suppressHeadline |
20 |
headLineLabel' |
|
10846 | 21 |
classVariableNames:'DefaultIcon IdDictionary NextSequentialID LastExtent |
11230 | 22 |
DefaultIntegerDisplayRadix ExpandArraysInAllLists' |
8962 | 23 |
poolDictionaries:'' |
24 |
category:'Interface-Inspector' |
|
0 | 25 |
! |
26 |
||
871 | 27 |
!InspectorView class methodsFor:'documentation'! |
29 | 28 |
|
29 |
copyright |
|
30 |
" |
|
31 |
COPYRIGHT (c) 1989 by Claus Gittinger |
|
8908 | 32 |
All Rights Reserved |
29 | 33 |
|
34 |
This software is furnished under a license and may be used |
|
35 |
only in accordance with the terms of that license and with the |
|
36 |
inclusion of the above copyright notice. This software may not |
|
37 |
be provided or otherwise made available to, or used by, any |
|
38 |
other person. No title to or ownership of the software is |
|
39 |
hereby transferred. |
|
40 |
" |
|
41 |
! |
|
42 |
||
43 |
documentation |
|
44 |
" |
|
1570 | 45 |
This class implements a graphical inspector. |
29 | 46 |
Inspecting can be done on an object - |
47 |
(where its instvarnames/values are inspected) |
|
1570 | 48 |
or a list of objects (where a nameArray/valuesArray is inspected). |
29 | 49 |
The later is used by the debugger to inspect method variables/args. |
50 |
||
51 |
The system calls the inspector through the global variable 'Inspector' |
|
52 |
which is bound to this class (but could be redefined - it actually is |
|
1570 | 53 |
set to MiniInspector in a smalltalk without graphical user interface, |
54 |
or to NewInspector if that is wanted). |
|
0 | 55 |
|
29 | 56 |
Also notice, that there are two methods to inspect an object: |
57 |
sending #basicInspect to any object, will open this kind of inspector on |
|
58 |
it (showing instance variables which are physically present). |
|
59 |
||
60 |
Sending it #inspect, will - depending on the object - sometimes invoke a |
|
61 |
specialized inspector. |
|
1570 | 62 |
(see OrderedCollectionInspectorView, ImageInspectorView, |
63 |
ColorInspectorView etc. as examples). |
|
29 | 64 |
|
446 | 65 |
You can also open a monitoring inspector, which displays some instance |
66 |
variable in regular intervals. See #openOn:monitor:. |
|
67 |
||
29 | 68 |
examples: |
2008
52bf8b8afd3b
separated allowFollow from isStandAlone flag
Claus Gittinger <cg@exept.de>
parents:
2007
diff
changeset
|
69 |
#(1 2 3 4) asOrderedCollection inspect |
52bf8b8afd3b
separated allowFollow from isStandAlone flag
Claus Gittinger <cg@exept.de>
parents:
2007
diff
changeset
|
70 |
#(1 2 3 4) asOrderedCollection basicInspect |
52bf8b8afd3b
separated allowFollow from isStandAlone flag
Claus Gittinger <cg@exept.de>
parents:
2007
diff
changeset
|
71 |
(Array new:10000) inspect |
52bf8b8afd3b
separated allowFollow from isStandAlone flag
Claus Gittinger <cg@exept.de>
parents:
2007
diff
changeset
|
72 |
(Image fromFile:'bitmaps/claus.gif') inspect |
52bf8b8afd3b
separated allowFollow from isStandAlone flag
Claus Gittinger <cg@exept.de>
parents:
2007
diff
changeset
|
73 |
(Image fromFile:'bitmaps/claus.gif') basicInspect |
52bf8b8afd3b
separated allowFollow from isStandAlone flag
Claus Gittinger <cg@exept.de>
parents:
2007
diff
changeset
|
74 |
(Image fromFile:'bitmaps/SBrowser.xbm') inspect |
52bf8b8afd3b
separated allowFollow from isStandAlone flag
Claus Gittinger <cg@exept.de>
parents:
2007
diff
changeset
|
75 |
(Image fromFile:'bitmaps/SBrowser.xbm') basicInspect |
446 | 76 |
|
2008
52bf8b8afd3b
separated allowFollow from isStandAlone flag
Claus Gittinger <cg@exept.de>
parents:
2007
diff
changeset
|
77 |
InspectorView openOn:Display |
52bf8b8afd3b
separated allowFollow from isStandAlone flag
Claus Gittinger <cg@exept.de>
parents:
2007
diff
changeset
|
78 |
InspectorView openOn:Display monitor:'shiftDown' |
52bf8b8afd3b
separated allowFollow from isStandAlone flag
Claus Gittinger <cg@exept.de>
parents:
2007
diff
changeset
|
79 |
|
52bf8b8afd3b
separated allowFollow from isStandAlone flag
Claus Gittinger <cg@exept.de>
parents:
2007
diff
changeset
|
80 |
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
|
81 |
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
|
82 |
inspector from changing the topViews window label. |
510 | 83 |
|
2235
ce49947e61f7
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
2193
diff
changeset
|
84 |
Notice: |
ce49947e61f7
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
2193
diff
changeset
|
85 |
the instvars 'inspectedObject' and 'selectedLine' have been |
ce49947e61f7
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
2193
diff
changeset
|
86 |
renamed to 'object' and 'selectionIndex' for squeak compatibility; |
ce49947e61f7
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
2193
diff
changeset
|
87 |
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
|
88 |
smooth migration. |
ce49947e61f7
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
2193
diff
changeset
|
89 |
|
6940 | 90 |
Controlling the contents from the inspected object. |
91 |
||
92 |
By redefining inspectorExtraAttributes or inspectorExtraNamedFields, the inspected |
|
93 |
object can add items to the list of fields as ashown in the left list-view of the inspector. |
|
94 |
These methods are meant to return a sequencable Collection of Associations, which represent |
|
95 |
of pseudo slot-name, slot-value pairs. |
|
96 |
In the list, extra attributes are shown with a dash (-), extra named fields are marked with a tick (`). |
|
97 |
These are added (read only) to the list. |
|
98 |
||
510 | 99 |
[author:] |
2008
52bf8b8afd3b
separated allowFollow from isStandAlone flag
Claus Gittinger <cg@exept.de>
parents:
2007
diff
changeset
|
100 |
Claus Gittinger |
29 | 101 |
" |
102 |
! ! |
|
0 | 103 |
|
871 | 104 |
!InspectorView class methodsFor:'instance creation'! |
0 | 105 |
|
200 | 106 |
for:anObject |
107 |
"create and launch a new inspector for anObject. |
|
108 |
This protocol is a historic leftover - this method will vanish." |
|
109 |
||
110 |
^ self openOn:anObject |
|
111 |
! |
|
112 |
||
113 |
inspect:anObject |
|
114 |
"create and launch a new inspector for anObject. |
|
115 |
This protocol is a historic leftover - this method will vanish." |
|
116 |
||
117 |
^ self openOn:anObject |
|
118 |
! |
|
119 |
||
0 | 120 |
openOn:anObject |
121 |
"create and launch a new inspector for anObject" |
|
122 |
||
416
fd30ab6185c7
added startup-with-monitor method
Claus Gittinger <cg@exept.de>
parents:
383
diff
changeset
|
123 |
^ self openOn:anObject monitor:nil |
fd30ab6185c7
added startup-with-monitor method
Claus Gittinger <cg@exept.de>
parents:
383
diff
changeset
|
124 |
|
fd30ab6185c7
added startup-with-monitor method
Claus Gittinger <cg@exept.de>
parents:
383
diff
changeset
|
125 |
" |
fd30ab6185c7
added startup-with-monitor method
Claus Gittinger <cg@exept.de>
parents:
383
diff
changeset
|
126 |
InspectorView openOn:(5 @ 7) |
fd30ab6185c7
added startup-with-monitor method
Claus Gittinger <cg@exept.de>
parents:
383
diff
changeset
|
127 |
InspectorView openOn:(Array new:400) |
fd30ab6185c7
added startup-with-monitor method
Claus Gittinger <cg@exept.de>
parents:
383
diff
changeset
|
128 |
DictionaryInspectorView openOn:(IdentityDictionary new) |
fd30ab6185c7
added startup-with-monitor method
Claus Gittinger <cg@exept.de>
parents:
383
diff
changeset
|
129 |
" |
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 |
"Modified: 1.3.1996 / 19:31:03 / cg" |
fd30ab6185c7
added startup-with-monitor method
Claus Gittinger <cg@exept.de>
parents:
383
diff
changeset
|
132 |
! |
fd30ab6185c7
added startup-with-monitor method
Claus Gittinger <cg@exept.de>
parents:
383
diff
changeset
|
133 |
|
8452 | 134 |
openOn:anObject monitor:anInstVarNameOrNil |
416
fd30ab6185c7
added startup-with-monitor method
Claus Gittinger <cg@exept.de>
parents:
383
diff
changeset
|
135 |
"create and launch a new inspector for anObject. |
8452 | 136 |
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
|
137 |
(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
|
138 |
|
105 | 139 |
|topView inspectorView| |
0 | 140 |
|
1895
8b51d61d9c0a
added follow & back menu items.
Claus Gittinger <cg@exept.de>
parents:
1873
diff
changeset
|
141 |
topView := StandardSystemView new. |
9295 | 142 |
topView |
143 |
icon:self defaultIcon; |
|
144 |
label:'Inspector'; |
|
145 |
iconLabel:'Inspector'; |
|
146 |
extent:self defaultTopViewExtent; |
|
147 |
objectAttributeAt:#rememberExtent put:true. |
|
0 | 148 |
|
149 |
inspectorView := self origin:(0.0 @ 0.0) |
|
2007 | 150 |
corner:(1.0 @ 1.0) |
151 |
in:topView. |
|
0 | 152 |
|
3 | 153 |
"kludge: must realize first, to be able to set menu again" |
352 | 154 |
topView openAndWait. |
871 | 155 |
topView windowGroup |
2007 | 156 |
focusSequence:(Array |
157 |
with:inspectorView listView |
|
158 |
with:inspectorView workspace). |
|
9262 | 159 |
inspectorView |
160 |
allowFollow:true; |
|
161 |
isStandaloneInspector:true; |
|
162 |
inspect:anObject. |
|
416
fd30ab6185c7
added startup-with-monitor method
Claus Gittinger <cg@exept.de>
parents:
383
diff
changeset
|
163 |
|
8452 | 164 |
anInstVarNameOrNil notNil ifTrue:[ |
165 |
inspectorView monitor:anInstVarNameOrNil |
|
416
fd30ab6185c7
added startup-with-monitor method
Claus Gittinger <cg@exept.de>
parents:
383
diff
changeset
|
166 |
]. |
fd30ab6185c7
added startup-with-monitor method
Claus Gittinger <cg@exept.de>
parents:
383
diff
changeset
|
167 |
|
69 | 168 |
^ inspectorView |
0 | 169 |
|
29 | 170 |
" |
416
fd30ab6185c7
added startup-with-monitor method
Claus Gittinger <cg@exept.de>
parents:
383
diff
changeset
|
171 |
|m| |
fd30ab6185c7
added startup-with-monitor method
Claus Gittinger <cg@exept.de>
parents:
383
diff
changeset
|
172 |
|
fd30ab6185c7
added startup-with-monitor method
Claus Gittinger <cg@exept.de>
parents:
383
diff
changeset
|
173 |
m := 1 asValue. |
fd30ab6185c7
added startup-with-monitor method
Claus Gittinger <cg@exept.de>
parents:
383
diff
changeset
|
174 |
InspectorView openOn:m monitor:'value'. |
871 | 175 |
|
176 |
2 to:10 do:[:i | |
|
2007 | 177 |
Delay waitForSeconds:1. |
178 |
m value:i |
|
871 | 179 |
] |
416
fd30ab6185c7
added startup-with-monitor method
Claus Gittinger <cg@exept.de>
parents:
383
diff
changeset
|
180 |
" |
fd30ab6185c7
added startup-with-monitor method
Claus Gittinger <cg@exept.de>
parents:
383
diff
changeset
|
181 |
|
29 | 182 |
" |
416
fd30ab6185c7
added startup-with-monitor method
Claus Gittinger <cg@exept.de>
parents:
383
diff
changeset
|
183 |
|o| |
fd30ab6185c7
added startup-with-monitor method
Claus Gittinger <cg@exept.de>
parents:
383
diff
changeset
|
184 |
|
fd30ab6185c7
added startup-with-monitor method
Claus Gittinger <cg@exept.de>
parents:
383
diff
changeset
|
185 |
o := Array with:1 with:2 with:3. |
fd30ab6185c7
added startup-with-monitor method
Claus Gittinger <cg@exept.de>
parents:
383
diff
changeset
|
186 |
InspectorView openOn:o monitor:'2'. |
fd30ab6185c7
added startup-with-monitor method
Claus Gittinger <cg@exept.de>
parents:
383
diff
changeset
|
187 |
Delay waitForSeconds:1. |
fd30ab6185c7
added startup-with-monitor method
Claus Gittinger <cg@exept.de>
parents:
383
diff
changeset
|
188 |
o at:2 put:20 |
fd30ab6185c7
added startup-with-monitor method
Claus Gittinger <cg@exept.de>
parents:
383
diff
changeset
|
189 |
" |
fd30ab6185c7
added startup-with-monitor method
Claus Gittinger <cg@exept.de>
parents:
383
diff
changeset
|
190 |
|
7867 | 191 |
"Created: / 01-03-1996 / 19:30:50 / cg" |
192 |
"Modified: / 23-10-2007 / 19:08:21 / cg" |
|
2235
ce49947e61f7
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
2193
diff
changeset
|
193 |
! |
ce49947e61f7
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
2193
diff
changeset
|
194 |
|
ce49947e61f7
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
2193
diff
changeset
|
195 |
openOn:anObject withEvalPane:withEvalPane |
ce49947e61f7
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
2193
diff
changeset
|
196 |
^ self openOn:anObject |
ce49947e61f7
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
2193
diff
changeset
|
197 |
! |
ce49947e61f7
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
2193
diff
changeset
|
198 |
|
ce49947e61f7
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
2193
diff
changeset
|
199 |
openOn:anObject withEvalPane:withEvalPane withLabel:aLabel |
ce49947e61f7
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
2193
diff
changeset
|
200 |
^ self openOn:anObject |
73 | 201 |
! ! |
202 |
||
10321 | 203 |
!InspectorView class methodsFor:'common label support'! |
204 |
||
205 |
commonLabelFor:anObject |
|
206 |
"return the windowLabel to use in my topView, when inspecting anObject. |
|
207 |
Identical objects are labelled with the same id, which makes it easy to |
|
208 |
see if two objects are identical (and is very useful, indeed). |
|
209 |
WARNING: used by both Inspector and Inspector2 !!!!!!" |
|
210 |
||
211 |
|lbl id| |
|
212 |
||
213 |
lbl := ''. |
|
214 |
(anObject isImmediate |
|
215 |
or:[anObject isBoolean]) ifFalse:[ |
|
216 |
lbl := '<%2> ' |
|
217 |
]. |
|
218 |
lbl := lbl , '%1'. |
|
219 |
||
220 |
IdDictionary isNil ifTrue:[ |
|
221 |
IdDictionary := WeakIdentityDictionary new. |
|
222 |
]. |
|
223 |
[ |
|
224 |
id := IdDictionary |
|
225 |
at:anObject |
|
226 |
ifAbsentPut:[ |
|
227 |
|nextID| |
|
228 |
||
229 |
nextID := NextSequentialID ? 0. |
|
230 |
NextSequentialID := nextID + 1. |
|
231 |
nextID |
|
232 |
]. |
|
233 |
] valueUninterruptably. |
|
234 |
||
235 |
^ self classResources |
|
236 |
string:lbl |
|
237 |
with:(self labelNameFor:anObject) |
|
238 |
with:id |
|
239 |
||
240 |
"Created: / 15-07-2011 / 16:21:44 / cg" |
|
241 |
! |
|
242 |
||
243 |
labelNameFor:anObject |
|
244 |
"return the iconLabel to use in my topView, when inspecting anObject. |
|
245 |
Simply returns the className or name of anObjects class" |
|
246 |
||
247 |
|s| |
|
248 |
||
249 |
anObject isClass ifTrue:[ |
|
250 |
s := anObject displayString |
|
251 |
] ifFalse:[ |
|
252 |
(anObject isImmediate |
|
253 |
or:[anObject isBoolean]) ifTrue:[ |
|
254 |
s := anObject printString , ', ' , anObject classNameWithArticle |
|
255 |
] ifFalse:[ |
|
256 |
s := anObject classNameWithArticle |
|
257 |
]. |
|
258 |
]. |
|
259 |
s isNil ifTrue:[ |
|
260 |
anObject isBehavior ifTrue:[ |
|
261 |
^ 'someBehavior' |
|
262 |
]. |
|
263 |
^ 'something' |
|
264 |
]. |
|
265 |
^ s |
|
266 |
||
267 |
"Created: / 15-07-2011 / 16:20:06 / cg" |
|
268 |
! ! |
|
269 |
||
871 | 270 |
!InspectorView class methodsFor:'defaults'! |
73 | 271 |
|
1873
5fd55aa184d4
added redefinable #defaultExtent method.
Claus Gittinger <cg@exept.de>
parents:
1855
diff
changeset
|
272 |
defaultExtent |
9389 | 273 |
^ (Screen current usableExtent // 3) |
1873
5fd55aa184d4
added redefinable #defaultExtent method.
Claus Gittinger <cg@exept.de>
parents:
1855
diff
changeset
|
274 |
|
5fd55aa184d4
added redefinable #defaultExtent method.
Claus Gittinger <cg@exept.de>
parents:
1855
diff
changeset
|
275 |
"Created: / 7.9.1998 / 13:47:45 / cg" |
5fd55aa184d4
added redefinable #defaultExtent method.
Claus Gittinger <cg@exept.de>
parents:
1855
diff
changeset
|
276 |
"Modified: / 7.9.1998 / 14:15:38 / cg" |
5fd55aa184d4
added redefinable #defaultExtent method.
Claus Gittinger <cg@exept.de>
parents:
1855
diff
changeset
|
277 |
! |
5fd55aa184d4
added redefinable #defaultExtent method.
Claus Gittinger <cg@exept.de>
parents:
1855
diff
changeset
|
278 |
|
73 | 279 |
defaultIcon |
1146 | 280 |
"return the browsers default window icon" |
281 |
||
7835 | 282 |
<resource: #programImage> |
7629 | 283 |
<resource: #style (#INSPECTOR_ICON #INSPECTOR_ICON_FILE)> |
1146 | 284 |
|
7629 | 285 |
|nm i resources| |
1146 | 286 |
|
287 |
(i := DefaultIcon) isNil ifTrue:[ |
|
7629 | 288 |
resources := self classResources. |
289 |
i := resources at:#INSPECTOR_ICON default:nil. |
|
2338 | 290 |
i isNil ifTrue:[ |
7629 | 291 |
nm := resources at:#INSPECTOR_ICON_FILE default:'Inspector.xbm'. |
2475 | 292 |
i := Smalltalk imageFromFileNamed:nm forClass:self. |
2338 | 293 |
i isNil ifTrue:[ |
2454
114111038a2b
try my bitmaps in package directory
Claus Gittinger <cg@exept.de>
parents:
2447
diff
changeset
|
294 |
i := StandardSystemView defaultIcon |
2338 | 295 |
] |
296 |
]. |
|
297 |
i notNil ifTrue:[ |
|
298 |
DefaultIcon := i := i onDevice:Display |
|
299 |
] |
|
73 | 300 |
]. |
1146 | 301 |
^ i |
874 | 302 |
|
7629 | 303 |
" |
304 |
DefaultIcon := nil |
|
305 |
" |
|
7835 | 306 |
|
307 |
"Modified: / 17-09-2007 / 11:36:17 / cg" |
|
7867 | 308 |
! |
309 |
||
310 |
defaultTopViewExtent |
|
9389 | 311 |
|def| |
312 |
||
313 |
def := LastExtent ? self defaultExtent. |
|
314 |
^ def min:(Screen current usableExtent) |
|
7867 | 315 |
|
316 |
"Created: / 23-10-2007 / 19:04:13 / cg" |
|
317 |
! |
|
318 |
||
11230 | 319 |
expandArraysInAllLists |
320 |
"in the 'all instvars' list, expand arrays" |
|
321 |
||
322 |
^ ExpandArraysInAllLists ? false |
|
323 |
||
324 |
"Created: / 30-01-2012 / 16:52:57 / cg" |
|
325 |
! |
|
326 |
||
327 |
expandArraysInAllLists:aBoolean |
|
328 |
"in the 'all instvars' list, expand arrays" |
|
329 |
||
330 |
ExpandArraysInAllLists := aBoolean |
|
331 |
||
332 |
"Created: / 30-01-2012 / 16:53:01 / cg" |
|
333 |
! |
|
334 |
||
7867 | 335 |
rememberLastExtent:anExtent |
336 |
LastExtent := anExtent |
|
337 |
||
338 |
"Created: / 23-10-2007 / 19:10:02 / cg" |
|
73 | 339 |
! ! |
340 |
||
2598 | 341 |
!InspectorView class methodsFor:'queries-plugin'! |
342 |
||
343 |
aspectSelectors |
|
344 |
^ #( inspectedObjectHolder ) |
|
345 |
||
346 |
"Modified: / 10.2.2000 / 12:25:28 / cg" |
|
347 |
! ! |
|
348 |
||
73 | 349 |
!InspectorView methodsFor:'accessing'! |
350 |
||
2007 | 351 |
allowFollow:aBoolean |
2271
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
352 |
"enable/disable the follow menu item; |
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
353 |
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
|
354 |
|
2007 | 355 |
allowFollow := aBoolean |
356 |
! |
|
357 |
||
4095
5bd36b14723d
labels; added suppressPseudoVars & dereferenceValueHolders
Claus Gittinger <cg@exept.de>
parents:
3884
diff
changeset
|
358 |
dereferenceValueHolders:aBoolean |
5bd36b14723d
labels; added suppressPseudoVars & dereferenceValueHolders
Claus Gittinger <cg@exept.de>
parents:
3884
diff
changeset
|
359 |
dereferenceValueHolders := aBoolean |
5bd36b14723d
labels; added suppressPseudoVars & dereferenceValueHolders
Claus Gittinger <cg@exept.de>
parents:
3884
diff
changeset
|
360 |
! |
5bd36b14723d
labels; added suppressPseudoVars & dereferenceValueHolders
Claus Gittinger <cg@exept.de>
parents:
3884
diff
changeset
|
361 |
|
5bd36b14723d
labels; added suppressPseudoVars & dereferenceValueHolders
Claus Gittinger <cg@exept.de>
parents:
3884
diff
changeset
|
362 |
fieldListLabel:aString |
5bd36b14723d
labels; added suppressPseudoVars & dereferenceValueHolders
Claus Gittinger <cg@exept.de>
parents:
3884
diff
changeset
|
363 |
labelView label:aString |
5bd36b14723d
labels; added suppressPseudoVars & dereferenceValueHolders
Claus Gittinger <cg@exept.de>
parents:
3884
diff
changeset
|
364 |
|
5bd36b14723d
labels; added suppressPseudoVars & dereferenceValueHolders
Claus Gittinger <cg@exept.de>
parents:
3884
diff
changeset
|
365 |
"Created: 28.6.1996 / 15:30:26 / cg" |
5bd36b14723d
labels; added suppressPseudoVars & dereferenceValueHolders
Claus Gittinger <cg@exept.de>
parents:
3884
diff
changeset
|
366 |
! |
5bd36b14723d
labels; added suppressPseudoVars & dereferenceValueHolders
Claus Gittinger <cg@exept.de>
parents:
3884
diff
changeset
|
367 |
|
9630 | 368 |
headLineLabel:aString |
369 |
"an alternative headline label (if used as embedded inspector)" |
|
370 |
||
371 |
headLineLabel := aString. |
|
372 |
||
9648 | 373 |
labelView notNil ifTrue:[ |
374 |
labelView label:headLineLabel. |
|
375 |
]. |
|
376 |
||
377 |
"Modified: / 25-11-2010 / 17:16:45 / cg" |
|
9630 | 378 |
! |
379 |
||
9693 | 380 |
headLineLabelView |
381 |
"provides access to the headline" |
|
382 |
||
383 |
^ labelView |
|
384 |
||
385 |
"Created: / 21-01-2011 / 12:07:13 / cg" |
|
386 |
! |
|
387 |
||
644
aab7d4f7c8c3
allow hiding self; added a label
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
388 |
hideReceiver:aBoolean |
2271
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
389 |
"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
|
390 |
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
|
391 |
|
644
aab7d4f7c8c3
allow hiding self; added a label
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
392 |
hideReceiver := aBoolean |
aab7d4f7c8c3
allow hiding self; added a label
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
393 |
|
aab7d4f7c8c3
allow hiding self; added a label
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
394 |
"Created: 28.6.1996 / 15:08:32 / cg" |
aab7d4f7c8c3
allow hiding self; added a label
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
395 |
! |
aab7d4f7c8c3
allow hiding self; added a label
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
396 |
|
73 | 397 |
inspect:anObject |
8452 | 398 |
"set/update the object to be inspected" |
73 | 399 |
|
9390 | 400 |
|aList sameObject sameClass oldSelectedField idx| |
401 |
||
9690 | 402 |
"/ (anObject isNil and:[object isNil]) ifTrue:[^ self]. |
9651 | 403 |
|
9390 | 404 |
sameObject := (anObject == object) and:[object notNil]. |
10520 | 405 |
|
406 |
"/ JV@2011-08-06: Be carefull here, classes may be variable-lenght, |
|
407 |
"/ so instances of same class may have different number of slots!! |
|
408 |
"/ (caused problems expecially when stack inspector is shown in debugger). |
|
409 |
"/ To fix, I've added ------------------------v |
|
410 |
sameClass := (anObject class == object class) and:[anObject class isVariable not]. |
|
9390 | 411 |
selectionIndex notNil ifTrue:[ |
412 |
oldSelectedField := (listView list ? #()) at:selectionIndex ifAbsent:nil. |
|
413 |
]. |
|
2235
ce49947e61f7
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
2193
diff
changeset
|
414 |
inspectedObject := object := anObject. |
73 | 415 |
|
9690 | 416 |
((sameObject | sameClass) and:[listView list notEmptyOrNil]) ifTrue:[ |
9262 | 417 |
"/ listView setContents:aList. |
418 |
] ifFalse:[ |
|
2007 | 419 |
hasMore := false. |
2996
2230855f6283
Show 'self for an UndefinedObject
Stefan Vogel <sv@exept.de>
parents:
2850
diff
changeset
|
420 |
aList := self fieldList. |
2007 | 421 |
hasMore ifTrue:[ |
422 |
aList add:' ... ' |
|
423 |
]. |
|
424 |
listView contents:aList. |
|
425 |
workspace contents:nil. |
|
426 |
self setDoItAction. |
|
73 | 427 |
]. |
9390 | 428 |
sameClass ifFalse:[ |
429 |
selectionIndex := selectedLine := nil. |
|
430 |
]. |
|
9262 | 431 |
isStandaloneInspector ifTrue:[ |
8452 | 432 |
"/ not embedded (as in the debugger) |
2284 | 433 |
self topView |
434 |
label:(self labelFor:anObject); |
|
10321 | 435 |
iconLabel:(self class labelNameFor:anObject). |
8452 | 436 |
]. |
437 |
||
9390 | 438 |
(sameObject | sameClass) ifFalse:[ |
439 |
idx := (listView list ? #()) indexOf:oldSelectedField. |
|
440 |
idx ~~ 0 ifTrue:[ |
|
441 |
listView selection:idx |
|
442 |
] ifFalse:[ |
|
443 |
self setInitialSelection. |
|
444 |
] |
|
8452 | 445 |
]. |
10520 | 446 |
self showSelection:((selectedLine ? 1) min: listView list size) |
9624 | 447 |
|
10321 | 448 |
"Modified: / 15-07-2011 / 16:20:32 / cg" |
10520 | 449 |
"Modified (comment): / 06-08-2011 / 13:41:50 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
1895
8b51d61d9c0a
added follow & back menu items.
Claus Gittinger <cg@exept.de>
parents:
1873
diff
changeset
|
450 |
! |
8b51d61d9c0a
added follow & back menu items.
Claus Gittinger <cg@exept.de>
parents:
1873
diff
changeset
|
451 |
|
8b51d61d9c0a
added follow & back menu items.
Claus Gittinger <cg@exept.de>
parents:
1873
diff
changeset
|
452 |
isStandaloneInspector:aBoolean |
2007 | 453 |
"obsolete now" |
454 |
||
2008
52bf8b8afd3b
separated allowFollow from isStandAlone flag
Claus Gittinger <cg@exept.de>
parents:
2007
diff
changeset
|
455 |
isStandaloneInspector := aBoolean |
52bf8b8afd3b
separated allowFollow from isStandAlone flag
Claus Gittinger <cg@exept.de>
parents:
2007
diff
changeset
|
456 |
|
52bf8b8afd3b
separated allowFollow from isStandAlone flag
Claus Gittinger <cg@exept.de>
parents:
2007
diff
changeset
|
457 |
"Modified: / 12.2.1999 / 16:01:44 / cg" |
29 | 458 |
! |
459 |
||
644
aab7d4f7c8c3
allow hiding self; added a label
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
460 |
label:aString |
4106 | 461 |
"set the fieldListLabel - obsolete; collides with inherited label-functionality" |
462 |
||
5845 | 463 |
<resource:#obsolete> |
4106 | 464 |
self obsoleteMethodWarning:'use fieldListLabel:'. |
465 |
self fieldListLabel:aString. |
|
466 |
super label:aString. |
|
644
aab7d4f7c8c3
allow hiding self; added a label
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
467 |
|
aab7d4f7c8c3
allow hiding self; added a label
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
468 |
"Created: 28.6.1996 / 15:30:26 / cg" |
aab7d4f7c8c3
allow hiding self; added a label
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
469 |
! |
aab7d4f7c8c3
allow hiding self; added a label
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
470 |
|
73 | 471 |
listView |
472 |
^ listView |
|
352 | 473 |
! |
474 |
||
2193
3d7b1044e8c8
fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents:
2188
diff
changeset
|
475 |
reinspect |
3d7b1044e8c8
fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents:
2188
diff
changeset
|
476 |
"update display for a changed inspectedObject" |
3d7b1044e8c8
fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents:
2188
diff
changeset
|
477 |
|
3d7b1044e8c8
fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents:
2188
diff
changeset
|
478 |
|aList| |
3d7b1044e8c8
fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents:
2188
diff
changeset
|
479 |
|
3d7b1044e8c8
fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents:
2188
diff
changeset
|
480 |
hasMore := false. |
3d7b1044e8c8
fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents:
2188
diff
changeset
|
481 |
aList := self fieldList. |
3d7b1044e8c8
fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents:
2188
diff
changeset
|
482 |
hasMore ifTrue:[ |
3d7b1044e8c8
fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents:
2188
diff
changeset
|
483 |
aList add:' ... ' |
3d7b1044e8c8
fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents:
2188
diff
changeset
|
484 |
]. |
3d7b1044e8c8
fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents:
2188
diff
changeset
|
485 |
|
3d7b1044e8c8
fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents:
2188
diff
changeset
|
486 |
listView contents:aList. |
3d7b1044e8c8
fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents:
2188
diff
changeset
|
487 |
|
2271
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
488 |
"/ workspace contents:nil. |
2193
3d7b1044e8c8
fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents:
2188
diff
changeset
|
489 |
self setDoItAction. |
3d7b1044e8c8
fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents:
2188
diff
changeset
|
490 |
|
2235
ce49947e61f7
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
2193
diff
changeset
|
491 |
selectionIndex := selectedLine := nil |
2193
3d7b1044e8c8
fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents:
2188
diff
changeset
|
492 |
! |
3d7b1044e8c8
fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents:
2188
diff
changeset
|
493 |
|
9625
1b6c049c1990
allow suppressing the headline
Claus Gittinger <cg@exept.de>
parents:
9624
diff
changeset
|
494 |
suppressHeadline:aBoolean |
1b6c049c1990
allow suppressing the headline
Claus Gittinger <cg@exept.de>
parents:
9624
diff
changeset
|
495 |
"hide/show the title line above the list/value" |
1b6c049c1990
allow suppressing the headline
Claus Gittinger <cg@exept.de>
parents:
9624
diff
changeset
|
496 |
|
9736 | 497 |
suppressHeadline := aBoolean. |
498 |
||
499 |
labelView notNil ifTrue:[ |
|
500 |
suppressHeadline == true ifTrue:[ |
|
501 |
labelView beInvisible. |
|
502 |
listView container topInset:0. |
|
503 |
workspace container topInset:0. |
|
504 |
] ifFalse:[ |
|
505 |
labelView beVisible. |
|
506 |
listView container topInset:(labelView preferredHeight). |
|
507 |
workspace container topInset:(labelView preferredHeight). |
|
508 |
]. |
|
509 |
]. |
|
9625
1b6c049c1990
allow suppressing the headline
Claus Gittinger <cg@exept.de>
parents:
9624
diff
changeset
|
510 |
|
1b6c049c1990
allow suppressing the headline
Claus Gittinger <cg@exept.de>
parents:
9624
diff
changeset
|
511 |
"Created: / 09-11-2010 / 14:50:04 / cg" |
9736 | 512 |
"Modified: / 05-02-2011 / 14:03:55 / cg" |
9625
1b6c049c1990
allow suppressing the headline
Claus Gittinger <cg@exept.de>
parents:
9624
diff
changeset
|
513 |
! |
1b6c049c1990
allow suppressing the headline
Claus Gittinger <cg@exept.de>
parents:
9624
diff
changeset
|
514 |
|
4095
5bd36b14723d
labels; added suppressPseudoVars & dereferenceValueHolders
Claus Gittinger <cg@exept.de>
parents:
3884
diff
changeset
|
515 |
suppressPseudoSlots:aBoolean |
5bd36b14723d
labels; added suppressPseudoVars & dereferenceValueHolders
Claus Gittinger <cg@exept.de>
parents:
3884
diff
changeset
|
516 |
suppressPseudoSlots := aBoolean |
5bd36b14723d
labels; added suppressPseudoVars & dereferenceValueHolders
Claus Gittinger <cg@exept.de>
parents:
3884
diff
changeset
|
517 |
! |
5bd36b14723d
labels; added suppressPseudoVars & dereferenceValueHolders
Claus Gittinger <cg@exept.de>
parents:
3884
diff
changeset
|
518 |
|
352 | 519 |
workspace |
520 |
^ workspace |
|
52 | 521 |
! ! |
522 |
||
2724 | 523 |
!InspectorView methodsFor:'accessing-channels'! |
2598 | 524 |
|
525 |
inspectedObjectHolder |
|
526 |
inspectedObjectHolder isNil ifTrue:[ |
|
527 |
inspectedObjectHolder := ValueHolder new. |
|
528 |
inspectedObjectHolder addDependent:self. |
|
529 |
]. |
|
530 |
^ inspectedObjectHolder |
|
531 |
||
532 |
"Created: / 10.2.2000 / 13:33:16 / cg" |
|
533 |
"Modified: / 10.2.2000 / 13:34:23 / cg" |
|
534 |
! |
|
535 |
||
536 |
inspectedObjectHolder:aValueHolder |
|
537 |
inspectedObjectHolder notNil ifTrue:[ |
|
538 |
inspectedObjectHolder removeDependent:self. |
|
539 |
]. |
|
540 |
inspectedObjectHolder := aValueHolder. |
|
541 |
inspectedObjectHolder notNil ifTrue:[ |
|
542 |
inspectedObjectHolder addDependent:self. |
|
543 |
]. |
|
544 |
||
545 |
"Created: / 10.2.2000 / 13:34:53 / cg" |
|
546 |
! ! |
|
547 |
||
548 |
!InspectorView methodsFor:'change & update'! |
|
549 |
||
550 |
update:something with:aParameter from:changedObject |
|
551 |
"Invoked when one of my dependees sends a change notification." |
|
552 |
||
553 |
|oldSelection| |
|
554 |
||
9367 | 555 |
changedObject == object ifTrue:[ |
2598 | 556 |
oldSelection := listView selection. |
9367 | 557 |
self inspect:object. |
2598 | 558 |
oldSelection notNil ifTrue:[ |
559 |
self showSelection:oldSelection |
|
560 |
] |
|
561 |
]. |
|
562 |
||
9367 | 563 |
changedObject == object ifTrue:[ |
564 |
self inspect:(object value) |
|
2598 | 565 |
]. |
566 |
||
567 |
super update:something with:aParameter from:changedObject |
|
568 |
||
569 |
"Created: / 10.2.2000 / 13:46:38 / cg" |
|
570 |
"Modified: / 10.2.2000 / 13:48:18 / cg" |
|
571 |
! ! |
|
572 |
||
7297 | 573 |
!InspectorView methodsFor:'drag & drop'! |
574 |
||
575 |
getDisplayObjects |
|
576 |
||
577 |
^List with:self selection printString |
|
578 |
||
579 |
"Created: / 16-08-2005 / 21:54:52 / janfrog" |
|
580 |
"Modified: / 18-09-2006 / 21:11:16 / cg" |
|
581 |
! |
|
582 |
||
583 |
getDropObjects |
|
584 |
||
585 |
^List with:(DropObject new:self selection). |
|
586 |
||
587 |
"Created: / 16-08-2005 / 21:49:23 / janfrog" |
|
588 |
"Modified: / 18-09-2006 / 21:11:31 / cg" |
|
589 |
! ! |
|
590 |
||
8025 | 591 |
!InspectorView methodsFor:'event handling'! |
592 |
||
10424
9d7d0c28f504
only follow (dive in) with double click;
Claus Gittinger <cg@exept.de>
parents:
10321
diff
changeset
|
593 |
doubleClickOnLine:lineNr |
9d7d0c28f504
only follow (dive in) with double click;
Claus Gittinger <cg@exept.de>
parents:
10321
diff
changeset
|
594 |
|objectToInspect app| |
9d7d0c28f504
only follow (dive in) with double click;
Claus Gittinger <cg@exept.de>
parents:
10321
diff
changeset
|
595 |
|
9d7d0c28f504
only follow (dive in) with double click;
Claus Gittinger <cg@exept.de>
parents:
10321
diff
changeset
|
596 |
objectToInspect := self selection ? object. |
9d7d0c28f504
only follow (dive in) with double click;
Claus Gittinger <cg@exept.de>
parents:
10321
diff
changeset
|
597 |
|
9d7d0c28f504
only follow (dive in) with double click;
Claus Gittinger <cg@exept.de>
parents:
10321
diff
changeset
|
598 |
"HACK" |
9d7d0c28f504
only follow (dive in) with double click;
Claus Gittinger <cg@exept.de>
parents:
10321
diff
changeset
|
599 |
app := (self topView perform:#application ifNotUnderstood: [nil]). |
9d7d0c28f504
only follow (dive in) with double click;
Claus Gittinger <cg@exept.de>
parents:
10321
diff
changeset
|
600 |
(app notNil and:[app isKindOf: Tools::Inspector2]) ifTrue:[ |
9d7d0c28f504
only follow (dive in) with double click;
Claus Gittinger <cg@exept.de>
parents:
10321
diff
changeset
|
601 |
app inspect: objectToInspect |
9d7d0c28f504
only follow (dive in) with double click;
Claus Gittinger <cg@exept.de>
parents:
10321
diff
changeset
|
602 |
] ifFalse:[ |
9d7d0c28f504
only follow (dive in) with double click;
Claus Gittinger <cg@exept.de>
parents:
10321
diff
changeset
|
603 |
objectToInspect inspect |
9d7d0c28f504
only follow (dive in) with double click;
Claus Gittinger <cg@exept.de>
parents:
10321
diff
changeset
|
604 |
] |
9d7d0c28f504
only follow (dive in) with double click;
Claus Gittinger <cg@exept.de>
parents:
10321
diff
changeset
|
605 |
|
9d7d0c28f504
only follow (dive in) with double click;
Claus Gittinger <cg@exept.de>
parents:
10321
diff
changeset
|
606 |
"Created: / 29-07-2011 / 21:09:43 / cg" |
9d7d0c28f504
only follow (dive in) with double click;
Claus Gittinger <cg@exept.de>
parents:
10321
diff
changeset
|
607 |
! |
9d7d0c28f504
only follow (dive in) with double click;
Claus Gittinger <cg@exept.de>
parents:
10321
diff
changeset
|
608 |
|
8025 | 609 |
keyPress:key x:x y:y |
610 |
"handle special keys" |
|
611 |
||
612 |
<resource: #keyboard (#BrowseIt #InspectIt)> |
|
613 |
||
614 |
self selection notNil ifTrue:[ |
|
615 |
(key == #BrowseIt) ifTrue:[ |
|
616 |
self browse. |
|
617 |
^ self. |
|
618 |
]. |
|
619 |
(key == #InspectIt) ifTrue:[ |
|
620 |
self doInspect. |
|
621 |
^ self. |
|
622 |
]. |
|
623 |
]. |
|
624 |
||
625 |
"all my other input is passed on to the workspace-field" |
|
626 |
x notNil ifTrue:[ |
|
627 |
"/ not already delegated |
|
628 |
workspace keyPress:key x:-1 y:-1 |
|
629 |
]. |
|
9389 | 630 |
! |
631 |
||
632 |
sizeChanged:how |
|
633 |
super sizeChanged:how. |
|
634 |
||
635 |
isStandaloneInspector == true ifTrue:[ |
|
636 |
LastExtent := self topView extent. |
|
637 |
]. |
|
8025 | 638 |
! ! |
639 |
||
2587
b6838cdb1f14
added show-stream-contents menu item
Claus Gittinger <cg@exept.de>
parents:
2580
diff
changeset
|
640 |
!InspectorView methodsFor:'initialization & release'! |
2117 | 641 |
|
642 |
destroy |
|
7867 | 643 |
(self topView objectAttributeAt:#rememberExtent) == true ifTrue:[ |
644 |
self class rememberLastExtent:(self topView extent). |
|
645 |
]. |
|
646 |
||
2235
ce49947e61f7
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
2193
diff
changeset
|
647 |
inspectedObject := object := nil. |
2117 | 648 |
monitorProcess notNil ifTrue:[ |
2235
ce49947e61f7
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
2193
diff
changeset
|
649 |
monitorProcess terminate |
2117 | 650 |
]. |
651 |
super destroy |
|
7867 | 652 |
|
653 |
"Modified: / 23-10-2007 / 19:11:04 / cg" |
|
2117 | 654 |
! |
73 | 655 |
|
656 |
initialize |
|
644
aab7d4f7c8c3
allow hiding self; added a label
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
657 |
|v panel helpView labelView2| |
73 | 658 |
|
659 |
super initialize. |
|
660 |
||
3318
46c3347385f4
preps to allow for displayString message to be configured
Claus Gittinger <cg@exept.de>
parents:
3199
diff
changeset
|
661 |
displayStringMessage := #displayString. |
644
aab7d4f7c8c3
allow hiding self; added a label
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
662 |
hideReceiver := false. |
10846 | 663 |
integerDisplayRadix := (DefaultIntegerDisplayRadix ? 10). |
2007 | 664 |
allowFollow := false. |
2008
52bf8b8afd3b
separated allowFollow from isStandAlone flag
Claus Gittinger <cg@exept.de>
parents:
2007
diff
changeset
|
665 |
isStandaloneInspector := false. |
644
aab7d4f7c8c3
allow hiding self; added a label
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
666 |
|
73 | 667 |
panel := VariableHorizontalPanel |
1991
dfbb30988edd
no miniScrollers; no autoHide
Claus Gittinger <cg@exept.de>
parents:
1930
diff
changeset
|
668 |
origin:(0.0 @ 0.0) |
dfbb30988edd
no miniScrollers; no autoHide
Claus Gittinger <cg@exept.de>
parents:
1930
diff
changeset
|
669 |
corner:(1.0 @ 1.0) |
dfbb30988edd
no miniScrollers; no autoHide
Claus Gittinger <cg@exept.de>
parents:
1930
diff
changeset
|
670 |
in:self. |
644
aab7d4f7c8c3
allow hiding self; added a label
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
671 |
|
aab7d4f7c8c3
allow hiding self; added a label
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
672 |
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
|
673 |
helpView level:0; borderWidth:0. |
aab7d4f7c8c3
allow hiding self; added a label
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
674 |
|
9625
1b6c049c1990
allow suppressing the headline
Claus Gittinger <cg@exept.de>
parents:
9624
diff
changeset
|
675 |
suppressHeadline == true ifFalse:[ |
1b6c049c1990
allow suppressing the headline
Claus Gittinger <cg@exept.de>
parents:
9624
diff
changeset
|
676 |
labelView := Label origin:0.0@0.0 corner:1.0@0.0 in:helpView. |
9630 | 677 |
labelView label:(headLineLabel ? self defaultLabel). |
9625
1b6c049c1990
allow suppressing the headline
Claus Gittinger <cg@exept.de>
parents:
9624
diff
changeset
|
678 |
labelView bottomInset:(labelView preferredHeight negated). |
1b6c049c1990
allow suppressing the headline
Claus Gittinger <cg@exept.de>
parents:
9624
diff
changeset
|
679 |
]. |
73 | 680 |
|
681 |
v := HVScrollableView |
|
9625
1b6c049c1990
allow suppressing the headline
Claus Gittinger <cg@exept.de>
parents:
9624
diff
changeset
|
682 |
for:SelectionInListView |
1b6c049c1990
allow suppressing the headline
Claus Gittinger <cg@exept.de>
parents:
9624
diff
changeset
|
683 |
miniScrollerH:true |
1b6c049c1990
allow suppressing the headline
Claus Gittinger <cg@exept.de>
parents:
9624
diff
changeset
|
684 |
miniScrollerV:false |
1b6c049c1990
allow suppressing the headline
Claus Gittinger <cg@exept.de>
parents:
9624
diff
changeset
|
685 |
in:helpView. |
1b6c049c1990
allow suppressing the headline
Claus Gittinger <cg@exept.de>
parents:
9624
diff
changeset
|
686 |
v origin:(0.0 @ 0.0) corner:(1.0 @ 1.0). |
1b6c049c1990
allow suppressing the headline
Claus Gittinger <cg@exept.de>
parents:
9624
diff
changeset
|
687 |
labelView notNil ifTrue:[ |
1b6c049c1990
allow suppressing the headline
Claus Gittinger <cg@exept.de>
parents:
9624
diff
changeset
|
688 |
v topInset:(labelView preferredHeight). |
1b6c049c1990
allow suppressing the headline
Claus Gittinger <cg@exept.de>
parents:
9624
diff
changeset
|
689 |
]. |
1b6c049c1990
allow suppressing the headline
Claus Gittinger <cg@exept.de>
parents:
9624
diff
changeset
|
690 |
|
1991
dfbb30988edd
no miniScrollers; no autoHide
Claus Gittinger <cg@exept.de>
parents:
1930
diff
changeset
|
691 |
"/ v autoHideScrollBars:true. |
73 | 692 |
|
693 |
listView := v scrolledView. |
|
8653 | 694 |
listView action:[:lineNr | self selection:lineNr.]. |
10424
9d7d0c28f504
only follow (dive in) with double click;
Claus Gittinger <cg@exept.de>
parents:
10321
diff
changeset
|
695 |
listView doubleClickAction:[:lineNr | self doubleClickOnLine:lineNr]. |
73 | 696 |
listView ignoreReselect:false. |
98 | 697 |
listView menuHolder:self; menuPerformer:self; menuMessage:#fieldMenu. |
7297 | 698 |
self initializeDragAndDrop. |
73 | 699 |
|
644
aab7d4f7c8c3
allow hiding self; added a label
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
700 |
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
|
701 |
helpView level:0; borderWidth:0. |
aab7d4f7c8c3
allow hiding self; added a label
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
702 |
|
9625
1b6c049c1990
allow suppressing the headline
Claus Gittinger <cg@exept.de>
parents:
9624
diff
changeset
|
703 |
suppressHeadline == true ifFalse:[ |
1b6c049c1990
allow suppressing the headline
Claus Gittinger <cg@exept.de>
parents:
9624
diff
changeset
|
704 |
labelView2 := Label origin:0.0@0.0 corner:1.0@0.0 in:helpView. |
1b6c049c1990
allow suppressing the headline
Claus Gittinger <cg@exept.de>
parents:
9624
diff
changeset
|
705 |
labelView2 label:''. |
1b6c049c1990
allow suppressing the headline
Claus Gittinger <cg@exept.de>
parents:
9624
diff
changeset
|
706 |
labelView2 bottomInset:(labelView preferredHeight negated). |
1b6c049c1990
allow suppressing the headline
Claus Gittinger <cg@exept.de>
parents:
9624
diff
changeset
|
707 |
]. |
644
aab7d4f7c8c3
allow hiding self; added a label
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
708 |
|
73 | 709 |
v := HVScrollableView |
1991
dfbb30988edd
no miniScrollers; no autoHide
Claus Gittinger <cg@exept.de>
parents:
1930
diff
changeset
|
710 |
for:CodeView |
dfbb30988edd
no miniScrollers; no autoHide
Claus Gittinger <cg@exept.de>
parents:
1930
diff
changeset
|
711 |
miniScrollerH:true |
dfbb30988edd
no miniScrollers; no autoHide
Claus Gittinger <cg@exept.de>
parents:
1930
diff
changeset
|
712 |
miniScrollerV:false |
dfbb30988edd
no miniScrollers; no autoHide
Claus Gittinger <cg@exept.de>
parents:
1930
diff
changeset
|
713 |
in:helpView. |
dfbb30988edd
no miniScrollers; no autoHide
Claus Gittinger <cg@exept.de>
parents:
1930
diff
changeset
|
714 |
"/ v autoHideScrollBars:true. |
644
aab7d4f7c8c3
allow hiding self; added a label
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
715 |
v origin:(0.0 @ 0.0) corner:(1.0 @ 1.0). |
9625
1b6c049c1990
allow suppressing the headline
Claus Gittinger <cg@exept.de>
parents:
9624
diff
changeset
|
716 |
labelView2 notNil ifTrue:[ |
1b6c049c1990
allow suppressing the headline
Claus Gittinger <cg@exept.de>
parents:
9624
diff
changeset
|
717 |
v topInset:(labelView2 preferredHeight). |
1b6c049c1990
allow suppressing the headline
Claus Gittinger <cg@exept.de>
parents:
9624
diff
changeset
|
718 |
]. |
73 | 719 |
workspace := v scrolledView. |
720 |
||
3608 | 721 |
self setAcceptAction. |
73 | 722 |
|
723 |
nShown := 100. |
|
724 |
hasMore := false. |
|
644
aab7d4f7c8c3
allow hiding self; added a label
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
725 |
|
7297 | 726 |
"Modified: / 16-08-2005 / 21:54:04 / janfrog" |
10846 | 727 |
"Modified: / 30-10-2011 / 09:18:36 / cg" |
7297 | 728 |
! |
729 |
||
730 |
initializeDragAndDrop |
|
731 |
||
732 |
| source | |
|
733 |
source := DropSource |
|
734 |
receiver:self |
|
735 |
argument:nil |
|
736 |
dropObjectSelector:#getDropObjects |
|
737 |
displayObjectSelector:#getDisplayObjects |
|
738 |
dropFeedBackSelector:nil. |
|
739 |
||
740 |
listView dropSource:source. |
|
741 |
||
742 |
"Created: / 16-08-2005 / 21:51:43 / janfrog" |
|
743 |
"Modified: / 18-09-2006 / 21:13:05 / cg" |
|
200 | 744 |
! |
745 |
||
593 | 746 |
realize |
747 |
"delayed setup of lists till first map-time - |
|
200 | 748 |
this makes startup of inspectors a bit faster" |
749 |
||
750 |
|o| |
|
751 |
||
593 | 752 |
super realize. |
7887
be186ae12782
dont clobber the current selection on realize
Claus Gittinger <cg@exept.de>
parents:
7867
diff
changeset
|
753 |
"/ cg: I dont remember what this was needed for (is it still?) |
9367 | 754 |
false "object notNil" ifTrue:[ |
2235
ce49947e61f7
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
2193
diff
changeset
|
755 |
" |
ce49947e61f7
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
2193
diff
changeset
|
756 |
kludge to trick inspect:, which ignores setting the |
ce49947e61f7
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
2193
diff
changeset
|
757 |
same object again ... |
ce49947e61f7
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
2193
diff
changeset
|
758 |
" |
9367 | 759 |
o := object. |
2235
ce49947e61f7
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
2193
diff
changeset
|
760 |
inspectedObject := object := nil. |
ce49947e61f7
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
2193
diff
changeset
|
761 |
self inspect:o |
383 | 762 |
] |
593 | 763 |
|
7887
be186ae12782
dont clobber the current selection on realize
Claus Gittinger <cg@exept.de>
parents:
7867
diff
changeset
|
764 |
"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
|
765 |
"Modified: / 05-11-2007 / 20:11:44 / cg" |
2117 | 766 |
! |
767 |
||
768 |
release |
|
769 |
"release inpected object. This is normally not needed, |
|
770 |
since the garbage collector will find this memory alone. |
|
771 |
However, if some applications keeps invisible inspectors around |
|
772 |
(for example, the debugger does this), the inspected object |
|
773 |
would be kept from being freed or freed very late." |
|
774 |
||
775 |
" |
|
776 |
inspectedObject notNil ifTrue:[ |
|
2235
ce49947e61f7
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
2193
diff
changeset
|
777 |
inspectedObject removeDependent:self |
2117 | 778 |
]. |
779 |
" |
|
2235
ce49947e61f7
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
2193
diff
changeset
|
780 |
inspectedObject := object := nil. |
2117 | 781 |
self setDoItAction. "/ to release ref to inspectedObject in doItBlock |
782 |
workspace contents:nil. |
|
783 |
listView contents:nil. |
|
784 |
||
785 |
super release. |
|
786 |
||
787 |
"Modified: 11.6.1997 / 13:20:39 / cg" |
|
8452 | 788 |
! |
789 |
||
790 |
setInitialSelection |
|
8868
1fd94adeda59
changed: #setInitialSelection
Claus Gittinger <cg@exept.de>
parents:
8800
diff
changeset
|
791 |
object isLazyValue ifFalse:[ |
1fd94adeda59
changed: #setInitialSelection
Claus Gittinger <cg@exept.de>
parents:
8800
diff
changeset
|
792 |
object isString ifTrue:[ |
1fd94adeda59
changed: #setInitialSelection
Claus Gittinger <cg@exept.de>
parents:
8800
diff
changeset
|
793 |
self showSelection:1 "/ the self-line |
1fd94adeda59
changed: #setInitialSelection
Claus Gittinger <cg@exept.de>
parents:
8800
diff
changeset
|
794 |
] |
8452 | 795 |
]. |
98 | 796 |
! ! |
797 |
||
798 |
!InspectorView methodsFor:'menu'! |
|
73 | 799 |
|
800 |
fieldMenu |
|
1040 | 801 |
"return the menu for the field-list" |
802 |
||
1235
13610578a5d2
resource flag: #menu -> #programMenu
Claus Gittinger <cg@exept.de>
parents:
1185
diff
changeset
|
803 |
<resource: #programMenu> |
1040 | 804 |
|
9703 | 805 |
|items m sel protocolMenu localProtocolMenu |
806 |
protocols protocolsSorted |
|
807 |
selectorsByFirstCharacter alphaMenu |
|
808 |
localSelectors| |
|
1597
48629e1fc7b6
use new menu-creation message in PopUpMenu.
Claus Gittinger <cg@exept.de>
parents:
1570
diff
changeset
|
809 |
|
48629e1fc7b6
use new menu-creation message in PopUpMenu.
Claus Gittinger <cg@exept.de>
parents:
1570
diff
changeset
|
810 |
items := #( |
3198 | 811 |
('Copy Name or Key' #doCopyKey ) |
2085 | 812 |
('-') |
3198 | 813 |
('Inspect' #doInspect ) |
814 |
('BasicInspect' #doBasicInspect ) |
|
9349
e6d367cbe86c
do not show new-inspector in menu, if there is none loaded
Claus Gittinger <cg@exept.de>
parents:
9316
diff
changeset
|
815 |
). |
e6d367cbe86c
do not show new-inspector in menu, if there is none loaded
Claus Gittinger <cg@exept.de>
parents:
9316
diff
changeset
|
816 |
NewInspector::NewInspectorView notNil ifTrue:[ |
e6d367cbe86c
do not show new-inspector in menu, if there is none loaded
Claus Gittinger <cg@exept.de>
parents:
9316
diff
changeset
|
817 |
items := items , #( |
4197 | 818 |
('Inspect Hierarchical' #doNewInspect ) |
9349
e6d367cbe86c
do not show new-inspector in menu, if there is none loaded
Claus Gittinger <cg@exept.de>
parents:
9316
diff
changeset
|
819 |
). |
e6d367cbe86c
do not show new-inspector in menu, if there is none loaded
Claus Gittinger <cg@exept.de>
parents:
9316
diff
changeset
|
820 |
]. |
e6d367cbe86c
do not show new-inspector in menu, if there is none loaded
Claus Gittinger <cg@exept.de>
parents:
9316
diff
changeset
|
821 |
items := items , #( |
8993
ddf4fc887179
experimental protocol menu...
Claus Gittinger <cg@exept.de>
parents:
8962
diff
changeset
|
822 |
('Browse' #browse ) |
8800 | 823 |
). |
9703 | 824 |
items := items , (self optionalToolItems). |
8800 | 825 |
items := items , (self optionalViewSelectionItems). |
826 |
items := items , #( |
|
7951 | 827 |
('-') |
828 |
('Owners' #showOwners ) |
|
4197 | 829 |
('Ref Chains' #showReferences ) |
3199 | 830 |
"/ ('Browse class hierarchy' #browseClassHierarchy ) |
831 |
"/ ('Browse full class protocol' #browseFullClassProtocol) |
|
2579 | 832 |
). |
2587
b6838cdb1f14
added show-stream-contents menu item
Claus Gittinger <cg@exept.de>
parents:
2580
diff
changeset
|
833 |
|
b6838cdb1f14
added show-stream-contents menu item
Claus Gittinger <cg@exept.de>
parents:
2580
diff
changeset
|
834 |
sel := self selection. |
6491 | 835 |
|
8799 | 836 |
items := items , (self optionalMethodOrBlockSelectionItems). |
7639 | 837 |
items := items , (self optionalStreamSelectionItems). |
838 |
items := items , (self optionalFilenameSelectionItems). |
|
9700 | 839 |
items := items , (self optionalByteArraySelectionItems). |
7639 | 840 |
|
2579 | 841 |
items := items , #( |
2085 | 842 |
('-') |
9574 | 843 |
('Local Protocol' #localProtocolMenu ) |
844 |
('Full Protocol' #protocolMenu ) |
|
845 |
('-') |
|
4197 | 846 |
('Trap Message...' #doTrap ) |
847 |
('Trap all Messages' #doTrapAll ) |
|
848 |
('Trace all Messages' #doTraceAll ) |
|
849 |
('Untrace/Untrap' #doUntrace ) |
|
2850 | 850 |
"/ ('-') |
3198 | 851 |
"/ ('Trap change to instVar' #doTrapInstVarChange ) |
852 |
"/ ('Trap change to any instVar' #doTrapAnyInstVarChange ) |
|
2007 | 853 |
). |
1895
8b51d61d9c0a
added follow & back menu items.
Claus Gittinger <cg@exept.de>
parents:
1873
diff
changeset
|
854 |
|
2007 | 855 |
allowFollow ifTrue:[ |
856 |
items := #( |
|
3198 | 857 |
('Follow' #doFollow ) |
858 |
('Back' #doBack ) |
|
2007 | 859 |
('-') |
860 |
) |
|
861 |
, |
|
862 |
items. |
|
1895
8b51d61d9c0a
added follow & back menu items.
Claus Gittinger <cg@exept.de>
parents:
1873
diff
changeset
|
863 |
]. |
73 | 864 |
|
8993
ddf4fc887179
experimental protocol menu...
Claus Gittinger <cg@exept.de>
parents:
8962
diff
changeset
|
865 |
monitorProcess isNil ifTrue:[ |
ddf4fc887179
experimental protocol menu...
Claus Gittinger <cg@exept.de>
parents:
8962
diff
changeset
|
866 |
items := items , #( |
ddf4fc887179
experimental protocol menu...
Claus Gittinger <cg@exept.de>
parents:
8962
diff
changeset
|
867 |
('Start Monitor' #doStartMonitor ) |
ddf4fc887179
experimental protocol menu...
Claus Gittinger <cg@exept.de>
parents:
8962
diff
changeset
|
868 |
). |
ddf4fc887179
experimental protocol menu...
Claus Gittinger <cg@exept.de>
parents:
8962
diff
changeset
|
869 |
] ifFalse:[ |
ddf4fc887179
experimental protocol menu...
Claus Gittinger <cg@exept.de>
parents:
8962
diff
changeset
|
870 |
items := items , #( |
ddf4fc887179
experimental protocol menu...
Claus Gittinger <cg@exept.de>
parents:
8962
diff
changeset
|
871 |
('Stop Monitor' #doStopMonitor ) |
ddf4fc887179
experimental protocol menu...
Claus Gittinger <cg@exept.de>
parents:
8962
diff
changeset
|
872 |
). |
ddf4fc887179
experimental protocol menu...
Claus Gittinger <cg@exept.de>
parents:
8962
diff
changeset
|
873 |
]. |
ddf4fc887179
experimental protocol menu...
Claus Gittinger <cg@exept.de>
parents:
8962
diff
changeset
|
874 |
|
73 | 875 |
hasMore ifTrue:[ |
2007 | 876 |
items := items , #( |
877 |
('-') |
|
4197 | 878 |
('Show More' #showMore ) |
2007 | 879 |
) |
73 | 880 |
]. |
881 |
||
8993
ddf4fc887179
experimental protocol menu...
Claus Gittinger <cg@exept.de>
parents:
8962
diff
changeset
|
882 |
protocols := Dictionary new. |
9703 | 883 |
selectorsByFirstCharacter := Dictionary new. |
9367 | 884 |
object class withAllSuperclassesDo:[:eachClass | |
8993
ddf4fc887179
experimental protocol menu...
Claus Gittinger <cg@exept.de>
parents:
8962
diff
changeset
|
885 |
eachClass methodDictionary keysAndValuesDo:[:sel :m | |
ddf4fc887179
experimental protocol menu...
Claus Gittinger <cg@exept.de>
parents:
8962
diff
changeset
|
886 |
sel numArgs == 0 ifTrue:[ |
ddf4fc887179
experimental protocol menu...
Claus Gittinger <cg@exept.de>
parents:
8962
diff
changeset
|
887 |
(protocols at:m category ifAbsentPut:[Set new]) add:sel. |
9703 | 888 |
(selectorsByFirstCharacter at:(sel first asString) ifAbsentPut:[Set new]) add:sel. |
8993
ddf4fc887179
experimental protocol menu...
Claus Gittinger <cg@exept.de>
parents:
8962
diff
changeset
|
889 |
] |
ddf4fc887179
experimental protocol menu...
Claus Gittinger <cg@exept.de>
parents:
8962
diff
changeset
|
890 |
]. |
ddf4fc887179
experimental protocol menu...
Claus Gittinger <cg@exept.de>
parents:
8962
diff
changeset
|
891 |
]. |
9574 | 892 |
|
8993
ddf4fc887179
experimental protocol menu...
Claus Gittinger <cg@exept.de>
parents:
8962
diff
changeset
|
893 |
protocolsSorted := protocols keys asArray sort. |
ddf4fc887179
experimental protocol menu...
Claus Gittinger <cg@exept.de>
parents:
8962
diff
changeset
|
894 |
protocolMenu := PopUpMenu |
9703 | 895 |
labels:#('alphabetical' '=') , protocolsSorted |
896 |
selectors:#(nil nil) , protocolsSorted. |
|
897 |
||
898 |
protocolMenu |
|
899 |
subMenuAt:'alphabetical' |
|
900 |
put:[ |
|
901 |
|firstChars| |
|
902 |
||
903 |
firstChars := selectorsByFirstCharacter keys asOrderedCollection sort. |
|
904 |
alphaMenu := PopUpMenu |
|
905 |
labels:firstChars |
|
906 |
selector:#mmm |
|
907 |
args:firstChars |
|
908 |
receiver:self. |
|
909 |
firstChars do:[:ch | |
|
910 |
alphaMenu |
|
911 |
subMenuAt:ch |
|
912 |
put:[ |
|
913 |
|selectors sortedSelectors| |
|
914 |
||
915 |
selectors := selectorsByFirstCharacter at:ch. |
|
916 |
sortedSelectors := selectors asArray sort. |
|
917 |
protocolMenu := PopUpMenu |
|
918 |
labels:sortedSelectors |
|
919 |
selector:#letSelectedObjectPerform: |
|
920 |
args:sortedSelectors |
|
921 |
receiver:self. |
|
922 |
] |
|
923 |
]. |
|
924 |
alphaMenu |
|
925 |
]. |
|
926 |
||
8993
ddf4fc887179
experimental protocol menu...
Claus Gittinger <cg@exept.de>
parents:
8962
diff
changeset
|
927 |
protocolsSorted do:[:p | |
ddf4fc887179
experimental protocol menu...
Claus Gittinger <cg@exept.de>
parents:
8962
diff
changeset
|
928 |
protocolMenu |
ddf4fc887179
experimental protocol menu...
Claus Gittinger <cg@exept.de>
parents:
8962
diff
changeset
|
929 |
subMenuAt:p |
ddf4fc887179
experimental protocol menu...
Claus Gittinger <cg@exept.de>
parents:
8962
diff
changeset
|
930 |
put:[ |
ddf4fc887179
experimental protocol menu...
Claus Gittinger <cg@exept.de>
parents:
8962
diff
changeset
|
931 |
|selectors sortedSelectors| |
ddf4fc887179
experimental protocol menu...
Claus Gittinger <cg@exept.de>
parents:
8962
diff
changeset
|
932 |
|
ddf4fc887179
experimental protocol menu...
Claus Gittinger <cg@exept.de>
parents:
8962
diff
changeset
|
933 |
selectors := protocols at:p. |
ddf4fc887179
experimental protocol menu...
Claus Gittinger <cg@exept.de>
parents:
8962
diff
changeset
|
934 |
sortedSelectors := selectors asArray sort. |
ddf4fc887179
experimental protocol menu...
Claus Gittinger <cg@exept.de>
parents:
8962
diff
changeset
|
935 |
protocolMenu := PopUpMenu |
ddf4fc887179
experimental protocol menu...
Claus Gittinger <cg@exept.de>
parents:
8962
diff
changeset
|
936 |
labels:sortedSelectors |
ddf4fc887179
experimental protocol menu...
Claus Gittinger <cg@exept.de>
parents:
8962
diff
changeset
|
937 |
selector:#letSelectedObjectPerform: |
ddf4fc887179
experimental protocol menu...
Claus Gittinger <cg@exept.de>
parents:
8962
diff
changeset
|
938 |
args:sortedSelectors |
ddf4fc887179
experimental protocol menu...
Claus Gittinger <cg@exept.de>
parents:
8962
diff
changeset
|
939 |
receiver:self. |
ddf4fc887179
experimental protocol menu...
Claus Gittinger <cg@exept.de>
parents:
8962
diff
changeset
|
940 |
] |
93 | 941 |
]. |
942 |
||
9574 | 943 |
localSelectors := object class methodDictionary keys asArray sort. |
944 |
localProtocolMenu := PopUpMenu |
|
945 |
labels:localSelectors |
|
946 |
selector:#letSelectedObjectPerform: |
|
947 |
args:localSelectors |
|
948 |
receiver:self. |
|
949 |
||
7639 | 950 |
items := items , (self numberBaseItems). |
1634
216a4254e634
added 'hex integers' toggle to menu.
Claus Gittinger <cg@exept.de>
parents:
1597
diff
changeset
|
951 |
|
472
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
952 |
m := PopUpMenu |
2007 | 953 |
itemList:items |
954 |
resources:resources. |
|
472
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
955 |
|
8993
ddf4fc887179
experimental protocol menu...
Claus Gittinger <cg@exept.de>
parents:
8962
diff
changeset
|
956 |
m subMenuAt:#protocolMenu put:protocolMenu. |
9574 | 957 |
m subMenuAt:#localProtocolMenu put:localProtocolMenu. |
8993
ddf4fc887179
experimental protocol menu...
Claus Gittinger <cg@exept.de>
parents:
8962
diff
changeset
|
958 |
|
9703 | 959 |
(self theSingleSelectionIndex isNil) ifTrue:[ |
2007 | 960 |
m disableAll:#(doFollow doInspect doBasicInspect doNewInspect |
961 |
browse browseClassHierarchy browseFullClassProtocol |
|
2271
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
962 |
doStartMonitor doCopyKey doCopyKey) |
1895
8b51d61d9c0a
added follow & back menu items.
Claus Gittinger <cg@exept.de>
parents:
1873
diff
changeset
|
963 |
]. |
9703 | 964 |
(self hasSelfEntry and:[selectionIndex == 1]) ifTrue:[ |
965 |
m disableAll:#(doFollow doCopyKey "doInspect doBasicInspect") |
|
472
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
966 |
]. |
7975 | 967 |
|
1895
8b51d61d9c0a
added follow & back menu items.
Claus Gittinger <cg@exept.de>
parents:
1873
diff
changeset
|
968 |
inspectHistory size == 0 ifTrue:[ |
2007 | 969 |
m disable:#doBack |
1895
8b51d61d9c0a
added follow & back menu items.
Claus Gittinger <cg@exept.de>
parents:
1873
diff
changeset
|
970 |
]. |
6491 | 971 |
sel class hasImmediateInstances ifTrue:[ |
2580 | 972 |
m disableAll:#(showReferences doNewInspect) |
973 |
]. |
|
8616 | 974 |
"/ sel inspectorClass == self class ifFalse:[ |
975 |
"/ m disable:#doFollow |
|
976 |
"/ ]. |
|
4197 | 977 |
sel isMethod ifFalse:[ |
978 |
m disable:#browseMethodsClass |
|
979 |
]. |
|
3199 | 980 |
|
472
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
981 |
^ m |
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
982 |
|
9703 | 983 |
"Modified: / 27-01-2011 / 12:08:54 / cg" |
7639 | 984 |
! |
985 |
||
986 |
numberBaseItems |
|
9557
14b8fe98a8ed
can now display values and indices in binary and hex.
Claus Gittinger <cg@exept.de>
parents:
9504
diff
changeset
|
987 |
^ { |
14b8fe98a8ed
can now display values and indices in binary and hex.
Claus Gittinger <cg@exept.de>
parents:
9504
diff
changeset
|
988 |
#('-') . |
14b8fe98a8ed
can now display values and indices in binary and hex.
Claus Gittinger <cg@exept.de>
parents:
9504
diff
changeset
|
989 |
(integerDisplayRadix == 10) |
14b8fe98a8ed
can now display values and indices in binary and hex.
Claus Gittinger <cg@exept.de>
parents:
9504
diff
changeset
|
990 |
ifFalse:[ #('Decimal Integers' #setDisplayRadixTo10 ) ] . |
14b8fe98a8ed
can now display values and indices in binary and hex.
Claus Gittinger <cg@exept.de>
parents:
9504
diff
changeset
|
991 |
(integerDisplayRadix == 2) |
14b8fe98a8ed
can now display values and indices in binary and hex.
Claus Gittinger <cg@exept.de>
parents:
9504
diff
changeset
|
992 |
ifFalse:[ #('Binary Integers' #setDisplayRadixTo2 ) ] . |
14b8fe98a8ed
can now display values and indices in binary and hex.
Claus Gittinger <cg@exept.de>
parents:
9504
diff
changeset
|
993 |
(integerDisplayRadix == 16) |
14b8fe98a8ed
can now display values and indices in binary and hex.
Claus Gittinger <cg@exept.de>
parents:
9504
diff
changeset
|
994 |
ifFalse:[ #('Hex Integers' #setDisplayRadixTo16 ) ] . |
14b8fe98a8ed
can now display values and indices in binary and hex.
Claus Gittinger <cg@exept.de>
parents:
9504
diff
changeset
|
995 |
} select:[:el | el notNil]. |
14b8fe98a8ed
can now display values and indices in binary and hex.
Claus Gittinger <cg@exept.de>
parents:
9504
diff
changeset
|
996 |
|
14b8fe98a8ed
can now display values and indices in binary and hex.
Claus Gittinger <cg@exept.de>
parents:
9504
diff
changeset
|
997 |
"Modified: / 24-08-2010 / 17:31:51 / cg" |
7639 | 998 |
! |
999 |
||
9700 | 1000 |
optionalByteArraySelectionItems |
1001 |
|sel| |
|
1002 |
||
1003 |
sel := self selection. |
|
1004 |
(object isByteArray) ifTrue:[ |
|
1005 |
^ #( |
|
1006 |
('Save Bytes to File...' #saveBytesToFile) |
|
1007 |
). |
|
1008 |
]. |
|
1009 |
^ #() |
|
1010 |
||
1011 |
"Created: / 25-01-2011 / 17:16:12 / cg" |
|
1012 |
! |
|
1013 |
||
7639 | 1014 |
optionalFilenameSelectionItems |
1015 |
|sel| |
|
1016 |
||
1017 |
sel := self selection. |
|
9367 | 1018 |
(object isFilename or:[sel isFilename]) ifTrue:[ |
9737 | 1019 |
OperatingSystem isMSWINDOWSlike ifTrue:[ |
1020 |
^ #( |
|
1021 |
('Show in Explorer' #showInWindowsExplorer) |
|
1022 |
('Open FileBrowser' #openFileBrowser) |
|
1023 |
). |
|
1024 |
]. |
|
7639 | 1025 |
^ #( |
8090 | 1026 |
('Open FileBrowser' #openFileBrowser) |
1027 |
). |
|
7639 | 1028 |
]. |
1029 |
^ #() |
|
1030 |
||
1031 |
"Created: / 09-02-2007 / 16:10:30 / cg" |
|
9737 | 1032 |
"Modified: / 05-02-2011 / 15:49:48 / cg" |
7639 | 1033 |
! |
1034 |
||
8799 | 1035 |
optionalMethodOrBlockSelectionItems |
1036 |
|sel items| |
|
1037 |
||
1038 |
sel := self selection. |
|
1039 |
||
1040 |
items := #(). |
|
1041 |
(sel isBlock or:[sel isContext]) ifTrue:[ |
|
1042 |
items := items , #( |
|
10436 | 1043 |
('Browse Block''s Home' #browseHome) |
8799 | 1044 |
). |
1045 |
]. |
|
9367 | 1046 |
(object isMethod or:[sel isMethod]) ifTrue:[ |
8799 | 1047 |
items := items , #( |
10436 | 1048 |
('Browse Method''s Class' #browseMethodsClass) |
8799 | 1049 |
). |
1050 |
]. |
|
1051 |
(selectionIndex notNil |
|
1052 |
and:[(self fieldList at:selectionIndex ifAbsent:nil) = '-dependents']) ifTrue:[ |
|
1053 |
items := items , #( |
|
1054 |
('Browse Update Methods' #browseUpdateMethods) |
|
1055 |
). |
|
1056 |
]. |
|
1057 |
||
1058 |
^ items |
|
10436 | 1059 |
|
1060 |
"Modified: / 03-08-2011 / 15:03:36 / cg" |
|
8799 | 1061 |
! |
1062 |
||
7639 | 1063 |
optionalStreamSelectionItems |
1064 |
|sel| |
|
1065 |
||
1066 |
sel := self selection. |
|
1067 |
||
8090 | 1068 |
sel isStream ifTrue:[ |
1069 |
sel isFileStream ifTrue:[ |
|
9737 | 1070 |
OperatingSystem isMSWINDOWSlike ifTrue:[ |
1071 |
^ #( |
|
1072 |
('Show in Explorer' #showInWindowsExplorer) |
|
1073 |
('Open FileBrowser' #openFileBrowser) |
|
1074 |
). |
|
1075 |
]. |
|
8090 | 1076 |
^ #( |
1077 |
('Open FileBrowser' #openFileBrowser) |
|
1078 |
). |
|
1079 |
]. |
|
9384 | 1080 |
sel isExternalStream ifFalse:[ |
8090 | 1081 |
^ #( |
7639 | 1082 |
('Show Stream Contents' #showStreamContents) |
1083 |
). |
|
8090 | 1084 |
]. |
7639 | 1085 |
]. |
1086 |
^ #() |
|
1087 |
||
1088 |
"Created: / 09-02-2007 / 16:09:15 / cg" |
|
9737 | 1089 |
"Modified: / 05-02-2011 / 15:49:55 / cg" |
8799 | 1090 |
! |
1091 |
||
9703 | 1092 |
optionalToolItems |
1093 |
"inserted after inspect/browse" |
|
1094 |
||
1095 |
^ #() |
|
1096 |
||
1097 |
"Created: / 27-01-2011 / 11:51:12 / cg" |
|
1098 |
! |
|
1099 |
||
8799 | 1100 |
optionalViewSelectionItems |
1101 |
|sel| |
|
1102 |
||
1103 |
sel := self selection. |
|
1104 |
||
1105 |
sel isView ifTrue:[ |
|
1106 |
^ #( |
|
1107 |
('Show Widget Hierarchy' #openWidgetHierarchy) |
|
1108 |
). |
|
1109 |
]. |
|
1110 |
^ #() |
|
472
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
1111 |
! ! |
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
1112 |
|
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
1113 |
!InspectorView methodsFor:'menu actions'! |
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
1114 |
|
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
1115 |
browse |
2235
ce49947e61f7
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
2193
diff
changeset
|
1116 |
|cls| |
527 | 1117 |
|
8025 | 1118 |
cls := (self selection ? object) class. |
10436 | 1119 |
(cls browserClass ? UserPreferences current systemBrowserClass) |
1120 |
openInClass:cls selector:nil |
|
1121 |
||
1122 |
"Created: / 14-12-1995 / 19:15:50 / cg" |
|
1123 |
"Modified: / 03-08-2011 / 15:07:42 / cg" |
|
527 | 1124 |
! |
1125 |
||
1126 |
browseClass |
|
2235
ce49947e61f7
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
2193
diff
changeset
|
1127 |
|cls| |
472
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
1128 |
|
8025 | 1129 |
cls := (self selection ? object) class. |
10436 | 1130 |
cls browserClass |
1131 |
openInClass:cls selector:nil |
|
1132 |
"/ browseClass:cls |
|
1133 |
||
1134 |
"Modified: / 03-08-2011 / 15:05:58 / cg" |
|
472
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
1135 |
! |
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
1136 |
|
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
1137 |
browseClassHierarchy |
2235
ce49947e61f7
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
2193
diff
changeset
|
1138 |
|cls| |
472
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
1139 |
|
8025 | 1140 |
cls := (self selection ? object) class. |
527 | 1141 |
cls browserClass browseClassHierarchy:cls |
1142 |
||
1143 |
"Modified: 3.5.1996 / 12:40:04 / cg" |
|
472
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
1144 |
! |
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
1145 |
|
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
1146 |
browseFullClassProtocol |
2235
ce49947e61f7
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
2193
diff
changeset
|
1147 |
|cls| |
472
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
1148 |
|
8025 | 1149 |
cls := (self selection ? object) class. |
527 | 1150 |
cls browserClass browseFullClassProtocol:cls |
1151 |
||
1152 |
"Modified: 3.5.1996 / 12:40:17 / cg" |
|
472
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
1153 |
! |
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
1154 |
|
2579 | 1155 |
browseHome |
1156 |
|sel mthd| |
|
1157 |
||
8025 | 1158 |
sel := self selection ? object. |
2579 | 1159 |
sel isBlock ifTrue:[ |
1160 |
mthd := sel homeMethod |
|
1161 |
] ifFalse:[ |
|
1162 |
sel isContext ifTrue:[ |
|
1163 |
mthd := sel method. |
|
1164 |
] |
|
1165 |
]. |
|
1166 |
mthd isNil ifTrue:[ |
|
1167 |
^ self warn:'Sorry - cannot figure out home method.' |
|
1168 |
]. |
|
1169 |
mthd class browserClass |
|
1170 |
openInClass:mthd mclass selector:mthd selector |
|
1171 |
! |
|
1172 |
||
4197 | 1173 |
browseMethodsClass |
1174 |
|mthd| |
|
1175 |
||
1176 |
mthd := self selection. |
|
1177 |
mthd mclass browserClass |
|
1178 |
openInClass:mthd mclass selector:mthd selector |
|
1179 |
! |
|
1180 |
||
7975 | 1181 |
browseUpdateMethods |
1182 |
|deps methods| |
|
1183 |
||
1184 |
deps := self selection. |
|
1185 |
methods := Set new. |
|
1186 |
deps do:[:each | |
|
1187 |
|implClass| |
|
1188 |
||
8962 | 1189 |
implClass := each class whichClassIncludesSelector:#'update:with:from:'. |
7975 | 1190 |
implClass notNil ifTrue:[ |
1191 |
methods add:(implClass compiledMethodAt:#'update:with:from:') |
|
1192 |
] |
|
1193 |
]. |
|
1194 |
methods isEmpty ifTrue:[^ self]. |
|
1195 |
||
1196 |
methods first mclass browserClass |
|
1197 |
browseMethods:methods |
|
1198 |
title:'Update Method(s) of dependent(s)' |
|
1199 |
! |
|
1200 |
||
1895
8b51d61d9c0a
added follow & back menu items.
Claus Gittinger <cg@exept.de>
parents:
1873
diff
changeset
|
1201 |
doBack |
8b51d61d9c0a
added follow & back menu items.
Claus Gittinger <cg@exept.de>
parents:
1873
diff
changeset
|
1202 |
"user selected back-menu entry" |
8b51d61d9c0a
added follow & back menu items.
Claus Gittinger <cg@exept.de>
parents:
1873
diff
changeset
|
1203 |
|
8b51d61d9c0a
added follow & back menu items.
Claus Gittinger <cg@exept.de>
parents:
1873
diff
changeset
|
1204 |
|objectToInspect| |
8b51d61d9c0a
added follow & back menu items.
Claus Gittinger <cg@exept.de>
parents:
1873
diff
changeset
|
1205 |
|
8b51d61d9c0a
added follow & back menu items.
Claus Gittinger <cg@exept.de>
parents:
1873
diff
changeset
|
1206 |
inspectHistory size > 0 ifTrue:[ |
8908 | 1207 |
objectToInspect := inspectHistory removeLast. |
1208 |
inspectHistory size == 0 ifTrue:[ |
|
1209 |
inspectHistory := nil |
|
1210 |
]. |
|
1211 |
self inspect:objectToInspect. |
|
1895
8b51d61d9c0a
added follow & back menu items.
Claus Gittinger <cg@exept.de>
parents:
1873
diff
changeset
|
1212 |
] |
8b51d61d9c0a
added follow & back menu items.
Claus Gittinger <cg@exept.de>
parents:
1873
diff
changeset
|
1213 |
|
8b51d61d9c0a
added follow & back menu items.
Claus Gittinger <cg@exept.de>
parents:
1873
diff
changeset
|
1214 |
"Created: / 22.9.1998 / 18:22:01 / cg" |
8b51d61d9c0a
added follow & back menu items.
Claus Gittinger <cg@exept.de>
parents:
1873
diff
changeset
|
1215 |
"Modified: / 22.9.1998 / 18:22:28 / cg" |
8b51d61d9c0a
added follow & back menu items.
Claus Gittinger <cg@exept.de>
parents:
1873
diff
changeset
|
1216 |
! |
8b51d61d9c0a
added follow & back menu items.
Claus Gittinger <cg@exept.de>
parents:
1873
diff
changeset
|
1217 |
|
1930 | 1218 |
doBasicInspect |
1219 |
"user selected inspect-menu entry" |
|
1220 |
||
1221 |
self doInspect:true |
|
1222 |
! |
|
1223 |
||
1895
8b51d61d9c0a
added follow & back menu items.
Claus Gittinger <cg@exept.de>
parents:
1873
diff
changeset
|
1224 |
doFollow |
8b51d61d9c0a
added follow & back menu items.
Claus Gittinger <cg@exept.de>
parents:
1873
diff
changeset
|
1225 |
"user selected follow-menu entry" |
8b51d61d9c0a
added follow & back menu items.
Claus Gittinger <cg@exept.de>
parents:
1873
diff
changeset
|
1226 |
|
8b51d61d9c0a
added follow & back menu items.
Claus Gittinger <cg@exept.de>
parents:
1873
diff
changeset
|
1227 |
|objectToInspect| |
8b51d61d9c0a
added follow & back menu items.
Claus Gittinger <cg@exept.de>
parents:
1873
diff
changeset
|
1228 |
|
2235
ce49947e61f7
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
2193
diff
changeset
|
1229 |
selectionIndex notNil ifTrue:[ |
ce49947e61f7
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
2193
diff
changeset
|
1230 |
objectToInspect := self selection. |
ce49947e61f7
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
2193
diff
changeset
|
1231 |
inspectHistory isNil ifTrue:[ |
ce49947e61f7
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
2193
diff
changeset
|
1232 |
inspectHistory := OrderedCollection new |
ce49947e61f7
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
2193
diff
changeset
|
1233 |
]. |
9367 | 1234 |
inspectHistory addLast:object. |
2235
ce49947e61f7
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
2193
diff
changeset
|
1235 |
self inspect:objectToInspect. |
1895
8b51d61d9c0a
added follow & back menu items.
Claus Gittinger <cg@exept.de>
parents:
1873
diff
changeset
|
1236 |
] |
8b51d61d9c0a
added follow & back menu items.
Claus Gittinger <cg@exept.de>
parents:
1873
diff
changeset
|
1237 |
|
8b51d61d9c0a
added follow & back menu items.
Claus Gittinger <cg@exept.de>
parents:
1873
diff
changeset
|
1238 |
"Created: / 22.9.1998 / 18:21:08 / cg" |
8b51d61d9c0a
added follow & back menu items.
Claus Gittinger <cg@exept.de>
parents:
1873
diff
changeset
|
1239 |
"Modified: / 22.9.1998 / 18:22:23 / cg" |
8b51d61d9c0a
added follow & back menu items.
Claus Gittinger <cg@exept.de>
parents:
1873
diff
changeset
|
1240 |
! |
8b51d61d9c0a
added follow & back menu items.
Claus Gittinger <cg@exept.de>
parents:
1873
diff
changeset
|
1241 |
|
472
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
1242 |
doInspect |
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
1243 |
"user selected inspect-menu entry" |
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
1244 |
|
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
1245 |
self doInspect:false |
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
1246 |
! |
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
1247 |
|
1365 | 1248 |
doNewInspect |
1249 |
self doInspect:#new |
|
1250 |
||
1251 |
"Created: / 31.10.1997 / 12:45:38 / cg" |
|
1252 |
"Modified: / 31.10.1997 / 12:47:11 / cg" |
|
1253 |
! |
|
1254 |
||
472
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
1255 |
doStartMonitor |
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
1256 |
"start a monitoring process" |
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
1257 |
|
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
1258 |
monitorProcess isNil ifTrue:[ |
2235
ce49947e61f7
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
2193
diff
changeset
|
1259 |
monitorProcess := |
ce49947e61f7
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
2193
diff
changeset
|
1260 |
[ |
ce49947e61f7
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
2193
diff
changeset
|
1261 |
|sel| |
295
92bcaa9996ae
minor changes for ContextInspector required
Claus Gittinger <cg@exept.de>
parents:
268
diff
changeset
|
1262 |
|
2235
ce49947e61f7
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
2193
diff
changeset
|
1263 |
[true] whileTrue:[ |
ce49947e61f7
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
2193
diff
changeset
|
1264 |
(sel := selectionIndex) notNil ifTrue:[ |
ce49947e61f7
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
2193
diff
changeset
|
1265 |
self showSelection:sel |
ce49947e61f7
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
2193
diff
changeset
|
1266 |
]. |
ce49947e61f7
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
2193
diff
changeset
|
1267 |
(Delay forSeconds:0.5) wait |
ce49947e61f7
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
2193
diff
changeset
|
1268 |
] |
ce49947e61f7
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
2193
diff
changeset
|
1269 |
] forkAt:Processor userBackgroundPriority |
472
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
1270 |
] |
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
1271 |
|
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
1272 |
"Modified: 12.4.1996 / 14:20:06 / cg" |
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
1273 |
! |
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
1274 |
|
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
1275 |
doStopMonitor |
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
1276 |
"stop the monitor" |
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
1277 |
|
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
1278 |
monitorProcess terminate. |
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
1279 |
monitorProcess := nil |
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
1280 |
! |
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
1281 |
|
2800 | 1282 |
doTraceAll |
472
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
1283 |
"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
|
1284 |
|
9367 | 1285 |
self topView withWaitCursorDo:[MessageTracer traceAll:object on:Transcript] |
472
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
1286 |
! |
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
1287 |
|
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
1288 |
doTrap |
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
1289 |
"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
|
1290 |
|
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
1291 |
|string selector| |
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
1292 |
|
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
1293 |
string := Dialog request:'Selector to trap on:' onCancel:nil. |
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
1294 |
|
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
1295 |
string notNil ifTrue:[ |
8908 | 1296 |
selector := string asSymbolIfInterned. |
901 | 1297 |
|
8908 | 1298 |
selector isNil ifTrue:[ |
1299 |
self warn:'no such selector' |
|
1300 |
] ifFalse:[ |
|
9367 | 1301 |
self topView withWaitCursorDo:[MessageTracer trap:object |
8908 | 1302 |
selector:selector] |
1303 |
] |
|
472
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
1304 |
] |
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
1305 |
|
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
1306 |
"Modified: 12.4.1996 / 14:07:01 / cg" |
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
1307 |
! |
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
1308 |
|
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
1309 |
doTrapAll |
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
1310 |
"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
|
1311 |
|
9367 | 1312 |
self topView withWaitCursorDo:[MessageTracer trapAll:object] |
472
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
1313 |
! |
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
1314 |
|
2850 | 1315 |
doTrapAnyInstVarChange |
1316 |
"place a trap which is triggered if any instVar of the inspected object is changed" |
|
1317 |
||
1318 |
self topView withWaitCursorDo:[ |
|
9367 | 1319 |
MessageTracer trapModificationsIn:object |
2850 | 1320 |
] |
1321 |
! |
|
1322 |
||
1323 |
doTrapInstVarChange |
|
1324 |
"place a trap which is triggered if the selected instVar of the inspected object is changed" |
|
1325 |
||
1326 |
self topView withWaitCursorDo:[ |
|
1327 |
|idx| |
|
1328 |
||
1329 |
"/ a named instVar ? |
|
1330 |
idx := self instVarIndexForLine:selectionIndex. |
|
1331 |
idx isNil ifTrue:[ |
|
1332 |
self warn:'select an instance variable first.'. |
|
1333 |
^ self. |
|
1334 |
]. |
|
1335 |
MessageTracer |
|
9367 | 1336 |
trapModificationsOf:(object class allInstVarNames at:idx) |
1337 |
in:object |
|
2850 | 1338 |
] |
1339 |
! |
|
1340 |
||
472
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
1341 |
doUntrace |
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
1342 |
"remove traps/traces" |
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
1343 |
|
9367 | 1344 |
MessageTracer untrace:object |
472
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
1345 |
! |
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
1346 |
|
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
1347 |
inspectOwners |
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
1348 |
"open an inspector on owners of the inspectedObject. |
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
1349 |
(this is a secret function)" |
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
1350 |
|
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
1351 |
self withCursor:(Cursor questionMark) do:[ |
8908 | 1352 |
|owners dict| |
472
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
1353 |
|
9367 | 1354 |
owners := (ObjectMemory whoReferences:object) asOrderedCollection. |
8908 | 1355 |
owners size > 500 ifTrue:[ |
1356 |
(self confirm:'there are ' , owners size printString , ' owners.\\Do you really want to see them all ?' withCRs) |
|
1357 |
ifFalse:[^ self] |
|
1358 |
]. |
|
1359 |
dict := IdentityDictionary new. |
|
1360 |
owners do:[:owner | |
|
1361 |
|set names oClass| |
|
472
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
1362 |
|
8908 | 1363 |
owner ~~ self ifTrue:[ |
1364 |
set := Set new. |
|
1365 |
names := owner class allInstVarNames. |
|
1366 |
oClass := owner class. |
|
1367 |
1 to:oClass instSize do:[:i | |
|
9367 | 1368 |
(owner instVarAt:i) == object ifTrue:[ |
8908 | 1369 |
set add:(names at:i). |
1370 |
]. |
|
1371 |
]. |
|
1372 |
oClass isVariable ifTrue:[ |
|
1373 |
oClass isPointers ifTrue:[ |
|
1374 |
1 to:owner basicSize do:[:i | |
|
9367 | 1375 |
(owner basicAt:i) == object ifTrue:[ |
8908 | 1376 |
set add:i |
1377 |
] |
|
1378 |
] |
|
1379 |
] |
|
1380 |
]. |
|
1381 |
dict at:owner put:set |
|
1382 |
]. |
|
1383 |
]. |
|
1384 |
dict inspect |
|
472
7e2d83585ed7
category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
1385 |
] |
2587
b6838cdb1f14
added show-stream-contents menu item
Claus Gittinger <cg@exept.de>
parents:
2580
diff
changeset
|
1386 |
! |
b6838cdb1f14
added show-stream-contents menu item
Claus Gittinger <cg@exept.de>
parents:
2580
diff
changeset
|
1387 |
|
8993
ddf4fc887179
experimental protocol menu...
Claus Gittinger <cg@exept.de>
parents:
8962
diff
changeset
|
1388 |
letSelectedObjectPerform:aSelector |
9574 | 1389 |
|sel argString| |
8993
ddf4fc887179
experimental protocol menu...
Claus Gittinger <cg@exept.de>
parents:
8962
diff
changeset
|
1390 |
|
ddf4fc887179
experimental protocol menu...
Claus Gittinger <cg@exept.de>
parents:
8962
diff
changeset
|
1391 |
sel := self selection ? object. |
ddf4fc887179
experimental protocol menu...
Claus Gittinger <cg@exept.de>
parents:
8962
diff
changeset
|
1392 |
aSelector numArgs == 0 ifTrue:[ |
ddf4fc887179
experimental protocol menu...
Claus Gittinger <cg@exept.de>
parents:
8962
diff
changeset
|
1393 |
(sel perform:aSelector) inspect. |
ddf4fc887179
experimental protocol menu...
Claus Gittinger <cg@exept.de>
parents:
8962
diff
changeset
|
1394 |
^ self. |
ddf4fc887179
experimental protocol menu...
Claus Gittinger <cg@exept.de>
parents:
8962
diff
changeset
|
1395 |
]. |
9574 | 1396 |
aSelector numArgs == 1 ifTrue:[ |
1397 |
argString := Dialog request:'Argument (Smalltalk Object)'. |
|
1398 |
argString isEmptyOrNil ifTrue:[^ self]. |
|
1399 |
(sel perform:aSelector with:(Object readFrom:argString)) inspect. |
|
1400 |
^ self. |
|
1401 |
]. |
|
8993
ddf4fc887179
experimental protocol menu...
Claus Gittinger <cg@exept.de>
parents:
8962
diff
changeset
|
1402 |
self halt. |
9574 | 1403 |
|
1404 |
"Modified: / 07-10-2010 / 14:34:21 / cg" |
|
8993
ddf4fc887179
experimental protocol menu...
Claus Gittinger <cg@exept.de>
parents:
8962
diff
changeset
|
1405 |
! |
ddf4fc887179
experimental protocol menu...
Claus Gittinger <cg@exept.de>
parents:
8962
diff
changeset
|
1406 |
|
6283
7fa17d36a91c
+openFileBrowser (when inspeting a filename)
Claus Gittinger <cg@exept.de>
parents:
6130
diff
changeset
|
1407 |
openFileBrowser |
7fa17d36a91c
+openFileBrowser (when inspeting a filename)
Claus Gittinger <cg@exept.de>
parents:
6130
diff
changeset
|
1408 |
|fn| |
7fa17d36a91c
+openFileBrowser (when inspeting a filename)
Claus Gittinger <cg@exept.de>
parents:
6130
diff
changeset
|
1409 |
|
7fa17d36a91c
+openFileBrowser (when inspeting a filename)
Claus Gittinger <cg@exept.de>
parents:
6130
diff
changeset
|
1410 |
fn := self selection. |
9615 | 1411 |
fn isNil ifTrue:[ fn := inspectedObject ]. |
8155 | 1412 |
fn isStream ifTrue:[ |
1413 |
fn := fn pathName asFilename |
|
1414 |
]. |
|
9794 | 1415 |
(UserPreferences current fileBrowserClass) openOnFileNamed:fn asFilename. |
1416 |
||
1417 |
"Modified: / 22-03-2011 / 18:05:22 / cg" |
|
6283
7fa17d36a91c
+openFileBrowser (when inspeting a filename)
Claus Gittinger <cg@exept.de>
parents:
6130
diff
changeset
|
1418 |
! |
7fa17d36a91c
+openFileBrowser (when inspeting a filename)
Claus Gittinger <cg@exept.de>
parents:
6130
diff
changeset
|
1419 |
|
8799 | 1420 |
openWidgetHierarchy |
1421 |
|view| |
|
1422 |
||
1423 |
view := self selection. |
|
1424 |
view isView ifFalse:[^ self]. |
|
1425 |
||
1426 |
WindowTreeView openOn:view |
|
1427 |
! |
|
1428 |
||
9700 | 1429 |
saveBytesToFile |
1430 |
|fn| |
|
1431 |
||
1432 |
fn := Dialog requestFileName:'Save bytes into:'. |
|
1433 |
fn isEmptyOrNil ifTrue:[^ self]. |
|
1434 |
||
1435 |
fn asFilename contents:inspectedObject. |
|
1436 |
||
1437 |
"Modified: / 25-01-2011 / 17:23:38 / cg" |
|
1438 |
! |
|
1439 |
||
9737 | 1440 |
showInWindowsExplorer |
1441 |
"show in explorer" |
|
1442 |
||
1443 |
|fn dir| |
|
1444 |
||
1445 |
fn := self selection. |
|
1446 |
fn isNil ifTrue:[ fn := inspectedObject ]. |
|
1447 |
fn isStream ifTrue:[ |
|
1448 |
fn := fn pathName asFilename |
|
1449 |
]. |
|
1450 |
dir := fn isDirectory |
|
1451 |
ifTrue:[ fn ] |
|
1452 |
ifFalse:[ fn directory ]. |
|
1453 |
||
1454 |
OperatingSystem |
|
1455 |
openApplicationForDocument:dir |
|
1456 |
operation:#explore. |
|
1457 |
||
1458 |
"Created: / 05-02-2011 / 15:49:33 / cg" |
|
1459 |
! |
|
1460 |
||
7951 | 1461 |
showOwners |
1462 |
|o| |
|
1463 |
||
1464 |
o := self selection. |
|
1465 |
self withCursor:(Cursor questionMark) do:[ |
|
1466 |
|owners dict| |
|
1467 |
||
1468 |
owners := (ObjectMemory whoReferences:o). |
|
1469 |
owners isEmptyOrNil ifTrue:[ |
|
1470 |
self information:'No owners found.'. |
|
1471 |
^ self |
|
1472 |
]. |
|
1473 |
owners := owners asOrderedCollection. |
|
1474 |
" |
|
1475 |
skip weakArrays ... (they dont count) |
|
1476 |
" |
|
1477 |
owners := owners reject:[:owner | owner isMemberOf:WeakArray]. |
|
1478 |
owners inspect. |
|
1479 |
"/ inspector := DictionaryInspectorView openOn:dict. |
|
1480 |
"/ inspector listView doubleClickAction:[:lineNr | inspector doInspectKey]. |
|
1481 |
] |
|
1482 |
||
1483 |
"Modified: 15.10.1996 / 22:09:38 / cg" |
|
1484 |
! |
|
1485 |
||
1486 |
showReferences |
|
1487 |
"user selected references-menu entry" |
|
1488 |
||
1489 |
self selection class hasImmediateInstances ifTrue:[ |
|
1490 |
^ self warn:'Sorry - cannot show references to immediate objects' |
|
1491 |
]. |
|
1492 |
ObjectMemory displayRefChainTo:(self selection) |
|
1493 |
||
1494 |
"Modified: / 30.7.1998 / 14:03:16 / cg" |
|
1495 |
! |
|
1496 |
||
2587
b6838cdb1f14
added show-stream-contents menu item
Claus Gittinger <cg@exept.de>
parents:
2580
diff
changeset
|
1497 |
showStreamContents |
b6838cdb1f14
added show-stream-contents menu item
Claus Gittinger <cg@exept.de>
parents:
2580
diff
changeset
|
1498 |
|sel| |
b6838cdb1f14
added show-stream-contents menu item
Claus Gittinger <cg@exept.de>
parents:
2580
diff
changeset
|
1499 |
|
b6838cdb1f14
added show-stream-contents menu item
Claus Gittinger <cg@exept.de>
parents:
2580
diff
changeset
|
1500 |
sel := self selection. |
b6838cdb1f14
added show-stream-contents menu item
Claus Gittinger <cg@exept.de>
parents:
2580
diff
changeset
|
1501 |
(sel isStream and:[sel isExternalStream not]) ifTrue:[ |
b6838cdb1f14
added show-stream-contents menu item
Claus Gittinger <cg@exept.de>
parents:
2580
diff
changeset
|
1502 |
workspace replace:(sel contents printString) |
b6838cdb1f14
added show-stream-contents menu item
Claus Gittinger <cg@exept.de>
parents:
2580
diff
changeset
|
1503 |
]. |
b6838cdb1f14
added show-stream-contents menu item
Claus Gittinger <cg@exept.de>
parents:
2580
diff
changeset
|
1504 |
|
b6838cdb1f14
added show-stream-contents menu item
Claus Gittinger <cg@exept.de>
parents:
2580
diff
changeset
|
1505 |
"Created: / 6.2.2000 / 13:46:37 / cg" |
b6838cdb1f14
added show-stream-contents menu item
Claus Gittinger <cg@exept.de>
parents:
2580
diff
changeset
|
1506 |
"Modified: / 6.2.2000 / 13:47:37 / cg" |
73 | 1507 |
! ! |
1508 |
||
200 | 1509 |
!InspectorView methodsFor:'private'! |
1510 |
||
2271
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
1511 |
baseInspectedObjectClass |
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
1512 |
^ Object |
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
1513 |
|
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
1514 |
|
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
1515 |
! |
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
1516 |
|
647 | 1517 |
defaultLabel |
9736 | 1518 |
^ 'InstVars & Pseudo Slots' |
1519 |
||
1520 |
"Modified: / 05-02-2011 / 14:06:26 / cg" |
|
647 | 1521 |
! |
1522 |
||
6850 | 1523 |
derivedFieldNames |
9701 | 1524 |
|d actionItems valueItems otherItems| |
7297 | 1525 |
|
1526 |
d := self derivedFields. |
|
1527 |
(d isKindOf:Dictionary) ifTrue:[ |
|
9701 | 1528 |
actionItems := d keys select:[:k | k startsWith:'!!'] as:OrderedCollection . |
1529 |
valueItems := d keys select:[:k | k startsWith:'-'] as:OrderedCollection. |
|
1530 |
otherItems := d keys select:[:k | (k startsWithAnyOf:#('!!' '-')) not] as:OrderedCollection. |
|
1531 |
^ ((actionItems sort , valueItems sort) collect:[:k | (k copyTo:1),(k copyFrom:2) allItalic]) |
|
1532 |
, |
|
1533 |
otherItems sort |
|
7297 | 1534 |
]. |
1535 |
^ d collect:[:eachEntry | |
|
6850 | 1536 |
|nm| |
1537 |
||
1538 |
nm := (eachEntry isAssociation) |
|
1539 |
ifTrue:[ eachEntry key ] |
|
1540 |
ifFalse:[ eachEntry first ]. |
|
8699 | 1541 |
'-',nm allItalic |
6850 | 1542 |
] |
1543 |
||
1544 |
"Created: / 03-08-2006 / 15:02:54 / cg" |
|
9701 | 1545 |
"Modified: / 27-01-2011 / 11:45:17 / cg" |
6850 | 1546 |
! |
1547 |
||
6823 | 1548 |
derivedFields |
7054 | 1549 |
"the check below is not sufficient - if someone catches messages, for example. |
1550 |
Therefore, we do a manual lookup here:" |
|
8962 | 1551 |
|
1552 |
(object class whichClassIncludesSelector:#inspectorExtraAttributes) isNil ifTrue:[ |
|
7054 | 1553 |
^ #() |
1554 |
]. |
|
6823 | 1555 |
^ [object inspectorExtraAttributes] |
1556 |
on: MessageNotUnderstood |
|
6850 | 1557 |
do: [:ex | ex return: #() ] |
6823 | 1558 |
|
1559 |
"Created: / 17-07-2006 / 11:02:32 / cg" |
|
7054 | 1560 |
"Modified: / 29-08-2006 / 13:03:31 / cg" |
6823 | 1561 |
! |
1562 |
||
6850 | 1563 |
extraNamedFieldNames |
1564 |
^ self extraNamedFields |
|
1565 |
collect:[:eachEntry | |
|
1566 |
|nm| |
|
1567 |
||
1568 |
nm := (eachEntry isAssociation) |
|
1569 |
ifTrue:[ eachEntry key ] |
|
1570 |
ifFalse:[ eachEntry first ]. |
|
1571 |
'`',nm |
|
1572 |
] |
|
1573 |
||
1574 |
"Modified: / 03-08-2006 / 15:17:19 / cg" |
|
1575 |
! |
|
1576 |
||
1577 |
extraNamedFields |
|
6940 | 1578 |
"by redefining inspectorExtraNamedFields to return an array of |
1579 |
pseudo-fieldName->value associations, the inspectors left list can be extended" |
|
1580 |
||
7054 | 1581 |
"the check below is not sufficient - if someone catches messages, for example. |
1582 |
Therefore, we do a manual lookup here:" |
|
8962 | 1583 |
|
1584 |
(object class whichClassIncludesSelector:#inspectorExtraNamedFields) isNil ifTrue:[ |
|
7054 | 1585 |
^ #() |
1586 |
]. |
|
6850 | 1587 |
^ [object inspectorExtraNamedFields] |
1588 |
on: MessageNotUnderstood |
|
6940 | 1589 |
do: [:ex | ex return: #() ] |
6850 | 1590 |
|
1591 |
"Created: / 03-08-2006 / 13:34:18 / cg" |
|
7054 | 1592 |
"Modified: / 29-08-2006 / 13:03:57 / cg" |
6850 | 1593 |
! |
1594 |
||
1595 |
extraNamedVarIndexForLine:lineNr |
|
1596 |
"helper - return the index for a named instVar; |
|
1597 |
nil, if self or a keyed instvar is selected." |
|
1598 |
||
1599 |
|idx nNamedInstvarsShown nExtraNamedInstvarsShown cls baseCls firstRealIndex line| |
|
1600 |
||
1601 |
lineNr isNil ifTrue:[^ nil]. |
|
1602 |
firstRealIndex := 1. |
|
1603 |
||
1604 |
idx := lineNr. |
|
1605 |
self hasSelfEntry ifTrue:[ |
|
1606 |
(lineNr == 1 or:[lineNr isNil]) ifTrue:[ |
|
1607 |
^ nil "/ self selected |
|
1608 |
]. |
|
1609 |
idx := idx - 1. |
|
1610 |
firstRealIndex := 2. |
|
1611 |
]. |
|
1612 |
||
1613 |
[line := listView at:firstRealIndex. |
|
1614 |
(line startsWith:'-') and:[line size < 2 or:[line second isDigit not]]] whileTrue:[ |
|
1615 |
firstRealIndex := firstRealIndex + 1. |
|
1616 |
idx := idx - 1. |
|
1617 |
]. |
|
1618 |
||
9367 | 1619 |
cls := object class. |
6850 | 1620 |
baseCls := self baseInspectedObjectClass. |
1621 |
||
1622 |
nNamedInstvarsShown := cls instSize. |
|
1623 |
"/ only the namedInstvars below baseInspectedObjectClass |
|
1624 |
"/ are shown ... |
|
1625 |
(cls == baseCls or:[cls isSubclassOf:baseCls]) ifTrue:[ |
|
1626 |
nNamedInstvarsShown := nNamedInstvarsShown - baseCls instSize. |
|
1627 |
]. |
|
1628 |
||
1629 |
idx := idx - nNamedInstvarsShown. |
|
1630 |
idx < 1 ifTrue:[ |
|
1631 |
^ nil. |
|
1632 |
]. |
|
1633 |
||
1634 |
nExtraNamedInstvarsShown := self extraNamedFields size. |
|
1635 |
idx <= nExtraNamedInstvarsShown ifTrue:[ |
|
1636 |
^ idx. |
|
1637 |
]. |
|
1638 |
||
1639 |
^ nil "/ indexed instvar or other selected |
|
1640 |
||
1641 |
"Created: / 03-08-2006 / 13:45:14 / cg" |
|
1642 |
"Modified: / 04-08-2006 / 11:45:29 / cg" |
|
3874
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1643 |
! |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1644 |
|
200 | 1645 |
fieldList |
1646 |
"return a list of names to show in the selectionList. |
|
1647 |
Leave hasMore as true, if a '...' entry should be added." |
|
1648 |
||
6840 | 1649 |
|derivedFieldList namedFieldList fieldList cls indexedList extraNamedFieldList| |
200 | 1650 |
|
9367 | 1651 |
object isNil ifTrue:[ |
4095
5bd36b14723d
labels; added suppressPseudoVars & dereferenceValueHolders
Claus Gittinger <cg@exept.de>
parents:
3884
diff
changeset
|
1652 |
^ self hasSelfEntry ifFalse:[ #() ] ifTrue:[ #('-self') ] |
3338 | 1653 |
]. |
2271
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
1654 |
|
9367 | 1655 |
cls := object class. |
7297 | 1656 |
|
2275 | 1657 |
self topView withWaitCursorDo:[ |
6823 | 1658 |
namedFieldList := self namedFieldList. |
3868 | 1659 |
indexedList := self indexedFieldList. |
6840 | 1660 |
extraNamedFieldList := OrderedCollection new. |
3349 | 1661 |
|
4095
5bd36b14723d
labels; added suppressPseudoVars & dereferenceValueHolders
Claus Gittinger <cg@exept.de>
parents:
3884
diff
changeset
|
1662 |
self hasSelfEntry ifTrue:[ |
5bd36b14723d
labels; added suppressPseudoVars & dereferenceValueHolders
Claus Gittinger <cg@exept.de>
parents:
3884
diff
changeset
|
1663 |
self suppressPseudoSlots ifFalse:[ |
6823 | 1664 |
derivedFieldList := OrderedCollection new. |
9370 | 1665 |
derivedFieldList addAll:(self pseudoFieldNamesWithIndexed:(indexedList notEmptyOrNil)). |
6850 | 1666 |
derivedFieldList addAll:(self derivedFieldNames). |
7297 | 1667 |
extraNamedFieldList addAll:(self extraNamedFieldNames). |
3608 | 1668 |
]. |
3525 | 1669 |
]. |
531 | 1670 |
|
6823 | 1671 |
fieldList := OrderedCollection new. |
1672 |
derivedFieldList notNil ifTrue:[fieldList addAll:derivedFieldList]. |
|
1673 |
namedFieldList notNil ifTrue:[fieldList addAll:namedFieldList]. |
|
6840 | 1674 |
extraNamedFieldList notNil ifTrue:[fieldList addAll:extraNamedFieldList]. |
6823 | 1675 |
indexedList notNil ifTrue:[fieldList addAll:indexedList]. |
200 | 1676 |
]. |
6823 | 1677 |
^ fieldList |
531 | 1678 |
|
7297 | 1679 |
"Modified: / 18-09-2006 / 21:16:03 / cg" |
200 | 1680 |
! |
1681 |
||
295
92bcaa9996ae
minor changes for ContextInspector required
Claus Gittinger <cg@exept.de>
parents:
268
diff
changeset
|
1682 |
hasSelfEntry |
4095
5bd36b14723d
labels; added suppressPseudoVars & dereferenceValueHolders
Claus Gittinger <cg@exept.de>
parents:
3884
diff
changeset
|
1683 |
^ hideReceiver not and:[self suppressPseudoSlots not] |
295
92bcaa9996ae
minor changes for ContextInspector required
Claus Gittinger <cg@exept.de>
parents:
268
diff
changeset
|
1684 |
|
92bcaa9996ae
minor changes for ContextInspector required
Claus Gittinger <cg@exept.de>
parents:
268
diff
changeset
|
1685 |
"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
|
1686 |
"Modified: 28.6.1996 / 15:13:41 / cg" |
295
92bcaa9996ae
minor changes for ContextInspector required
Claus Gittinger <cg@exept.de>
parents:
268
diff
changeset
|
1687 |
! |
92bcaa9996ae
minor changes for ContextInspector required
Claus Gittinger <cg@exept.de>
parents:
268
diff
changeset
|
1688 |
|
3874
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1689 |
indexList |
9557
14b8fe98a8ed
can now display values and indices in binary and hex.
Claus Gittinger <cg@exept.de>
parents:
9504
diff
changeset
|
1690 |
"return a list of indexes usable to access the object's indexed slots. |
2271
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
1691 |
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
|
1692 |
|
9557
14b8fe98a8ed
can now display values and indices in binary and hex.
Claus Gittinger <cg@exept.de>
parents:
9504
diff
changeset
|
1693 |
|objSz n cls sz| |
2271
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
1694 |
|
9367 | 1695 |
cls := object class. |
2271
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
1696 |
|
3868 | 1697 |
cls isVariable ifFalse:[^ nil ]. |
2271
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
1698 |
|
9557
14b8fe98a8ed
can now display values and indices in binary and hex.
Claus Gittinger <cg@exept.de>
parents:
9504
diff
changeset
|
1699 |
n := objSz := object basicSize. |
2271
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
1700 |
(n > nShown) ifTrue:[ |
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
1701 |
n := nShown. |
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
1702 |
hasMore := true. |
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
1703 |
]. |
3874
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1704 |
^ (1 to:n) |
9557
14b8fe98a8ed
can now display values and indices in binary and hex.
Claus Gittinger <cg@exept.de>
parents:
9504
diff
changeset
|
1705 |
|
14b8fe98a8ed
can now display values and indices in binary and hex.
Claus Gittinger <cg@exept.de>
parents:
9504
diff
changeset
|
1706 |
"Modified: / 24-08-2010 / 17:56:23 / cg" |
3874
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1707 |
! |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1708 |
|
9367 | 1709 |
indexOfFirstNamedInstvarInList |
1710 |
"helper - return the index for the first named instVar; |
|
1711 |
nil, if self or a keyed instvar is selected." |
|
1712 |
||
1713 |
|firstRealIndex| |
|
1714 |
||
1715 |
firstRealIndex := 1. |
|
1716 |
self hasSelfEntry ifTrue:[ |
|
1717 |
firstRealIndex := 2. |
|
1718 |
]. |
|
1719 |
||
1720 |
[ |
|
1721 |
|line| |
|
1722 |
||
1723 |
line := listView at:firstRealIndex. |
|
1724 |
(line startsWith:'-') and:[line size < 2 or:[line second isDigit not]] |
|
1725 |
] whileTrue:[ |
|
1726 |
firstRealIndex := firstRealIndex + 1. |
|
1727 |
]. |
|
1728 |
^ firstRealIndex |
|
1729 |
! |
|
1730 |
||
3874
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1731 |
indexedFieldList |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1732 |
"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
|
1733 |
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
|
1734 |
|
9557
14b8fe98a8ed
can now display values and indices in binary and hex.
Claus Gittinger <cg@exept.de>
parents:
9504
diff
changeset
|
1735 |
|l maxIndex sz| |
3874
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1736 |
|
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1737 |
l := self indexList. |
10858 | 1738 |
l isEmptyOrNil ifTrue:[^ nil ]. |
9557
14b8fe98a8ed
can now display values and indices in binary and hex.
Claus Gittinger <cg@exept.de>
parents:
9504
diff
changeset
|
1739 |
|
14b8fe98a8ed
can now display values and indices in binary and hex.
Claus Gittinger <cg@exept.de>
parents:
9504
diff
changeset
|
1740 |
integerDisplayRadix ~~ 10 ifTrue:[ |
14b8fe98a8ed
can now display values and indices in binary and hex.
Claus Gittinger <cg@exept.de>
parents:
9504
diff
changeset
|
1741 |
maxIndex := l last. |
14b8fe98a8ed
can now display values and indices in binary and hex.
Claus Gittinger <cg@exept.de>
parents:
9504
diff
changeset
|
1742 |
maxIndex isInteger ifTrue:[ |
14b8fe98a8ed
can now display values and indices in binary and hex.
Claus Gittinger <cg@exept.de>
parents:
9504
diff
changeset
|
1743 |
sz := (maxIndex printStringRadix:integerDisplayRadix) size. |
14b8fe98a8ed
can now display values and indices in binary and hex.
Claus Gittinger <cg@exept.de>
parents:
9504
diff
changeset
|
1744 |
] ifFalse:[ |
14b8fe98a8ed
can now display values and indices in binary and hex.
Claus Gittinger <cg@exept.de>
parents:
9504
diff
changeset
|
1745 |
sz := 0 |
14b8fe98a8ed
can now display values and indices in binary and hex.
Claus Gittinger <cg@exept.de>
parents:
9504
diff
changeset
|
1746 |
]. |
14b8fe98a8ed
can now display values and indices in binary and hex.
Claus Gittinger <cg@exept.de>
parents:
9504
diff
changeset
|
1747 |
^ l collect:[:i | |
14b8fe98a8ed
can now display values and indices in binary and hex.
Claus Gittinger <cg@exept.de>
parents:
9504
diff
changeset
|
1748 |
i isInteger ifTrue:[ |
14b8fe98a8ed
can now display values and indices in binary and hex.
Claus Gittinger <cg@exept.de>
parents:
9504
diff
changeset
|
1749 |
(i printStringRadix:integerDisplayRadix size:sz fill:$0) |
14b8fe98a8ed
can now display values and indices in binary and hex.
Claus Gittinger <cg@exept.de>
parents:
9504
diff
changeset
|
1750 |
] ifFalse:[ |
14b8fe98a8ed
can now display values and indices in binary and hex.
Claus Gittinger <cg@exept.de>
parents:
9504
diff
changeset
|
1751 |
i printString |
14b8fe98a8ed
can now display values and indices in binary and hex.
Claus Gittinger <cg@exept.de>
parents:
9504
diff
changeset
|
1752 |
] |
14b8fe98a8ed
can now display values and indices in binary and hex.
Claus Gittinger <cg@exept.de>
parents:
9504
diff
changeset
|
1753 |
] |
14b8fe98a8ed
can now display values and indices in binary and hex.
Claus Gittinger <cg@exept.de>
parents:
9504
diff
changeset
|
1754 |
] ifFalse:[ |
14b8fe98a8ed
can now display values and indices in binary and hex.
Claus Gittinger <cg@exept.de>
parents:
9504
diff
changeset
|
1755 |
^ l collect:[:i | i printString]. |
14b8fe98a8ed
can now display values and indices in binary and hex.
Claus Gittinger <cg@exept.de>
parents:
9504
diff
changeset
|
1756 |
]. |
14b8fe98a8ed
can now display values and indices in binary and hex.
Claus Gittinger <cg@exept.de>
parents:
9504
diff
changeset
|
1757 |
|
10858 | 1758 |
"Modified: / 14-11-2011 / 12:56:12 / cg" |
3874
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1759 |
! |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1760 |
|
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1761 |
indexedValueAtIndex:idx |
9367 | 1762 |
^ object basicAt:idx |
3874
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1763 |
! |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1764 |
|
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1765 |
indexedValueAtIndex:idx put:newValue |
9367 | 1766 |
object basicAt:idx put:newValue |
2271
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
1767 |
! |
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
1768 |
|
3884 | 1769 |
indexedValueAtKey:key |
4314 | 1770 |
"/ kludge |
9367 | 1771 |
object isLimitedPrecisionReal ifTrue:[ |
1772 |
^ object basicAt:key |
|
4314 | 1773 |
]. |
9367 | 1774 |
^ object at:key |
3884 | 1775 |
! |
1776 |
||
2193
3d7b1044e8c8
fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents:
2188
diff
changeset
|
1777 |
instVarIndexForLine:lineNr |
3d7b1044e8c8
fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents:
2188
diff
changeset
|
1778 |
"helper - return the index for a named instVar; |
3d7b1044e8c8
fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents:
2188
diff
changeset
|
1779 |
nil, if self or a keyed instvar is selected." |
3d7b1044e8c8
fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents:
2188
diff
changeset
|
1780 |
|
5421
86a6077b131d
Fix for negative numbers as keys in a Dictionary
Stefan Vogel <sv@exept.de>
parents:
5134
diff
changeset
|
1781 |
|idx nNamedInstvarsShown cls baseCls firstRealIndex line| |
2193
3d7b1044e8c8
fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents:
2188
diff
changeset
|
1782 |
|
3d7b1044e8c8
fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents:
2188
diff
changeset
|
1783 |
lineNr isNil ifTrue:[^ nil]. |
3349 | 1784 |
firstRealIndex := 1. |
2193
3d7b1044e8c8
fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents:
2188
diff
changeset
|
1785 |
|
3d7b1044e8c8
fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents:
2188
diff
changeset
|
1786 |
idx := lineNr. |
4095
5bd36b14723d
labels; added suppressPseudoVars & dereferenceValueHolders
Claus Gittinger <cg@exept.de>
parents:
3884
diff
changeset
|
1787 |
self hasSelfEntry ifTrue:[ |
2193
3d7b1044e8c8
fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents:
2188
diff
changeset
|
1788 |
(lineNr == 1 or:[lineNr isNil]) ifTrue:[ |
3d7b1044e8c8
fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents:
2188
diff
changeset
|
1789 |
^ nil "/ self selected |
3d7b1044e8c8
fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents:
2188
diff
changeset
|
1790 |
]. |
3d7b1044e8c8
fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents:
2188
diff
changeset
|
1791 |
idx := idx - 1. |
3349 | 1792 |
firstRealIndex := 2. |
1793 |
]. |
|
1794 |
||
5421
86a6077b131d
Fix for negative numbers as keys in a Dictionary
Stefan Vogel <sv@exept.de>
parents:
5134
diff
changeset
|
1795 |
[line := listView at:firstRealIndex. |
86a6077b131d
Fix for negative numbers as keys in a Dictionary
Stefan Vogel <sv@exept.de>
parents:
5134
diff
changeset
|
1796 |
(line startsWith:'-') and:[line size < 2 or:[line second isDigit not]]] whileTrue:[ |
3349 | 1797 |
firstRealIndex := firstRealIndex + 1. |
1798 |
idx := idx - 1. |
|
2193
3d7b1044e8c8
fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents:
2188
diff
changeset
|
1799 |
]. |
3d7b1044e8c8
fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents:
2188
diff
changeset
|
1800 |
|
9367 | 1801 |
cls := object class. |
2447 | 1802 |
baseCls := self baseInspectedObjectClass. |
1803 |
||
1804 |
nNamedInstvarsShown := cls instSize. |
|
2271
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
1805 |
"/ only the namedInstvars below baseInspectedObjectClass |
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
1806 |
"/ are shown ... |
8962 | 1807 |
(cls includesBehavior:baseCls) ifTrue:[ |
2447 | 1808 |
nNamedInstvarsShown := nNamedInstvarsShown - baseCls instSize. |
1809 |
]. |
|
2271
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
1810 |
|
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
1811 |
idx <= nNamedInstvarsShown ifTrue:[ |
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
1812 |
^ idx + self baseInspectedObjectClass instSize. |
2193
3d7b1044e8c8
fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents:
2188
diff
changeset
|
1813 |
]. |
2271
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
1814 |
^ nil "/ indexed instvar or other selected |
2193
3d7b1044e8c8
fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents:
2188
diff
changeset
|
1815 |
|
3349 | 1816 |
"Modified: / 31.10.2001 / 09:20:20 / cg" |
2193
3d7b1044e8c8
fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents:
2188
diff
changeset
|
1817 |
! |
3d7b1044e8c8
fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents:
2188
diff
changeset
|
1818 |
|
3d7b1044e8c8
fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents:
2188
diff
changeset
|
1819 |
keyIndexForLine:lineNr |
3d7b1044e8c8
fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents:
2188
diff
changeset
|
1820 |
"helper - return the index of the key-list; |
3d7b1044e8c8
fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents:
2188
diff
changeset
|
1821 |
nil, if self or a namedInstVar is selected." |
3d7b1044e8c8
fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents:
2188
diff
changeset
|
1822 |
|
6840 | 1823 |
|idx nNamedInstvarsShown nExtraNamedInstvarsShown cls baseCls firstRealIndex line| |
2193
3d7b1044e8c8
fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents:
2188
diff
changeset
|
1824 |
|
3d7b1044e8c8
fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents:
2188
diff
changeset
|
1825 |
lineNr isNil ifTrue:[^ nil]. |
3d7b1044e8c8
fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents:
2188
diff
changeset
|
1826 |
|
3349 | 1827 |
firstRealIndex := 1. |
2193
3d7b1044e8c8
fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents:
2188
diff
changeset
|
1828 |
idx := lineNr. |
4095
5bd36b14723d
labels; added suppressPseudoVars & dereferenceValueHolders
Claus Gittinger <cg@exept.de>
parents:
3884
diff
changeset
|
1829 |
self hasSelfEntry ifTrue:[ |
2193
3d7b1044e8c8
fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents:
2188
diff
changeset
|
1830 |
(lineNr == 1 or:[lineNr isNil]) ifTrue:[ |
3d7b1044e8c8
fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents:
2188
diff
changeset
|
1831 |
^ nil "/ self selected |
3d7b1044e8c8
fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents:
2188
diff
changeset
|
1832 |
]. |
3d7b1044e8c8
fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents:
2188
diff
changeset
|
1833 |
idx := idx - 1. |
3349 | 1834 |
firstRealIndex := firstRealIndex + 1. |
1835 |
]. |
|
1836 |
||
5421
86a6077b131d
Fix for negative numbers as keys in a Dictionary
Stefan Vogel <sv@exept.de>
parents:
5134
diff
changeset
|
1837 |
[line := listView at:firstRealIndex. |
5881
ef6791c315ab
oops - out of bounds error fixed
Claus Gittinger <cg@exept.de>
parents:
5845
diff
changeset
|
1838 |
line notNil |
ef6791c315ab
oops - out of bounds error fixed
Claus Gittinger <cg@exept.de>
parents:
5845
diff
changeset
|
1839 |
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
|
1840 |
] whileTrue:[ |
3349 | 1841 |
firstRealIndex := firstRealIndex + 1. |
1842 |
idx := idx - 1. |
|
2193
3d7b1044e8c8
fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents:
2188
diff
changeset
|
1843 |
]. |
3d7b1044e8c8
fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents:
2188
diff
changeset
|
1844 |
|
9367 | 1845 |
cls := object class. |
2447 | 1846 |
baseCls := self baseInspectedObjectClass. |
1847 |
||
1848 |
nNamedInstvarsShown := cls instSize. |
|
2271
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
1849 |
"/ only the namedInstvars below baseInspectedObjectClass |
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
1850 |
"/ are shown ... |
8962 | 1851 |
(cls includesBehavior:baseCls) ifTrue:[ |
2447 | 1852 |
nNamedInstvarsShown := nNamedInstvarsShown - baseCls instSize. |
1853 |
]. |
|
6850 | 1854 |
nExtraNamedInstvarsShown := self extraNamedFields size. |
2271
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
1855 |
|
6840 | 1856 |
idx <= (nNamedInstvarsShown+nExtraNamedInstvarsShown) ifTrue:[ |
2271
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
1857 |
^ nil "/ named instVar selected. |
2193
3d7b1044e8c8
fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents:
2188
diff
changeset
|
1858 |
]. |
6840 | 1859 |
^ idx - (nNamedInstvarsShown+nExtraNamedInstvarsShown). |
2193
3d7b1044e8c8
fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents:
2188
diff
changeset
|
1860 |
|
6850 | 1861 |
"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
|
1862 |
! |
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
1863 |
|
9367 | 1864 |
namedFieldAt:idx |
1865 |
^ object instVarAt:idx |
|
1866 |
! |
|
1867 |
||
1868 |
namedFieldAt:idx put:newValue |
|
1869 |
^ object instVarAt:idx put:newValue |
|
1870 |
! |
|
1871 |
||
2271
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
1872 |
namedFieldList |
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
1873 |
"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
|
1874 |
|
2447 | 1875 |
|aList cls baseCls| |
2271
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
1876 |
|
9367 | 1877 |
cls := object class. |
2447 | 1878 |
baseCls := self baseInspectedObjectClass. |
1879 |
||
3351 | 1880 |
aList := OrderedCollection new. |
3338 | 1881 |
|
3351 | 1882 |
aList addAll:(cls allInstVarNames). |
8962 | 1883 |
(cls includesBehavior:baseCls) ifTrue:[ |
3351 | 1884 |
"/ hide some stuff |
1885 |
aList := aList copyFrom:(self baseInspectedObjectClass instSize + 1). |
|
1886 |
]. |
|
1887 |
||
2271
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
1888 |
^ aList |
3349 | 1889 |
|
7297 | 1890 |
"Modified: / 18-09-2006 / 21:35:30 / cg" |
6372 | 1891 |
! |
1892 |
||
9370 | 1893 |
pseudoFieldNames |
1894 |
"return a list of names to show in the selectionList. |
|
1895 |
Leave hasMore as true, if a '...' entry should be added." |
|
1896 |
||
1897 |
|list cls| |
|
1898 |
||
1899 |
cls := object class. |
|
1900 |
||
1901 |
list := OrderedCollection new. |
|
1902 |
list add:'-' , 'self' allItalic. |
|
1903 |
list add:'-' , 'local messages' allItalic. |
|
1904 |
"/ list add:'-' , 'inherited messages' allItalic. |
|
1905 |
list add:'-' , 'all messages' allItalic. |
|
1906 |
list add:'-' , 'hash' allItalic. |
|
1907 |
list add:'-' , 'identityHash' allItalic. |
|
1908 |
||
1909 |
cls hasImmediateInstances ifFalse:[ |
|
1910 |
object dependents notEmptyOrNil ifTrue:[ |
|
1911 |
list add:'-' , 'dependents' allItalic. |
|
1912 |
]. |
|
1913 |
]. |
|
1914 |
cls instSize > 0 ifTrue:[ |
|
1915 |
list add:'-' , 'all inst vars' allItalic. |
|
1916 |
]. |
|
1917 |
((cls isVariable) and:[self showAllIndexedVarsInFieldList]) ifTrue:[ |
|
1918 |
list add:'-' , 'all indexed vars' allItalic. |
|
1919 |
]. |
|
1920 |
^ list |
|
1921 |
! |
|
1922 |
||
1923 |
pseudoFieldNamesWithIndexed:withIndexed |
|
1924 |
"return a list of names to show in the selectionList. |
|
1925 |
Leave hasMore as true, if a '...' entry should be added." |
|
1926 |
||
1927 |
|list cls| |
|
1928 |
||
1929 |
cls := object class. |
|
1930 |
||
1931 |
list := OrderedCollection new. |
|
1932 |
list add:'-' , 'self' allItalic. |
|
1933 |
list add:'-' , 'local messages' allItalic. |
|
1934 |
"/ list add:'-' , 'inherited messages' allItalic. |
|
1935 |
list add:'-' , 'all messages' allItalic. |
|
1936 |
list add:'-' , 'hash' allItalic. |
|
1937 |
list add:'-' , 'identityHash' allItalic. |
|
1938 |
||
1939 |
cls hasImmediateInstances ifFalse:[ |
|
1940 |
object dependents notEmptyOrNil ifTrue:[ |
|
1941 |
list add:'-' , 'dependents' allItalic. |
|
1942 |
]. |
|
1943 |
]. |
|
1944 |
cls instSize > 0 ifTrue:[ |
|
1945 |
list add:'-' , 'all inst vars' allItalic. |
|
1946 |
]. |
|
1947 |
(withIndexed and:[self showAllIndexedVarsInFieldList]) ifTrue:[ |
|
1948 |
list add:'-' , 'all indexed vars' allItalic. |
|
1949 |
]. |
|
1950 |
^ list |
|
1951 |
! |
|
1952 |
||
3608 | 1953 |
setAcceptAction |
1954 |
"set the codeViews accept action" |
|
1955 |
||
9375
f885ea13e694
allow multiSelect in dictionary inspector (for removeKey)
Claus Gittinger <cg@exept.de>
parents:
9370
diff
changeset
|
1956 |
|idx acceptAction sel| |
3608 | 1957 |
|
1958 |
acceptAction := [:theText | self doAccept:theText asString]. |
|
1959 |
||
9375
f885ea13e694
allow multiSelect in dictionary inspector (for removeKey)
Claus Gittinger <cg@exept.de>
parents:
9370
diff
changeset
|
1960 |
idx := self theSingleSelectionIndex. |
f885ea13e694
allow multiSelect in dictionary inspector (for removeKey)
Claus Gittinger <cg@exept.de>
parents:
9370
diff
changeset
|
1961 |
|
f885ea13e694
allow multiSelect in dictionary inspector (for removeKey)
Claus Gittinger <cg@exept.de>
parents:
9370
diff
changeset
|
1962 |
(idx isNil |
9367 | 1963 |
or:[ object class hasImmediateInstances]) |
3608 | 1964 |
ifTrue:[ |
1965 |
acceptAction := nil. |
|
1966 |
] ifFalse:[ |
|
9375
f885ea13e694
allow multiSelect in dictionary inspector (for removeKey)
Claus Gittinger <cg@exept.de>
parents:
9370
diff
changeset
|
1967 |
sel := listView at:idx. |
3608 | 1968 |
|
3868 | 1969 |
(sel startsWith:'-all') ifTrue:[ |
3608 | 1970 |
acceptAction := nil. |
1971 |
]. |
|
1972 |
(sel startsWith:'-hash') ifTrue:[ |
|
1973 |
acceptAction := nil. |
|
1974 |
]. |
|
1975 |
(sel startsWith:'-identityHash') ifTrue:[ |
|
1976 |
acceptAction := nil. |
|
1977 |
]. |
|
3634 | 1978 |
(sel startsWith:'-dependents') ifTrue:[ |
1979 |
acceptAction := nil. |
|
1980 |
]. |
|
5134 | 1981 |
(sel startsWith:'-source') ifTrue:[ |
1982 |
acceptAction := nil. |
|
1983 |
]. |
|
3608 | 1984 |
]. |
1985 |
||
1986 |
workspace acceptAction:acceptAction. |
|
1987 |
! |
|
1988 |
||
200 | 1989 |
setDoItAction |
542 | 1990 |
"set the codeViews doit action" |
1991 |
||
1992 |
workspace |
|
8908 | 1993 |
doItAction:[:theCode | |
1994 |
|evaluator| |
|
200 | 1995 |
|
9367 | 1996 |
(evaluator := object class evaluatorClass) |
8908 | 1997 |
notNil ifTrue:[ |
1998 |
evaluator |
|
1999 |
evaluate:theCode |
|
2000 |
in:nil |
|
9367 | 2001 |
receiver:object |
8908 | 2002 |
notifying:workspace |
2003 |
logged:true |
|
2004 |
ifFail:nil |
|
2005 |
] ifFalse:[ |
|
2006 |
'objects class provides no evaluator' |
|
2007 |
] |
|
2008 |
]. |
|
542 | 2009 |
|
9367 | 2010 |
object class evaluatorClass isNil ifTrue:[ |
8908 | 2011 |
workspace doItAction:nil. |
2012 |
workspace acceptAction:nil. |
|
1270
3dc841708edd
disable accept/doIt, if instances class provides no evaluator
Claus Gittinger <cg@exept.de>
parents:
1235
diff
changeset
|
2013 |
] |
3dc841708edd
disable accept/doIt, if instances class provides no evaluator
Claus Gittinger <cg@exept.de>
parents:
1235
diff
changeset
|
2014 |
|
3dc841708edd
disable accept/doIt, if instances class provides no evaluator
Claus Gittinger <cg@exept.de>
parents:
1235
diff
changeset
|
2015 |
"Modified: 1.8.1997 / 21:47:09 / cg" |
200 | 2016 |
! |
2017 |
||
3884 | 2018 |
showAllIndexedVarsInFieldList |
2019 |
^ true |
|
2020 |
! |
|
2021 |
||
200 | 2022 |
showMore |
1855
24108d2b3374
oops - fixed showMore handling
Claus Gittinger <cg@exept.de>
parents:
1770
diff
changeset
|
2023 |
|o| |
24108d2b3374
oops - fixed showMore handling
Claus Gittinger <cg@exept.de>
parents:
1770
diff
changeset
|
2024 |
|
200 | 2025 |
hasMore ifTrue:[ |
2235
ce49947e61f7
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
2193
diff
changeset
|
2026 |
nShown := nShown * 2. |
ce49947e61f7
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
2193
diff
changeset
|
2027 |
"/ force update (which is otherwise ignored) |
9367 | 2028 |
o := object. |
2235
ce49947e61f7
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
2193
diff
changeset
|
2029 |
inspectedObject := object := nil. |
ce49947e61f7
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
2193
diff
changeset
|
2030 |
self inspect:o |
200 | 2031 |
] |
1855
24108d2b3374
oops - fixed showMore handling
Claus Gittinger <cg@exept.de>
parents:
1770
diff
changeset
|
2032 |
|
24108d2b3374
oops - fixed showMore handling
Claus Gittinger <cg@exept.de>
parents:
1770
diff
changeset
|
2033 |
"Modified: / 26.8.1998 / 19:05:25 / cg" |
1739 | 2034 |
! |
2035 |
||
3868 | 2036 |
stringWithAllIndexedVarValues |
3874
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2037 |
|nIdx s names maxLen varString padLeft| |
3868 | 2038 |
|
9367 | 2039 |
nIdx := object size. |
3868 | 2040 |
|
8388 | 2041 |
s := CharacterWriteStream on:''. |
3874
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2042 |
names := self indexList. |
4999 | 2043 |
names size > 0 ifTrue:[ |
2044 |
maxLen := (names collect:[:eachName | eachName printString size]) max. |
|
2045 |
padLeft := names conform:[:eachIdx | eachIdx isInteger]. |
|
2046 |
||
2047 |
names do:[:eachIdx | |
|
2048 |
|val| |
|
3874
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2049 |
|
4999 | 2050 |
padLeft ifTrue:[ |
2051 |
s nextPutAll:(eachIdx printStringLeftPaddedTo:maxLen). |
|
2052 |
] ifFalse:[ |
|
2053 |
s nextPutAll:((eachIdx printString , ' ') paddedTo:maxLen+1 with:$.). |
|
2054 |
]. |
|
3874
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2055 |
|
4999 | 2056 |
s nextPutAll:' : '. |
2057 |
val := self indexedValueAtKey:eachIdx. |
|
3874
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2058 |
|
4999 | 2059 |
varString := self basicDisplayStringForValue:val. |
2060 |
(varString includes:Character cr) ifTrue:[ |
|
2061 |
varString := varString copyTo:(varString indexOf:Character cr)-1. |
|
2062 |
varString := varString , '...'. |
|
2063 |
]. |
|
2064 |
s nextPutLine:varString. |
|
3868 | 2065 |
]. |
2066 |
]. |
|
2067 |
nShown < nIdx ifTrue:[ |
|
2068 |
s nextPutLine:' ...'. |
|
2069 |
]. |
|
2070 |
^ s contents |
|
2071 |
! |
|
2072 |
||
3608 | 2073 |
stringWithAllInstVarValues |
11228 | 2074 |
|s names maxLen| |
3608 | 2075 |
|
8388 | 2076 |
s := CharacterWriteStream on:''. |
9367 | 2077 |
names := object class allInstVarNames. |
3608 | 2078 |
maxLen := (names collect:[:eachName | eachName size]) max. |
5498 | 2079 |
names keysAndValuesDo:[:eachInstVarIndex :eachInstVarName | |
11228 | 2080 |
|val valString| |
2081 |
||
2082 |
val := object instVarAt:eachInstVarIndex. |
|
2083 |
||
3608 | 2084 |
s nextPutAll:((eachInstVarName , ' ') paddedTo:maxLen+1 with:$.). |
2085 |
s nextPutAll:' : '. |
|
11228 | 2086 |
valString := self basicDisplayStringForValue:val. |
2087 |
(valString includes:Character cr) ifTrue:[ |
|
2088 |
valString := valString copyTo:(valString indexOf:Character cr)-1. |
|
2089 |
valString := valString , '...'. |
|
3608 | 2090 |
]. |
11228 | 2091 |
s nextPutAll:valString. |
3608 | 2092 |
s cr. |
11228 | 2093 |
|
11230 | 2094 |
((ExpandArraysInAllLists == true) and:[val isArray]) ifTrue:[ |
11228 | 2095 |
val doWithIndex:[:el :idx | |
2096 |
|elValString| |
|
2097 |
||
2098 |
s nextPutAll:(' ' paddedTo:maxLen+1 with:$.). |
|
2099 |
s nextPutAll:(' [',(idx printString leftPaddedTo:2),']'). |
|
2100 |
s nextPutAll:' : '. |
|
2101 |
elValString := self basicDisplayStringForValue:el. |
|
2102 |
s nextPutAll:elValString. |
|
2103 |
s cr. |
|
2104 |
]. |
|
2105 |
]. |
|
3608 | 2106 |
]. |
8388 | 2107 |
^ s contents |
11228 | 2108 |
|
11230 | 2109 |
"Modified: / 30-01-2012 / 16:51:25 / cg" |
3608 | 2110 |
! |
2111 |
||
8726 | 2112 |
stringWithMessages:which |
2113 |
|cls s messages | |
|
2114 |
||
2115 |
s := CharacterWriteStream on:''. |
|
9367 | 2116 |
cls := object class. |
8726 | 2117 |
which == #local ifTrue:[ |
2118 |
messages := cls selectors. |
|
2119 |
] ifFalse:[ |
|
2120 |
which == #all ifTrue:[ |
|
2121 |
messages := cls allSelectors. |
|
2122 |
] ifFalse:[ |
|
2123 |
messages := cls allSelectors copy asSet removeAll:cls selectors; yourself. |
|
2124 |
]. |
|
2125 |
]. |
|
2126 |
||
2127 |
messages asOrderedCollection sort do:[:eachSelector | |
|
2128 |
s nextPutAll:eachSelector. |
|
2129 |
s cr. |
|
2130 |
]. |
|
2131 |
^ s contents |
|
2132 |
! |
|
2133 |
||
9375
f885ea13e694
allow multiSelect in dictionary inspector (for removeKey)
Claus Gittinger <cg@exept.de>
parents:
9370
diff
changeset
|
2134 |
theSingleSelectionIndex |
f885ea13e694
allow multiSelect in dictionary inspector (for removeKey)
Claus Gittinger <cg@exept.de>
parents:
9370
diff
changeset
|
2135 |
"helper - return the index of the (single) selected entry. |
f885ea13e694
allow multiSelect in dictionary inspector (for removeKey)
Claus Gittinger <cg@exept.de>
parents:
9370
diff
changeset
|
2136 |
Nil if nothing or multiple items are selected" |
f885ea13e694
allow multiSelect in dictionary inspector (for removeKey)
Claus Gittinger <cg@exept.de>
parents:
9370
diff
changeset
|
2137 |
|
f885ea13e694
allow multiSelect in dictionary inspector (for removeKey)
Claus Gittinger <cg@exept.de>
parents:
9370
diff
changeset
|
2138 |
|idx| |
f885ea13e694
allow multiSelect in dictionary inspector (for removeKey)
Claus Gittinger <cg@exept.de>
parents:
9370
diff
changeset
|
2139 |
|
f885ea13e694
allow multiSelect in dictionary inspector (for removeKey)
Claus Gittinger <cg@exept.de>
parents:
9370
diff
changeset
|
2140 |
idx := selectionIndex. |
f885ea13e694
allow multiSelect in dictionary inspector (for removeKey)
Claus Gittinger <cg@exept.de>
parents:
9370
diff
changeset
|
2141 |
idx isCollection ifTrue:[ |
f885ea13e694
allow multiSelect in dictionary inspector (for removeKey)
Claus Gittinger <cg@exept.de>
parents:
9370
diff
changeset
|
2142 |
selectionIndex size == 1 ifTrue:[ |
f885ea13e694
allow multiSelect in dictionary inspector (for removeKey)
Claus Gittinger <cg@exept.de>
parents:
9370
diff
changeset
|
2143 |
^ selectionIndex first |
f885ea13e694
allow multiSelect in dictionary inspector (for removeKey)
Claus Gittinger <cg@exept.de>
parents:
9370
diff
changeset
|
2144 |
]. |
f885ea13e694
allow multiSelect in dictionary inspector (for removeKey)
Claus Gittinger <cg@exept.de>
parents:
9370
diff
changeset
|
2145 |
^ nil |
f885ea13e694
allow multiSelect in dictionary inspector (for removeKey)
Claus Gittinger <cg@exept.de>
parents:
9370
diff
changeset
|
2146 |
]. |
f885ea13e694
allow multiSelect in dictionary inspector (for removeKey)
Claus Gittinger <cg@exept.de>
parents:
9370
diff
changeset
|
2147 |
^ selectionIndex |
f885ea13e694
allow multiSelect in dictionary inspector (for removeKey)
Claus Gittinger <cg@exept.de>
parents:
9370
diff
changeset
|
2148 |
! |
f885ea13e694
allow multiSelect in dictionary inspector (for removeKey)
Claus Gittinger <cg@exept.de>
parents:
9370
diff
changeset
|
2149 |
|
200 | 2150 |
valueAtLine:lineNr |
2151 |
"helper - return the value of the selected entry" |
|
2152 |
||
6850 | 2153 |
|idx l val| |
200 | 2154 |
|
4095
5bd36b14723d
labels; added suppressPseudoVars & dereferenceValueHolders
Claus Gittinger <cg@exept.de>
parents:
3884
diff
changeset
|
2155 |
(self hasSelfEntry |
2271
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
2156 |
and:[lineNr == 1 or:[lineNr isNil]]) ifTrue:[ |
9367 | 2157 |
^ object |
2271
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
2158 |
]. |
2235
ce49947e61f7
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
2193
diff
changeset
|
2159 |
|
3645 | 2160 |
((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
|
2161 |
(l ~= '-' and:[(l at:2) isDigit not "negative number"]) ifTrue:[ |
3645 | 2162 |
^ self valueForSpecialLine:(listView at:lineNr) |
2163 |
]. |
|
3338 | 2164 |
]. |
2165 |
||
2271
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
2166 |
"/ a named instVar ? |
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
2167 |
idx := self instVarIndexForLine:lineNr. |
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
2168 |
idx notNil ifTrue:[ |
3432
087493c18c74
class based exceptions - no longer need to send #breakPointSÃgnal
Claus Gittinger <cg@exept.de>
parents:
3428
diff
changeset
|
2169 |
BreakPointInterrupt catch:[ |
9367 | 2170 |
^ self namedFieldAt:idx |
2800 | 2171 |
] |
2271
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
2172 |
]. |
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
2173 |
|
6840 | 2174 |
"/ an extra named field ? |
2175 |
idx := self extraNamedVarIndexForLine:lineNr. |
|
2176 |
idx notNil ifTrue:[ |
|
2177 |
BreakPointInterrupt catch:[ |
|
6850 | 2178 |
val := ((self extraNamedFields) at:idx) value. |
2179 |
val isBlock ifTrue:[ val := val value ]. |
|
2180 |
^ val |
|
6840 | 2181 |
] |
2182 |
]. |
|
2183 |
||
2271
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
2184 |
"/ an indexed instVar ? |
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
2185 |
idx := self keyIndexForLine:lineNr. |
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
2186 |
idx notNil ifTrue:[ |
3432
087493c18c74
class based exceptions - no longer need to send #breakPointSÃgnal
Claus Gittinger <cg@exept.de>
parents:
3428
diff
changeset
|
2187 |
BreakPointInterrupt catch:[ |
2800 | 2188 |
^ self indexedValueAtIndex:idx. |
2189 |
] |
|
200 | 2190 |
]. |
644
aab7d4f7c8c3
allow hiding self; added a label
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
2191 |
|
2271
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
2192 |
"/ nope |
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
2193 |
^ nil |
613 | 2194 |
|
6850 | 2195 |
"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
|
2196 |
! |
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
2197 |
|
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
2198 |
valueAtLine:lineNr put:newValue |
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
2199 |
|idx| |
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
2200 |
|
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
2201 |
idx := self instVarIndexForLine:selectionIndex. |
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
2202 |
idx notNil ifTrue:[ |
9367 | 2203 |
self namedFieldAt:idx put:newValue. |
2204 |
^ self. |
|
2271
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
2205 |
]. |
9367 | 2206 |
|
2207 |
idx := self keyIndexForLine:selectionIndex. |
|
2208 |
idx notNil ifTrue:[ |
|
2209 |
self indexedValueAtIndex:idx put:newValue. |
|
2210 |
^ self |
|
2211 |
]. |
|
2212 |
||
2213 |
^ self "/ self selected - dont store |
|
3349 | 2214 |
! |
2215 |
||
2216 |
valueForSpecialLine:line |
|
9367 | 2217 |
|idx fieldEntry extraAttributes| |
2218 |
||
2219 |
extraAttributes := object inspectorExtraAttributes. |
|
8664
c6afed1e4bfa
changed #valueForSpecialLine:
Claus Gittinger <cg@exept.de>
parents:
8653
diff
changeset
|
2220 |
(extraAttributes notNil and:[ extraAttributes includesKey:line ]) ifTrue:[ |
7297 | 2221 |
^ (extraAttributes at:line) value |
2222 |
]. |
|
6823 | 2223 |
|
6850 | 2224 |
idx := self derivedFieldNames indexOf:line. |
2225 |
idx ~~ 0 ifTrue:[ |
|
2226 |
fieldEntry := self derivedFields at:idx. |
|
2227 |
] ifFalse:[ |
|
2228 |
idx := self extraNamedFieldNames indexOf:line. |
|
2229 |
idx ~~ 0 ifTrue:[ |
|
2230 |
fieldEntry := self extraNamedFields at:idx. |
|
2231 |
]. |
|
6840 | 2232 |
]. |
6823 | 2233 |
fieldEntry notNil ifTrue:[ |
6850 | 2234 |
fieldEntry isAssociation ifTrue:[ |
2235 |
^ fieldEntry value |
|
2236 |
]. |
|
2237 |
^ fieldEntry at:2. |
|
6823 | 2238 |
]. |
2239 |
||
3525 | 2240 |
(line startsWith:'-self') ifTrue:[ |
9367 | 2241 |
^ object |
3525 | 2242 |
]. |
9504 | 2243 |
(line startsWith:'-size') ifTrue:[ |
2244 |
^ object size |
|
2245 |
]. |
|
3525 | 2246 |
(line startsWith:'-hash') ifTrue:[ |
9367 | 2247 |
^ object hash |
3525 | 2248 |
]. |
2249 |
(line startsWith:'-identityHash') ifTrue:[ |
|
9367 | 2250 |
^ object identityHash |
3525 | 2251 |
]. |
3634 | 2252 |
(line startsWith:'-dependents') ifTrue:[ |
9367 | 2253 |
^ object dependents |
3634 | 2254 |
]. |
3868 | 2255 |
(line startsWith:'-all') ifTrue:[ |
9367 | 2256 |
^ object |
3608 | 2257 |
]. |
8726 | 2258 |
(line startsWith:'-local messages') ifTrue:[ |
9367 | 2259 |
^ object |
8726 | 2260 |
]. |
2261 |
(line startsWith:'-inherited messages') ifTrue:[ |
|
9367 | 2262 |
^ object |
8726 | 2263 |
]. |
2264 |
(line startsWith:'-all messages') ifTrue:[ |
|
9367 | 2265 |
^ object |
8726 | 2266 |
]. |
3608 | 2267 |
|
3526 | 2268 |
self error:'unknown special line'. |
3349 | 2269 |
|
6823 | 2270 |
"Created: / 31-10-2001 / 09:17:45 / cg" |
7297 | 2271 |
"Modified: / 18-09-2006 / 21:34:54 / cg" |
200 | 2272 |
! ! |
2273 |
||
3874
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2274 |
!InspectorView methodsFor:'queries'! |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2275 |
|
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2276 |
canInspect:anObject |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2277 |
^ anObject inspectorClass == self class |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2278 |
! |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2279 |
|
5925 | 2280 |
compilerClass |
9367 | 2281 |
^ object class compilerClass |
5925 | 2282 |
! |
2283 |
||
4095
5bd36b14723d
labels; added suppressPseudoVars & dereferenceValueHolders
Claus Gittinger <cg@exept.de>
parents:
3884
diff
changeset
|
2284 |
dereferenceValueHolders |
5bd36b14723d
labels; added suppressPseudoVars & dereferenceValueHolders
Claus Gittinger <cg@exept.de>
parents:
3884
diff
changeset
|
2285 |
^ dereferenceValueHolders ? false |
5bd36b14723d
labels; added suppressPseudoVars & dereferenceValueHolders
Claus Gittinger <cg@exept.de>
parents:
3884
diff
changeset
|
2286 |
! |
5bd36b14723d
labels; added suppressPseudoVars & dereferenceValueHolders
Claus Gittinger <cg@exept.de>
parents:
3884
diff
changeset
|
2287 |
|
3874
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2288 |
labelFor:anObject |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2289 |
"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
|
2290 |
|
10321 | 2291 |
|lbl| |
3874
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2292 |
|
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2293 |
(self class == InspectorView |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2294 |
and:[anObject inspectorClass ~~ InspectorView]) ifTrue:[ |
6130 | 2295 |
lbl := 'BasicInspector on: ' |
3874
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2296 |
] ifFalse:[ |
6130 | 2297 |
lbl := 'Inspector on: ' |
5958 | 2298 |
]. |
10321 | 2299 |
^ (self class classResources string:lbl) |
2300 |
, (self class commonLabelFor:anObject) |
|
2301 |
||
2302 |
"Modified: / 15-07-2011 / 16:22:05 / cg" |
|
3874
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2303 |
! |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2304 |
|
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2305 |
labelNameFor:anObject |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2306 |
"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
|
2307 |
Simply returns the className or name of anObjects class" |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2308 |
|
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2309 |
|s| |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2310 |
|
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2311 |
anObject isClass ifTrue:[ |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2312 |
s := anObject displayString |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2313 |
] ifFalse:[ |
9262 | 2314 |
(anObject isImmediate |
2315 |
or:[anObject isBoolean]) ifTrue:[ |
|
5958 | 2316 |
s := anObject printString , ', ' , anObject classNameWithArticle |
2317 |
] ifFalse:[ |
|
2318 |
s := anObject classNameWithArticle |
|
2319 |
]. |
|
3874
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2320 |
]. |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2321 |
s isNil ifTrue:[ |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2322 |
anObject isBehavior ifTrue:[ |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2323 |
^ 'someBehavior' |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2324 |
]. |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2325 |
^ 'something' |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2326 |
]. |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2327 |
^ s |
5958 | 2328 |
|
2329 |
" |
|
2330 |
1234 inspect |
|
2331 |
true inspect |
|
2332 |
$a inspect |
|
2333 |
" |
|
3874
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2334 |
! |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2335 |
|
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2336 |
selectedKeyName |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2337 |
selectionIndex notNil ifTrue:[ |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2338 |
^ listView listAt:selectionIndex. |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2339 |
]. |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2340 |
^ nil |
4095
5bd36b14723d
labels; added suppressPseudoVars & dereferenceValueHolders
Claus Gittinger <cg@exept.de>
parents:
3884
diff
changeset
|
2341 |
! |
5bd36b14723d
labels; added suppressPseudoVars & dereferenceValueHolders
Claus Gittinger <cg@exept.de>
parents:
3884
diff
changeset
|
2342 |
|
5bd36b14723d
labels; added suppressPseudoVars & dereferenceValueHolders
Claus Gittinger <cg@exept.de>
parents:
3884
diff
changeset
|
2343 |
suppressPseudoSlots |
5bd36b14723d
labels; added suppressPseudoVars & dereferenceValueHolders
Claus Gittinger <cg@exept.de>
parents:
3884
diff
changeset
|
2344 |
^ suppressPseudoSlots ? false |
3874
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2345 |
! ! |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2346 |
|
8653 | 2347 |
!InspectorView methodsFor:'selection'! |
2348 |
||
2349 |
basicDisplayStringForValue:someValue |
|
2350 |
"return the value's displayString to be pasted into the workspace." |
|
2351 |
||
2352 |
|s| |
|
2353 |
||
2354 |
Error handle:[:ex | |
|
2355 |
s := someValue classNameWithArticle. |
|
2356 |
displayStringMessage == #displayString ifTrue:[ |
|
2357 |
s := s , ' "error in displayString: ' , ex description , '"' |
|
2358 |
] ifFalse:[ |
|
2359 |
s := s , ' "error in displayString (' , displayStringMessage , '): ' , ex description , '"' |
|
2360 |
]. |
|
2361 |
^ s |
|
2362 |
] do:[ |
|
9557
14b8fe98a8ed
can now display values and indices in binary and hex.
Claus Gittinger <cg@exept.de>
parents:
9504
diff
changeset
|
2363 |
integerDisplayRadix ~= 10 ifTrue:[ |
14b8fe98a8ed
can now display values and indices in binary and hex.
Claus Gittinger <cg@exept.de>
parents:
9504
diff
changeset
|
2364 |
"/ not everything can be shown in HEX/Binary |
8653 | 2365 |
|
2366 |
someValue isInteger ifTrue:[ |
|
9557
14b8fe98a8ed
can now display values and indices in binary and hex.
Claus Gittinger <cg@exept.de>
parents:
9504
diff
changeset
|
2367 |
^ someValue radixPrintStringRadix:integerDisplayRadix |
8653 | 2368 |
]. |
2369 |
(someValue isMemberOf:ByteArray) ifTrue:[ |
|
2370 |
s := WriteStream on:(String new:10). |
|
2371 |
s writeLimit:100000. |
|
9557
14b8fe98a8ed
can now display values and indices in binary and hex.
Claus Gittinger <cg@exept.de>
parents:
9504
diff
changeset
|
2372 |
someValue printOn:s base:integerDisplayRadix showRadix:true. |
8653 | 2373 |
^ s contents |
2374 |
] |
|
2375 |
]. |
|
2376 |
||
2377 |
"/ displayStringMessage := #classNameWithArticle |
|
2378 |
"/ displayStringMessage := #displayString |
|
2379 |
"/ displayStringMessage := #printString |
|
2380 |
||
9316
eb1bf46371c4
changed: #basicDisplayStringForValue:
Claus Gittinger <cg@exept.de>
parents:
9295
diff
changeset
|
2381 |
s := CharacterWriteStream on:(String new:10). |
8653 | 2382 |
s writeLimit:100000. |
2383 |
||
9280
b3c58d41c771
changed: #basicDisplayStringForValue:
Claus Gittinger <cg@exept.de>
parents:
9262
diff
changeset
|
2384 |
someValue isLazyValue ifTrue:[ |
b3c58d41c771
changed: #basicDisplayStringForValue:
Claus Gittinger <cg@exept.de>
parents:
9262
diff
changeset
|
2385 |
s nextPutAll:someValue class nameWithArticle |
8653 | 2386 |
] ifFalse:[ |
9280
b3c58d41c771
changed: #basicDisplayStringForValue:
Claus Gittinger <cg@exept.de>
parents:
9262
diff
changeset
|
2387 |
"/ mhmh - avoid sending #perform: (bad for proxy objects which pass it to somewhere..) |
b3c58d41c771
changed: #basicDisplayStringForValue:
Claus Gittinger <cg@exept.de>
parents:
9262
diff
changeset
|
2388 |
displayStringMessage == #displayString ifTrue:[ |
b3c58d41c771
changed: #basicDisplayStringForValue:
Claus Gittinger <cg@exept.de>
parents:
9262
diff
changeset
|
2389 |
someValue displayOn:s. |
b3c58d41c771
changed: #basicDisplayStringForValue:
Claus Gittinger <cg@exept.de>
parents:
9262
diff
changeset
|
2390 |
"/ s := someValue displayString. |
8653 | 2391 |
] ifFalse:[ |
9280
b3c58d41c771
changed: #basicDisplayStringForValue:
Claus Gittinger <cg@exept.de>
parents:
9262
diff
changeset
|
2392 |
displayStringMessage == #printString ifTrue:[ |
b3c58d41c771
changed: #basicDisplayStringForValue:
Claus Gittinger <cg@exept.de>
parents:
9262
diff
changeset
|
2393 |
someValue printOn:s. |
b3c58d41c771
changed: #basicDisplayStringForValue:
Claus Gittinger <cg@exept.de>
parents:
9262
diff
changeset
|
2394 |
"/ s := someValue printString. |
8653 | 2395 |
] ifFalse:[ |
9280
b3c58d41c771
changed: #basicDisplayStringForValue:
Claus Gittinger <cg@exept.de>
parents:
9262
diff
changeset
|
2396 |
displayStringMessage == #storeString ifTrue:[ |
b3c58d41c771
changed: #basicDisplayStringForValue:
Claus Gittinger <cg@exept.de>
parents:
9262
diff
changeset
|
2397 |
someValue storeOn:s. |
b3c58d41c771
changed: #basicDisplayStringForValue:
Claus Gittinger <cg@exept.de>
parents:
9262
diff
changeset
|
2398 |
"/ s := someValue storeString. |
b3c58d41c771
changed: #basicDisplayStringForValue:
Claus Gittinger <cg@exept.de>
parents:
9262
diff
changeset
|
2399 |
] ifFalse:[ |
b3c58d41c771
changed: #basicDisplayStringForValue:
Claus Gittinger <cg@exept.de>
parents:
9262
diff
changeset
|
2400 |
^ someValue perform:displayStringMessage. |
b3c58d41c771
changed: #basicDisplayStringForValue:
Claus Gittinger <cg@exept.de>
parents:
9262
diff
changeset
|
2401 |
]. |
8653 | 2402 |
]. |
2403 |
]. |
|
2404 |
]. |
|
2405 |
^ s contents |
|
2406 |
]. |
|
2407 |
||
9557
14b8fe98a8ed
can now display values and indices in binary and hex.
Claus Gittinger <cg@exept.de>
parents:
9504
diff
changeset
|
2408 |
"Modified: / 24-08-2010 / 17:29:08 / cg" |
8653 | 2409 |
! |
2410 |
||
9637
a89a667c84ef
changed: #displayStringForValue:
Claus Gittinger <cg@exept.de>
parents:
9630
diff
changeset
|
2411 |
displayStringForValue:someValue |
8653 | 2412 |
"return the value's displayString to be pasted into the workspace." |
2413 |
||
9375
f885ea13e694
allow multiSelect in dictionary inspector (for removeKey)
Claus Gittinger <cg@exept.de>
parents:
9370
diff
changeset
|
2414 |
|idx sel extraAttributes| |
f885ea13e694
allow multiSelect in dictionary inspector (for removeKey)
Claus Gittinger <cg@exept.de>
parents:
9370
diff
changeset
|
2415 |
|
f885ea13e694
allow multiSelect in dictionary inspector (for removeKey)
Claus Gittinger <cg@exept.de>
parents:
9370
diff
changeset
|
2416 |
idx := self theSingleSelectionIndex. |
f885ea13e694
allow multiSelect in dictionary inspector (for removeKey)
Claus Gittinger <cg@exept.de>
parents:
9370
diff
changeset
|
2417 |
idx notNil ifTrue:[ |
f885ea13e694
allow multiSelect in dictionary inspector (for removeKey)
Claus Gittinger <cg@exept.de>
parents:
9370
diff
changeset
|
2418 |
sel := listView at:idx. |
8653 | 2419 |
|
9367 | 2420 |
extraAttributes := object inspectorExtraAttributes. |
8653 | 2421 |
(extraAttributes notNil and:[extraAttributes includesKey:sel]) ifTrue:[ |
9637
a89a667c84ef
changed: #displayStringForValue:
Claus Gittinger <cg@exept.de>
parents:
9630
diff
changeset
|
2422 |
^ someValue "(extraAttributes at:sel) value" printString |
8653 | 2423 |
]. |
2424 |
||
2425 |
(sel startsWith:'-all inst vars') ifTrue:[ |
|
2426 |
^ self stringWithAllInstVarValues |
|
2427 |
]. |
|
2428 |
(sel startsWith:'-all indexed vars') ifTrue:[ |
|
2429 |
^ self stringWithAllIndexedVarValues |
|
2430 |
]. |
|
8726 | 2431 |
(sel startsWith:'-all messages') ifTrue:[ |
2432 |
^ self stringWithMessages:#all |
|
2433 |
]. |
|
2434 |
(sel startsWith:'-local messages') ifTrue:[ |
|
2435 |
^ self stringWithMessages:#local |
|
2436 |
]. |
|
2437 |
(sel startsWith:'-inherited messages') ifTrue:[ |
|
2438 |
^ self stringWithMessages:#inherited |
|
2439 |
]. |
|
8653 | 2440 |
]. |
2441 |
^ self basicDisplayStringForValue:someValue |
|
2442 |
||
9637
a89a667c84ef
changed: #displayStringForValue:
Claus Gittinger <cg@exept.de>
parents:
9630
diff
changeset
|
2443 |
"Modified: / 17-11-2010 / 19:20:47 / cg" |
8653 | 2444 |
! |
2445 |
||
2446 |
selection:lineNr |
|
2447 |
self showSelection:lineNr |
|
2448 |
! |
|
2449 |
||
2450 |
showSelection:lineNr |
|
2451 |
"user clicked on an instvar - show value in workspace" |
|
2452 |
||
9672 | 2453 |
|listSize val| |
2454 |
||
2455 |
listSize := listView list size. |
|
2456 |
listSize == 0 ifTrue:[^ self]. |
|
2457 |
||
2458 |
(hasMore and:[lineNr == listSize]) ifTrue:[ |
|
8653 | 2459 |
"clicked on the '...' entry" |
2460 |
self showMore. |
|
2461 |
listView setSelection:lineNr. |
|
2462 |
]. |
|
2463 |
||
2464 |
self hasSelfEntry ifTrue:[ |
|
2465 |
(self hasSelfEntry and:[lineNr == 1]) ifTrue:[ |
|
2466 |
"selecting self also does a re-set, this allows updating the list" |
|
2467 |
self reinspect. |
|
2468 |
]. |
|
2469 |
]. |
|
10521
9218a2f4a6d1
Oops, fixes previous (messed) revision (changed: #showSelection:)
vrany
parents:
10520
diff
changeset
|
2470 |
selectionIndex := selectedLine := lineNr. |
8653 | 2471 |
val := self selection. |
2472 |
self showValue:val. |
|
2473 |
||
2474 |
self setAcceptAction. |
|
2475 |
||
2476 |
"Modified: / 03-08-2006 / 14:26:22 / cg" |
|
2477 |
! |
|
2478 |
||
2479 |
showValue:someValue |
|
2480 |
"user clicked on an entry - show value in workspace" |
|
2481 |
||
2482 |
|s| |
|
2483 |
||
9651 | 2484 |
self "topView" withWaitCursorDo:[ |
8653 | 2485 |
s := self displayStringForValue:someValue. |
2486 |
s = workspace selectionAsString ifFalse:[ |
|
2487 |
workspace replace:s. |
|
2488 |
]. |
|
2489 |
]. |
|
2490 |
||
9651 | 2491 |
"Modified: / 30-11-2010 / 18:56:55 / cg" |
8653 | 2492 |
! ! |
2493 |
||
3874
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2494 |
!InspectorView methodsFor:'user interaction'! |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2495 |
|
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2496 |
doAccept:theText |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2497 |
|sel newValue| |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2498 |
|
9396 | 2499 |
sel := listView at:(self theSingleSelectionIndex). |
3874
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2500 |
(sel startsWith:'-all') ifTrue:[ |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2501 |
workspace flash. |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2502 |
^ self. |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2503 |
]. |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2504 |
|
4642
ee63c37d9d3c
Convert Object>>errorSignal -> Error
Stefan Vogel <sv@exept.de>
parents:
4314
diff
changeset
|
2505 |
Error handle:[:ex | |
3874
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2506 |
workspace flash |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2507 |
] do:[ |
9367 | 2508 |
newValue := object class evaluatorClass |
3874
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2509 |
evaluate:theText |
9367 | 2510 |
receiver:object |
3874
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2511 |
notifying:workspace. |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2512 |
|
4095
5bd36b14723d
labels; added suppressPseudoVars & dereferenceValueHolders
Claus Gittinger <cg@exept.de>
parents:
3884
diff
changeset
|
2513 |
self dereferenceValueHolders ifTrue:[ |
5bd36b14723d
labels; added suppressPseudoVars & dereferenceValueHolders
Claus Gittinger <cg@exept.de>
parents:
3884
diff
changeset
|
2514 |
(self valueAtLine:selectionIndex) value:newValue |
5bd36b14723d
labels; added suppressPseudoVars & dereferenceValueHolders
Claus Gittinger <cg@exept.de>
parents:
3884
diff
changeset
|
2515 |
] ifFalse:[ |
5bd36b14723d
labels; added suppressPseudoVars & dereferenceValueHolders
Claus Gittinger <cg@exept.de>
parents:
3884
diff
changeset
|
2516 |
self valueAtLine:selectionIndex put:newValue. |
5bd36b14723d
labels; added suppressPseudoVars & dereferenceValueHolders
Claus Gittinger <cg@exept.de>
parents:
3884
diff
changeset
|
2517 |
] |
3874
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2518 |
] |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2519 |
! |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2520 |
|
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2521 |
doCopyKey |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2522 |
"put the instVar-name into the text-copy-buffer" |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2523 |
|
9378 | 2524 |
|nm selIdx| |
2525 |
||
2526 |
(selIdx := self theSingleSelectionIndex) notNil ifTrue:[ |
|
2527 |
nm := listView listAt:selIdx. |
|
3874
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2528 |
nm notNil ifTrue:[ |
6034 | 2529 |
self setClipboardText:(nm asString) |
3874
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2530 |
] |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2531 |
] |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2532 |
! |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2533 |
|
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2534 |
doInspect:basic |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2535 |
"user selected inspect-menu entry" |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2536 |
|
10207
e2968eb0d08e
changed: #doInspect: to open instvars within same Inspector2 window
vrany
parents:
9794
diff
changeset
|
2537 |
|objectToInspect app | |
3874
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2538 |
|
8025 | 2539 |
objectToInspect := self selection ? object. |
2540 |
objectToInspect notNil ifTrue:[ |
|
9349
e6d367cbe86c
do not show new-inspector in menu, if there is none loaded
Claus Gittinger <cg@exept.de>
parents:
9316
diff
changeset
|
2541 |
(basic == #new and:[NewInspector::NewInspectorView notNil]) ifTrue:[ |
3874
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2542 |
NewInspector::NewInspectorView inspect:objectToInspect |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2543 |
] ifFalse:[ |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2544 |
basic ifTrue:[ |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2545 |
objectToInspect basicInspect |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2546 |
] ifFalse:[ |
10424
9d7d0c28f504
only follow (dive in) with double click;
Claus Gittinger <cg@exept.de>
parents:
10321
diff
changeset
|
2547 |
"/ cg: a bad hack; it is ok for a double-click, but not for the |
9d7d0c28f504
only follow (dive in) with double click;
Claus Gittinger <cg@exept.de>
parents:
10321
diff
changeset
|
2548 |
"/ menu item (i often want to have another inspector on the same object) |
9d7d0c28f504
only follow (dive in) with double click;
Claus Gittinger <cg@exept.de>
parents:
10321
diff
changeset
|
2549 |
"/ for the menu: add an extra follow/diveIn or whatever entry, if desired |
9d7d0c28f504
only follow (dive in) with double click;
Claus Gittinger <cg@exept.de>
parents:
10321
diff
changeset
|
2550 |
"/ "HACK" |
9d7d0c28f504
only follow (dive in) with double click;
Claus Gittinger <cg@exept.de>
parents:
10321
diff
changeset
|
2551 |
"/ app := (self topView perform:#application ifNotUnderstood: [nil]). |
9d7d0c28f504
only follow (dive in) with double click;
Claus Gittinger <cg@exept.de>
parents:
10321
diff
changeset
|
2552 |
"/ (app notNil and:[app isKindOf: Tools::Inspector2]) ifTrue:[ |
9d7d0c28f504
only follow (dive in) with double click;
Claus Gittinger <cg@exept.de>
parents:
10321
diff
changeset
|
2553 |
"/ app inspect: objectToInspect |
9d7d0c28f504
only follow (dive in) with double click;
Claus Gittinger <cg@exept.de>
parents:
10321
diff
changeset
|
2554 |
"/ ] ifFalse:[ |
10207
e2968eb0d08e
changed: #doInspect: to open instvars within same Inspector2 window
vrany
parents:
9794
diff
changeset
|
2555 |
objectToInspect inspect |
10424
9d7d0c28f504
only follow (dive in) with double click;
Claus Gittinger <cg@exept.de>
parents:
10321
diff
changeset
|
2556 |
"/ ] |
3874
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2557 |
] |
8025 | 2558 |
]. |
2559 |
]. |
|
3874
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2560 |
|
10207
e2968eb0d08e
changed: #doInspect: to open instvars within same Inspector2 window
vrany
parents:
9794
diff
changeset
|
2561 |
"Modified: / 06-07-2011 / 15:58:55 / jv" |
10424
9d7d0c28f504
only follow (dive in) with double click;
Claus Gittinger <cg@exept.de>
parents:
10321
diff
changeset
|
2562 |
"Modified: / 29-07-2011 / 21:07:21 / cg" |
3874
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2563 |
! |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2564 |
|
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2565 |
doUpdate |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2566 |
self reinspect |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2567 |
! |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2568 |
|
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2569 |
monitor:anInstVarName |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2570 |
"start a monitoring process, showing the given instVar |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2571 |
in regular intervals." |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2572 |
|
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2573 |
|ivName| |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2574 |
|
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2575 |
(ivName := anInstVarName) isInteger ifTrue:[ |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2576 |
ivName := anInstVarName printString |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2577 |
]. |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2578 |
listView selectElement:ivName. |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2579 |
self doStartMonitor |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2580 |
|
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2581 |
"Created: / 1.3.1996 / 19:31:45 / cg" |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2582 |
"Modified: / 12.2.1999 / 16:05:47 / cg" |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2583 |
! |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2584 |
|
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2585 |
selection |
9375
f885ea13e694
allow multiSelect in dictionary inspector (for removeKey)
Claus Gittinger <cg@exept.de>
parents:
9370
diff
changeset
|
2586 |
"helper - return the value of the (single) selected entry. |
f885ea13e694
allow multiSelect in dictionary inspector (for removeKey)
Claus Gittinger <cg@exept.de>
parents:
9370
diff
changeset
|
2587 |
Nil if nothing or multiple items are selected" |
f885ea13e694
allow multiSelect in dictionary inspector (for removeKey)
Claus Gittinger <cg@exept.de>
parents:
9370
diff
changeset
|
2588 |
|
f885ea13e694
allow multiSelect in dictionary inspector (for removeKey)
Claus Gittinger <cg@exept.de>
parents:
9370
diff
changeset
|
2589 |
|idx val| |
f885ea13e694
allow multiSelect in dictionary inspector (for removeKey)
Claus Gittinger <cg@exept.de>
parents:
9370
diff
changeset
|
2590 |
|
f885ea13e694
allow multiSelect in dictionary inspector (for removeKey)
Claus Gittinger <cg@exept.de>
parents:
9370
diff
changeset
|
2591 |
idx := self theSingleSelectionIndex. |
f885ea13e694
allow multiSelect in dictionary inspector (for removeKey)
Claus Gittinger <cg@exept.de>
parents:
9370
diff
changeset
|
2592 |
idx isNil ifTrue:[^ nil]. |
f885ea13e694
allow multiSelect in dictionary inspector (for removeKey)
Claus Gittinger <cg@exept.de>
parents:
9370
diff
changeset
|
2593 |
|
f885ea13e694
allow multiSelect in dictionary inspector (for removeKey)
Claus Gittinger <cg@exept.de>
parents:
9370
diff
changeset
|
2594 |
val := self valueAtLine:idx. |
6850 | 2595 |
self dereferenceValueHolders ifTrue:[ |
2596 |
"workspace-variable-inspection" |
|
2597 |
val := val value |
|
2598 |
]. |
|
2599 |
^ val |
|
2600 |
||
2601 |
"Modified: / 03-08-2006 / 14:27:02 / cg" |
|
3874
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2602 |
! |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2603 |
|
9557
14b8fe98a8ed
can now display values and indices in binary and hex.
Claus Gittinger <cg@exept.de>
parents:
9504
diff
changeset
|
2604 |
setDisplayRadixTo10 |
14b8fe98a8ed
can now display values and indices in binary and hex.
Claus Gittinger <cg@exept.de>
parents:
9504
diff
changeset
|
2605 |
self setDisplayRadixTo:10 |
14b8fe98a8ed
can now display values and indices in binary and hex.
Claus Gittinger <cg@exept.de>
parents:
9504
diff
changeset
|
2606 |
|
14b8fe98a8ed
can now display values and indices in binary and hex.
Claus Gittinger <cg@exept.de>
parents:
9504
diff
changeset
|
2607 |
"Created: / 24-08-2010 / 17:26:12 / cg" |
14b8fe98a8ed
can now display values and indices in binary and hex.
Claus Gittinger <cg@exept.de>
parents:
9504
diff
changeset
|
2608 |
! |
14b8fe98a8ed
can now display values and indices in binary and hex.
Claus Gittinger <cg@exept.de>
parents:
9504
diff
changeset
|
2609 |
|
14b8fe98a8ed
can now display values and indices in binary and hex.
Claus Gittinger <cg@exept.de>
parents:
9504
diff
changeset
|
2610 |
setDisplayRadixTo16 |
14b8fe98a8ed
can now display values and indices in binary and hex.
Claus Gittinger <cg@exept.de>
parents:
9504
diff
changeset
|
2611 |
self setDisplayRadixTo:16 |
14b8fe98a8ed
can now display values and indices in binary and hex.
Claus Gittinger <cg@exept.de>
parents:
9504
diff
changeset
|
2612 |
|
14b8fe98a8ed
can now display values and indices in binary and hex.
Claus Gittinger <cg@exept.de>
parents:
9504
diff
changeset
|
2613 |
"Created: / 24-08-2010 / 17:26:22 / cg" |
14b8fe98a8ed
can now display values and indices in binary and hex.
Claus Gittinger <cg@exept.de>
parents:
9504
diff
changeset
|
2614 |
! |
14b8fe98a8ed
can now display values and indices in binary and hex.
Claus Gittinger <cg@exept.de>
parents:
9504
diff
changeset
|
2615 |
|
14b8fe98a8ed
can now display values and indices in binary and hex.
Claus Gittinger <cg@exept.de>
parents:
9504
diff
changeset
|
2616 |
setDisplayRadixTo2 |
14b8fe98a8ed
can now display values and indices in binary and hex.
Claus Gittinger <cg@exept.de>
parents:
9504
diff
changeset
|
2617 |
self setDisplayRadixTo:2 |
14b8fe98a8ed
can now display values and indices in binary and hex.
Claus Gittinger <cg@exept.de>
parents:
9504
diff
changeset
|
2618 |
|
14b8fe98a8ed
can now display values and indices in binary and hex.
Claus Gittinger <cg@exept.de>
parents:
9504
diff
changeset
|
2619 |
"Created: / 24-08-2010 / 17:26:18 / cg" |
14b8fe98a8ed
can now display values and indices in binary and hex.
Claus Gittinger <cg@exept.de>
parents:
9504
diff
changeset
|
2620 |
! |
14b8fe98a8ed
can now display values and indices in binary and hex.
Claus Gittinger <cg@exept.de>
parents:
9504
diff
changeset
|
2621 |
|
14b8fe98a8ed
can now display values and indices in binary and hex.
Claus Gittinger <cg@exept.de>
parents:
9504
diff
changeset
|
2622 |
setDisplayRadixTo:radix |
14b8fe98a8ed
can now display values and indices in binary and hex.
Claus Gittinger <cg@exept.de>
parents:
9504
diff
changeset
|
2623 |
|sel| |
14b8fe98a8ed
can now display values and indices in binary and hex.
Claus Gittinger <cg@exept.de>
parents:
9504
diff
changeset
|
2624 |
|
10846 | 2625 |
integerDisplayRadix := DefaultIntegerDisplayRadix := radix. |
9557
14b8fe98a8ed
can now display values and indices in binary and hex.
Claus Gittinger <cg@exept.de>
parents:
9504
diff
changeset
|
2626 |
self reinspect. |
14b8fe98a8ed
can now display values and indices in binary and hex.
Claus Gittinger <cg@exept.de>
parents:
9504
diff
changeset
|
2627 |
sel := listView selection. |
14b8fe98a8ed
can now display values and indices in binary and hex.
Claus Gittinger <cg@exept.de>
parents:
9504
diff
changeset
|
2628 |
sel notNil ifTrue:[ |
14b8fe98a8ed
can now display values and indices in binary and hex.
Claus Gittinger <cg@exept.de>
parents:
9504
diff
changeset
|
2629 |
self showSelection:sel |
14b8fe98a8ed
can now display values and indices in binary and hex.
Claus Gittinger <cg@exept.de>
parents:
9504
diff
changeset
|
2630 |
] |
14b8fe98a8ed
can now display values and indices in binary and hex.
Claus Gittinger <cg@exept.de>
parents:
9504
diff
changeset
|
2631 |
|
14b8fe98a8ed
can now display values and indices in binary and hex.
Claus Gittinger <cg@exept.de>
parents:
9504
diff
changeset
|
2632 |
"Created: / 24-08-2010 / 17:26:54 / cg" |
14b8fe98a8ed
can now display values and indices in binary and hex.
Claus Gittinger <cg@exept.de>
parents:
9504
diff
changeset
|
2633 |
! |
14b8fe98a8ed
can now display values and indices in binary and hex.
Claus Gittinger <cg@exept.de>
parents:
9504
diff
changeset
|
2634 |
|
3874
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2635 |
showLast |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2636 |
"user clicked on an instvar - show value in workspace" |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2637 |
|
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2638 |
|lastIdx| |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2639 |
|
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2640 |
lastIdx := listView list size. |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2641 |
lastIdx ~~ 0 ifTrue:[ |
8908 | 2642 |
self showSelection:lastIdx. |
2643 |
listView selection:lastIdx. |
|
3874
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2644 |
] |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2645 |
|
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2646 |
"Created: 28.6.1996 / 15:06:38 / cg" |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2647 |
"Modified: 18.3.1997 / 18:22:54 / cg" |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2648 |
! |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2649 |
|
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2650 |
tryToSelectKeyNamed:aString |
5558 | 2651 |
|list idx| |
3874
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2652 |
|
5558 | 2653 |
list := listView list. |
2654 |
list notNil ifTrue:[ |
|
2655 |
(idx := list indexOf:aString) ~= 0 ifTrue:[ |
|
2656 |
listView selection:idx |
|
2657 |
]. |
|
3874
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2658 |
]. |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2659 |
|
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2660 |
"Created: / 16.11.2001 / 13:48:51 / cg" |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2661 |
! ! |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
2662 |
|
4268
0fe3e4a82ddf
more textView protocol (for Workspace)
Claus Gittinger <cg@exept.de>
parents:
4197
diff
changeset
|
2663 |
!InspectorView methodsFor:'workspace protocol'! |
0fe3e4a82ddf
more textView protocol (for Workspace)
Claus Gittinger <cg@exept.de>
parents:
4197
diff
changeset
|
2664 |
|
0fe3e4a82ddf
more textView protocol (for Workspace)
Claus Gittinger <cg@exept.de>
parents:
4197
diff
changeset
|
2665 |
modified:aBoolean |
0fe3e4a82ddf
more textView protocol (for Workspace)
Claus Gittinger <cg@exept.de>
parents:
4197
diff
changeset
|
2666 |
^ workspace modified:aBoolean |
0fe3e4a82ddf
more textView protocol (for Workspace)
Claus Gittinger <cg@exept.de>
parents:
4197
diff
changeset
|
2667 |
! |
0fe3e4a82ddf
more textView protocol (for Workspace)
Claus Gittinger <cg@exept.de>
parents:
4197
diff
changeset
|
2668 |
|
0fe3e4a82ddf
more textView protocol (for Workspace)
Claus Gittinger <cg@exept.de>
parents:
4197
diff
changeset
|
2669 |
saveAs:file doAppend:doAppend |
0fe3e4a82ddf
more textView protocol (for Workspace)
Claus Gittinger <cg@exept.de>
parents:
4197
diff
changeset
|
2670 |
workspace saveAs:file doAppend:doAppend |
0fe3e4a82ddf
more textView protocol (for Workspace)
Claus Gittinger <cg@exept.de>
parents:
4197
diff
changeset
|
2671 |
! ! |
0fe3e4a82ddf
more textView protocol (for Workspace)
Claus Gittinger <cg@exept.de>
parents:
4197
diff
changeset
|
2672 |
|
871 | 2673 |
!InspectorView class methodsFor:'documentation'! |
200 | 2674 |
|
10521
9218a2f4a6d1
Oops, fixes previous (messed) revision (changed: #showSelection:)
vrany
parents:
10520
diff
changeset
|
2675 |
version |
11230 | 2676 |
^ '$Header: /cvs/stx/stx/libtool/InspectorView.st,v 1.242 2012-01-30 15:58:17 cg Exp $' |
10521
9218a2f4a6d1
Oops, fixes previous (messed) revision (changed: #showSelection:)
vrany
parents:
10520
diff
changeset
|
2677 |
! |
9218a2f4a6d1
Oops, fixes previous (messed) revision (changed: #showSelection:)
vrany
parents:
10520
diff
changeset
|
2678 |
|
8868
1fd94adeda59
changed: #setInitialSelection
Claus Gittinger <cg@exept.de>
parents:
8800
diff
changeset
|
2679 |
version_CVS |
11230 | 2680 |
^ '$Header: /cvs/stx/stx/libtool/InspectorView.st,v 1.242 2012-01-30 15:58:17 cg Exp $' |
200 | 2681 |
! ! |