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