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