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