author | Claus Gittinger <cg@exept.de> |
Thu, 18 Aug 2011 02:16:52 +0200 | |
changeset 10579 | 89bb79eaee8e |
parent 10549 | 1f387878f9c6 |
child 10640 | 0a2838f81ca2 |
permissions | -rw-r--r-- |
5591 | 1 |
" |
2 |
COPYRIGHT (c) 2000 by eXept Software AG |
|
10388 | 3 |
All Rights Reserved |
5591 | 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 |
" |
|
12 |
"{ Package: 'stx:libtool' }" |
|
13 |
||
14 |
"{ NameSpace: Tools }" |
|
15 |
||
16 |
BrowserList subclass:#MethodList |
|
10549
1f387878f9c6
changed: #updateListEntryFor:
Claus Gittinger <cg@exept.de>
parents:
10388
diff
changeset
|
17 |
instanceVariableNames:'classes selectedMethodNameIndices methodList lastSelectedMethods |
1f387878f9c6
changed: #updateListEntryFor:
Claus Gittinger <cg@exept.de>
parents:
10388
diff
changeset
|
18 |
browserNameList variableFilter filterClassVars updateProcess |
1f387878f9c6
changed: #updateListEntryFor:
Claus Gittinger <cg@exept.de>
parents:
10388
diff
changeset
|
19 |
lastShowClass lastShowCategory lastShowClassFirst |
1f387878f9c6
changed: #updateListEntryFor:
Claus Gittinger <cg@exept.de>
parents:
10388
diff
changeset
|
20 |
showMethodInheritance lastMethodClass lastMethodClassesSubclasses |
1f387878f9c6
changed: #updateListEntryFor:
Claus Gittinger <cg@exept.de>
parents:
10388
diff
changeset
|
21 |
classAndSelectorsRedefinedBySubclassesOfClass showClass |
1f387878f9c6
changed: #updateListEntryFor:
Claus Gittinger <cg@exept.de>
parents:
10388
diff
changeset
|
22 |
showMethodComplexity showMethodTypeIcon |
1f387878f9c6
changed: #updateListEntryFor:
Claus Gittinger <cg@exept.de>
parents:
10388
diff
changeset
|
23 |
showImageResourceMethodsImages' |
1f387878f9c6
changed: #updateListEntryFor:
Claus Gittinger <cg@exept.de>
parents:
10388
diff
changeset
|
24 |
classVariableNames:'ShowComplexityValue' |
1f387878f9c6
changed: #updateListEntryFor:
Claus Gittinger <cg@exept.de>
parents:
10388
diff
changeset
|
25 |
poolDictionaries:'' |
1f387878f9c6
changed: #updateListEntryFor:
Claus Gittinger <cg@exept.de>
parents:
10388
diff
changeset
|
26 |
category:'Interface-Browsers-New' |
5591 | 27 |
! |
28 |
||
29 |
!MethodList class methodsFor:'documentation'! |
|
30 |
||
31 |
copyright |
|
32 |
" |
|
33 |
COPYRIGHT (c) 2000 by eXept Software AG |
|
10388 | 34 |
All Rights Reserved |
5591 | 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 |
!MethodList class methodsFor:'interface specs'! |
|
46 |
||
47 |
singleMethodWindowSpec |
|
48 |
"This resource specification was automatically generated |
|
49 |
by the UIPainter of ST/X." |
|
50 |
||
51 |
"Do not manually edit this!! If it is corrupted, |
|
52 |
the UIPainter may not be able to read the specification." |
|
53 |
||
54 |
" |
|
55 |
UIPainter new openOnClass:MethodList andSelector:#singleMethodWindowSpec |
|
56 |
MethodList new openInterface:#singleMethodWindowSpec |
|
57 |
" |
|
58 |
||
59 |
<resource: #canvas> |
|
60 |
||
61 |
^ |
|
62 |
#(#FullSpec |
|
63 |
#name: #singleMethodWindowSpec |
|
64 |
#window: |
|
65 |
#(#WindowSpec |
|
66 |
#label: 'SingleSelectorList' |
|
67 |
#name: 'SingleSelectorList' |
|
68 |
#min: #(#Point 0 0) |
|
69 |
#max: #(#Point 1024 721) |
|
70 |
#bounds: #(#Rectangle 12 22 312 322) |
|
71 |
) |
|
72 |
#component: |
|
73 |
#(#SpecCollection |
|
74 |
#collection: #( |
|
75 |
#(#LabelSpec |
|
76 |
#label: 'MethodName' |
|
77 |
#name: 'MethodLabel' |
|
78 |
#layout: #(#LayoutFrame 0 0.0 0 0 0 1.0 25 0) |
|
79 |
#translateLabel: true |
|
80 |
#labelChannel: #methodLabelHolder |
|
81 |
#menu: #menuHolder |
|
82 |
) |
|
83 |
) |
|
84 |
||
85 |
) |
|
86 |
) |
|
87 |
||
88 |
"Modified: / 1.3.2000 / 20:50:15 / cg" |
|
89 |
! |
|
90 |
||
91 |
windowSpec |
|
92 |
"This resource specification was automatically generated |
|
93 |
by the UIPainter of ST/X." |
|
94 |
||
95 |
"Do not manually edit this!! If it is corrupted, |
|
96 |
the UIPainter may not be able to read the specification." |
|
97 |
||
98 |
" |
|
10579 | 99 |
UIPainter new openOnClass:Tools::MethodList andSelector:#windowSpec |
100 |
Tools::MethodList new openInterface:#windowSpec |
|
101 |
Tools::MethodList open |
|
5591 | 102 |
" |
103 |
||
104 |
<resource: #canvas> |
|
105 |
||
106 |
^ |
|
10579 | 107 |
#(FullSpec |
108 |
name: windowSpec |
|
109 |
window: |
|
110 |
(WindowSpec |
|
111 |
label: 'SelectorList' |
|
112 |
name: 'SelectorList' |
|
113 |
min: (Point 0 0) |
|
114 |
bounds: (Rectangle 0 0 300 300) |
|
5591 | 115 |
) |
10579 | 116 |
component: |
117 |
(SpecCollection |
|
118 |
collection: ( |
|
119 |
(SequenceViewSpec |
|
120 |
name: 'List' |
|
121 |
layout: (LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0) |
|
122 |
tabable: true |
|
123 |
model: selectedMethodNameIndices |
|
124 |
menu: menuHolder |
|
125 |
hasHorizontalScrollBar: true |
|
126 |
hasVerticalScrollBar: true |
|
127 |
miniScrollerHorizontal: true |
|
128 |
isMultiSelect: true |
|
129 |
valueChangeSelector: selectionChangedByClick |
|
130 |
useIndex: true |
|
131 |
sequenceList: browserNameList |
|
132 |
doubleClickChannel: doubleClickChannel |
|
133 |
properties: |
|
134 |
(PropertyListDictionary |
|
135 |
canDropSelector: canDropContext: |
|
136 |
dragArgument: nil |
|
137 |
dropArgument: nil |
|
138 |
dropSelector: doDropContext: |
|
6774
ae9ed5b0b548
move method via drag and drop
Claus Gittinger <cg@exept.de>
parents:
6697
diff
changeset
|
139 |
) |
5591 | 140 |
) |
141 |
) |
|
142 |
||
143 |
) |
|
144 |
) |
|
145 |
! ! |
|
146 |
||
147 |
!MethodList class methodsFor:'plugIn spec'! |
|
148 |
||
149 |
aspectSelectors |
|
150 |
"This resource specification was automatically generated |
|
151 |
by the UIPainter of ST/X." |
|
152 |
||
153 |
"Do not manually edit this. If it is corrupted, |
|
154 |
the UIPainter may not be able to read the specification." |
|
155 |
||
156 |
"Return a description of exported aspects; |
|
157 |
these can be connected to aspects of an embedding application |
|
158 |
(if this app is embedded in a subCanvas)." |
|
159 |
||
160 |
^ #( |
|
10579 | 161 |
#(doubleClickChannel action) |
162 |
#filterClassVars |
|
6259
e440c14b02aa
experimental display of method complexity
Claus Gittinger <cg@exept.de>
parents:
5998
diff
changeset
|
163 |
#forceGeneratorTrigger |
e440c14b02aa
experimental display of method complexity
Claus Gittinger <cg@exept.de>
parents:
5998
diff
changeset
|
164 |
#immediateUpdate |
e440c14b02aa
experimental display of method complexity
Claus Gittinger <cg@exept.de>
parents:
5998
diff
changeset
|
165 |
#inGeneratorHolder |
e440c14b02aa
experimental display of method complexity
Claus Gittinger <cg@exept.de>
parents:
5998
diff
changeset
|
166 |
#menuHolder |
e440c14b02aa
experimental display of method complexity
Claus Gittinger <cg@exept.de>
parents:
5998
diff
changeset
|
167 |
#methodCategoryHolder |
e440c14b02aa
experimental display of method complexity
Claus Gittinger <cg@exept.de>
parents:
5998
diff
changeset
|
168 |
#packageFilter |
e440c14b02aa
experimental display of method complexity
Claus Gittinger <cg@exept.de>
parents:
5998
diff
changeset
|
169 |
#selectedMethods |
e440c14b02aa
experimental display of method complexity
Claus Gittinger <cg@exept.de>
parents:
5998
diff
changeset
|
170 |
#selectionChangeCondition |
10579 | 171 |
#showCoverageInformation |
172 |
#showImageResourceMethodsImages |
|
173 |
#showMethodComplexity |
|
174 |
#showMethodInheritance |
|
175 |
#showMethodTypeIcon |
|
176 |
#sortBy |
|
6259
e440c14b02aa
experimental display of method complexity
Claus Gittinger <cg@exept.de>
parents:
5998
diff
changeset
|
177 |
#updateTrigger |
e440c14b02aa
experimental display of method complexity
Claus Gittinger <cg@exept.de>
parents:
5998
diff
changeset
|
178 |
#variableFilter |
5591 | 179 |
). |
9421 | 180 |
|
5591 | 181 |
! ! |
182 |
||
183 |
!MethodList methodsFor:'aspects'! |
|
184 |
||
185 |
browserNameList |
|
186 |
browserNameList isNil ifTrue:[ |
|
10388 | 187 |
browserNameList := List new. |
5591 | 188 |
]. |
189 |
^ browserNameList. |
|
190 |
||
191 |
"Modified: / 31.1.2000 / 00:42:44 / cg" |
|
192 |
"Created: / 5.2.2000 / 22:38:32 / cg" |
|
193 |
! |
|
194 |
||
195 |
defaultSlaveModeValue |
|
196 |
^ false. |
|
197 |
! |
|
198 |
||
199 |
filterClassVars |
|
200 |
filterClassVars isNil ifTrue:[ |
|
10388 | 201 |
filterClassVars := false asValue. |
202 |
filterClassVars addDependent:self |
|
5591 | 203 |
]. |
204 |
^ filterClassVars |
|
205 |
! |
|
206 |
||
207 |
filterClassVars:aValueHolder |
|
208 |
filterClassVars notNil ifTrue:[ |
|
10388 | 209 |
filterClassVars removeDependent:self |
5591 | 210 |
]. |
211 |
filterClassVars := aValueHolder. |
|
212 |
filterClassVars notNil ifTrue:[ |
|
10388 | 213 |
filterClassVars addDependent:self |
5591 | 214 |
]. |
215 |
! |
|
216 |
||
217 |
methodLabelHolder |
|
218 |
^ self pseudoListLabelHolder |
|
219 |
||
220 |
"Created: / 1.3.2000 / 20:50:07 / cg" |
|
221 |
! |
|
222 |
||
223 |
methodList |
|
224 |
^ methodList |
|
225 |
! |
|
226 |
||
227 |
selectedMethodNameIndices |
|
228 |
selectedMethodNameIndices isNil ifTrue:[ |
|
10388 | 229 |
selectedMethodNameIndices := ValueHolder new. |
230 |
selectedMethodNameIndices addDependent:self |
|
5591 | 231 |
]. |
232 |
^ selectedMethodNameIndices. |
|
233 |
||
234 |
"Modified: / 5.2.2000 / 00:31:48 / cg" |
|
235 |
"Created: / 5.2.2000 / 22:59:31 / cg" |
|
236 |
! |
|
237 |
||
238 |
selectedMethods |
|
239 |
^ self selectionHolder |
|
240 |
! |
|
241 |
||
242 |
selectedMethods:aValueHolder |
|
243 |
^ self selectionHolder:aValueHolder |
|
244 |
! |
|
245 |
||
8197
3b1c5bd94fdd
preps for showResourceImages
Claus Gittinger <cg@exept.de>
parents:
7994
diff
changeset
|
246 |
showImageResourceMethodsImages |
3b1c5bd94fdd
preps for showResourceImages
Claus Gittinger <cg@exept.de>
parents:
7994
diff
changeset
|
247 |
showImageResourceMethodsImages isNil ifTrue:[ |
3b1c5bd94fdd
preps for showResourceImages
Claus Gittinger <cg@exept.de>
parents:
7994
diff
changeset
|
248 |
showImageResourceMethodsImages := false asValue. |
3b1c5bd94fdd
preps for showResourceImages
Claus Gittinger <cg@exept.de>
parents:
7994
diff
changeset
|
249 |
showImageResourceMethodsImages addDependent:self |
3b1c5bd94fdd
preps for showResourceImages
Claus Gittinger <cg@exept.de>
parents:
7994
diff
changeset
|
250 |
]. |
3b1c5bd94fdd
preps for showResourceImages
Claus Gittinger <cg@exept.de>
parents:
7994
diff
changeset
|
251 |
^ showImageResourceMethodsImages |
3b1c5bd94fdd
preps for showResourceImages
Claus Gittinger <cg@exept.de>
parents:
7994
diff
changeset
|
252 |
! |
3b1c5bd94fdd
preps for showResourceImages
Claus Gittinger <cg@exept.de>
parents:
7994
diff
changeset
|
253 |
|
3b1c5bd94fdd
preps for showResourceImages
Claus Gittinger <cg@exept.de>
parents:
7994
diff
changeset
|
254 |
showImageResourceMethodsImages:aValueHolder |
3b1c5bd94fdd
preps for showResourceImages
Claus Gittinger <cg@exept.de>
parents:
7994
diff
changeset
|
255 |
showImageResourceMethodsImages notNil ifTrue:[ |
3b1c5bd94fdd
preps for showResourceImages
Claus Gittinger <cg@exept.de>
parents:
7994
diff
changeset
|
256 |
showImageResourceMethodsImages removeDependent:self |
3b1c5bd94fdd
preps for showResourceImages
Claus Gittinger <cg@exept.de>
parents:
7994
diff
changeset
|
257 |
]. |
3b1c5bd94fdd
preps for showResourceImages
Claus Gittinger <cg@exept.de>
parents:
7994
diff
changeset
|
258 |
showImageResourceMethodsImages := aValueHolder. |
3b1c5bd94fdd
preps for showResourceImages
Claus Gittinger <cg@exept.de>
parents:
7994
diff
changeset
|
259 |
showImageResourceMethodsImages notNil ifTrue:[ |
3b1c5bd94fdd
preps for showResourceImages
Claus Gittinger <cg@exept.de>
parents:
7994
diff
changeset
|
260 |
showImageResourceMethodsImages addDependent:self |
3b1c5bd94fdd
preps for showResourceImages
Claus Gittinger <cg@exept.de>
parents:
7994
diff
changeset
|
261 |
]. |
3b1c5bd94fdd
preps for showResourceImages
Claus Gittinger <cg@exept.de>
parents:
7994
diff
changeset
|
262 |
! |
3b1c5bd94fdd
preps for showResourceImages
Claus Gittinger <cg@exept.de>
parents:
7994
diff
changeset
|
263 |
|
6259
e440c14b02aa
experimental display of method complexity
Claus Gittinger <cg@exept.de>
parents:
5998
diff
changeset
|
264 |
showMethodComplexity |
e440c14b02aa
experimental display of method complexity
Claus Gittinger <cg@exept.de>
parents:
5998
diff
changeset
|
265 |
showMethodComplexity isNil ifTrue:[ |
e440c14b02aa
experimental display of method complexity
Claus Gittinger <cg@exept.de>
parents:
5998
diff
changeset
|
266 |
showMethodComplexity := false asValue. |
e440c14b02aa
experimental display of method complexity
Claus Gittinger <cg@exept.de>
parents:
5998
diff
changeset
|
267 |
showMethodComplexity addDependent:self |
e440c14b02aa
experimental display of method complexity
Claus Gittinger <cg@exept.de>
parents:
5998
diff
changeset
|
268 |
]. |
e440c14b02aa
experimental display of method complexity
Claus Gittinger <cg@exept.de>
parents:
5998
diff
changeset
|
269 |
^ showMethodComplexity |
e440c14b02aa
experimental display of method complexity
Claus Gittinger <cg@exept.de>
parents:
5998
diff
changeset
|
270 |
! |
e440c14b02aa
experimental display of method complexity
Claus Gittinger <cg@exept.de>
parents:
5998
diff
changeset
|
271 |
|
e440c14b02aa
experimental display of method complexity
Claus Gittinger <cg@exept.de>
parents:
5998
diff
changeset
|
272 |
showMethodComplexity:aValueHolder |
e440c14b02aa
experimental display of method complexity
Claus Gittinger <cg@exept.de>
parents:
5998
diff
changeset
|
273 |
showMethodComplexity notNil ifTrue:[ |
e440c14b02aa
experimental display of method complexity
Claus Gittinger <cg@exept.de>
parents:
5998
diff
changeset
|
274 |
showMethodComplexity removeDependent:self |
e440c14b02aa
experimental display of method complexity
Claus Gittinger <cg@exept.de>
parents:
5998
diff
changeset
|
275 |
]. |
e440c14b02aa
experimental display of method complexity
Claus Gittinger <cg@exept.de>
parents:
5998
diff
changeset
|
276 |
showMethodComplexity := aValueHolder. |
e440c14b02aa
experimental display of method complexity
Claus Gittinger <cg@exept.de>
parents:
5998
diff
changeset
|
277 |
showMethodComplexity notNil ifTrue:[ |
e440c14b02aa
experimental display of method complexity
Claus Gittinger <cg@exept.de>
parents:
5998
diff
changeset
|
278 |
showMethodComplexity addDependent:self |
e440c14b02aa
experimental display of method complexity
Claus Gittinger <cg@exept.de>
parents:
5998
diff
changeset
|
279 |
]. |
e440c14b02aa
experimental display of method complexity
Claus Gittinger <cg@exept.de>
parents:
5998
diff
changeset
|
280 |
! |
e440c14b02aa
experimental display of method complexity
Claus Gittinger <cg@exept.de>
parents:
5998
diff
changeset
|
281 |
|
5591 | 282 |
showMethodInheritance |
283 |
showMethodInheritance isNil ifTrue:[ |
|
10388 | 284 |
showMethodInheritance := false asValue. |
285 |
showMethodInheritance addDependent:self |
|
5591 | 286 |
]. |
287 |
^ showMethodInheritance |
|
288 |
! |
|
289 |
||
290 |
showMethodInheritance:aValueHolder |
|
291 |
showMethodInheritance notNil ifTrue:[ |
|
10388 | 292 |
showMethodInheritance removeDependent:self |
5591 | 293 |
]. |
294 |
showMethodInheritance := aValueHolder. |
|
295 |
showMethodInheritance notNil ifTrue:[ |
|
10388 | 296 |
showMethodInheritance addDependent:self |
5591 | 297 |
]. |
298 |
! |
|
299 |
||
6268 | 300 |
showMethodTypeIcon |
301 |
showMethodTypeIcon isNil ifTrue:[ |
|
302 |
showMethodTypeIcon := true asValue. |
|
303 |
showMethodTypeIcon addDependent:self |
|
304 |
]. |
|
305 |
^ showMethodTypeIcon |
|
306 |
! |
|
307 |
||
308 |
showMethodTypeIcon:aValueHolder |
|
309 |
showMethodTypeIcon notNil ifTrue:[ |
|
310 |
showMethodTypeIcon removeDependent:self |
|
311 |
]. |
|
312 |
showMethodTypeIcon := aValueHolder. |
|
313 |
showMethodTypeIcon notNil ifTrue:[ |
|
314 |
showMethodTypeIcon addDependent:self |
|
315 |
]. |
|
316 |
! |
|
317 |
||
5591 | 318 |
variableFilter |
319 |
variableFilter isNil ifTrue:[ |
|
10388 | 320 |
variableFilter := nil asValue. |
321 |
variableFilter addDependent:self |
|
5591 | 322 |
]. |
323 |
^ variableFilter |
|
324 |
! |
|
325 |
||
326 |
variableFilter:aValueHolder |
|
327 |
variableFilter notNil ifTrue:[ |
|
10388 | 328 |
variableFilter removeDependent:self |
5591 | 329 |
]. |
330 |
variableFilter := aValueHolder. |
|
331 |
variableFilter notNil ifTrue:[ |
|
10388 | 332 |
variableFilter addDependent:self |
5591 | 333 |
]. |
334 |
! ! |
|
335 |
||
336 |
!MethodList methodsFor:'change & update'! |
|
337 |
||
338 |
delayedUpdate:something with:aParameter from:changedObject |
|
339 |
|cls sel oldMethod newMethod methods newSelection |
|
340 |
selectionHolder selection needSelectionChange| |
|
341 |
||
342 |
selectionHolder := self selectedMethods. |
|
343 |
selection := selectionHolder value. |
|
344 |
||
345 |
changedObject == Smalltalk ifTrue:[ |
|
5998 | 346 |
classes notNil ifTrue:[ |
10388 | 347 |
something == #classDefinition ifTrue:[ |
348 |
cls := aParameter. |
|
349 |
(classes contains:[:aClass | aClass name == cls name]) ifFalse:[ |
|
350 |
^ self "/ I dont care for that class |
|
351 |
]. |
|
352 |
classes := classes collect:[:eachClass | eachClass isMeta ifTrue:[ |
|
353 |
(Smalltalk at:eachClass theNonMetaclass name) class |
|
354 |
] ifFalse:[ |
|
355 |
Smalltalk at:eachClass name |
|
356 |
] |
|
357 |
]. |
|
358 |
self invalidateList. |
|
359 |
"/ self updateList. |
|
360 |
^ self. |
|
361 |
]. |
|
362 |
||
5998 | 363 |
something == #methodCategory ifTrue:[ |
364 |
"/ ignore here - methodCategoryList will tell me if required |
|
365 |
^ self |
|
366 |
]. |
|
6663
1453d4f33815
changed change-update aspect when changing some method category
Claus Gittinger <cg@exept.de>
parents:
6575
diff
changeset
|
367 |
(something == #classOrganization |
1453d4f33815
changed change-update aspect when changing some method category
Claus Gittinger <cg@exept.de>
parents:
6575
diff
changeset
|
368 |
or:[ something == #methodCategoryAdded |
1453d4f33815
changed change-update aspect when changing some method category
Claus Gittinger <cg@exept.de>
parents:
6575
diff
changeset
|
369 |
or:[ something == #methodCategoryRemoved |
1453d4f33815
changed change-update aspect when changing some method category
Claus Gittinger <cg@exept.de>
parents:
6575
diff
changeset
|
370 |
or:[ something == #methodCategoriesRemoved |
1453d4f33815
changed change-update aspect when changing some method category
Claus Gittinger <cg@exept.de>
parents:
6575
diff
changeset
|
371 |
or:[ something == #methodCategoryRenamed ]]]]) ifTrue:[ |
5998 | 372 |
"/ ignore here - methodCategoryList will tell me if required |
373 |
^ self |
|
374 |
]. |
|
5591 | 375 |
|
5998 | 376 |
something == #methodInClass ifTrue:[ |
377 |
"/ a method has been added/changed |
|
378 |
cls := aParameter at:1. |
|
379 |
(classes includesIdentical:cls) ifTrue:[ |
|
380 |
sel := aParameter at:2. |
|
381 |
oldMethod := aParameter at:3. |
|
382 |
newMethod := cls compiledMethodAt:sel. |
|
383 |
(oldMethod notNil and:[newMethod notNil]) ifTrue:[ |
|
384 |
"a method was changed & acccepted; |
|
385 |
No need for a rescan of the methodDictionary; |
|
386 |
however, ensure that the refs to the old method are updated |
|
387 |
" |
|
388 |
methods := selection. |
|
389 |
methods size > 0 ifTrue:[ |
|
390 |
(methods includesIdentical:oldMethod) ifTrue:[ |
|
391 |
needSelectionChange := true. |
|
392 |
] |
|
393 |
]. |
|
394 |
methodList replaceAllIdentical:oldMethod with:newMethod. |
|
395 |
lastSelectedMethods notNil ifTrue:[ |
|
396 |
lastSelectedMethods replaceAllIdentical:oldMethod with:newMethod |
|
397 |
]. |
|
398 |
methods size > 0 ifTrue:[ |
|
399 |
methods := methods asOrderedCollection. |
|
400 |
methods replaceAllIdentical:oldMethod with:newMethod. |
|
401 |
]. |
|
5591 | 402 |
|
5998 | 403 |
needSelectionChange == true ifTrue:[ |
404 |
selectionHolder setValue:methods. |
|
6575
94f336bcb07b
update notifiaction from other browsers (refix)
Claus Gittinger <cg@exept.de>
parents:
6490
diff
changeset
|
405 |
"/ self enqueueDelayedMethodsSelectionChanged. |
94f336bcb07b
update notifiaction from other browsers (refix)
Claus Gittinger <cg@exept.de>
parents:
6490
diff
changeset
|
406 |
"/ need this to inform my browser that method was changed |
94f336bcb07b
update notifiaction from other browsers (refix)
Claus Gittinger <cg@exept.de>
parents:
6490
diff
changeset
|
407 |
"/ by someone else. |
94f336bcb07b
update notifiaction from other browsers (refix)
Claus Gittinger <cg@exept.de>
parents:
6490
diff
changeset
|
408 |
selectionHolder changed. |
5998 | 409 |
]. |
10376
8a61751a59fa
method entry updating fixed (it is updated whenever a method is changed)
vrany
parents:
10363
diff
changeset
|
410 |
"/JV@2011-07-22: Update always - I need to see immediately that |
8a61751a59fa
method entry updating fixed (it is updated whenever a method is changed)
vrany
parents:
10363
diff
changeset
|
411 |
"/the method has changed. Also, add/remove breakpoint etc. |
8a61751a59fa
method entry updating fixed (it is updated whenever a method is changed)
vrany
parents:
10363
diff
changeset
|
412 |
|
8a61751a59fa
method entry updating fixed (it is updated whenever a method is changed)
vrany
parents:
10363
diff
changeset
|
413 |
"/ (variableFilter value size > 0 |
8a61751a59fa
method entry updating fixed (it is updated whenever a method is changed)
vrany
parents:
10363
diff
changeset
|
414 |
"/ or:[oldMethod package ~= newMethod package |
8a61751a59fa
method entry updating fixed (it is updated whenever a method is changed)
vrany
parents:
10363
diff
changeset
|
415 |
"/ or:[oldMethod resources ~= newMethod resources |
8a61751a59fa
method entry updating fixed (it is updated whenever a method is changed)
vrany
parents:
10363
diff
changeset
|
416 |
"/ or:[showMethodComplexity value == true]]]) |
8a61751a59fa
method entry updating fixed (it is updated whenever a method is changed)
vrany
parents:
10363
diff
changeset
|
417 |
true |
8a61751a59fa
method entry updating fixed (it is updated whenever a method is changed)
vrany
parents:
10363
diff
changeset
|
418 |
ifTrue:[ |
5998 | 419 |
"/ only update that methods entry |
420 |
self updateListEntryFor:newMethod. |
|
421 |
"/ sigh - must invalidate |
|
422 |
"/ self invalidateList. |
|
423 |
]. |
|
424 |
^ self. |
|
425 |
]. |
|
426 |
"/ method was added - update the methodList |
|
427 |
"/ Q: is this needed (methodCategoryList should send me a new inGenerator) |
|
428 |
self invalidateList. |
|
429 |
]. |
|
430 |
^ self. |
|
431 |
]. |
|
432 |
||
433 |
something == #methodInClassRemoved ifTrue:[ |
|
434 |
cls := aParameter at:1. |
|
435 |
(classes includesIdentical:cls) ifTrue:[ |
|
436 |
sel := aParameter at:2. |
|
437 |
"/ method was removed - update the methodList |
|
438 |
"/ Q: is this needed (methodCategoryList should send me a new inGenerator) |
|
439 |
self invalidateList. |
|
440 |
]. |
|
441 |
^ self. |
|
442 |
]. |
|
5591 | 443 |
|
10357 | 444 |
something == #methodCoverageInfo ifTrue:[ |
445 |
"/ already checked if it is one of my classes |
|
10363 | 446 |
listValid == true ifTrue:[ |
447 |
self invalidateList. |
|
448 |
]. |
|
10357 | 449 |
^ self. |
450 |
]. |
|
451 |
||
5998 | 452 |
(something == #methodTrap |
453 |
or:[ something == #privacyOfMethod ]) ifTrue:[ |
|
454 |
cls := aParameter at:1. |
|
455 |
sel := aParameter at:2. |
|
456 |
(classes includesIdentical:cls) ifFalse:[ ^ self]. |
|
457 |
newMethod := cls compiledMethodAt:sel. |
|
458 |
newMethod isNil ifTrue:[ |
|
459 |
self invalidateList. |
|
460 |
^ self |
|
461 |
]. |
|
5591 | 462 |
|
5998 | 463 |
(something == #privacyOfMethod) ifTrue:[ |
464 |
self updateListEntryFor:newMethod. |
|
465 |
]. |
|
466 |
||
467 |
(something == #methodTrap) ifTrue:[ |
|
468 |
newMethod isWrapped ifTrue:[ |
|
469 |
oldMethod := newMethod originalMethod |
|
470 |
] ifFalse:[ |
|
471 |
selection size > 0 ifTrue:[ |
|
472 |
oldMethod := selection detect:[:each | each isWrapped and:[each originalMethod == newMethod]] ifNone:nil. |
|
473 |
] |
|
474 |
]. |
|
5591 | 475 |
|
5998 | 476 |
selection size > 0 ifTrue:[ |
477 |
(selection includesIdentical:oldMethod) ifTrue:[ |
|
478 |
needSelectionChange := true. |
|
479 |
] |
|
480 |
]. |
|
481 |
methodList replaceAllIdentical:oldMethod with:newMethod. |
|
482 |
lastSelectedMethods notNil ifTrue:[ |
|
483 |
lastSelectedMethods replaceAllIdentical:oldMethod with:newMethod |
|
484 |
]. |
|
485 |
selection size > 0 ifTrue:[ |
|
486 |
selection := selection asOrderedCollection. |
|
487 |
selection replaceAllIdentical:oldMethod with:newMethod. |
|
488 |
]. |
|
489 |
needSelectionChange == true ifTrue:[ |
|
490 |
selectionHolder changed. |
|
491 |
]. |
|
5591 | 492 |
|
5998 | 493 |
"/ actually, could just change that single item ... |
494 |
"/ ... might be cheaper, if list is huge. |
|
495 |
"/ only update that methods entry |
|
496 |
self updateListEntryFor:newMethod. |
|
497 |
"/ self invalidateList. |
|
498 |
]. |
|
499 |
^ self |
|
500 |
]. |
|
5591 | 501 |
|
6846 | 502 |
(something == #projectOrganization |
503 |
or:[something == #lastTestRunResult]) ifTrue:[ |
|
5998 | 504 |
aParameter notNil ifTrue:[ |
505 |
cls := aParameter at:1. |
|
506 |
cls notNil ifTrue:[ |
|
507 |
((classes includesIdentical:cls theNonMetaclass) |
|
508 |
or:[(classes includesIdentical:cls theMetaclass)]) ifTrue:[ |
|
509 |
self invalidateList. |
|
510 |
]. |
|
511 |
]. |
|
512 |
] ifFalse:[ |
|
513 |
self invalidateList. |
|
514 |
]. |
|
515 |
^ self |
|
516 |
]. |
|
6846 | 517 |
|
5998 | 518 |
"/ everything else is ignored |
519 |
"/ self halt. |
|
520 |
]. |
|
521 |
^ self |
|
5591 | 522 |
]. |
523 |
||
524 |
"/ something == #organization ifTrue:[ |
|
525 |
"/self halt:'no longer'. |
|
526 |
"/^ self. |
|
527 |
"/ "/ a methods cateory has changed |
|
528 |
"/ (classes includesIdentical:changedObject) ifTrue:[ |
|
529 |
"/ aParameter isSymbol ifTrue:[ |
|
530 |
"/ "/ a method with a new category |
|
531 |
"/ (self methodList includesIdentical:(changedObject compiledMethodAt:aParameter)) ifTrue:[ |
|
532 |
"/ self invalidateList. |
|
533 |
"/ ]. |
|
534 |
"/ ^ self. |
|
535 |
"/ ]. |
|
536 |
"/ "/ a new category (no method yet) |
|
537 |
"/ self invalidateList |
|
538 |
"/ ]. |
|
539 |
"/ ^ self |
|
540 |
"/ ]. |
|
541 |
||
542 |
"/ something == #methodDictionary ifTrue:[ |
|
543 |
"/self halt:'no longer'. |
|
544 |
"/^ self. |
|
545 |
"/ "/ a method has been added/removed |
|
546 |
"/ (classes includesIdentical:changedObject) ifTrue:[ |
|
547 |
"/ aParameter isArray ifTrue:[ |
|
548 |
"/ sel := aParameter at:1. |
|
549 |
"/ oldMethod := aParameter at:2. |
|
550 |
"/ newMethod := changedObject compiledMethodAt:sel. |
|
551 |
"/ oldMethod notNil ifTrue:[ |
|
552 |
"/ "a method was changed & acccepted; |
|
553 |
"/ No need for a rescan of the methodDictionary; |
|
554 |
"/ however, ensure that the refs to the old method are updated |
|
555 |
"/ " |
|
556 |
"/ methods := selection. |
|
557 |
"/ methods size > 0 ifTrue:[ |
|
558 |
"/ (methods includesIdentical:oldMethod) ifTrue:[ |
|
559 |
"/ needSelectionChange := true. |
|
560 |
"/ ] |
|
561 |
"/ ]. |
|
562 |
"/ methodList replaceAllIdentical:oldMethod with:newMethod. |
|
563 |
"/ lastSelectedMethods notNil ifTrue:[ |
|
564 |
"/ lastSelectedMethods replaceAllIdentical:oldMethod with:newMethod |
|
565 |
"/ ]. |
|
566 |
"/ methods size > 0 ifTrue:[ |
|
567 |
"/ methods := methods asOrderedCollection. |
|
568 |
"/ methods replaceAllIdentical:oldMethod with:newMethod. |
|
569 |
"/ ]. |
|
570 |
"/ needSelectionChange == true ifTrue:[ |
|
571 |
"/ selectionHolder setValue:methods. |
|
572 |
"/ selectionHolder changed. |
|
573 |
"/ ]. |
|
574 |
"/ ^ self. |
|
575 |
"/ ] |
|
576 |
"/ ]. |
|
577 |
"/ "/ class has changed must update the methodList |
|
578 |
"/ self invalidateList. |
|
579 |
"/ ]. |
|
580 |
"/ ^ self. |
|
581 |
"/ ]. |
|
582 |
||
583 |
"/ something == #projectOrganization ifTrue:[ |
|
584 |
"/ ((classes includesIdentical:changedObject theNonMetaclass) |
|
585 |
"/ or:[(classes includesIdentical:changedObject theMetaclass)]) ifTrue:[ |
|
586 |
"/ self invalidateList. |
|
587 |
"/ ]. |
|
588 |
"/ ^ self |
|
589 |
"/ ]. |
|
590 |
||
591 |
changedObject == sortBy ifTrue:[ |
|
5998 | 592 |
listValid ~~ true ifTrue:[ "/ could be nil |
593 |
inGeneratorHolder value isNil ifTrue:[ |
|
594 |
"/ ok, no need to react on that one |
|
595 |
"/ (will invalidate anyway, once I have more info at hand) |
|
596 |
^ self |
|
597 |
]. |
|
598 |
]. |
|
599 |
self invalidateList. |
|
600 |
^ self |
|
5591 | 601 |
]. |
602 |
||
603 |
(changedObject == variableFilter |
|
604 |
or:[changedObject == filterClassVars |
|
6259
e440c14b02aa
experimental display of method complexity
Claus Gittinger <cg@exept.de>
parents:
5998
diff
changeset
|
605 |
or:[changedObject == showMethodInheritance |
e440c14b02aa
experimental display of method complexity
Claus Gittinger <cg@exept.de>
parents:
5998
diff
changeset
|
606 |
or:[changedObject == showMethodComplexity]]]) ifTrue:[ |
5998 | 607 |
self invalidateList. |
608 |
^ self |
|
5591 | 609 |
]. |
610 |
||
611 |
changedObject == selectedMethodNameIndices ifTrue:[ |
|
5998 | 612 |
newSelection := self selectedMethodNameIndices value collect:[:idx | methodList at:idx]. |
613 |
newSelection ~= selection ifTrue:[ |
|
614 |
selectionHolder value:newSelection. |
|
615 |
lastSelectedMethods := newSelection. |
|
616 |
lastSelectedMethods notNil ifTrue:[ |
|
617 |
lastSelectedMethods := lastSelectedMethods asOrderedCollection |
|
618 |
]. |
|
619 |
] ifFalse:[ |
|
620 |
"/ a reselect - force update |
|
5591 | 621 |
"/ selection size == 1 ifTrue:[ |
5998 | 622 |
selectionHolder setValue:newSelection. |
623 |
selectionHolder changed:#value. |
|
5591 | 624 |
"/ ]. |
5998 | 625 |
]. |
626 |
^ self |
|
5591 | 627 |
]. |
628 |
changedObject == selectionHolder ifTrue:[ |
|
5998 | 629 |
self selectedMethodsChanged. |
630 |
lastSelectedMethods := selectionHolder value. |
|
631 |
lastSelectedMethods notNil ifTrue:[ |
|
632 |
lastSelectedMethods := lastSelectedMethods asOrderedCollection |
|
633 |
]. |
|
634 |
^ self |
|
5591 | 635 |
]. |
636 |
"/ something == #methodTrap ifTrue:[ |
|
637 |
"/self halt:'no longer'. |
|
638 |
"/^ self. |
|
639 |
"/ (classes includesIdentical:changedObject) ifTrue:[ |
|
640 |
"/ newMethod := changedObject compiledMethodAt:aParameter. |
|
641 |
"/ newMethod isNil ifTrue:[ |
|
642 |
"/ self invalidateList. |
|
643 |
"/ ^ self |
|
644 |
"/ ]. |
|
645 |
"/ newMethod isWrapped ifTrue:[ |
|
646 |
"/ oldMethod := newMethod originalMethod |
|
647 |
"/ ] ifFalse:[ |
|
648 |
"/ selection size > 0 ifTrue:[ |
|
649 |
"/ oldMethod := selection detect:[:each | each isWrapped and:[each originalMethod == newMethod]] ifNone:nil. |
|
650 |
"/ ] |
|
651 |
"/ ]. |
|
652 |
"/ |
|
653 |
"/ selection size > 0 ifTrue:[ |
|
654 |
"/ (selection includesIdentical:oldMethod) ifTrue:[ |
|
655 |
"/ needSelectionChange := true. |
|
656 |
"/ ] |
|
657 |
"/ ]. |
|
658 |
"/"/ methodList replaceAllIdentical:oldMethod with:newMethod. |
|
659 |
"/ lastSelectedMethods notNil ifTrue:[ |
|
660 |
"/ lastSelectedMethods replaceAllIdentical:oldMethod with:newMethod |
|
661 |
"/ ]. |
|
662 |
"/ selection size > 0 ifTrue:[ |
|
663 |
"/ selection := selection asOrderedCollection. |
|
664 |
"/ selection replaceAllIdentical:oldMethod with:newMethod. |
|
665 |
"/ ]. |
|
666 |
"/ needSelectionChange == true ifTrue:[ |
|
667 |
"/ selectionHolder changed. |
|
668 |
"/ ]. |
|
669 |
"/ self invalidateList. |
|
670 |
"/ ^ self |
|
671 |
"/ ]. |
|
672 |
"/ ^ self |
|
673 |
"/ ]. |
|
674 |
super delayedUpdate:something with:aParameter from:changedObject |
|
675 |
||
6846 | 676 |
"Created: / 05-02-2000 / 13:42:14 / cg" |
10363 | 677 |
"Modified: / 20-07-2011 / 18:56:23 / cg" |
10376
8a61751a59fa
method entry updating fixed (it is updated whenever a method is changed)
vrany
parents:
10363
diff
changeset
|
678 |
"Modified: / 22-07-2011 / 18:12:23 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
5591 | 679 |
! |
680 |
||
681 |
selectedMethodsChanged |
|
682 |
"the set of selected methods has changed; |
|
683 |
update the selection-index collection (for the selectionInListView)" |
|
684 |
||
685 |
|indices methods reverseMap |
|
686 |
selectedMethodsHolder selectedMethods selectedMethodNameIndicesHolder| |
|
687 |
||
688 |
methods := methodList ? #(). |
|
689 |
methods size == 0 ifTrue:[ |
|
10388 | 690 |
"/ this may happen during early startup, |
691 |
"/ when invoked with a preset methodSelection, |
|
692 |
"/ and the methodGenerator has not yet been setup |
|
693 |
"/ to not clobber the selection, defer the update |
|
694 |
"/ until the methodList arrives ... |
|
695 |
^ self |
|
5591 | 696 |
]. |
697 |
||
698 |
selectedMethodsHolder := self selectedMethods. |
|
699 |
selectedMethods := selectedMethodsHolder value. |
|
700 |
||
701 |
"/ check if all is selected (likely) |
|
702 |
((selectedMethods size == methodList size) |
|
703 |
and:[selectedMethods = methodList]) ifTrue:[ |
|
10388 | 704 |
indices := (1 to:selectedMethods size) |
5591 | 705 |
] ifFalse:[ |
10388 | 706 |
selectedMethods size > 100 ifTrue:[ |
707 |
"/ check if all is selected (likely) |
|
708 |
((selectedMethods size == methodList size) |
|
709 |
and:[selectedMethods = methodList]) ifTrue:[ |
|
710 |
indices := (1 to:selectedMethods size) |
|
711 |
] ifFalse:[ |
|
712 |
"/ for big collections, generate a reverse map |
|
713 |
reverseMap := IdentityDictionary new. |
|
714 |
methods keysAndValuesDo:[:idx :mthd | reverseMap at:mthd put:idx]. |
|
715 |
indices := selectedMethods collect:[:eachSelectedMethod | |
|
716 |
reverseMap at:eachSelectedMethod ifAbsent:0 |
|
717 |
] |
|
718 |
] |
|
719 |
] ifFalse:[ |
|
720 |
indices := (selectedMethods ? #()) collect:[:eachSelectedMethod | |
|
721 |
methods identityIndexOf:eachSelectedMethod. |
|
722 |
] |
|
723 |
]. |
|
724 |
indices := indices select:[:idx | idx ~= 0]. |
|
5591 | 725 |
]. |
726 |
||
727 |
selectedMethodNameIndicesHolder := self selectedMethodNameIndices. |
|
728 |
selectedMethodNameIndicesHolder value ~= indices ifTrue:[ |
|
10388 | 729 |
selectedMethodNameIndicesHolder value:indices. |
5591 | 730 |
] |
731 |
! |
|
732 |
||
733 |
selectionChanged |
|
734 |
|methods| |
|
735 |
||
736 |
methods := ((self selectedMethodNameIndices value) ? #()) collect:[:idx | methodList at:idx]. |
|
737 |
methods notEmpty ifTrue:[ |
|
10388 | 738 |
lastSelectedMethods := methods asOrderedCollection. |
5591 | 739 |
]. |
740 |
"/ to allow reselect, change my valueHolder, even if the same collection |
|
741 |
"/ self selectedMethods value ~= methods ifTrue:[ |
|
10388 | 742 |
self selectedMethods value:methods |
5591 | 743 |
"/ ] |
744 |
||
745 |
"Created: / 5.2.2000 / 13:42:14 / cg" |
|
746 |
"Modified: / 5.2.2000 / 23:32:20 / cg" |
|
747 |
! |
|
748 |
||
749 |
selectionChangedByClick |
|
750 |
"we are not interested in that - get another notification |
|
751 |
via the changed valueHolder" |
|
752 |
||
753 |
! |
|
754 |
||
755 |
update:something with:aParameter from:changedObject |
|
10357 | 756 |
|cls mthd| |
5591 | 757 |
|
758 |
"/ some can be ignored immediately |
|
759 |
changedObject == Smalltalk ifTrue:[ |
|
760 |
classes isNil ifTrue:[ |
|
761 |
^ self. |
|
762 |
]. |
|
763 |
something isNil ifTrue:[ |
|
764 |
"/ self halt "/ huh - Smalltalk changed - so what ? |
|
765 |
^ self. |
|
766 |
]. |
|
5998 | 767 |
|
5591 | 768 |
something == #classComment ifTrue:[ |
769 |
^ self. |
|
770 |
]. |
|
771 |
something == #classVariables ifTrue:[ |
|
772 |
^ self. |
|
773 |
]. |
|
774 |
something == #organization ifTrue:[ |
|
775 |
^ self. |
|
776 |
]. |
|
777 |
something == #methodCategory ifTrue:[ |
|
778 |
"/ ignore here - methodCategoryList will tell me if required |
|
779 |
^ self |
|
780 |
]. |
|
6663
1453d4f33815
changed change-update aspect when changing some method category
Claus Gittinger <cg@exept.de>
parents:
6575
diff
changeset
|
781 |
(something == #classOrganization |
1453d4f33815
changed change-update aspect when changing some method category
Claus Gittinger <cg@exept.de>
parents:
6575
diff
changeset
|
782 |
or:[ something == #methodCategoryAdded |
1453d4f33815
changed change-update aspect when changing some method category
Claus Gittinger <cg@exept.de>
parents:
6575
diff
changeset
|
783 |
or:[ something == #methodCategoryRemoved |
1453d4f33815
changed change-update aspect when changing some method category
Claus Gittinger <cg@exept.de>
parents:
6575
diff
changeset
|
784 |
or:[ something == #methodCategoriesRemoved |
1453d4f33815
changed change-update aspect when changing some method category
Claus Gittinger <cg@exept.de>
parents:
6575
diff
changeset
|
785 |
or:[ something == #methodCategoryRenamed ]]]]) ifTrue:[ |
5591 | 786 |
"/ ignore here - methodCategoryList will tell me if required |
787 |
^ self |
|
788 |
]. |
|
10357 | 789 |
|
790 |
something == #methodCoverageInfo ifTrue:[ |
|
10363 | 791 |
listValid ifFalse:[^ self]. |
10357 | 792 |
self showCoverageInformation value ifFalse:[^ self]. |
793 |
mthd := aParameter. |
|
794 |
(classes notNil and:[classes includesIdentical:mthd mclass]) ifFalse:[ |
|
795 |
^ self "/ I dont care for that class |
|
796 |
]. |
|
10363 | 797 |
listValid ifFalse:[^ self]. |
10357 | 798 |
]. |
799 |
||
5998 | 800 |
(something == #methodTrap |
6846 | 801 |
or:[ something == #methodPrivacy |
802 |
or:[ something == #lastTestRunResult] ]) ifTrue:[ |
|
5998 | 803 |
self window shown ifFalse:[ |
804 |
changedObject removeDependent:self. "/ ????? |
|
805 |
^ self |
|
806 |
]. |
|
5591 | 807 |
cls := aParameter at:1. |
808 |
(classes includesIdentical:cls) ifFalse:[ |
|
5998 | 809 |
^ self "/ I dont care for that class |
5591 | 810 |
]. |
811 |
]. |
|
812 |
||
6846 | 813 |
"/ as the organisation changes, flush my remembered redefinition-cache-info |
5591 | 814 |
classAndSelectorsRedefinedBySubclassesOfClass := nil. |
815 |
||
816 |
something == #classDefinition ifTrue:[ |
|
817 |
cls := aParameter. |
|
818 |
(classes contains:[:aClass | aClass name == cls name]) ifFalse:[ |
|
819 |
^ self "/ I dont care for that class |
|
820 |
]. |
|
10388 | 821 |
"/ classes := classes collect:[:eachClass | eachClass isMeta ifTrue:[ |
822 |
"/ (Smalltalk at:eachClass theNonMetaclass name) class |
|
823 |
"/ ] ifFalse:[ |
|
824 |
"/ Smalltalk at:eachClass name |
|
825 |
"/ ] |
|
826 |
"/ ]. |
|
827 |
"/ self updateList. |
|
828 |
self enqueueDelayedUpdate:something with:aParameter from:changedObject. |
|
5591 | 829 |
^ self. |
830 |
]. |
|
831 |
something == #newClass ifTrue:[ |
|
832 |
^ self. |
|
833 |
]. |
|
834 |
something == #classRemove ifTrue:[ |
|
835 |
^ self. |
|
836 |
]. |
|
837 |
something == #classRename ifTrue:[ |
|
838 |
^ self. |
|
839 |
]. |
|
840 |
]. |
|
841 |
||
842 |
"/ these must lead to immediate update of the selectedMethods collection |
|
843 |
"/ (otherwise, that collection might be updated too late, leading to |
|
844 |
"/ an obsolete methods code being shown by the codeView. |
|
845 |
something == #methodInClass ifTrue:[ |
|
6846 | 846 |
"/ as the organisation changes, flush my remembered redefinition-cache-info |
5591 | 847 |
classAndSelectorsRedefinedBySubclassesOfClass := nil. |
848 |
cls := aParameter at:1. |
|
849 |
(classes includesIdentical:cls) ifFalse:[ |
|
850 |
^ self "/ I dont care for that class |
|
851 |
]. |
|
852 |
self enqueueDelayedUpdate:something with:aParameter from:changedObject. |
|
853 |
^ self |
|
854 |
]. |
|
855 |
||
856 |
something == #methodInClassRemoved ifTrue:[ |
|
857 |
cls := aParameter at:1. |
|
858 |
(classes includesIdentical:cls) ifFalse:[ |
|
859 |
^ self "/ I dont care for that class |
|
860 |
]. |
|
861 |
]. |
|
862 |
||
863 |
super update:something with:aParameter from:changedObject |
|
6846 | 864 |
|
10363 | 865 |
"Modified: / 20-07-2011 / 18:54:04 / cg" |
10376
8a61751a59fa
method entry updating fixed (it is updated whenever a method is changed)
vrany
parents:
10363
diff
changeset
|
866 |
"Modified (format): / 22-07-2011 / 18:13:28 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
5591 | 867 |
! ! |
868 |
||
6774
ae9ed5b0b548
move method via drag and drop
Claus Gittinger <cg@exept.de>
parents:
6697
diff
changeset
|
869 |
!MethodList methodsFor:'drag & drop'! |
ae9ed5b0b548
move method via drag and drop
Claus Gittinger <cg@exept.de>
parents:
6697
diff
changeset
|
870 |
|
ae9ed5b0b548
move method via drag and drop
Claus Gittinger <cg@exept.de>
parents:
6697
diff
changeset
|
871 |
canDropContext:aDropContext |
ae9ed5b0b548
move method via drag and drop
Claus Gittinger <cg@exept.de>
parents:
6697
diff
changeset
|
872 |
|methods| |
ae9ed5b0b548
move method via drag and drop
Claus Gittinger <cg@exept.de>
parents:
6697
diff
changeset
|
873 |
|
ae9ed5b0b548
move method via drag and drop
Claus Gittinger <cg@exept.de>
parents:
6697
diff
changeset
|
874 |
aDropContext sourceWidget == aDropContext targetWidget ifTrue:[^ false]. |
ae9ed5b0b548
move method via drag and drop
Claus Gittinger <cg@exept.de>
parents:
6697
diff
changeset
|
875 |
|
ae9ed5b0b548
move method via drag and drop
Claus Gittinger <cg@exept.de>
parents:
6697
diff
changeset
|
876 |
methods := aDropContext dropObjects collect:[:obj | obj theObject]. |
7122 | 877 |
(methods conform:[:aMethod | aMethod isMethod]) ifFalse:[^ false]. |
6774
ae9ed5b0b548
move method via drag and drop
Claus Gittinger <cg@exept.de>
parents:
6697
diff
changeset
|
878 |
|
ae9ed5b0b548
move method via drag and drop
Claus Gittinger <cg@exept.de>
parents:
6697
diff
changeset
|
879 |
self masterApplication theSingleSelectedClass isNil ifTrue:[^ false]. |
ae9ed5b0b548
move method via drag and drop
Claus Gittinger <cg@exept.de>
parents:
6697
diff
changeset
|
880 |
^ true |
7122 | 881 |
|
882 |
"Modified: / 13-09-2006 / 11:43:54 / cg" |
|
6774
ae9ed5b0b548
move method via drag and drop
Claus Gittinger <cg@exept.de>
parents:
6697
diff
changeset
|
883 |
! |
ae9ed5b0b548
move method via drag and drop
Claus Gittinger <cg@exept.de>
parents:
6697
diff
changeset
|
884 |
|
ae9ed5b0b548
move method via drag and drop
Claus Gittinger <cg@exept.de>
parents:
6697
diff
changeset
|
885 |
doDropContext:aDropContext |
8596 | 886 |
|methods browser| |
6774
ae9ed5b0b548
move method via drag and drop
Claus Gittinger <cg@exept.de>
parents:
6697
diff
changeset
|
887 |
|
ae9ed5b0b548
move method via drag and drop
Claus Gittinger <cg@exept.de>
parents:
6697
diff
changeset
|
888 |
methods := aDropContext dropObjects collect:[:aDropObject | aDropObject theObject]. |
7122 | 889 |
(methods conform:[:something | something isMethod]) ifFalse:[^ self]. |
6774
ae9ed5b0b548
move method via drag and drop
Claus Gittinger <cg@exept.de>
parents:
6697
diff
changeset
|
890 |
|
8596 | 891 |
browser := self masterApplication. |
892 |
aDropContext dragType == DropContext dragTypeCopy ifTrue:[ |
|
893 |
browser |
|
894 |
copyMethods:methods |
|
895 |
toClass:(browser theSingleSelectedClass). |
|
896 |
] ifFalse:[ |
|
897 |
browser |
|
898 |
moveMethods:methods |
|
899 |
toClass:(browser theSingleSelectedClass). |
|
900 |
]. |
|
7122 | 901 |
|
902 |
"Modified: / 13-09-2006 / 11:43:44 / cg" |
|
6774
ae9ed5b0b548
move method via drag and drop
Claus Gittinger <cg@exept.de>
parents:
6697
diff
changeset
|
903 |
! ! |
ae9ed5b0b548
move method via drag and drop
Claus Gittinger <cg@exept.de>
parents:
6697
diff
changeset
|
904 |
|
5591 | 905 |
!MethodList methodsFor:'private'! |
906 |
||
10579 | 907 |
isMethodToBeShown:aMethod |
908 |
"invoked, when we get a change for aMethod which was previously not |
|
909 |
in the list (for example, if I show a filtered list). |
|
910 |
Check if that single method is to be shown now. |
|
911 |
Used to speed up update for senders/string/implementors lists" |
|
912 |
||
913 |
|generator| |
|
914 |
||
915 |
generator := inGeneratorHolder value. |
|
916 |
generator isNil ifTrue:[ |
|
917 |
^ false |
|
918 |
]. |
|
919 |
||
920 |
"/ generator generates nil-selector entries |
|
921 |
"/ to pass multiple-class and multiple-protocol info |
|
922 |
||
923 |
generator do:[:cls :cat :sel :mthd | |
|
924 |
mthd == aMethod ifTrue:[ |
|
925 |
mthd isSynthetic ifFalse:[ |
|
926 |
sel notNil ifTrue:[ |
|
927 |
(packageFilter value isNil |
|
928 |
or:[ packageFilter value includes:mthd package ]) ifTrue:[ |
|
929 |
^ true |
|
930 |
] |
|
931 |
] |
|
932 |
]. |
|
933 |
^ false |
|
934 |
] |
|
935 |
]. |
|
936 |
^ false |
|
937 |
||
938 |
"Created: / 17-08-2011 / 15:03:34 / cg" |
|
939 |
! |
|
940 |
||
5591 | 941 |
listOfMethodNames |
10257 | 942 |
|methods entries selectorBag newNameList allClasses newClasses |
943 |
allCategories "allSelectors" |
|
944 |
generator doShowClass doShowClassFirst doShowCategory enforceClassAndProtocolInList theMethod sortByClass anyMethodToWatch mclass| |
|
5591 | 945 |
|
946 |
generator := inGeneratorHolder value. |
|
10257 | 947 |
generator isNil ifTrue:[ |
948 |
^ #() |
|
949 |
]. |
|
5591 | 950 |
allClasses := IdentitySet new. |
10257 | 951 |
allCategories := IdentitySet new. |
952 |
||
5591 | 953 |
"/ allSelectors := Set new. |
10257 | 954 |
|
5591 | 955 |
newClasses := IdentitySet new. |
956 |
selectorBag := Bag new. |
|
957 |
entries := OrderedCollection new. |
|
958 |
enforceClassAndProtocolInList := false. |
|
959 |
anyMethodToWatch := false. |
|
10257 | 960 |
|
5591 | 961 |
"/ generator generates nil-selector entries |
962 |
"/ to pass multiple-class and multiple-protocol info |
|
10257 | 963 |
|
964 |
generator do:[:cls :cat :sel :mthd | |
|
965 |
(cls isNil and:[ cat isNil and:[ sel isNil ] ]) ifTrue:[ |
|
966 |
enforceClassAndProtocolInList := true |
|
967 |
] ifFalse:[ |
|
968 |
cls notNil ifTrue:[ |
|
969 |
allClasses add:cls. |
|
970 |
]. |
|
971 |
cat notNil ifTrue:[ |
|
972 |
allCategories add:cat. |
|
973 |
]. |
|
974 |
"JV: Filter method through package filter" |
|
975 |
(mthd notNil |
|
976 |
and:[ |
|
977 |
mthd isSynthetic not |
|
978 |
and:[ |
|
979 |
sel notNil |
|
980 |
and:[ |
|
981 |
packageFilter value isNil |
|
982 |
or:[ packageFilter value includes:mthd package ] |
|
983 |
] |
|
984 |
] |
|
985 |
]) |
|
986 |
ifTrue:[ |
|
987 |
entries add:(Array |
|
988 |
with:cls |
|
989 |
with:sel |
|
990 |
with:mthd). |
|
991 |
selectorBag add:sel. |
|
992 |
newClasses add:cls. |
|
993 |
||
994 |
"/ allSelectors add:sel. |
|
995 |
] |
|
996 |
]. |
|
997 |
(mthd notNil and:[ mthd isWrapped ]) ifTrue:[ |
|
998 |
(mthd isTiming or:[ mthd isCounting or:[ mthd isCountingMemoryUsage ] ]) ifTrue:[ |
|
999 |
anyMethodToWatch := true |
|
1000 |
] |
|
1001 |
]. |
|
1002 |
]. |
|
5591 | 1003 |
showMethodInheritance value ~~ false ifTrue:[ |
1004 |
"/ collect redefinition information once (big speedup for #methodIsRedefinedbelow) |
|
1005 |
classAndSelectorsRedefinedBySubclassesOfClass isNil ifTrue:[ |
|
1006 |
classAndSelectorsRedefinedBySubclassesOfClass := IdentityDictionary new. |
|
1007 |
]. |
|
10257 | 1008 |
allClasses do:[:cls | |
1009 |
|d| |
|
1010 |
||
5591 | 1011 |
d := classAndSelectorsRedefinedBySubclassesOfClass. |
1012 |
(d notNil and:[ (d includesKey:cls) not ]) ifTrue:[ |
|
8206 | 1013 |
cls isLoaded ifTrue:[ |
1014 |
d at:cls put:(self setOfAllSelectorsImplementedBelow:cls) |
|
1015 |
] |
|
5591 | 1016 |
] |
1017 |
]. |
|
1018 |
]. |
|
10257 | 1019 |
|
5591 | 1020 |
"/ multiple classes must: add the className for some |
10257 | 1021 |
|
1022 |
doShowClass := enforceClassAndProtocolInList or:[ allClasses size > 1 ]. |
|
1023 |
||
5591 | 1024 |
"/ multiple categories: must add the categorie for some |
10257 | 1025 |
|
1026 |
doShowCategory := enforceClassAndProtocolInList |
|
1027 |
or:[ allCategories size > 1 ]. |
|
1028 |
doShowClassFirst := doShowClass. |
|
5591 | 1029 |
doShowClassFirst := doShowClass and:[ sortBy value == #class ]. |
1030 |
sortBy value == false ifTrue:[ |
|
1031 |
"/ do not sort |
|
1032 |
] ifFalse:[ |
|
1033 |
(doShowClass not and:[ sortBy value == #class ]) ifTrue:[ |
|
1034 |
"/ multiple classes must add the className for some |
|
1035 |
"/ check, if doShowClass must be enforced |
|
10257 | 1036 |
entries do:[:entry | |
5591 | 1037 |
|cls sel mthd s needClass| |
1038 |
||
1039 |
cls := entry at:1. |
|
1040 |
sel := entry at:2. |
|
1041 |
mthd := entry at:3. |
|
1042 |
doShowClass ifFalse:[ |
|
1043 |
doShowClass := (selectorBag occurrencesOf:sel) > 1 |
|
1044 |
]. |
|
1045 |
]. |
|
1046 |
]. |
|
1047 |
sortByClass := doShowClass and:[ sortBy value == #class ]. |
|
1048 |
sortByClass ifTrue:[ |
|
10257 | 1049 |
entries |
1050 |
sort:[:a :b | |
|
1051 |
|nmA nmB clsNmA clsNmB nsNmA nsNmB| |
|
1052 |
||
1053 |
clsNmA := (a at:1) name. |
|
1054 |
clsNmB := (b at:1) name. |
|
1055 |
clsNmA = clsNmB ifTrue:[ |
|
1056 |
nmA := (a at:2) asSymbol selector. |
|
1057 |
nmB := (b at:2) asSymbol selector. |
|
1058 |
nmA = nmB ifTrue:[ |
|
1059 |
nsNmA := (a at:3) nameSpaceName. |
|
1060 |
nsNmB := (b at:3) nameSpaceName. |
|
1061 |
nsNmA < nsNmB |
|
1062 |
] ifFalse:[ nmA < nmB ] |
|
1063 |
] ifFalse:[ |
|
1064 |
clsNmA < clsNmB |
|
1065 |
] |
|
1066 |
]. |
|
5591 | 1067 |
] ifFalse:[ |
7610 | 1068 |
sortBy value == #category ifTrue:[ |
10257 | 1069 |
entries |
1070 |
sort:[:a :b | |
|
1071 |
|nmA nmB catA catB clsNmA clsNmB nsNmA nsNmB| |
|
1072 |
||
1073 |
catA := (a at:3) category. |
|
1074 |
catB := (b at:3) category. |
|
1075 |
catA = catB ifTrue:[ |
|
1076 |
nmA := (a at:2) asSymbol selector. |
|
1077 |
nmB := (b at:2) asSymbol selector. |
|
1078 |
nmA = nmB ifTrue:[ |
|
1079 |
clsNmA := (a at:1) name. |
|
1080 |
clsNmB := (b at:1) name. |
|
1081 |
clsNmA = clsNmB ifTrue:[ |
|
1082 |
nsNmA := (a at:3) nameSpaceName. |
|
1083 |
nsNmB := (b at:3) nameSpaceName. |
|
1084 |
nsNmA < nsNmB |
|
1085 |
] ifFalse:[ |
|
1086 |
clsNmA < clsNmB |
|
1087 |
] |
|
1088 |
] ifFalse:[ nmA < nmB ] |
|
1089 |
] ifFalse:[ |
|
1090 |
catA < catB |
|
1091 |
] |
|
1092 |
]. |
|
7610 | 1093 |
] ifFalse:[ |
10257 | 1094 |
entries |
1095 |
sort:[:a :b | |
|
1096 |
|nmA nmB clsNmA clsNmB nsNmA nsNmB| |
|
1097 |
||
1098 |
nmA := (a at:2) asSymbol selector. |
|
1099 |
nmB := (b at:2) asSymbol selector. |
|
1100 |
nmA = nmB ifTrue:[ |
|
1101 |
clsNmA := (a at:1) name. |
|
1102 |
clsNmB := (b at:1) name. |
|
1103 |
clsNmA = clsNmB ifTrue:[ |
|
1104 |
nsNmA := (a at:3) nameSpaceName. |
|
1105 |
nsNmB := (b at:3) nameSpaceName. |
|
1106 |
nsNmA < nsNmB |
|
1107 |
] ifFalse:[ |
|
1108 |
clsNmA < clsNmB |
|
1109 |
] |
|
1110 |
] ifFalse:[ nmA < nmB ] |
|
1111 |
]. |
|
7610 | 1112 |
]. |
5591 | 1113 |
]. |
1114 |
]. |
|
1115 |
methods := OrderedCollection new:(entries size). |
|
10257 | 1116 |
|
5591 | 1117 |
"/ first generate the new methodList, and see if it is different ... |
10257 | 1118 |
|
1119 |
entries do:[:entry | |
|
5591 | 1120 |
|sel mthd| |
1121 |
||
1122 |
mthd := entry at:3. |
|
1123 |
methods add:mthd. |
|
1124 |
]. |
|
1125 |
false "methodList = methods" "does not care for changed icons" ifTrue:[ |
|
1126 |
"/ same list |
|
1127 |
newNameList := self browserNameList. |
|
1128 |
] ifFalse:[ |
|
1129 |
newNameList := OrderedCollection new:(entries size). |
|
10257 | 1130 |
|
5591 | 1131 |
"/ multiple classes must add the className for some |
10257 | 1132 |
|
1133 |
entries do:[:entry | |
|
5591 | 1134 |
|cls sel mthd s needClass| |
1135 |
||
1136 |
cls := entry at:1. |
|
1137 |
sel := entry at:2. |
|
1138 |
mthd := entry at:3. |
|
1139 |
needClass := doShowClass. |
|
10257 | 1140 |
|
5591 | 1141 |
"/ needClass ifFalse:[ |
1142 |
"/ needClass := (selectorBag occurrencesOf:sel) > 1 |
|
1143 |
"/ ]. |
|
10257 | 1144 |
|
5591 | 1145 |
s := self |
10257 | 1146 |
listEntryForMethod:mthd |
1147 |
selector:sel |
|
1148 |
class:cls |
|
1149 |
showClass:needClass |
|
1150 |
showCategory:doShowCategory |
|
1151 |
classFirst:doShowClassFirst. |
|
1152 |
||
5591 | 1153 |
"/ s := mthd printStringForBrowserWithSelector:sel inClass:cls. |
1154 |
"/ needClass ifTrue:[ |
|
1155 |
"/ s := s , ' [' , cls name , ']'. |
|
1156 |
"/ ]. |
|
1157 |
"/ doShowCategory ifTrue:[ |
|
1158 |
"/ s := s , ' {' , mthd category "asText allItalic" , '}' |
|
1159 |
"/ ]. |
|
10257 | 1160 |
|
5591 | 1161 |
newNameList add:s. |
1162 |
]. |
|
1163 |
]. |
|
1164 |
self makeIndependent. |
|
1165 |
classes := newClasses. |
|
1166 |
self makeDependent. |
|
1167 |
methodList := methods. |
|
1168 |
methods size == 1 ifTrue:[ |
|
1169 |
theMethod := methods first. |
|
1170 |
mclass := theMethod mclass. |
|
1171 |
mclass isNil ifTrue:[ |
|
1172 |
theMethod isWrapped ifTrue:[ |
|
1173 |
theMethod := theMethod originalMethod. |
|
1174 |
mclass := theMethod mclass. |
|
1175 |
]. |
|
1176 |
]. |
|
10257 | 1177 |
self methodLabelHolder value:(mclass isNil |
1178 |
ifTrue:[ ('???' , ' ' , '???') ] |
|
1179 |
ifFalse:[ (mclass name , ' ' , theMethod selector) ]) |
|
5591 | 1180 |
]. |
1181 |
anyMethodToWatch ifTrue:[ |
|
1182 |
self startWatchProcess. |
|
1183 |
] ifFalse:[ |
|
1184 |
self stopWatchProcess. |
|
1185 |
]. |
|
10257 | 1186 |
|
5591 | 1187 |
"/ remember these, in case of an incremental (single method only) |
1188 |
"/ update in the future. |
|
10257 | 1189 |
|
5591 | 1190 |
lastShowClass := doShowClass. |
1191 |
lastShowClassFirst := doShowClassFirst. |
|
1192 |
lastShowCategory := doShowCategory. |
|
1193 |
^ newNameList. |
|
1194 |
||
7610 | 1195 |
"Created: / 05-02-2000 / 22:43:40 / cg" |
1196 |
"Modified: / 26-01-2007 / 14:58:59 / cg" |
|
10257 | 1197 |
"Modified: / 20-07-2010 / 11:21:15 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
1198 |
"Modified: / 24-08-2010 / 20:34:09 / Jan Vrany <enter your email here>" |
|
5591 | 1199 |
! |
1200 |
||
1201 |
makeDependent |
|
1202 |
Smalltalk addDependent:self. |
|
7502 | 1203 |
"/ ChangeSet addDependent:self. |
1204 |
||
1205 |
"Modified: / 10-11-2006 / 17:57:01 / cg" |
|
5591 | 1206 |
! |
1207 |
||
1208 |
makeIndependent |
|
1209 |
Smalltalk removeDependent:self. |
|
8218 | 1210 |
"/ ChangeSet removeDependent:self. |
5591 | 1211 |
! |
1212 |
||
1213 |
method:mthd includesModsOfClassVariable:variablesToHighLight |
|
1214 |
^ self method:mthd includesRefsToVariable:variablesToHighLight askParserWith:#modifiedClassVars |
|
1215 |
! |
|
1216 |
||
1217 |
method:mthd includesModsOfInstanceVariable:variablesToHighLight |
|
1218 |
^ self method:mthd includesRefsToVariable:variablesToHighLight askParserWith:#modifiedInstVars |
|
1219 |
! |
|
1220 |
||
1221 |
method:mthd includesRefsToClassVariable:variablesToHighLight |
|
1222 |
^ self method:mthd includesRefsToVariable:variablesToHighLight askParserWith:#usedClassVars |
|
1223 |
! |
|
1224 |
||
1225 |
method:mthd includesRefsToInstanceVariable:variablesToHighLight |
|
1226 |
^ self method:mthd includesRefsToVariable:variablesToHighLight askParserWith:#usedInstVars |
|
1227 |
! |
|
1228 |
||
1229 |
method:mthd includesRefsToVariable:variablesToHighLight askParserWith:querySelector |
|
1230 |
|cls src parser usedVars anyVarNameAccessable| |
|
1231 |
||
1232 |
cls := mthd mclass. |
|
5885 | 1233 |
cls isNil ifTrue:[^ false]. |
1234 |
||
5591 | 1235 |
anyVarNameAccessable := cls allInstVarNames includesAny:variablesToHighLight. |
1236 |
anyVarNameAccessable ifFalse:[ |
|
5885 | 1237 |
anyVarNameAccessable := cls theNonMetaclass allClassVarNames includesAny:variablesToHighLight. |
5591 | 1238 |
]. |
1239 |
anyVarNameAccessable ifFalse:[ |
|
5885 | 1240 |
"/ no need to parse |
1241 |
^ false |
|
5591 | 1242 |
]. |
1243 |
||
1244 |
src := mthd source. |
|
1245 |
src notNil ifTrue:[ |
|
5885 | 1246 |
" |
1247 |
before doing a slow parse, quickly scan the |
|
1248 |
methods source for the variables name ... |
|
1249 |
" |
|
1250 |
(variablesToHighLight contains:[:varName | (src findString:varName) ~~ 0]) ifTrue:[ |
|
1251 |
parser := Parser |
|
1252 |
parseMethod:src |
|
1253 |
in:cls |
|
1254 |
ignoreErrors:true |
|
1255 |
ignoreWarnings:true. |
|
1256 |
(parser notNil and:[parser ~~ #Error]) ifTrue:[ |
|
1257 |
usedVars := parser perform:querySelector. |
|
1258 |
(usedVars includesAny:variablesToHighLight) |
|
1259 |
ifTrue:[ |
|
1260 |
^ true |
|
1261 |
] |
|
1262 |
] |
|
1263 |
] |
|
5591 | 1264 |
]. |
1265 |
^ false |
|
1266 |
! |
|
1267 |
||
1268 |
methodIsInheritedFromAbove:aMethod |
|
1269 |
|mClass| |
|
1270 |
||
1271 |
mClass := aMethod mclass. |
|
1272 |
(mClass notNil and:[mClass superclass notNil]) ifTrue:[ |
|
6789 | 1273 |
^ (mClass superclass whichClassIncludesSelector:aMethod selector) notNil. |
5591 | 1274 |
]. |
1275 |
^ false |
|
1276 |
! |
|
1277 |
||
1278 |
methodIsRedefinedBelow:aMethod |
|
1279 |
|mclass subClasses setOfRedefinedSelectors| |
|
1280 |
||
1281 |
mclass := aMethod mclass. |
|
1282 |
mclass isNil ifTrue:[^ false]. |
|
1283 |
||
1284 |
"/ if possible, make use of info prepared by listOfMethodNames |
|
1285 |
classAndSelectorsRedefinedBySubclassesOfClass notNil |
|
1286 |
ifTrue:[ |
|
9004
fbd6a4c325f6
changed: #methodIsRedefinedBelow:
Claus Gittinger <cg@exept.de>
parents:
8644
diff
changeset
|
1287 |
setOfRedefinedSelectors := classAndSelectorsRedefinedBySubclassesOfClass at:mclass ifAbsent:nil. |
fbd6a4c325f6
changed: #methodIsRedefinedBelow:
Claus Gittinger <cg@exept.de>
parents:
8644
diff
changeset
|
1288 |
setOfRedefinedSelectors notNil ifTrue:[ |
fbd6a4c325f6
changed: #methodIsRedefinedBelow:
Claus Gittinger <cg@exept.de>
parents:
8644
diff
changeset
|
1289 |
^ setOfRedefinedSelectors includes:aMethod selector |
fbd6a4c325f6
changed: #methodIsRedefinedBelow:
Claus Gittinger <cg@exept.de>
parents:
8644
diff
changeset
|
1290 |
] |
5591 | 1291 |
]. |
1292 |
||
1293 |
lastMethodClass == mclass ifTrue:[ |
|
9004
fbd6a4c325f6
changed: #methodIsRedefinedBelow:
Claus Gittinger <cg@exept.de>
parents:
8644
diff
changeset
|
1294 |
subClasses := lastMethodClassesSubclasses |
5591 | 1295 |
] ifFalse:[ |
9004
fbd6a4c325f6
changed: #methodIsRedefinedBelow:
Claus Gittinger <cg@exept.de>
parents:
8644
diff
changeset
|
1296 |
subClasses := aMethod mclass allSubclasses. |
fbd6a4c325f6
changed: #methodIsRedefinedBelow:
Claus Gittinger <cg@exept.de>
parents:
8644
diff
changeset
|
1297 |
lastMethodClassesSubclasses := subClasses. |
fbd6a4c325f6
changed: #methodIsRedefinedBelow:
Claus Gittinger <cg@exept.de>
parents:
8644
diff
changeset
|
1298 |
lastMethodClass := mclass. |
5591 | 1299 |
]. |
9004
fbd6a4c325f6
changed: #methodIsRedefinedBelow:
Claus Gittinger <cg@exept.de>
parents:
8644
diff
changeset
|
1300 |
^ subClasses contains:[:cls | cls includesSelector:aMethod selector]. |
5591 | 1301 |
! |
1302 |
||
1303 |
redefinedOrInheritedIconFor:aMethod |
|
5761
b350e042dc9f
Icons for subclassResponsibility and deprecated methods
Stefan Vogel <sv@exept.de>
parents:
5591
diff
changeset
|
1304 |
|inherited redefined subclassResponsibility| |
5591 | 1305 |
|
1306 |
inherited := self methodIsInheritedFromAbove:aMethod. |
|
1307 |
redefined := self methodIsRedefinedBelow:aMethod. |
|
1308 |
||
1309 |
inherited ifTrue:[ |
|
5761
b350e042dc9f
Icons for subclassResponsibility and deprecated methods
Stefan Vogel <sv@exept.de>
parents:
5591
diff
changeset
|
1310 |
redefined ifTrue:[ |
b350e042dc9f
Icons for subclassResponsibility and deprecated methods
Stefan Vogel <sv@exept.de>
parents:
5591
diff
changeset
|
1311 |
^ self methodInheritedFromAboveAndRedefinedBelowIcon. |
b350e042dc9f
Icons for subclassResponsibility and deprecated methods
Stefan Vogel <sv@exept.de>
parents:
5591
diff
changeset
|
1312 |
]. |
b350e042dc9f
Icons for subclassResponsibility and deprecated methods
Stefan Vogel <sv@exept.de>
parents:
5591
diff
changeset
|
1313 |
^ self methodInheritedFromAboveIcon. |
5591 | 1314 |
]. |
5761
b350e042dc9f
Icons for subclassResponsibility and deprecated methods
Stefan Vogel <sv@exept.de>
parents:
5591
diff
changeset
|
1315 |
|
b350e042dc9f
Icons for subclassResponsibility and deprecated methods
Stefan Vogel <sv@exept.de>
parents:
5591
diff
changeset
|
1316 |
subclassResponsibility := aMethod sends:#subclassResponsibility. |
5591 | 1317 |
redefined ifTrue:[ |
5761
b350e042dc9f
Icons for subclassResponsibility and deprecated methods
Stefan Vogel <sv@exept.de>
parents:
5591
diff
changeset
|
1318 |
subclassResponsibility ifTrue:[ |
b350e042dc9f
Icons for subclassResponsibility and deprecated methods
Stefan Vogel <sv@exept.de>
parents:
5591
diff
changeset
|
1319 |
^ self methodIsSubclassResponsibilityAndRedefinedBelowIcon. |
b350e042dc9f
Icons for subclassResponsibility and deprecated methods
Stefan Vogel <sv@exept.de>
parents:
5591
diff
changeset
|
1320 |
]. |
b350e042dc9f
Icons for subclassResponsibility and deprecated methods
Stefan Vogel <sv@exept.de>
parents:
5591
diff
changeset
|
1321 |
^ self methodRedefinedBelowIcon. |
b350e042dc9f
Icons for subclassResponsibility and deprecated methods
Stefan Vogel <sv@exept.de>
parents:
5591
diff
changeset
|
1322 |
]. |
b350e042dc9f
Icons for subclassResponsibility and deprecated methods
Stefan Vogel <sv@exept.de>
parents:
5591
diff
changeset
|
1323 |
subclassResponsibility ifTrue:[ |
b350e042dc9f
Icons for subclassResponsibility and deprecated methods
Stefan Vogel <sv@exept.de>
parents:
5591
diff
changeset
|
1324 |
^ self methodIsSubclassResponsibilityIcon. |
5591 | 1325 |
]. |
1326 |
||
1327 |
^ self methodEmptyInheritedIcon |
|
1328 |
! |
|
1329 |
||
1330 |
release |
|
1331 |
super release. |
|
1332 |
||
1333 |
filterClassVars removeDependent:self. |
|
1334 |
selectedMethodNameIndices removeDependent:self. |
|
1335 |
showMethodInheritance removeDependent:self. |
|
1336 |
variableFilter removeDependent:self. |
|
1337 |
! |
|
1338 |
||
1339 |
resourceIconForMethod:aMethod |
|
6903 | 1340 |
^ SystemBrowser resourceIconForMethod:aMethod |
5591 | 1341 |
|
6903 | 1342 |
"Modified: / 17-08-2006 / 09:09:01 / cg" |
5591 | 1343 |
! |
1344 |
||
1345 |
setOfAllSelectorsImplementedBelow:aClass |
|
1346 |
|set| |
|
1347 |
||
1348 |
set := IdentitySet new. |
|
1349 |
aClass allSubclassesDo:[:eachSubclass | |
|
10388 | 1350 |
set addAll:(eachSubclass methodDictionary keys). |
5591 | 1351 |
]. |
1352 |
^ set |
|
1353 |
! |
|
1354 |
||
1355 |
updateList |
|
1356 |
|prevSelection newList newSelection newSelIdx reverseMap sameContents newListSize oldListSize |
|
1357 |
prevClasses methodSet selectedMethodsHolder| |
|
1358 |
||
1359 |
selectedMethodsHolder := self selectedMethods. |
|
1360 |
prevSelection := selectedMethodsHolder value ? #(). |
|
1361 |
||
1362 |
prevClasses := classes ifNil:[ #() ] ifNotNil:[ classes copy ]. |
|
1363 |
||
1364 |
oldListSize := self browserNameList size. |
|
1365 |
||
8644 | 1366 |
self topApplication withWaitCursorDo:[ |
1367 |
newList := self listOfMethodNames. |
|
1368 |
]. |
|
7702 | 1369 |
newListSize := newList size. |
1370 |
sameContents := self updateListFor:newList. |
|
5591 | 1371 |
|
7702 | 1372 |
sameContents ifFalse:[ |
5591 | 1373 |
"/ self browserNameList value:newList. |
1374 |
||
7702 | 1375 |
(prevSelection size == 0 |
1376 |
and:[selectedMethodsHolder value size ~~ 0]) ifTrue:[ |
|
1377 |
"/ this happens during early startup time, |
|
1378 |
"/ when the selection is already (pre-)set, |
|
1379 |
"/ and the methodList is generated the first time |
|
1380 |
"/ (i.e. when opened with preset selection |
|
5591 | 1381 |
|
7702 | 1382 |
"/ do not clobber the selection in this case. |
1383 |
prevSelection := selectedMethodsHolder value. |
|
1384 |
]. |
|
5591 | 1385 |
|
7702 | 1386 |
(methodList size == 0 or:[prevSelection size == 0]) ifTrue:[ |
1387 |
newSelection := #() |
|
1388 |
] ifFalse:[ |
|
1389 |
methodSet := methodList. |
|
5591 | 1390 |
|
7702 | 1391 |
"/ inclusion test is much faster with sets, if the number of items is large |
1392 |
methodList size > 30 ifTrue:[ |
|
1393 |
"/ however, only if its worth building the set ... |
|
1394 |
prevSelection size > 5 ifTrue:[ |
|
1395 |
methodSet := methodSet asIdentitySet. |
|
1396 |
] |
|
1397 |
]. |
|
1398 |
newSelection := prevSelection select:[:item | methodSet includesIdentical:item]. |
|
1399 |
]. |
|
1400 |
newSelection size > 0 ifTrue:[ |
|
1401 |
newSelection size > 100 ifTrue:[ |
|
1402 |
"/ need selection indices - might be expensive if done straight forward... |
|
1403 |
reverseMap := IdentityDictionary new. |
|
1404 |
methodList keysAndValuesDo:[:idx :mthd | reverseMap at:mthd put:idx]. |
|
1405 |
newSelIdx := newSelection collect:[:mthd | reverseMap at:mthd]. |
|
1406 |
] ifFalse:[ |
|
1407 |
newSelIdx := newSelection collect:[:mthd | methodList identityIndexOf:mthd] |
|
1408 |
]. |
|
5591 | 1409 |
"/ self halt. |
7702 | 1410 |
"/ force change (for dependents) |
1411 |
newSelIdx ~= selectedMethodNameIndices value ifTrue:[ |
|
1412 |
selectedMethodNameIndices value:newSelIdx. |
|
1413 |
]. |
|
1414 |
] ifFalse:[ |
|
1415 |
lastSelectedMethods := selectedMethodsHolder value. |
|
1416 |
lastSelectedMethods notNil ifTrue:[ |
|
1417 |
lastSelectedMethods := lastSelectedMethods asOrderedCollection |
|
1418 |
]. |
|
1419 |
selectedMethodNameIndices value size > 0 ifTrue:[ |
|
1420 |
selectedMethodNameIndices value:#(). |
|
1421 |
] |
|
1422 |
]. |
|
5591 | 1423 |
|
7702 | 1424 |
newSelection ~= prevSelection ifTrue:[ |
1425 |
self selectionChanged. |
|
1426 |
] |
|
1427 |
] ifTrue:[ |
|
1428 |
"/ same list - but classes might have changed |
|
1429 |
"/ that is the case, if the class selection has been changed, |
|
1430 |
"/ to another class which has the same categories. |
|
5591 | 1431 |
|
7702 | 1432 |
(prevClasses size ~= classes size |
1433 |
or:[prevClasses asOrderedCollection ~= (classes ? #()) asOrderedCollection ]) ifTrue:[ |
|
1434 |
(newListSize > 0 or:[oldListSize > 0]) ifTrue:[ |
|
1435 |
self selectionChanged. |
|
1436 |
] |
|
1437 |
] |
|
1438 |
] |
|
5591 | 1439 |
"/ ]. |
1440 |
||
7702 | 1441 |
"Modified: / 05-03-2007 / 16:07:24 / cg" |
5591 | 1442 |
! |
1443 |
||
1444 |
updateListEntryFor:aMethod |
|
1445 |
"update my list for a single method. |
|
1446 |
(used when a single methods package, code or whatever changes, and a full udpate |
|
1447 |
would be too slow)" |
|
1448 |
||
1449 |
|s idx| |
|
1450 |
||
1451 |
s := self |
|
6268 | 1452 |
listEntryForMethod:aMethod |
1453 |
selector:aMethod selector |
|
1454 |
class:aMethod mclass |
|
1455 |
showClass:lastShowClass |
|
1456 |
showCategory:lastShowCategory |
|
1457 |
classFirst:lastShowClassFirst. |
|
5591 | 1458 |
|
1459 |
idx := methodList identityIndexOf:aMethod. |
|
1460 |
idx == 0 ifTrue:[ |
|
6268 | 1461 |
aMethod isWrapped ifTrue:[ |
1462 |
idx := methodList identityIndexOf:aMethod originalMethod. |
|
10549
1f387878f9c6
changed: #updateListEntryFor:
Claus Gittinger <cg@exept.de>
parents:
10388
diff
changeset
|
1463 |
idx == 0 ifTrue:[ |
1f387878f9c6
changed: #updateListEntryFor:
Claus Gittinger <cg@exept.de>
parents:
10388
diff
changeset
|
1464 |
"/ aMethod (wrapped) has changed its status, but is not in the list. |
1f387878f9c6
changed: #updateListEntryFor:
Claus Gittinger <cg@exept.de>
parents:
10388
diff
changeset
|
1465 |
^ self. |
1f387878f9c6
changed: #updateListEntryFor:
Claus Gittinger <cg@exept.de>
parents:
10388
diff
changeset
|
1466 |
]. |
6268 | 1467 |
] |
5591 | 1468 |
]. |
1469 |
idx == 0 ifTrue:[ |
|
10579 | 1470 |
"/ method was not previously shown; try to avoid a full update |
1471 |
(self isMethodToBeShown:aMethod) ifTrue:[ |
|
1472 |
self invalidateList |
|
1473 |
]. |
|
5591 | 1474 |
] ifFalse:[ |
6268 | 1475 |
self browserNameList at:idx put:s. |
5591 | 1476 |
] |
10549
1f387878f9c6
changed: #updateListEntryFor:
Claus Gittinger <cg@exept.de>
parents:
10388
diff
changeset
|
1477 |
|
10579 | 1478 |
"Modified: / 17-08-2011 / 15:05:02 / cg" |
5591 | 1479 |
! ! |
1480 |
||
6271 | 1481 |
!MethodList methodsFor:'private-presentation'! |
1482 |
||
9451
79d033f585b9
added: #colorForCoverageInformationOfMethod:
Claus Gittinger <cg@exept.de>
parents:
9448
diff
changeset
|
1483 |
colorForCoverageInformationOfMethod:aMethod |
9430 | 1484 |
aMethod isInstrumented ifFalse:[^ nil]. |
9448
f9258f99d465
changed: #emphasisForCoverageInformationOfMethod:
Claus Gittinger <cg@exept.de>
parents:
9438
diff
changeset
|
1485 |
aMethod category = 'documentation' ifTrue:[^ nil]. |
9430 | 1486 |
|
1487 |
aMethod hasBeenCalled ifTrue:[ |
|
1488 |
aMethod haveAllBlocksBeenExecuted ifTrue:[ |
|
9451
79d033f585b9
added: #colorForCoverageInformationOfMethod:
Claus Gittinger <cg@exept.de>
parents:
9448
diff
changeset
|
1489 |
^ UserPreferences current colorForInstrumentedFullyCoveredCode |
9430 | 1490 |
]. |
9451
79d033f585b9
added: #colorForCoverageInformationOfMethod:
Claus Gittinger <cg@exept.de>
parents:
9448
diff
changeset
|
1491 |
^ UserPreferences current colorForInstrumentedPartiallyCoveredCode |
9430 | 1492 |
]. |
9451
79d033f585b9
added: #colorForCoverageInformationOfMethod:
Claus Gittinger <cg@exept.de>
parents:
9448
diff
changeset
|
1493 |
^ UserPreferences current colorForInstrumentedNeverCalledCode |
9430 | 1494 |
|
9451
79d033f585b9
added: #colorForCoverageInformationOfMethod:
Claus Gittinger <cg@exept.de>
parents:
9448
diff
changeset
|
1495 |
"Created: / 30-04-2010 / 11:53:38 / cg" |
9430 | 1496 |
! |
1497 |
||
6271 | 1498 |
listEntryForMethod:aMethod selector:selector class:cls showClass:showClass showCategory:showCategory classFirst:showClassFirst |
1499 |
"answer a method list entry |
|
1500 |
gimmics: |
|
1501 |
adding a little image to breakPointed methods, |
|
1502 |
inheritance indicators, |
|
1503 |
highlight accessors of variable" |
|
1504 |
||
1505 |
|clsName s icn variablesToHighlight classVarsToHighLight |
|
9451
79d033f585b9
added: #colorForCoverageInformationOfMethod:
Claus Gittinger <cg@exept.de>
parents:
9448
diff
changeset
|
1506 |
doHighLight doHighLightRed clr emp cat l redefIcon |
7502 | 1507 |
metrics complexity complexityString complexityIcon mark| |
6271 | 1508 |
|
9038
9b56d0b8c38e
required missing protocol display
Claus Gittinger <cg@exept.de>
parents:
9004
diff
changeset
|
1509 |
aMethod isNil ifTrue:[ |
9b56d0b8c38e
required missing protocol display
Claus Gittinger <cg@exept.de>
parents:
9004
diff
changeset
|
1510 |
"/ a non-existing (pseudo) method (such as required protocol) |
9b56d0b8c38e
required missing protocol display
Claus Gittinger <cg@exept.de>
parents:
9004
diff
changeset
|
1511 |
^ selector colorizeAllWith:Color red. |
9b56d0b8c38e
required missing protocol display
Claus Gittinger <cg@exept.de>
parents:
9004
diff
changeset
|
1512 |
]. |
9b56d0b8c38e
required missing protocol display
Claus Gittinger <cg@exept.de>
parents:
9004
diff
changeset
|
1513 |
|
6271 | 1514 |
aMethod isAssociation ifTrue:[ |
1515 |
self halt:'should not happen'. |
|
1516 |
]. |
|
1517 |
||
8638 | 1518 |
selector isNil ifTrue:[ |
1519 |
s := '???' |
|
1520 |
] ifFalse:[ |
|
1521 |
s := aMethod printStringForBrowserWithSelector:selector inClass:cls. |
|
1522 |
]. |
|
6271 | 1523 |
showClassFirst ifTrue:[ |
1524 |
clsName := cls nameInBrowser. |
|
1525 |
s := clsName , ' ' , s allBold |
|
1526 |
]. |
|
1527 |
||
1528 |
"/ |
|
1529 |
"/ wrap icons (i.e. break- or trace points) |
|
1530 |
"/ have higher prio ... |
|
1531 |
"/ |
|
9038
9b56d0b8c38e
required missing protocol display
Claus Gittinger <cg@exept.de>
parents:
9004
diff
changeset
|
1532 |
(aMethod notNil and:[aMethod isWrapped]) ifTrue:[ |
6271 | 1533 |
(s endsWith:' !!') ifTrue:[ |
1534 |
s := s copyWithoutLast:2 |
|
1535 |
]. |
|
1536 |
aMethod isBreakpointed ifTrue:[ |
|
1537 |
icn := self stopIcon |
|
1538 |
] ifFalse:[ |
|
1539 |
aMethod isTimed ifTrue:[ |
|
1540 |
icn := self timeIcon |
|
1541 |
] ifFalse:[ |
|
1542 |
icn := self traceIcon |
|
1543 |
] |
|
1544 |
]. |
|
1545 |
]. |
|
1546 |
||
1547 |
icn isNil ifTrue:[ |
|
8198 | 1548 |
self showImageResourceMethodsImages value ~~ false ifTrue:[ |
9252
ee7770f155ca
changed: #listEntryForMethod:selector:class:showClass:showCategory:classFirst:
Claus Gittinger <cg@exept.de>
parents:
9038
diff
changeset
|
1549 |
(aMethod hasImageResource) ifTrue:[ |
8474 | 1550 |
aMethod mclass isMeta ifTrue:[ |
1551 |
icn := aMethod valueWithReceiver:nil arguments:nil . |
|
8197
3b1c5bd94fdd
preps for showResourceImages
Claus Gittinger <cg@exept.de>
parents:
7994
diff
changeset
|
1552 |
]. |
3b1c5bd94fdd
preps for showResourceImages
Claus Gittinger <cg@exept.de>
parents:
7994
diff
changeset
|
1553 |
]. |
3b1c5bd94fdd
preps for showResourceImages
Claus Gittinger <cg@exept.de>
parents:
7994
diff
changeset
|
1554 |
]. |
3b1c5bd94fdd
preps for showResourceImages
Claus Gittinger <cg@exept.de>
parents:
7994
diff
changeset
|
1555 |
]. |
3b1c5bd94fdd
preps for showResourceImages
Claus Gittinger <cg@exept.de>
parents:
7994
diff
changeset
|
1556 |
|
3b1c5bd94fdd
preps for showResourceImages
Claus Gittinger <cg@exept.de>
parents:
7994
diff
changeset
|
1557 |
icn isNil ifTrue:[ |
6271 | 1558 |
showMethodTypeIcon value ~~ false ifTrue:[ |
1559 |
icn := self resourceIconForMethod:aMethod. |
|
1560 |
]. |
|
1561 |
icn isNil ifTrue:[ |
|
1562 |
aMethod isProtected ifTrue:[ |
|
1563 |
icn := self protectedMethodIcon |
|
1564 |
] ifFalse:[ |
|
1565 |
aMethod isPrivate ifTrue:[ |
|
1566 |
icn := self privateMethodIcon |
|
1567 |
] ifFalse:[ |
|
1568 |
(aMethod isIgnored) ifTrue:[ |
|
1569 |
icn := self ignoredMethodIcon |
|
1570 |
] ifFalse:[ |
|
1571 |
(aMethod isJavaMethod and:[aMethod isAbstract]) ifTrue:[ |
|
1572 |
icn := self abstractMethodIcon |
|
1573 |
] |
|
1574 |
] |
|
1575 |
] |
|
1576 |
]. |
|
1577 |
]. |
|
1578 |
]. |
|
1579 |
icn isNil ifTrue:[ |
|
1580 |
(selector startsWith:'test') ifTrue:[ |
|
10257 | 1581 |
((cls isSubclassOf:TestCase) |
1582 |
and:[cls isAbstract not]) ifTrue:[ |
|
1583 |
cls lastTestRunResultOrNil "== false" notNil ifTrue:[ |
|
6271 | 1584 |
(cls testSelectorFailed:selector) ifTrue:[ |
1585 |
icn := SystemBrowser testCaseFailedIcon |
|
1586 |
] ifFalse:[ |
|
10257 | 1587 |
(cls testSelectorPassed: selector) ifTrue: |
1588 |
[icn := SystemBrowser testCasePassedIcon] |
|
6271 | 1589 |
]. |
1590 |
] |
|
1591 |
]. |
|
1592 |
] |
|
1593 |
]. |
|
1594 |
||
1595 |
showClass ifTrue:[ |
|
1596 |
showClassFirst ifFalse:[ |
|
1597 |
s := s , ' [' , cls name allBold , ']'. |
|
1598 |
] |
|
1599 |
]. |
|
1600 |
showCategory ifTrue:[ |
|
1601 |
cat := aMethod category. |
|
1602 |
cat notNil ifTrue:[ |
|
1603 |
s := s , ' {' , cat "asText allItalic" , '}' |
|
1604 |
] |
|
1605 |
]. |
|
7502 | 1606 |
|
10257 | 1607 |
self showCoverageInformation value ifTrue:[ |
9451
79d033f585b9
added: #colorForCoverageInformationOfMethod:
Claus Gittinger <cg@exept.de>
parents:
9448
diff
changeset
|
1608 |
clr := self colorForCoverageInformationOfMethod:aMethod. |
79d033f585b9
added: #colorForCoverageInformationOfMethod:
Claus Gittinger <cg@exept.de>
parents:
9448
diff
changeset
|
1609 |
clr notNil ifTrue:[ |
79d033f585b9
added: #colorForCoverageInformationOfMethod:
Claus Gittinger <cg@exept.de>
parents:
9448
diff
changeset
|
1610 |
s := self colorize:s with:(#color->clr). |
9430 | 1611 |
"/ aMethod isInstrumented ifTrue:[ |
1612 |
"/ icn := self instrumentationIcon |
|
1613 |
"/ ]. |
|
1614 |
]. |
|
1615 |
] ifFalse:[ |
|
1616 |
(ChangeSet current includesChangeForClass:cls selector:selector) ifTrue:[ |
|
1617 |
mark := self class markForBeingInChangeList. |
|
1618 |
"/ mark := self colorizeForChangedCode:mark. |
|
1619 |
s := s , mark. |
|
1620 |
"/ cg: I dont know why this was disabled - it is req'd to |
|
1621 |
"/ see changed methods in a method list (implementors...) |
|
1622 |
s := self colorizeForChangedCode:s. |
|
1623 |
]. |
|
1624 |
||
1625 |
(SmallTeam notNil and:[SmallTeam includesChangeForClass:cls selector:selector]) ifTrue:[ |
|
1626 |
s := (self colorizeForChangedCodeInSmallTeam:'!! '),s |
|
1627 |
]. |
|
6841
6d72f92ed6cd
mark changed methods with a '*'
Claus Gittinger <cg@exept.de>
parents:
6789
diff
changeset
|
1628 |
]. |
6271 | 1629 |
|
1630 |
variablesToHighlight := variableFilter value. |
|
1631 |
variablesToHighlight size > 0 ifTrue:[ |
|
1632 |
classVarsToHighLight := filterClassVars value. |
|
1633 |
classVarsToHighLight ifTrue:[ |
|
1634 |
doHighLight := self method:aMethod includesRefsToClassVariable:variablesToHighlight. |
|
1635 |
doHighLight ifTrue:[ |
|
1636 |
doHighLightRed := self method:aMethod includesModsOfClassVariable:variablesToHighlight. |
|
1637 |
]. |
|
1638 |
] ifFalse:[ |
|
1639 |
doHighLight := self method:aMethod includesRefsToInstanceVariable:variablesToHighlight. |
|
1640 |
doHighLight ifTrue:[ |
|
1641 |
doHighLightRed := self method:aMethod includesModsOfInstanceVariable:variablesToHighlight |
|
1642 |
] |
|
1643 |
]. |
|
1644 |
doHighLight ifTrue:[ |
|
1645 |
s := s allBold. |
|
1646 |
doHighLightRed ifTrue:[ |
|
1647 |
emp := (UserPreferences current emphasisForWrittenVariable) |
|
1648 |
] ifFalse:[ |
|
1649 |
emp := (UserPreferences current emphasisForReadVariable) |
|
1650 |
]. |
|
1651 |
s := s emphasisAllAdd:emp |
|
1652 |
] |
|
1653 |
]. |
|
1654 |
||
6694 | 1655 |
(showMethodComplexity value == true |
6271 | 1656 |
and:[ OOM::MethodMetrics notNil ]) ifTrue:[ |
8197
3b1c5bd94fdd
preps for showResourceImages
Claus Gittinger <cg@exept.de>
parents:
7994
diff
changeset
|
1657 |
icn isNil ifTrue:[ |
3b1c5bd94fdd
preps for showResourceImages
Claus Gittinger <cg@exept.de>
parents:
7994
diff
changeset
|
1658 |
metrics := OOM::MethodMetrics forMethod:aMethod. |
3b1c5bd94fdd
preps for showResourceImages
Claus Gittinger <cg@exept.de>
parents:
7994
diff
changeset
|
1659 |
complexity := metrics complexity ? 0. |
3b1c5bd94fdd
preps for showResourceImages
Claus Gittinger <cg@exept.de>
parents:
7994
diff
changeset
|
1660 |
complexityIcon := OOM::MethodMetrics iconForComplexity:complexity. |
6271 | 1661 |
|
8197
3b1c5bd94fdd
preps for showResourceImages
Claus Gittinger <cg@exept.de>
parents:
7994
diff
changeset
|
1662 |
ShowComplexityValue == true ifTrue:[ |
3b1c5bd94fdd
preps for showResourceImages
Claus Gittinger <cg@exept.de>
parents:
7994
diff
changeset
|
1663 |
complexityString := '{' , complexity printString , '}'. |
3b1c5bd94fdd
preps for showResourceImages
Claus Gittinger <cg@exept.de>
parents:
7994
diff
changeset
|
1664 |
s := complexityString , ' ' , s. |
3b1c5bd94fdd
preps for showResourceImages
Claus Gittinger <cg@exept.de>
parents:
7994
diff
changeset
|
1665 |
]. |
3b1c5bd94fdd
preps for showResourceImages
Claus Gittinger <cg@exept.de>
parents:
7994
diff
changeset
|
1666 |
"/ icn := icn ? complexityIcon. |
3b1c5bd94fdd
preps for showResourceImages
Claus Gittinger <cg@exept.de>
parents:
7994
diff
changeset
|
1667 |
s := LabelAndIcon icon:complexityIcon string:s. |
6271 | 1668 |
]. |
1669 |
]. |
|
1670 |
||
1671 |
showMethodInheritance value ~~ false ifTrue:[ |
|
1672 |
redefIcon := self redefinedOrInheritedIconFor:aMethod. |
|
1673 |
]. |
|
1674 |
||
1675 |
(icn notNil or:[redefIcon notNil]) ifTrue:[ |
|
10257 | 1676 |
"/eXept version |
1677 |
"/l := LabelAndIcon icon:redefIcon string:s. |
|
1678 |
"/l image:icn. |
|
1679 |
"/JV: |
|
1680 |
l := LabelAndIcon icon:icn string:s. |
|
1681 |
l image:redefIcon. |
|
1682 |
icn ifNil:[l offset: 13]. |
|
1683 |
l gap:1. |
|
6271 | 1684 |
^ l |
1685 |
]. |
|
1686 |
^ s |
|
1687 |
||
6841
6d72f92ed6cd
mark changed methods with a '*'
Claus Gittinger <cg@exept.de>
parents:
6789
diff
changeset
|
1688 |
"Created: / 22-10-1996 / 19:51:00 / cg" |
10257 | 1689 |
"Modified: / 30-04-2010 / 11:54:32 / cg" |
1690 |
"Modified: / 15-08-2009 / 13:13:32 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
1691 |
"Modified: / 15-03-2010 / 18:16:54 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
6271 | 1692 |
! ! |
1693 |
||
5591 | 1694 |
!MethodList methodsFor:'private-watching'! |
1695 |
||
1696 |
startWatchProcess |
|
1697 |
updateProcess notNil ifTrue:[ |
|
10388 | 1698 |
^ self |
5591 | 1699 |
]. |
1700 |
updateProcess := [ |
|
10388 | 1701 |
[true] whileTrue:[ |
1702 |
Delay waitForSeconds:1. |
|
1703 |
self enqueueDelayedUpdateList |
|
1704 |
] |
|
1705 |
] fork. |
|
5591 | 1706 |
! |
1707 |
||
1708 |
stopWatchProcess |
|
1709 |
|p| |
|
1710 |
||
1711 |
(p := updateProcess) notNil ifTrue:[ |
|
10388 | 1712 |
updateProcess := nil. |
1713 |
p terminate |
|
5591 | 1714 |
]. |
1715 |
! ! |
|
1716 |
||
1717 |
!MethodList methodsFor:'setup'! |
|
1718 |
||
1719 |
postBuildWith:aBuilder |
|
1720 |
|methodListView| |
|
1721 |
||
1722 |
super postBuildWith:aBuilder. |
|
1723 |
||
1724 |
methodListView := aBuilder componentAt:'List'. |
|
1725 |
methodListView notNil ifTrue:[ |
|
6277 | 1726 |
methodListView allowDrag:true. |
1727 |
methodListView dragObjectConverter:[:obj | |
|
1728 |
|nm method idx| |
|
5591 | 1729 |
|
6277 | 1730 |
nm := obj theObject asString string string. |
1731 |
idx := browserNameList value findFirst:[:item | item string string = nm]. |
|
1732 |
method := methodList value at:idx. |
|
1733 |
DropObject newMethod:method. |
|
1734 |
]. |
|
5591 | 1735 |
] |
1736 |
! ! |
|
1737 |
||
1738 |
!MethodList class methodsFor:'documentation'! |
|
1739 |
||
10363 | 1740 |
version |
10579 | 1741 |
^ '$Header: /cvs/stx/stx/libtool/Tools_MethodList.st,v 1.58 2011-08-18 00:16:52 cg Exp $' |
10363 | 1742 |
! |
1743 |
||
9004
fbd6a4c325f6
changed: #methodIsRedefinedBelow:
Claus Gittinger <cg@exept.de>
parents:
8644
diff
changeset
|
1744 |
version_CVS |
10579 | 1745 |
^ '$Header: /cvs/stx/stx/libtool/Tools_MethodList.st,v 1.58 2011-08-18 00:16:52 cg Exp $' |
5591 | 1746 |
! ! |