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