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