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