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