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