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