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