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