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