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