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