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