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