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