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