author | Claus Gittinger <cg@exept.de> |
Tue, 21 Apr 2020 13:54:09 +0200 | |
changeset 19580 | ce40b5d1e941 |
parent 19126 | 15cb6262ec30 |
permissions | -rw-r--r-- |
36 | 1 |
" |
2 |
COPYRIGHT (c) 1993 by Claus Gittinger |
|
18732 | 3 |
All Rights Reserved |
36 | 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 |
" |
|
2697
b4f4e431b71e
browserClass from preferences
Claus Gittinger <cg@exept.de>
parents:
2647
diff
changeset
|
12 |
"{ Package: 'stx:libtool' }" |
b4f4e431b71e
browserClass from preferences
Claus Gittinger <cg@exept.de>
parents:
2647
diff
changeset
|
13 |
|
15681
45a2a17c583e
class: DictionaryInspectorView
Claus Gittinger <cg@exept.de>
parents:
14951
diff
changeset
|
14 |
"{ NameSpace: Smalltalk }" |
45a2a17c583e
class: DictionaryInspectorView
Claus Gittinger <cg@exept.de>
parents:
14951
diff
changeset
|
15 |
|
36 | 16 |
InspectorView subclass:#DictionaryInspectorView |
18971 | 17 |
instanceVariableNames:'keys hideClassVars hideClasses hideUnloadedClasses hideAliases |
18 |
hideNilValues hideLiteralValues hideColorsAndImages |
|
19 |
hideSignalInstances hideEmptyCollections hideFreeSemaphores |
|
20 |
hideCollectionsHoldingOnlyLiterals hideNonRefObjectReferences |
|
21 |
hideStreams hideFilenames hideSimpleObjects' |
|
22 |
classVariableNames:'' |
|
23 |
poolDictionaries:'' |
|
24 |
category:'Interface-Inspector' |
|
36 | 25 |
! |
26 |
||
957
ecbcb2c15ae8
show a waitCursor, while collecitng keys
Claus Gittinger <cg@exept.de>
parents:
689
diff
changeset
|
27 |
!DictionaryInspectorView class methodsFor:'documentation'! |
36 | 28 |
|
29 |
copyright |
|
30 |
" |
|
31 |
COPYRIGHT (c) 1993 by Claus Gittinger |
|
18732 | 32 |
All Rights Reserved |
36 | 33 |
|
34 |
This software is furnished under a license and may be used |
|
35 |
only in accordance with the terms of that license and with the |
|
36 |
inclusion of the above copyright notice. This software may not |
|
37 |
be provided or otherwise made available to, or used by, any |
|
38 |
other person. No title to or ownership of the software is |
|
39 |
hereby transferred. |
|
40 |
" |
|
41 |
! |
|
42 |
||
43 |
documentation |
|
44 |
" |
|
45 |
a modified Inspector for Dictionaries |
|
510 | 46 |
|
17960 | 47 |
Notice the filters: these are to inspect Smalltalk, |
48 |
to get to interesting references more quickly |
|
49 |
(typically to find class variables which still refer to object, |
|
50 |
keeping them from being collected) |
|
17961 | 51 |
|
52 |
Try: |
|
53 |
Smalltalk inspect |
|
54 |
then enable some filter(s) |
|
17960 | 55 |
|
510 | 56 |
[author:] |
57 |
Claus Gittinger |
|
36 | 58 |
" |
59 |
! ! |
|
60 |
||
8024
2eec1213d292
Handle keys: Delete, Backspace, Insert
Stefan Vogel <sv@exept.de>
parents:
7946
diff
changeset
|
61 |
!DictionaryInspectorView methodsFor:'event handling'! |
2eec1213d292
Handle keys: Delete, Backspace, Insert
Stefan Vogel <sv@exept.de>
parents:
7946
diff
changeset
|
62 |
|
2eec1213d292
Handle keys: Delete, Backspace, Insert
Stefan Vogel <sv@exept.de>
parents:
7946
diff
changeset
|
63 |
keyPress:key x:x y:y |
2eec1213d292
Handle keys: Delete, Backspace, Insert
Stefan Vogel <sv@exept.de>
parents:
7946
diff
changeset
|
64 |
"handle special keys" |
2eec1213d292
Handle keys: Delete, Backspace, Insert
Stefan Vogel <sv@exept.de>
parents:
7946
diff
changeset
|
65 |
|
12111
0da8cd378b6f
class: DictionaryInspectorView
Claus Gittinger <cg@exept.de>
parents:
11815
diff
changeset
|
66 |
<resource: #keyboard (#Delete #BackSpace #Insert)> |
8024
2eec1213d292
Handle keys: Delete, Backspace, Insert
Stefan Vogel <sv@exept.de>
parents:
7946
diff
changeset
|
67 |
|
2eec1213d292
Handle keys: Delete, Backspace, Insert
Stefan Vogel <sv@exept.de>
parents:
7946
diff
changeset
|
68 |
(key == #Delete or:[key == #BackSpace]) ifTrue:[ |
2eec1213d292
Handle keys: Delete, Backspace, Insert
Stefan Vogel <sv@exept.de>
parents:
7946
diff
changeset
|
69 |
self doRemoveKey. |
2eec1213d292
Handle keys: Delete, Backspace, Insert
Stefan Vogel <sv@exept.de>
parents:
7946
diff
changeset
|
70 |
^ self. |
2eec1213d292
Handle keys: Delete, Backspace, Insert
Stefan Vogel <sv@exept.de>
parents:
7946
diff
changeset
|
71 |
]. |
2eec1213d292
Handle keys: Delete, Backspace, Insert
Stefan Vogel <sv@exept.de>
parents:
7946
diff
changeset
|
72 |
(key == #Insert) ifTrue:[ |
2eec1213d292
Handle keys: Delete, Backspace, Insert
Stefan Vogel <sv@exept.de>
parents:
7946
diff
changeset
|
73 |
self doAddKey. |
2eec1213d292
Handle keys: Delete, Backspace, Insert
Stefan Vogel <sv@exept.de>
parents:
7946
diff
changeset
|
74 |
^ self. |
2eec1213d292
Handle keys: Delete, Backspace, Insert
Stefan Vogel <sv@exept.de>
parents:
7946
diff
changeset
|
75 |
]. |
2eec1213d292
Handle keys: Delete, Backspace, Insert
Stefan Vogel <sv@exept.de>
parents:
7946
diff
changeset
|
76 |
|
2eec1213d292
Handle keys: Delete, Backspace, Insert
Stefan Vogel <sv@exept.de>
parents:
7946
diff
changeset
|
77 |
super keyPress:key x:x y:y |
2eec1213d292
Handle keys: Delete, Backspace, Insert
Stefan Vogel <sv@exept.de>
parents:
7946
diff
changeset
|
78 |
! ! |
2eec1213d292
Handle keys: Delete, Backspace, Insert
Stefan Vogel <sv@exept.de>
parents:
7946
diff
changeset
|
79 |
|
8403 | 80 |
!DictionaryInspectorView methodsFor:'initialization & release'! |
81 |
||
82 |
initialize |
|
83 |
super initialize. |
|
84 |
||
9376
8312c2e767ea
allow multiSelect in dictionary inspector (for removeKey)
Claus Gittinger <cg@exept.de>
parents:
9350
diff
changeset
|
85 |
listView multipleSelectOk:true. |
8312c2e767ea
allow multiSelect in dictionary inspector (for removeKey)
Claus Gittinger <cg@exept.de>
parents:
9350
diff
changeset
|
86 |
|
8403 | 87 |
hideClassVars := false. |
88 |
hideClasses := false. |
|
89 |
hideUnloadedClasses := false. |
|
90 |
hideAliases := false. |
|
91 |
hideLiteralValues := false. |
|
92 |
hideNilValues := false. |
|
12624
fd12279a7888
class: DictionaryInspectorView
Claus Gittinger <cg@exept.de>
parents:
12598
diff
changeset
|
93 |
hideColorsAndImages := false. |
fd12279a7888
class: DictionaryInspectorView
Claus Gittinger <cg@exept.de>
parents:
12598
diff
changeset
|
94 |
hideSignalInstances := false. |
17959 | 95 |
hideEmptyCollections := false. |
17960 | 96 |
hideFreeSemaphores := false. |
97 |
hideCollectionsHoldingOnlyLiterals := false. |
|
17962 | 98 |
hideNonRefObjectReferences := false. |
8403 | 99 |
! ! |
100 |
||
470
5bb60cb688c8
category rename / added monitor stuff
Claus Gittinger <cg@exept.de>
parents:
385
diff
changeset
|
101 |
!DictionaryInspectorView methodsFor:'menu'! |
36 | 102 |
|
73 | 103 |
fieldMenu |
1361 | 104 |
<resource: #programMenu > |
105 |
||
9379 | 106 |
|items m selIdx| |
36 | 107 |
|
2645
d01d467c5199
#isNamespace renamed to #isNameSpace
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
108 |
inspectedObject isNameSpace ifTrue:[ |
1665 | 109 |
items := #( |
3198 | 110 |
('Copy Key' doCopyKey ) |
111 |
('-') |
|
112 |
('Inspect' doInspect ) |
|
113 |
('Inspect Key' doInspectKey ) |
|
114 |
('BasicInspect' doBasicInspect ) |
|
9350
c94c232ef91e
do not show new-inspector in menu, if there is none loaded
Claus Gittinger <cg@exept.de>
parents:
8973
diff
changeset
|
115 |
). |
c94c232ef91e
do not show new-inspector in menu, if there is none loaded
Claus Gittinger <cg@exept.de>
parents:
8973
diff
changeset
|
116 |
NewInspector::NewInspectorView notNil ifTrue:[ |
c94c232ef91e
do not show new-inspector in menu, if there is none loaded
Claus Gittinger <cg@exept.de>
parents:
8973
diff
changeset
|
117 |
items := items , #( |
c94c232ef91e
do not show new-inspector in menu, if there is none loaded
Claus Gittinger <cg@exept.de>
parents:
8973
diff
changeset
|
118 |
('Inspect Hierarchical' #doNewInspect ) |
c94c232ef91e
do not show new-inspector in menu, if there is none loaded
Claus Gittinger <cg@exept.de>
parents:
8973
diff
changeset
|
119 |
). |
c94c232ef91e
do not show new-inspector in menu, if there is none loaded
Claus Gittinger <cg@exept.de>
parents:
8973
diff
changeset
|
120 |
]. |
c94c232ef91e
do not show new-inspector in menu, if there is none loaded
Claus Gittinger <cg@exept.de>
parents:
8973
diff
changeset
|
121 |
items := items , #( |
2085 | 122 |
('-') |
7946 | 123 |
('Owners' showOwners ) |
7805 | 124 |
('Ref Chains' showReferences ) |
4269 | 125 |
('References to Global' showKeyReferences ) |
2085 | 126 |
('-') |
3198 | 127 |
('Browse' browse ) |
2085 | 128 |
('-') |
9502
49a0c6fc64b4
comment/format in: #doRemoveKey
Claus Gittinger <cg@exept.de>
parents:
9379
diff
changeset
|
129 |
('Add Key...' doAddKey ) |
3198 | 130 |
('Remove Key' doRemoveKey ) |
2271
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2236
diff
changeset
|
131 |
('-') |
470
5bb60cb688c8
category rename / added monitor stuff
Claus Gittinger <cg@exept.de>
parents:
385
diff
changeset
|
132 |
). |
2271
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2236
diff
changeset
|
133 |
|
18311 | 134 |
items := items , #( |
135 |
('Show All' doShowAll ) |
|
136 |
('Hide All' doHideAll ) |
|
137 |
). |
|
138 |
||
2271
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2236
diff
changeset
|
139 |
hideClassVars == true ifTrue:[ |
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2236
diff
changeset
|
140 |
items := items , #( |
7805 | 141 |
('Show ClassVars' doShowClassVars ) |
2271
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2236
diff
changeset
|
142 |
). |
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2236
diff
changeset
|
143 |
] ifFalse:[ |
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2236
diff
changeset
|
144 |
items := items , #( |
7805 | 145 |
('Hide ClassVars' doHideClassVars ) |
2271
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2236
diff
changeset
|
146 |
). |
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2236
diff
changeset
|
147 |
]. |
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2236
diff
changeset
|
148 |
hideClasses == true ifTrue:[ |
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2236
diff
changeset
|
149 |
items := items , #( |
7805 | 150 |
('Show Classes' doShowClasses ) |
2271
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2236
diff
changeset
|
151 |
). |
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2236
diff
changeset
|
152 |
] ifFalse:[ |
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2236
diff
changeset
|
153 |
items := items , #( |
7805 | 154 |
('Hide Classes' doHideClasses ) |
2271
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2236
diff
changeset
|
155 |
). |
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2236
diff
changeset
|
156 |
]. |
8403 | 157 |
hideUnloadedClasses == true ifTrue:[ |
158 |
items := items , #( |
|
159 |
('Show Unloaded Classes' doShowUnloadedClasses ) |
|
160 |
). |
|
161 |
] ifFalse:[ |
|
162 |
items := items , #( |
|
163 |
('Hide UnloadedClasses' doHideUnloadedClasses ) |
|
164 |
). |
|
165 |
]. |
|
2271
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2236
diff
changeset
|
166 |
hideAliases == true ifTrue:[ |
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2236
diff
changeset
|
167 |
items := items , #( |
7805 | 168 |
('Show Aliases' doShowAliases ) |
2271
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2236
diff
changeset
|
169 |
). |
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2236
diff
changeset
|
170 |
] ifFalse:[ |
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2236
diff
changeset
|
171 |
items := items , #( |
7805 | 172 |
('Hide Aliases' doHideAliases ) |
2271
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2236
diff
changeset
|
173 |
). |
7946 | 174 |
]. |
175 |
hideLiteralValues == true ifTrue:[ |
|
176 |
items := items , #( |
|
177 |
('Show Literal Values' doShowLiteralValues ) |
|
178 |
). |
|
179 |
] ifFalse:[ |
|
180 |
items := items , #( |
|
181 |
('Hide Literal Values' doHideLiteralValues ) |
|
182 |
). |
|
183 |
]. |
|
184 |
hideNilValues == true ifTrue:[ |
|
185 |
items := items , #( |
|
186 |
('Show Nil Values' doShowNilValues ) |
|
187 |
). |
|
188 |
] ifFalse:[ |
|
189 |
items := items , #( |
|
190 |
('Hide Nil Values' doHideNilValues ) |
|
191 |
). |
|
192 |
]. |
|
12624
fd12279a7888
class: DictionaryInspectorView
Claus Gittinger <cg@exept.de>
parents:
12598
diff
changeset
|
193 |
hideColorsAndImages == true ifTrue:[ |
fd12279a7888
class: DictionaryInspectorView
Claus Gittinger <cg@exept.de>
parents:
12598
diff
changeset
|
194 |
items := items , #( |
fd12279a7888
class: DictionaryInspectorView
Claus Gittinger <cg@exept.de>
parents:
12598
diff
changeset
|
195 |
('Show Colors and Images' doShowColorsAndImages ) |
fd12279a7888
class: DictionaryInspectorView
Claus Gittinger <cg@exept.de>
parents:
12598
diff
changeset
|
196 |
). |
fd12279a7888
class: DictionaryInspectorView
Claus Gittinger <cg@exept.de>
parents:
12598
diff
changeset
|
197 |
] ifFalse:[ |
fd12279a7888
class: DictionaryInspectorView
Claus Gittinger <cg@exept.de>
parents:
12598
diff
changeset
|
198 |
items := items , #( |
fd12279a7888
class: DictionaryInspectorView
Claus Gittinger <cg@exept.de>
parents:
12598
diff
changeset
|
199 |
('Hide Colors and Images' doHideColorsAndImages ) |
fd12279a7888
class: DictionaryInspectorView
Claus Gittinger <cg@exept.de>
parents:
12598
diff
changeset
|
200 |
). |
fd12279a7888
class: DictionaryInspectorView
Claus Gittinger <cg@exept.de>
parents:
12598
diff
changeset
|
201 |
]. |
fd12279a7888
class: DictionaryInspectorView
Claus Gittinger <cg@exept.de>
parents:
12598
diff
changeset
|
202 |
hideSignalInstances == true ifTrue:[ |
fd12279a7888
class: DictionaryInspectorView
Claus Gittinger <cg@exept.de>
parents:
12598
diff
changeset
|
203 |
items := items , #( |
fd12279a7888
class: DictionaryInspectorView
Claus Gittinger <cg@exept.de>
parents:
12598
diff
changeset
|
204 |
('Show Signals' doShowSignalInstances ) |
fd12279a7888
class: DictionaryInspectorView
Claus Gittinger <cg@exept.de>
parents:
12598
diff
changeset
|
205 |
). |
fd12279a7888
class: DictionaryInspectorView
Claus Gittinger <cg@exept.de>
parents:
12598
diff
changeset
|
206 |
] ifFalse:[ |
fd12279a7888
class: DictionaryInspectorView
Claus Gittinger <cg@exept.de>
parents:
12598
diff
changeset
|
207 |
items := items , #( |
fd12279a7888
class: DictionaryInspectorView
Claus Gittinger <cg@exept.de>
parents:
12598
diff
changeset
|
208 |
('Hide Signals' doHideSignalInstances ) |
fd12279a7888
class: DictionaryInspectorView
Claus Gittinger <cg@exept.de>
parents:
12598
diff
changeset
|
209 |
). |
fd12279a7888
class: DictionaryInspectorView
Claus Gittinger <cg@exept.de>
parents:
12598
diff
changeset
|
210 |
]. |
17959 | 211 |
hideEmptyCollections == true ifTrue:[ |
212 |
items := items , #( |
|
213 |
('Show Empty Collections' doShowEmptyCollections ) |
|
214 |
). |
|
215 |
] ifFalse:[ |
|
216 |
items := items , #( |
|
217 |
('Hide Empty Collections' doHideEmptyCollections ) |
|
218 |
). |
|
219 |
]. |
|
17960 | 220 |
hideFreeSemaphores == true ifTrue:[ |
221 |
items := items , #( |
|
222 |
('Show Free Semaphores' doShowFreeSemaphores ) |
|
223 |
). |
|
224 |
] ifFalse:[ |
|
225 |
items := items , #( |
|
226 |
('Hide Free Semaphores' doHideFreeSemaphores ) |
|
227 |
). |
|
228 |
]. |
|
18311 | 229 |
hideStreams == true ifTrue:[ |
230 |
items := items , #( |
|
231 |
('Show Streams' doShowStreams ) |
|
232 |
). |
|
233 |
] ifFalse:[ |
|
234 |
items := items , #( |
|
235 |
('Hide Streams' doHideStreams ) |
|
236 |
). |
|
237 |
]. |
|
238 |
hideFilenames == true ifTrue:[ |
|
239 |
items := items , #( |
|
240 |
('Show Filenames' doShowFilenames ) |
|
241 |
). |
|
242 |
] ifFalse:[ |
|
243 |
items := items , #( |
|
244 |
('Hide Filenames' doHideFilenames ) |
|
245 |
). |
|
246 |
]. |
|
17960 | 247 |
hideCollectionsHoldingOnlyLiterals == true ifTrue:[ |
248 |
items := items , #( |
|
249 |
('Show Collections of Literals' doShowCollectionsHoldingOnlyLiterals ) |
|
250 |
). |
|
251 |
] ifFalse:[ |
|
252 |
items := items , #( |
|
253 |
('Hide Collections of Literals' doHideCollectionsHoldingOnlyLiterals ) |
|
254 |
). |
|
255 |
]. |
|
17962 | 256 |
hideNonRefObjectReferences == true ifTrue:[ |
257 |
items := items , #( |
|
258 |
('Show References to Simple Objects' doShowNonRefObjectReferences ) |
|
259 |
). |
|
260 |
] ifFalse:[ |
|
261 |
items := items , #( |
|
262 |
('Hide References to Simple Objects' doHideNonRefObjectReferences ) |
|
263 |
). |
|
264 |
]. |
|
17960 | 265 |
|
45 | 266 |
] ifFalse:[ |
1665 | 267 |
items := #( |
3198 | 268 |
('Copy Key' doCopyKey ) |
269 |
('-') |
|
270 |
('Inspect' doInspect ) |
|
271 |
('Inspect Key' doInspectKey ) |
|
272 |
('BasicInspect' doBasicInspect ) |
|
273 |
('Inspect Hierarchical' doNewInspect ) |
|
2085 | 274 |
('-') |
7946 | 275 |
('Owners' showOwners ) |
7805 | 276 |
('Ref Chains' showReferences ) |
12598
8dcaa0fcccc1
class: DictionaryInspectorView
Claus Gittinger <cg@exept.de>
parents:
12111
diff
changeset
|
277 |
('Ref Chains to Key' showReferencesToKey ) |
2085 | 278 |
('-') |
3198 | 279 |
('Browse' browse ) |
7805 | 280 |
('Browse Class Hierarchy' browseClassHierarchy ) |
281 |
('Browse Full Class Protocol' browseFullClassProtocol) |
|
2085 | 282 |
('-') |
9502
49a0c6fc64b4
comment/format in: #doRemoveKey
Claus Gittinger <cg@exept.de>
parents:
9379
diff
changeset
|
283 |
('Add Key...' doAddKey ) |
3198 | 284 |
('Remove Key' doRemoveKey ) |
470
5bb60cb688c8
category rename / added monitor stuff
Claus Gittinger <cg@exept.de>
parents:
385
diff
changeset
|
285 |
). |
5bb60cb688c8
category rename / added monitor stuff
Claus Gittinger <cg@exept.de>
parents:
385
diff
changeset
|
286 |
]. |
5bb60cb688c8
category rename / added monitor stuff
Claus Gittinger <cg@exept.de>
parents:
385
diff
changeset
|
287 |
|
12834 | 288 |
(hasMore) ifTrue:[ |
289 |
items := items , #( |
|
290 |
('-') |
|
291 |
('Show More' showMore ) |
|
292 |
). |
|
293 |
(inspectedObject size > (nShown * 2)) ifTrue:[ |
|
294 |
items := items , #( |
|
295 |
('Show All' #showAll ) |
|
296 |
) |
|
297 |
]. |
|
298 |
]. |
|
470
5bb60cb688c8
category rename / added monitor stuff
Claus Gittinger <cg@exept.de>
parents:
385
diff
changeset
|
299 |
monitorProcess isNil ifTrue:[ |
1665 | 300 |
items := items , #( |
2085 | 301 |
('-') |
3198 | 302 |
('Start Monitor' doStartMonitor ) |
1665 | 303 |
). |
470
5bb60cb688c8
category rename / added monitor stuff
Claus Gittinger <cg@exept.de>
parents:
385
diff
changeset
|
304 |
] ifFalse:[ |
1665 | 305 |
items := items , #( |
2085 | 306 |
('-') |
3198 | 307 |
('Stop Monitor' doStopMonitor ) |
1665 | 308 |
). |
45 | 309 |
]. |
310 |
||
11815 | 311 |
items := items , (self sortOrderItems). |
3198 | 312 |
items := items , #( |
313 |
('-') |
|
314 |
('Update' doUpdate ) |
|
315 |
). |
|
316 |
||
1665 | 317 |
m := PopUpMenu itemList:items resources:resources. |
470
5bb60cb688c8
category rename / added monitor stuff
Claus Gittinger <cg@exept.de>
parents:
385
diff
changeset
|
318 |
|
7942
fce54ed1ef8b
sharedPool inspection support
Claus Gittinger <cg@exept.de>
parents:
7805
diff
changeset
|
319 |
(inspectedObject isNameSpace or:[inspectedObject isSharedPool]) ifTrue:[ |
8973 | 320 |
m disableAll:#( doAddKey ) |
321 |
]. |
|
322 |
(inspectedObject isSharedPool) ifTrue:[ |
|
323 |
m disableAll:#( doRemoveKey ) |
|
7942
fce54ed1ef8b
sharedPool inspection support
Claus Gittinger <cg@exept.de>
parents:
7805
diff
changeset
|
324 |
]. |
fce54ed1ef8b
sharedPool inspection support
Claus Gittinger <cg@exept.de>
parents:
7805
diff
changeset
|
325 |
|
9379 | 326 |
(selIdx := self theSingleSelectionIndex) isNil ifTrue:[ |
1665 | 327 |
m disableAll:#(doInspect doInspectKey doBasicInspect doNewInspect |
9376
8312c2e767ea
allow multiSelect in dictionary inspector (for removeKey)
Claus Gittinger <cg@exept.de>
parents:
9350
diff
changeset
|
328 |
doStartMonitor doStopMonitor doCopyKey |
8312c2e767ea
allow multiSelect in dictionary inspector (for removeKey)
Claus Gittinger <cg@exept.de>
parents:
9350
diff
changeset
|
329 |
showKeyReferences showReferences showOwners browse |
8312c2e767ea
allow multiSelect in dictionary inspector (for removeKey)
Claus Gittinger <cg@exept.de>
parents:
9350
diff
changeset
|
330 |
). |
8312c2e767ea
allow multiSelect in dictionary inspector (for removeKey)
Claus Gittinger <cg@exept.de>
parents:
9350
diff
changeset
|
331 |
selectionIndex isEmptyOrNil ifTrue:[ |
8312c2e767ea
allow multiSelect in dictionary inspector (for removeKey)
Claus Gittinger <cg@exept.de>
parents:
9350
diff
changeset
|
332 |
"/ allowed for multi-select |
8312c2e767ea
allow multiSelect in dictionary inspector (for removeKey)
Claus Gittinger <cg@exept.de>
parents:
9350
diff
changeset
|
333 |
m disableAll:#( doRemoveKey ) |
8312c2e767ea
allow multiSelect in dictionary inspector (for removeKey)
Claus Gittinger <cg@exept.de>
parents:
9350
diff
changeset
|
334 |
] |
2193
3d7b1044e8c8
fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents:
2190
diff
changeset
|
335 |
] ifFalse:[ |
9379 | 336 |
(self keyIndexForLine:selIdx) isNil ifTrue:[ |
2193
3d7b1044e8c8
fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents:
2190
diff
changeset
|
337 |
m disableAll:#(doInspectKey doRemoveKey doCopyKey) |
3d7b1044e8c8
fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents:
2190
diff
changeset
|
338 |
] |
1665 | 339 |
]. |
7946 | 340 |
hideLiteralValues == true ifTrue:[ |
341 |
m disableAll:#( doShowNilValues doHideNilValues ) |
|
342 |
]. |
|
2271
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2236
diff
changeset
|
343 |
|
1665 | 344 |
^ m. |
345 |
||
11815 | 346 |
"Modified: / 26-09-2012 / 13:20:59 / cg" |
18311 | 347 |
"Modified: / 31-07-2018 / 01:14:46 / Claus Gittinger" |
36 | 348 |
! ! |
200 | 349 |
|
470
5bb60cb688c8
category rename / added monitor stuff
Claus Gittinger <cg@exept.de>
parents:
385
diff
changeset
|
350 |
!DictionaryInspectorView methodsFor:'menu actions'! |
200 | 351 |
|
3198 | 352 |
browse |
353 |
|cls| |
|
354 |
||
355 |
cls := self selection class theNonMetaclass. |
|
356 |
"/ cls isNameSpace ifTrue:[ |
|
357 |
"/ self halt. |
|
358 |
"/ ]. |
|
359 |
cls browserClass openInClass:cls selector:nil |
|
360 |
! |
|
361 |
||
200 | 362 |
doAddKey |
363 |
"add a key" |
|
364 |
||
2271
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2236
diff
changeset
|
365 |
|keyName key val l| |
200 | 366 |
|
3198 | 367 |
keyName := Dialog request:'Key to add (storeString):' initialAnswer:''. |
9502
49a0c6fc64b4
comment/format in: #doRemoveKey
Claus Gittinger <cg@exept.de>
parents:
9379
diff
changeset
|
368 |
keyName notEmptyOrNil ifTrue:[ |
3198 | 369 |
key := Object readFrom:keyName onError:[ self information:'Bad input.'. ^ self]. |
2193
3d7b1044e8c8
fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents:
2190
diff
changeset
|
370 |
(inspectedObject includesKey:key) ifFalse:[ |
3198 | 371 |
val := Dialog request:'Value to add (storeString):' initialAnswer:''. |
2271
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2236
diff
changeset
|
372 |
val notNil ifTrue:[ |
3198 | 373 |
val := Object readFrom:val onError:[ self information:'Bad input.'. ^ self]. |
2271
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2236
diff
changeset
|
374 |
]. |
3198 | 375 |
|
2271
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2236
diff
changeset
|
376 |
inspectedObject at:key put:val. |
2236
257f587ad7dc
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
2215
diff
changeset
|
377 |
selectionIndex := selectedLine := nil. |
2193
3d7b1044e8c8
fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents:
2190
diff
changeset
|
378 |
inspectedObject changed. |
2213
d6e6c41db3ef
keep scroll-offset when removing a key
Claus Gittinger <cg@exept.de>
parents:
2212
diff
changeset
|
379 |
l := listView firstLineShown. |
2193
3d7b1044e8c8
fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents:
2190
diff
changeset
|
380 |
self reinspect. "force list update" |
2213
d6e6c41db3ef
keep scroll-offset when removing a key
Claus Gittinger <cg@exept.de>
parents:
2212
diff
changeset
|
381 |
listView scrollToLine:l |
2193
3d7b1044e8c8
fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents:
2190
diff
changeset
|
382 |
] |
200 | 383 |
] |
9502
49a0c6fc64b4
comment/format in: #doRemoveKey
Claus Gittinger <cg@exept.de>
parents:
9379
diff
changeset
|
384 |
|
49a0c6fc64b4
comment/format in: #doRemoveKey
Claus Gittinger <cg@exept.de>
parents:
9379
diff
changeset
|
385 |
"Modified: / 01-07-2010 / 10:53:25 / cg" |
200 | 386 |
! |
387 |
||
2271
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2236
diff
changeset
|
388 |
doHideAliases |
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2236
diff
changeset
|
389 |
hideAliases := true. |
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2236
diff
changeset
|
390 |
self reinspect |
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2236
diff
changeset
|
391 |
! |
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2236
diff
changeset
|
392 |
|
18311 | 393 |
doHideAll |
394 |
"/ hideClassVars := true. |
|
395 |
hideClasses := hideUnloadedClasses := hideAliases := true. |
|
396 |
hideNilValues := hideLiteralValues := hideColorsAndImages := true. |
|
397 |
hideSignalInstances := hideEmptyCollections := hideFreeSemaphores := true. |
|
398 |
hideCollectionsHoldingOnlyLiterals := hideNonRefObjectReferences := true. |
|
399 |
hideStreams := hideFilenames := hideSimpleObjects := true. |
|
400 |
hideAliases := true. |
|
401 |
self reinspect |
|
402 |
||
403 |
"Created: / 31-07-2018 / 01:16:07 / Claus Gittinger" |
|
404 |
! |
|
405 |
||
2271
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2236
diff
changeset
|
406 |
doHideClassVars |
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2236
diff
changeset
|
407 |
hideClassVars := true. |
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2236
diff
changeset
|
408 |
self reinspect |
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2236
diff
changeset
|
409 |
! |
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2236
diff
changeset
|
410 |
|
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2236
diff
changeset
|
411 |
doHideClasses |
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2236
diff
changeset
|
412 |
hideClasses := true. |
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2236
diff
changeset
|
413 |
self reinspect |
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2236
diff
changeset
|
414 |
! |
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2236
diff
changeset
|
415 |
|
17960 | 416 |
doHideCollectionsHoldingOnlyLiterals |
417 |
hideCollectionsHoldingOnlyLiterals := true. |
|
418 |
self reinspect |
|
419 |
! |
|
420 |
||
12624
fd12279a7888
class: DictionaryInspectorView
Claus Gittinger <cg@exept.de>
parents:
12598
diff
changeset
|
421 |
doHideColorsAndImages |
fd12279a7888
class: DictionaryInspectorView
Claus Gittinger <cg@exept.de>
parents:
12598
diff
changeset
|
422 |
hideColorsAndImages := true. |
fd12279a7888
class: DictionaryInspectorView
Claus Gittinger <cg@exept.de>
parents:
12598
diff
changeset
|
423 |
self reinspect |
fd12279a7888
class: DictionaryInspectorView
Claus Gittinger <cg@exept.de>
parents:
12598
diff
changeset
|
424 |
! |
fd12279a7888
class: DictionaryInspectorView
Claus Gittinger <cg@exept.de>
parents:
12598
diff
changeset
|
425 |
|
17959 | 426 |
doHideEmptyCollections |
427 |
hideEmptyCollections := true. |
|
428 |
self reinspect |
|
429 |
! |
|
430 |
||
18311 | 431 |
doHideFilenames |
432 |
hideFilenames := true. |
|
433 |
self reinspect |
|
434 |
||
435 |
"Created: / 31-07-2018 / 01:13:51 / Claus Gittinger" |
|
436 |
! |
|
437 |
||
17960 | 438 |
doHideFreeSemaphores |
439 |
hideFreeSemaphores := true. |
|
440 |
self reinspect |
|
441 |
! |
|
442 |
||
7946 | 443 |
doHideLiteralValues |
444 |
hideLiteralValues := true. |
|
445 |
self reinspect |
|
446 |
! |
|
447 |
||
448 |
doHideNilValues |
|
449 |
hideNilValues := true. |
|
450 |
self reinspect |
|
451 |
! |
|
452 |
||
17962 | 453 |
doHideNonRefObjectReferences |
454 |
hideNonRefObjectReferences := true. |
|
455 |
self reinspect |
|
456 |
! |
|
457 |
||
12624
fd12279a7888
class: DictionaryInspectorView
Claus Gittinger <cg@exept.de>
parents:
12598
diff
changeset
|
458 |
doHideSignalInstances |
fd12279a7888
class: DictionaryInspectorView
Claus Gittinger <cg@exept.de>
parents:
12598
diff
changeset
|
459 |
hideSignalInstances := true. |
fd12279a7888
class: DictionaryInspectorView
Claus Gittinger <cg@exept.de>
parents:
12598
diff
changeset
|
460 |
self reinspect |
fd12279a7888
class: DictionaryInspectorView
Claus Gittinger <cg@exept.de>
parents:
12598
diff
changeset
|
461 |
! |
fd12279a7888
class: DictionaryInspectorView
Claus Gittinger <cg@exept.de>
parents:
12598
diff
changeset
|
462 |
|
18311 | 463 |
doHideSimpleObjects |
464 |
hideSimpleObjects := true. |
|
465 |
self reinspect |
|
466 |
||
467 |
"Created: / 31-07-2018 / 01:29:29 / Claus Gittinger" |
|
468 |
! |
|
469 |
||
470 |
doHideStreams |
|
471 |
hideStreams := true. |
|
472 |
self reinspect |
|
473 |
||
474 |
"Created: / 31-07-2018 / 01:13:18 / Claus Gittinger" |
|
475 |
! |
|
476 |
||
8403 | 477 |
doHideUnloadedClasses |
478 |
hideUnloadedClasses := true. |
|
479 |
self reinspect |
|
480 |
! |
|
481 |
||
200 | 482 |
doInspectKey |
483 |
"inspect selected items key" |
|
484 |
||
4269 | 485 |
|key| |
200 | 486 |
|
4269 | 487 |
key := self selectedKey. |
488 |
key notNil ifTrue:[ |
|
14261
89fca378e089
class: DictionaryInspectorView
Stefan Vogel <sv@exept.de>
parents:
13624
diff
changeset
|
489 |
self inspectNext:key. |
4269 | 490 |
] |
200 | 491 |
! |
492 |
||
493 |
doRemoveKey |
|
494 |
"remove selected item from keys" |
|
495 |
||
9376
8312c2e767ea
allow multiSelect in dictionary inspector (for removeKey)
Claus Gittinger <cg@exept.de>
parents:
9350
diff
changeset
|
496 |
|l| |
8312c2e767ea
allow multiSelect in dictionary inspector (for removeKey)
Claus Gittinger <cg@exept.de>
parents:
9350
diff
changeset
|
497 |
|
8312c2e767ea
allow multiSelect in dictionary inspector (for removeKey)
Claus Gittinger <cg@exept.de>
parents:
9350
diff
changeset
|
498 |
listView withWaitCursorDo:[ |
8312c2e767ea
allow multiSelect in dictionary inspector (for removeKey)
Claus Gittinger <cg@exept.de>
parents:
9350
diff
changeset
|
499 |
self selectedKeys do:[:key | |
8312c2e767ea
allow multiSelect in dictionary inspector (for removeKey)
Claus Gittinger <cg@exept.de>
parents:
9350
diff
changeset
|
500 |
(inspectedObject includesKey:key) ifTrue:[ |
8312c2e767ea
allow multiSelect in dictionary inspector (for removeKey)
Claus Gittinger <cg@exept.de>
parents:
9350
diff
changeset
|
501 |
inspectedObject removeKey:key |
8312c2e767ea
allow multiSelect in dictionary inspector (for removeKey)
Claus Gittinger <cg@exept.de>
parents:
9350
diff
changeset
|
502 |
] |
8312c2e767ea
allow multiSelect in dictionary inspector (for removeKey)
Claus Gittinger <cg@exept.de>
parents:
9350
diff
changeset
|
503 |
]. |
200 | 504 |
|
9376
8312c2e767ea
allow multiSelect in dictionary inspector (for removeKey)
Claus Gittinger <cg@exept.de>
parents:
9350
diff
changeset
|
505 |
keys := nil. |
8312c2e767ea
allow multiSelect in dictionary inspector (for removeKey)
Claus Gittinger <cg@exept.de>
parents:
9350
diff
changeset
|
506 |
selectionIndex := selectedLine := nil. |
8312c2e767ea
allow multiSelect in dictionary inspector (for removeKey)
Claus Gittinger <cg@exept.de>
parents:
9350
diff
changeset
|
507 |
inspectedObject changed. |
8312c2e767ea
allow multiSelect in dictionary inspector (for removeKey)
Claus Gittinger <cg@exept.de>
parents:
9350
diff
changeset
|
508 |
]. |
8312c2e767ea
allow multiSelect in dictionary inspector (for removeKey)
Claus Gittinger <cg@exept.de>
parents:
9350
diff
changeset
|
509 |
|
8312c2e767ea
allow multiSelect in dictionary inspector (for removeKey)
Claus Gittinger <cg@exept.de>
parents:
9350
diff
changeset
|
510 |
l := listView firstLineShown. |
8312c2e767ea
allow multiSelect in dictionary inspector (for removeKey)
Claus Gittinger <cg@exept.de>
parents:
9350
diff
changeset
|
511 |
self reinspect. "force list update" |
8312c2e767ea
allow multiSelect in dictionary inspector (for removeKey)
Claus Gittinger <cg@exept.de>
parents:
9350
diff
changeset
|
512 |
listView scrollToLine:l. |
1740 | 513 |
! |
514 |
||
2271
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2236
diff
changeset
|
515 |
doShowAliases |
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2236
diff
changeset
|
516 |
hideAliases := false. |
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2236
diff
changeset
|
517 |
self reinspect |
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2236
diff
changeset
|
518 |
! |
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2236
diff
changeset
|
519 |
|
18311 | 520 |
doShowAll |
521 |
"/ hideClassVars := := false. |
|
522 |
hideClasses := hideUnloadedClasses := hideAliases := false. |
|
523 |
hideNilValues := hideLiteralValues := hideColorsAndImages := false. |
|
524 |
hideSignalInstances := hideEmptyCollections := hideFreeSemaphores := false. |
|
525 |
hideCollectionsHoldingOnlyLiterals := hideNonRefObjectReferences := false. |
|
526 |
hideStreams := hideFilenames := false. |
|
527 |
hideAliases := hideSimpleObjects := false. |
|
528 |
self reinspect |
|
529 |
||
530 |
"Created: / 31-07-2018 / 01:16:17 / Claus Gittinger" |
|
531 |
! |
|
532 |
||
2271
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2236
diff
changeset
|
533 |
doShowClassVars |
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2236
diff
changeset
|
534 |
hideClassVars := false. |
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2236
diff
changeset
|
535 |
self reinspect |
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2236
diff
changeset
|
536 |
! |
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2236
diff
changeset
|
537 |
|
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2236
diff
changeset
|
538 |
doShowClasses |
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2236
diff
changeset
|
539 |
hideClasses := false. |
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2236
diff
changeset
|
540 |
self reinspect |
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2236
diff
changeset
|
541 |
! |
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2236
diff
changeset
|
542 |
|
17960 | 543 |
doShowCollectionsHoldingOnlyLiterals |
544 |
hideCollectionsHoldingOnlyLiterals := false. |
|
545 |
self reinspect |
|
546 |
! |
|
547 |
||
12624
fd12279a7888
class: DictionaryInspectorView
Claus Gittinger <cg@exept.de>
parents:
12598
diff
changeset
|
548 |
doShowColorsAndImages |
fd12279a7888
class: DictionaryInspectorView
Claus Gittinger <cg@exept.de>
parents:
12598
diff
changeset
|
549 |
hideColorsAndImages := false. |
fd12279a7888
class: DictionaryInspectorView
Claus Gittinger <cg@exept.de>
parents:
12598
diff
changeset
|
550 |
self reinspect |
fd12279a7888
class: DictionaryInspectorView
Claus Gittinger <cg@exept.de>
parents:
12598
diff
changeset
|
551 |
! |
fd12279a7888
class: DictionaryInspectorView
Claus Gittinger <cg@exept.de>
parents:
12598
diff
changeset
|
552 |
|
17959 | 553 |
doShowEmptyCollections |
554 |
hideEmptyCollections := false. |
|
555 |
self reinspect |
|
556 |
! |
|
557 |
||
18311 | 558 |
doShowFilenames |
559 |
hideFilenames := false. |
|
560 |
self reinspect |
|
561 |
||
562 |
"Created: / 31-07-2018 / 01:13:41 / Claus Gittinger" |
|
563 |
! |
|
564 |
||
17960 | 565 |
doShowFreeSemaphores |
566 |
hideFreeSemaphores := false. |
|
567 |
self reinspect |
|
568 |
! |
|
569 |
||
7946 | 570 |
doShowLiteralValues |
571 |
hideLiteralValues := false. |
|
572 |
self reinspect |
|
573 |
! |
|
574 |
||
575 |
doShowNilValues |
|
576 |
hideNilValues := false. |
|
577 |
self reinspect |
|
578 |
! |
|
579 |
||
17962 | 580 |
doShowNonRefObjectReferences |
581 |
hideNonRefObjectReferences := false. |
|
582 |
self reinspect |
|
583 |
! |
|
584 |
||
12624
fd12279a7888
class: DictionaryInspectorView
Claus Gittinger <cg@exept.de>
parents:
12598
diff
changeset
|
585 |
doShowSignalInstances |
fd12279a7888
class: DictionaryInspectorView
Claus Gittinger <cg@exept.de>
parents:
12598
diff
changeset
|
586 |
hideSignalInstances := false. |
fd12279a7888
class: DictionaryInspectorView
Claus Gittinger <cg@exept.de>
parents:
12598
diff
changeset
|
587 |
self reinspect |
fd12279a7888
class: DictionaryInspectorView
Claus Gittinger <cg@exept.de>
parents:
12598
diff
changeset
|
588 |
! |
fd12279a7888
class: DictionaryInspectorView
Claus Gittinger <cg@exept.de>
parents:
12598
diff
changeset
|
589 |
|
18311 | 590 |
doShowSimpleObjects |
591 |
hideSimpleObjects := false. |
|
592 |
self reinspect |
|
593 |
||
594 |
"Created: / 31-07-2018 / 01:29:43 / Claus Gittinger" |
|
595 |
! |
|
596 |
||
597 |
doShowStreams |
|
598 |
hideStreams := false. |
|
599 |
self reinspect |
|
600 |
||
601 |
"Created: / 31-07-2018 / 01:13:27 / Claus Gittinger" |
|
602 |
! |
|
603 |
||
8403 | 604 |
doShowUnloadedClasses |
605 |
hideUnloadedClasses := false. |
|
606 |
self reinspect |
|
607 |
! |
|
608 |
||
1740 | 609 |
showKeyReferences |
2193
3d7b1044e8c8
fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents:
2190
diff
changeset
|
610 |
"show users of selected key (i.e. global). |
3d7b1044e8c8
fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents:
2190
diff
changeset
|
611 |
Only useful when inspecting smalltalk" |
1740 | 612 |
|
4269 | 613 |
|key| |
1740 | 614 |
|
4269 | 615 |
key := self selectedKey. |
616 |
key notNil ifTrue:[ |
|
2274 | 617 |
self topView withWaitCursorDo:[ |
17659 | 618 |
SystemBrowser default browseReferendsOf:(key asSymbol) |
1740 | 619 |
]. |
620 |
] |
|
17659 | 621 |
|
622 |
"Modified: / 01-09-2017 / 14:20:41 / cg" |
|
12598
8dcaa0fcccc1
class: DictionaryInspectorView
Claus Gittinger <cg@exept.de>
parents:
12111
diff
changeset
|
623 |
! |
8dcaa0fcccc1
class: DictionaryInspectorView
Claus Gittinger <cg@exept.de>
parents:
12111
diff
changeset
|
624 |
|
8dcaa0fcccc1
class: DictionaryInspectorView
Claus Gittinger <cg@exept.de>
parents:
12111
diff
changeset
|
625 |
showReferencesToKey |
8dcaa0fcccc1
class: DictionaryInspectorView
Claus Gittinger <cg@exept.de>
parents:
12111
diff
changeset
|
626 |
self selectedKey class hasImmediateInstances ifTrue:[ |
8dcaa0fcccc1
class: DictionaryInspectorView
Claus Gittinger <cg@exept.de>
parents:
12111
diff
changeset
|
627 |
^ self warn:'Sorry - cannot show references to immediate objects' |
8dcaa0fcccc1
class: DictionaryInspectorView
Claus Gittinger <cg@exept.de>
parents:
12111
diff
changeset
|
628 |
]. |
17984 | 629 |
"Run in own process to allow inspector to be closed while running" |
630 |
[ |
|
631 |
ObjectMemory displayRefChainTo:(self selectedKey) |
|
632 |
] fork. |
|
633 |
||
634 |
"Modified: / 13-02-2018 / 12:27:39 / stefan" |
|
470
5bb60cb688c8
category rename / added monitor stuff
Claus Gittinger <cg@exept.de>
parents:
385
diff
changeset
|
635 |
! ! |
5bb60cb688c8
category rename / added monitor stuff
Claus Gittinger <cg@exept.de>
parents:
385
diff
changeset
|
636 |
|
5bb60cb688c8
category rename / added monitor stuff
Claus Gittinger <cg@exept.de>
parents:
385
diff
changeset
|
637 |
!DictionaryInspectorView methodsFor:'private'! |
5bb60cb688c8
category rename / added monitor stuff
Claus Gittinger <cg@exept.de>
parents:
385
diff
changeset
|
638 |
|
2193
3d7b1044e8c8
fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents:
2190
diff
changeset
|
639 |
baseInspectedObjectClass |
18971 | 640 |
"only instvars below that are shown by me in the non-basic tab. |
641 |
This hides uninterresting details in the regular tab" |
|
2297
a881c775d42f
Fix for classes like MethodDictionary, that are not a subclass of Dictionary.
Stefan Vogel <sv@exept.de>
parents:
2274
diff
changeset
|
642 |
|
18971 | 643 |
(inspectedObject isKindOf:Dictionary) ifTrue:[ |
644 |
^ Dictionary |
|
2297
a881c775d42f
Fix for classes like MethodDictionary, that are not a subclass of Dictionary.
Stefan Vogel <sv@exept.de>
parents:
2274
diff
changeset
|
645 |
]. |
18971 | 646 |
(inspectedObject isKindOf:SmallDictionary) ifTrue:[ |
647 |
^ SmallDictionary |
|
648 |
]. |
|
649 |
"this is true for e.g. MethodDictionary" |
|
650 |
^ Object |
|
2297
a881c775d42f
Fix for classes like MethodDictionary, that are not a subclass of Dictionary.
Stefan Vogel <sv@exept.de>
parents:
2274
diff
changeset
|
651 |
|
a881c775d42f
Fix for classes like MethodDictionary, that are not a subclass of Dictionary.
Stefan Vogel <sv@exept.de>
parents:
2274
diff
changeset
|
652 |
"Modified: / 23.7.1999 / 10:39:11 / stefan" |
2193
3d7b1044e8c8
fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents:
2190
diff
changeset
|
653 |
! |
3d7b1044e8c8
fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents:
2190
diff
changeset
|
654 |
|
649 | 655 |
defaultLabel |
4095
5bd36b14723d
labels; added suppressPseudoVars & dereferenceValueHolders
Claus Gittinger <cg@exept.de>
parents:
3874
diff
changeset
|
656 |
^ 'Keys' |
649 | 657 |
|
658 |
"Created: 28.6.1996 / 19:46:51 / cg" |
|
659 |
! |
|
660 |
||
18732 | 661 |
hasAllNumericKeys |
662 |
"answer true, if all keys of the inspectedObject are numbers" |
|
663 |
||
664 |
inspectedObject keysDo:[:k | |
|
665 |
k isProtoObject ifTrue:[^ false]. |
|
666 |
k isNumber ifFalse:[^ false]. |
|
667 |
]. |
|
668 |
^ true |
|
669 |
||
670 |
"Created: / 03-04-2019 / 08:23:56 / Claus Gittinger" |
|
671 |
! |
|
672 |
||
3874
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3870
diff
changeset
|
673 |
indexList |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3870
diff
changeset
|
674 |
"return a list of indexes to show in the selectionList. |
2271
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2236
diff
changeset
|
675 |
Set hasMore to true, if a '...' entry should be added." |
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2236
diff
changeset
|
676 |
|
9927 | 677 |
|sortBlockForKeys allShown| |
9926 | 678 |
|
13624
b59ab4a6247d
class: DictionaryInspectorView
Claus Gittinger <cg@exept.de>
parents:
13576
diff
changeset
|
679 |
(inspectedObject isNameSpace |
18731 | 680 |
or:[inspectedObject isSharedPool]) ifTrue:[ |
13624
b59ab4a6247d
class: DictionaryInspectorView
Claus Gittinger <cg@exept.de>
parents:
13576
diff
changeset
|
681 |
^ self indexListForNameSpace. |
b59ab4a6247d
class: DictionaryInspectorView
Claus Gittinger <cg@exept.de>
parents:
13576
diff
changeset
|
682 |
]. |
b59ab4a6247d
class: DictionaryInspectorView
Claus Gittinger <cg@exept.de>
parents:
13576
diff
changeset
|
683 |
|
9927 | 684 |
allShown := inspectedObject size <= nShown. |
685 |
||
15681
45a2a17c583e
class: DictionaryInspectorView
Claus Gittinger <cg@exept.de>
parents:
14951
diff
changeset
|
686 |
inspectedObject isOrdered ifFalse:[ |
18732 | 687 |
(allShown and:[self hasAllNumericKeys]) ifTrue:[ |
15681
45a2a17c583e
class: DictionaryInspectorView
Claus Gittinger <cg@exept.de>
parents:
14951
diff
changeset
|
688 |
sortBlockForKeys := [:a :b | a < b]. |
45a2a17c583e
class: DictionaryInspectorView
Claus Gittinger <cg@exept.de>
parents:
14951
diff
changeset
|
689 |
] ifFalse:[ |
45a2a17c583e
class: DictionaryInspectorView
Claus Gittinger <cg@exept.de>
parents:
14951
diff
changeset
|
690 |
sortBlockForKeys := [:a :b | a displayString < b displayString]. |
45a2a17c583e
class: DictionaryInspectorView
Claus Gittinger <cg@exept.de>
parents:
14951
diff
changeset
|
691 |
]. |
9926 | 692 |
]. |
18731 | 693 |
|
694 |
sortBlockForKeys notNil ifTrue:[ |
|
695 |
keys := (SortedCollection new:(inspectedObject size min:nShown)) sortBlock:sortBlockForKeys. |
|
696 |
] ifFalse:[ |
|
697 |
keys := OrderedCollection new:(inspectedObject size min:nShown). |
|
8527
1f78e8ddae80
also show only the first nShown names;
Claus Gittinger <cg@exept.de>
parents:
8470
diff
changeset
|
698 |
]. |
1f78e8ddae80
also show only the first nShown names;
Claus Gittinger <cg@exept.de>
parents:
8470
diff
changeset
|
699 |
|
18731 | 700 |
"/ do not use 'inspectedObject keys', |
701 |
"/ since Sets couldn't hold nils (which are now valid keys) |
|
702 |
"/ now they can: #(1 2 3 nil) asSet |
|
703 |
allShown ifTrue:[ |
|
704 |
inspectedObject keysDo:[:k | keys add:k]. |
|
705 |
^ keys. |
|
706 |
]. |
|
707 |
||
708 |
inspectedObject keysDo:[:k | |
|
709 |
keys add:k. |
|
710 |
keys size >= nShown ifTrue:[ |
|
711 |
hasMore := true. |
|
712 |
^ keys |
|
713 |
]. |
|
714 |
]. |
|
715 |
^ keys. |
|
9926 | 716 |
|
9927 | 717 |
"Modified: / 10-05-2011 / 08:14:59 / cg" |
18731 | 718 |
"Modified (comment): / 02-04-2019 / 23:21:09 / Stefan Vogel" |
3874
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3870
diff
changeset
|
719 |
! |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3870
diff
changeset
|
720 |
|
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3870
diff
changeset
|
721 |
indexListForNameSpace |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3870
diff
changeset
|
722 |
"return a list of indexes to show in the selectionList. |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3870
diff
changeset
|
723 |
Set hasMore to true, if a '...' entry should be added." |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3870
diff
changeset
|
724 |
|
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3870
diff
changeset
|
725 |
keys := SortedCollection new:1000. |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3870
diff
changeset
|
726 |
|
8403 | 727 |
inspectedObject keysDo:[:k | |
728 |
|hidden i o| |
|
2271
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2236
diff
changeset
|
729 |
|
8403 | 730 |
hidden := false. |
731 |
hideClassVars == true ifTrue:[ |
|
732 |
(i := k lastIndexOf:$:) ~~ 0 ifTrue:[ |
|
733 |
(i > 1 and:[(k at:i-1) ~~ $:]) ifTrue:[ |
|
734 |
hidden := true |
|
735 |
]. |
|
736 |
]. |
|
737 |
]. |
|
738 |
(hidden not and:[hideNilValues == true]) ifTrue:[ |
|
14951
c620388aa2e2
class: DictionaryInspectorView
Claus Gittinger <cg@exept.de>
parents:
14678
diff
changeset
|
739 |
o isNil ifTrue:[ |
c620388aa2e2
class: DictionaryInspectorView
Claus Gittinger <cg@exept.de>
parents:
14678
diff
changeset
|
740 |
o := inspectedObject at:k ifAbsent:nil. |
c620388aa2e2
class: DictionaryInspectorView
Claus Gittinger <cg@exept.de>
parents:
14678
diff
changeset
|
741 |
o isNil ifTrue:[ |
c620388aa2e2
class: DictionaryInspectorView
Claus Gittinger <cg@exept.de>
parents:
14678
diff
changeset
|
742 |
hidden := true |
c620388aa2e2
class: DictionaryInspectorView
Claus Gittinger <cg@exept.de>
parents:
14678
diff
changeset
|
743 |
]. |
8403 | 744 |
]. |
745 |
]. |
|
746 |
(hidden not and:[hideClasses == true]) ifTrue:[ |
|
747 |
o isNil ifTrue:[ o := inspectedObject at:k ifAbsent:nil ]. |
|
748 |
o isBehavior ifTrue:[ |
|
749 |
inspectedObject == Smalltalk ifTrue:[ |
|
750 |
o name == k ifTrue:[ |
|
751 |
hidden := true |
|
752 |
] |
|
753 |
] ifFalse:[ |
|
754 |
o nameWithoutNameSpacePrefix = k ifTrue:[ |
|
755 |
hidden := true |
|
756 |
] |
|
757 |
] |
|
758 |
]. |
|
759 |
]. |
|
760 |
(hidden not and:[hideAliases == true]) ifTrue:[ |
|
761 |
o isNil ifTrue:[ o := inspectedObject at:k ifAbsent:nil ]. |
|
762 |
o isBehavior ifTrue:[ |
|
763 |
inspectedObject == Smalltalk ifTrue:[ |
|
764 |
o name ~~ k ifTrue:[ |
|
765 |
hidden := true |
|
766 |
] |
|
767 |
] ifFalse:[ |
|
768 |
o nameWithoutNameSpacePrefix ~= k ifTrue:[ |
|
3874
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3870
diff
changeset
|
769 |
hidden := true |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3870
diff
changeset
|
770 |
]. |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3870
diff
changeset
|
771 |
]. |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3870
diff
changeset
|
772 |
]. |
8403 | 773 |
]. |
774 |
(hidden not and:[hideLiteralValues == true]) ifTrue:[ |
|
8470
2bec16caeefb
changed #indexListForNameSpace
Claus Gittinger <cg@exept.de>
parents:
8403
diff
changeset
|
775 |
self breakPoint:#cg. |
8403 | 776 |
o isNil ifTrue:[ o := inspectedObject at:k ifAbsent:nil ]. |
777 |
o isLiteral ifTrue:[ |
|
778 |
hidden := true |
|
3874
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3870
diff
changeset
|
779 |
]. |
8403 | 780 |
]. |
12624
fd12279a7888
class: DictionaryInspectorView
Claus Gittinger <cg@exept.de>
parents:
12598
diff
changeset
|
781 |
(hidden not and:[hideColorsAndImages == true]) ifTrue:[ |
fd12279a7888
class: DictionaryInspectorView
Claus Gittinger <cg@exept.de>
parents:
12598
diff
changeset
|
782 |
o isNil ifTrue:[ o := inspectedObject at:k ifAbsent:nil ]. |
fd12279a7888
class: DictionaryInspectorView
Claus Gittinger <cg@exept.de>
parents:
12598
diff
changeset
|
783 |
(o isColor or:[o isImageOrForm or:[o class == Cursor]]) ifTrue:[ |
fd12279a7888
class: DictionaryInspectorView
Claus Gittinger <cg@exept.de>
parents:
12598
diff
changeset
|
784 |
hidden := true |
fd12279a7888
class: DictionaryInspectorView
Claus Gittinger <cg@exept.de>
parents:
12598
diff
changeset
|
785 |
]. |
fd12279a7888
class: DictionaryInspectorView
Claus Gittinger <cg@exept.de>
parents:
12598
diff
changeset
|
786 |
]. |
fd12279a7888
class: DictionaryInspectorView
Claus Gittinger <cg@exept.de>
parents:
12598
diff
changeset
|
787 |
(hidden not and:[hideSignalInstances == true]) ifTrue:[ |
fd12279a7888
class: DictionaryInspectorView
Claus Gittinger <cg@exept.de>
parents:
12598
diff
changeset
|
788 |
o isNil ifTrue:[ o := inspectedObject at:k ifAbsent:nil ]. |
fd12279a7888
class: DictionaryInspectorView
Claus Gittinger <cg@exept.de>
parents:
12598
diff
changeset
|
789 |
(o isException or:[o isKindOf:Signal]) ifTrue:[ |
fd12279a7888
class: DictionaryInspectorView
Claus Gittinger <cg@exept.de>
parents:
12598
diff
changeset
|
790 |
hidden := true |
fd12279a7888
class: DictionaryInspectorView
Claus Gittinger <cg@exept.de>
parents:
12598
diff
changeset
|
791 |
]. |
fd12279a7888
class: DictionaryInspectorView
Claus Gittinger <cg@exept.de>
parents:
12598
diff
changeset
|
792 |
]. |
17959 | 793 |
(hidden not and:[hideEmptyCollections == true]) ifTrue:[ |
794 |
o isNil ifTrue:[ o := inspectedObject at:k ifAbsent:nil ]. |
|
795 |
(o isCollection and:[o size == 0]) ifTrue:[ |
|
796 |
hidden := true |
|
797 |
]. |
|
17960 | 798 |
]. |
799 |
(hidden not and:[hideCollectionsHoldingOnlyLiterals == true]) ifTrue:[ |
|
800 |
o isNil ifTrue:[ o := inspectedObject at:k ifAbsent:nil ]. |
|
17962 | 801 |
(o isCollection) ifTrue:[ |
802 |
(o conform:[:el | el isLiteral]) ifTrue:[ |
|
803 |
hidden := true |
|
804 |
] ifFalse:[ |
|
805 |
(o conform:[:el | el isCollection and:[el conform:[:subEl | subEl isLiteral]]]) ifTrue:[ |
|
806 |
hidden := true |
|
807 |
]. |
|
808 |
]. |
|
17960 | 809 |
]. |
810 |
]. |
|
811 |
(hidden not and:[hideFreeSemaphores == true]) ifTrue:[ |
|
812 |
o isNil ifTrue:[ o := inspectedObject at:k ifAbsent:nil ]. |
|
813 |
((o isKindOf:Semaphore) |
|
814 |
and:[(o owner isNil or:[o owner isCollection and:[o owner isEmpty]]) |
|
815 |
and:[o waitingProcesses isEmptyOrNil]]) ifTrue:[ |
|
816 |
hidden := true |
|
817 |
]. |
|
17959 | 818 |
]. |
17962 | 819 |
(hidden not and:[hideNonRefObjectReferences == true]) ifTrue:[ |
820 |
o isNil ifTrue:[ o := inspectedObject at:k ifAbsent:nil ]. |
|
17974 | 821 |
hidden := (o class == Point) |
822 |
or:[(o class == Rectangle) |
|
823 |
or:[(o class == Object)]] |
|
17962 | 824 |
]. |
18311 | 825 |
(hidden not and:[hideFilenames == true]) ifTrue:[ |
826 |
o isNil ifTrue:[ o := inspectedObject at:k ifAbsent:nil ]. |
|
827 |
(o isFilename) ifTrue:[ |
|
828 |
hidden := true |
|
829 |
]. |
|
830 |
]. |
|
831 |
(hidden not and:[hideStreams == true]) ifTrue:[ |
|
832 |
o isNil ifTrue:[ o := inspectedObject at:k ifAbsent:nil ]. |
|
833 |
(o isStream) ifTrue:[ |
|
834 |
hidden := true |
|
835 |
]. |
|
836 |
]. |
|
837 |
(hidden not and:[hideSimpleObjects == true]) ifTrue:[ |
|
838 |
o isNil ifTrue:[ o := inspectedObject at:k ifAbsent:nil ]. |
|
839 |
((1 to:o class instSize) conform:[:i | (o instVarAt:i) isLiteral]) ifTrue:[ |
|
19126 | 840 |
((o basicSize == 0) |
18311 | 841 |
or:[ ((1 to:o basicSize) conform:[:i | (o basicAt:i) isLiteral]) ]) ifTrue:[ |
842 |
hidden := true |
|
843 |
]. |
|
844 |
]. |
|
845 |
]. |
|
7946 | 846 |
|
8403 | 847 |
hidden ifFalse:[keys add:k] |
3874
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3870
diff
changeset
|
848 |
]. |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3870
diff
changeset
|
849 |
^ keys |
17974 | 850 |
|
851 |
"Modified: / 31-01-2018 / 09:34:39 / stefan" |
|
18311 | 852 |
"Modified: / 31-07-2018 / 01:36:29 / Claus Gittinger" |
3874
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3870
diff
changeset
|
853 |
! |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3870
diff
changeset
|
854 |
|
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3870
diff
changeset
|
855 |
indexedFieldList |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3870
diff
changeset
|
856 |
"return a list of indexed-variable names to show in the selectionList. |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3870
diff
changeset
|
857 |
Set hasMore to true, if a '...' entry should be added." |
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3870
diff
changeset
|
858 |
|
11516 | 859 |
|indexList keyList| |
3874
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3870
diff
changeset
|
860 |
|
11516 | 861 |
indexList := self indexList. |
862 |
keyList := indexList |
|
3874
ed3a652e5ce0
all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents:
3870
diff
changeset
|
863 |
collect:[:k | |
17973 | 864 |
(k isProtoObject not and:[k isInteger]) |
865 |
ifTrue:[ self basicDisplayStringForValue:k ] |
|
866 |
ifFalse:[ k displayString ] |
|
11516 | 867 |
]. |
868 |
||
16547 | 869 |
sortOrder == SortOrderAlphabetical ifTrue:[ |
11815 | 870 |
keyList sort:[:a :b | a string < b string]. |
871 |
]. |
|
11516 | 872 |
^ keyList |
873 |
keysAndValuesCollect:[:idx :nm | |
|
14678
079d9fc7384d
Fix in DictionaryInspectorView>>#indexedFieldList: use #indexedValueAtKey: instead of object #at:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14261
diff
changeset
|
874 |
self listEntryForName:nm value:(self indexedValueAtKey:(indexList at:idx)) |
11516 | 875 |
]. |
876 |
||
11815 | 877 |
"Modified: / 26-09-2012 / 13:22:08 / cg" |
14678
079d9fc7384d
Fix in DictionaryInspectorView>>#indexedFieldList: use #indexedValueAtKey: instead of object #at:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14261
diff
changeset
|
878 |
"Modified: / 25-07-2014 / 09:44:34 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
17973 | 879 |
"Modified: / 31-01-2018 / 09:03:51 / stefan" |
2271
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2236
diff
changeset
|
880 |
! |
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2236
diff
changeset
|
881 |
|
15877 | 882 |
indexedValueAtKey:key |
883 |
object isWeakCollection ifTrue:[ |
|
884 |
"keys may vanish" |
|
885 |
^ object at:key ifAbsent:[]. |
|
886 |
]. |
|
18973 | 887 |
^ object at:key ifAbsent:NoLongerPresentDummyObject |
888 |
||
889 |
"Modified: / 06-08-2019 / 18:25:52 / Stefan Vogel" |
|
15877 | 890 |
! |
891 |
||
2271
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2236
diff
changeset
|
892 |
instVarIndexForLine:lineNr |
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2236
diff
changeset
|
893 |
"helper - return the index for a named instVar; |
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2236
diff
changeset
|
894 |
nil, if self or a keyed instvar is selected." |
2189
db73912a0b4c
show named instvars (except those of Dictionary)
Claus Gittinger <cg@exept.de>
parents:
2085
diff
changeset
|
895 |
|
7942
fce54ed1ef8b
sharedPool inspection support
Claus Gittinger <cg@exept.de>
parents:
7805
diff
changeset
|
896 |
(inspectedObject isNameSpace or:[inspectedObject isSharedPool]) ifTrue:[ |
2271
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2236
diff
changeset
|
897 |
^ nil |
957
ecbcb2c15ae8
show a waitCursor, while collecitng keys
Claus Gittinger <cg@exept.de>
parents:
689
diff
changeset
|
898 |
]. |
2271
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2236
diff
changeset
|
899 |
^ super instVarIndexForLine:lineNr |
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2236
diff
changeset
|
900 |
! |
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2236
diff
changeset
|
901 |
|
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2236
diff
changeset
|
902 |
keyIndexForLine:lineNr |
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2236
diff
changeset
|
903 |
"helper - return the index of the key-list" |
470
5bb60cb688c8
category rename / added monitor stuff
Claus Gittinger <cg@exept.de>
parents:
385
diff
changeset
|
904 |
|
5421
86a6077b131d
Fix for negative numbers as keys in a Dictionary
Stefan Vogel <sv@exept.de>
parents:
4269
diff
changeset
|
905 |
|firstRealIndex idx line| |
4100 | 906 |
|
7942
fce54ed1ef8b
sharedPool inspection support
Claus Gittinger <cg@exept.de>
parents:
7805
diff
changeset
|
907 |
(inspectedObject isNameSpace or:[inspectedObject isSharedPool]) ifTrue:[ |
4095
5bd36b14723d
labels; added suppressPseudoVars & dereferenceValueHolders
Claus Gittinger <cg@exept.de>
parents:
3874
diff
changeset
|
908 |
(self hasSelfEntry |
2271
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2236
diff
changeset
|
909 |
and:[lineNr == 1 or:[lineNr isNil]]) ifTrue:[ |
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2236
diff
changeset
|
910 |
^ nil "/ self selected |
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2236
diff
changeset
|
911 |
]. |
4100 | 912 |
firstRealIndex := 1. |
913 |
idx := lineNr. |
|
11512 | 914 |
[line := self listEntryAt:firstRealIndex. |
5421
86a6077b131d
Fix for negative numbers as keys in a Dictionary
Stefan Vogel <sv@exept.de>
parents:
4269
diff
changeset
|
915 |
(line startsWith:'-') and:[line size < 2 or:[line second isDigit not]]] whileTrue:[ |
4100 | 916 |
firstRealIndex := firstRealIndex + 1. |
917 |
idx := idx - 1. |
|
4095
5bd36b14723d
labels; added suppressPseudoVars & dereferenceValueHolders
Claus Gittinger <cg@exept.de>
parents:
3874
diff
changeset
|
918 |
]. |
4100 | 919 |
|
920 |
^ idx |
|
2271
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2236
diff
changeset
|
921 |
]. |
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2236
diff
changeset
|
922 |
^ super keyIndexForLine:lineNr |
11512 | 923 |
|
924 |
"Modified: / 16-05-2012 / 17:56:01 / cg" |
|
2271
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2236
diff
changeset
|
925 |
! |
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2236
diff
changeset
|
926 |
|
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2236
diff
changeset
|
927 |
namedFieldList |
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2236
diff
changeset
|
928 |
"return a list of instVar names to show in the selectionList." |
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2236
diff
changeset
|
929 |
|
7942
fce54ed1ef8b
sharedPool inspection support
Claus Gittinger <cg@exept.de>
parents:
7805
diff
changeset
|
930 |
(inspectedObject isNameSpace or:[inspectedObject isSharedPool]) ifTrue:[ |
2271
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2236
diff
changeset
|
931 |
"/ empty ... |
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2236
diff
changeset
|
932 |
^ OrderedCollection new |
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2236
diff
changeset
|
933 |
]. |
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2236
diff
changeset
|
934 |
^ super namedFieldList |
470
5bb60cb688c8
category rename / added monitor stuff
Claus Gittinger <cg@exept.de>
parents:
385
diff
changeset
|
935 |
! |
5bb60cb688c8
category rename / added monitor stuff
Claus Gittinger <cg@exept.de>
parents:
385
diff
changeset
|
936 |
|
12834 | 937 |
numIndexedFields |
938 |
^ inspectedObject size |
|
939 |
! |
|
940 |
||
470
5bb60cb688c8
category rename / added monitor stuff
Claus Gittinger <cg@exept.de>
parents:
385
diff
changeset
|
941 |
release |
5bb60cb688c8
category rename / added monitor stuff
Claus Gittinger <cg@exept.de>
parents:
385
diff
changeset
|
942 |
"release inspected object" |
5bb60cb688c8
category rename / added monitor stuff
Claus Gittinger <cg@exept.de>
parents:
385
diff
changeset
|
943 |
|
5bb60cb688c8
category rename / added monitor stuff
Claus Gittinger <cg@exept.de>
parents:
385
diff
changeset
|
944 |
keys := nil. |
5bb60cb688c8
category rename / added monitor stuff
Claus Gittinger <cg@exept.de>
parents:
385
diff
changeset
|
945 |
super release |
4269 | 946 |
! |
947 |
||
948 |
selectedKey |
|
13576
3fd34524bbb9
class: DictionaryInspectorView
Claus Gittinger <cg@exept.de>
parents:
12834
diff
changeset
|
949 |
"selected item's key or nil. But only if exactly one item is selected" |
4269 | 950 |
|
9376
8312c2e767ea
allow multiSelect in dictionary inspector (for removeKey)
Claus Gittinger <cg@exept.de>
parents:
9350
diff
changeset
|
951 |
|selIdx idx| |
4269 | 952 |
|
9376
8312c2e767ea
allow multiSelect in dictionary inspector (for removeKey)
Claus Gittinger <cg@exept.de>
parents:
9350
diff
changeset
|
953 |
selIdx := self theSingleSelectionIndex. |
8312c2e767ea
allow multiSelect in dictionary inspector (for removeKey)
Claus Gittinger <cg@exept.de>
parents:
9350
diff
changeset
|
954 |
selIdx notNil ifTrue:[ |
8312c2e767ea
allow multiSelect in dictionary inspector (for removeKey)
Claus Gittinger <cg@exept.de>
parents:
9350
diff
changeset
|
955 |
idx := self keyIndexForLine:selIdx. |
8312c2e767ea
allow multiSelect in dictionary inspector (for removeKey)
Claus Gittinger <cg@exept.de>
parents:
9350
diff
changeset
|
956 |
idx notNil ifTrue:[ |
8312c2e767ea
allow multiSelect in dictionary inspector (for removeKey)
Claus Gittinger <cg@exept.de>
parents:
9350
diff
changeset
|
957 |
^ (keys at:idx) |
8312c2e767ea
allow multiSelect in dictionary inspector (for removeKey)
Claus Gittinger <cg@exept.de>
parents:
9350
diff
changeset
|
958 |
]. |
4269 | 959 |
]. |
960 |
^ nil. |
|
9376
8312c2e767ea
allow multiSelect in dictionary inspector (for removeKey)
Claus Gittinger <cg@exept.de>
parents:
9350
diff
changeset
|
961 |
! |
8312c2e767ea
allow multiSelect in dictionary inspector (for removeKey)
Claus Gittinger <cg@exept.de>
parents:
9350
diff
changeset
|
962 |
|
8312c2e767ea
allow multiSelect in dictionary inspector (for removeKey)
Claus Gittinger <cg@exept.de>
parents:
9350
diff
changeset
|
963 |
selectedKeys |
8312c2e767ea
allow multiSelect in dictionary inspector (for removeKey)
Claus Gittinger <cg@exept.de>
parents:
9350
diff
changeset
|
964 |
"selected keys or empty" |
8312c2e767ea
allow multiSelect in dictionary inspector (for removeKey)
Claus Gittinger <cg@exept.de>
parents:
9350
diff
changeset
|
965 |
|
13576
3fd34524bbb9
class: DictionaryInspectorView
Claus Gittinger <cg@exept.de>
parents:
12834
diff
changeset
|
966 |
^ (listView selection ? #()) |
9376
8312c2e767ea
allow multiSelect in dictionary inspector (for removeKey)
Claus Gittinger <cg@exept.de>
parents:
9350
diff
changeset
|
967 |
collect:[:eachSelectionIndex | |
8312c2e767ea
allow multiSelect in dictionary inspector (for removeKey)
Claus Gittinger <cg@exept.de>
parents:
9350
diff
changeset
|
968 |
|idx| |
8312c2e767ea
allow multiSelect in dictionary inspector (for removeKey)
Claus Gittinger <cg@exept.de>
parents:
9350
diff
changeset
|
969 |
|
8312c2e767ea
allow multiSelect in dictionary inspector (for removeKey)
Claus Gittinger <cg@exept.de>
parents:
9350
diff
changeset
|
970 |
idx := self keyIndexForLine:eachSelectionIndex. |
8312c2e767ea
allow multiSelect in dictionary inspector (for removeKey)
Claus Gittinger <cg@exept.de>
parents:
9350
diff
changeset
|
971 |
idx notNil |
8312c2e767ea
allow multiSelect in dictionary inspector (for removeKey)
Claus Gittinger <cg@exept.de>
parents:
9350
diff
changeset
|
972 |
ifTrue:[ (keys at:idx) ] |
8312c2e767ea
allow multiSelect in dictionary inspector (for removeKey)
Claus Gittinger <cg@exept.de>
parents:
9350
diff
changeset
|
973 |
ifFalse:[ nil ] |
8312c2e767ea
allow multiSelect in dictionary inspector (for removeKey)
Claus Gittinger <cg@exept.de>
parents:
9350
diff
changeset
|
974 |
] |
8312c2e767ea
allow multiSelect in dictionary inspector (for removeKey)
Claus Gittinger <cg@exept.de>
parents:
9350
diff
changeset
|
975 |
thenSelect:[:each | each notNil]. |
9502
49a0c6fc64b4
comment/format in: #doRemoveKey
Claus Gittinger <cg@exept.de>
parents:
9379
diff
changeset
|
976 |
|
49a0c6fc64b4
comment/format in: #doRemoveKey
Claus Gittinger <cg@exept.de>
parents:
9379
diff
changeset
|
977 |
"Modified: / 01-07-2010 / 10:54:31 / cg" |
9505 | 978 |
! |
979 |
||
980 |
selection:lineNrCollection |
|
981 |
"redefined because of multiselect" |
|
982 |
||
983 |
lineNrCollection isEmptyOrNil ifTrue:[ |
|
984 |
self showSelection:nil |
|
985 |
] ifFalse:[ |
|
986 |
self showSelection:lineNrCollection first |
|
987 |
]. |
|
470
5bb60cb688c8
category rename / added monitor stuff
Claus Gittinger <cg@exept.de>
parents:
385
diff
changeset
|
988 |
! ! |
5bb60cb688c8
category rename / added monitor stuff
Claus Gittinger <cg@exept.de>
parents:
385
diff
changeset
|
989 |
|
5bb60cb688c8
category rename / added monitor stuff
Claus Gittinger <cg@exept.de>
parents:
385
diff
changeset
|
990 |
!DictionaryInspectorView methodsFor:'user interaction'! |
5bb60cb688c8
category rename / added monitor stuff
Claus Gittinger <cg@exept.de>
parents:
385
diff
changeset
|
991 |
|
2271
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2236
diff
changeset
|
992 |
indexedValueAtIndex:idx |
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2236
diff
changeset
|
993 |
|key| |
470
5bb60cb688c8
category rename / added monitor stuff
Claus Gittinger <cg@exept.de>
parents:
385
diff
changeset
|
994 |
|
15878 | 995 |
key := keys at:idx ifAbsent:[^ nil]. |
18973 | 996 |
^ inspectedObject at:key ifAbsent:NoLongerPresentDummyObject. |
997 |
||
998 |
"Modified: / 06-08-2019 / 18:53:27 / Stefan Vogel" |
|
200 | 999 |
! |
1000 |
||
2271
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2236
diff
changeset
|
1001 |
indexedValueAtIndex:idx put:newValue |
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2236
diff
changeset
|
1002 |
|key| |
200 | 1003 |
|
2271
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2236
diff
changeset
|
1004 |
key := keys at:idx. |
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2236
diff
changeset
|
1005 |
inspectedObject at:key put:newValue. |
200 | 1006 |
! ! |
1007 |
||
957
ecbcb2c15ae8
show a waitCursor, while collecitng keys
Claus Gittinger <cg@exept.de>
parents:
689
diff
changeset
|
1008 |
!DictionaryInspectorView class methodsFor:'documentation'! |
200 | 1009 |
|
1010 |
version |
|
15877 | 1011 |
^ '$Header$' |
8973 | 1012 |
! |
1013 |
||
1014 |
version_CVS |
|
15877 | 1015 |
^ '$Header$' |
200 | 1016 |
! ! |
12111
0da8cd378b6f
class: DictionaryInspectorView
Claus Gittinger <cg@exept.de>
parents:
11815
diff
changeset
|
1017 |