author | Claus Gittinger <cg@exept.de> |
Sun, 24 Jul 2011 11:37:57 +0200 | |
changeset 10388 | 993bab7e261d |
parent 10376 | 8a61751a59fa |
child 10549 | 1f387878f9c6 |
permissions | -rw-r--r-- |
5591 | 1 |
" |
2 |
COPYRIGHT (c) 2000 by eXept Software AG |
|
10388 | 3 |
All Rights Reserved |
5591 | 4 |
|
5 |
This software is furnished under a license and may be used |
|
6 |
only in accordance with the terms of that license and with the |
|
7 |
inclusion of the above copyright notice. This software may not |
|
8 |
be provided or otherwise made available to, or used by, any |
|
9 |
other person. No title to or ownership of the software is |
|
10 |
hereby transferred. |
|
11 |
" |
|
12 |
"{ Package: 'stx:libtool' }" |
|
13 |
||
14 |
"{ NameSpace: Tools }" |
|
15 |
||
16 |
BrowserList subclass:#MethodList |
|
10388 | 17 |
instanceVariableNames:'classes selectedMethodNameIndices methodList lastSelectedMethods |
18 |
browserNameList variableFilter filterClassVars updateProcess |
|
19 |
lastShowClass lastShowCategory lastShowClassFirst |
|
20 |
showMethodInheritance lastMethodClass lastMethodClassesSubclasses |
|
21 |
classAndSelectorsRedefinedBySubclassesOfClass showClass |
|
22 |
showMethodComplexity showMethodTypeIcon |
|
23 |
showImageResourceMethodsImages' |
|
24 |
classVariableNames:'ShowComplexityValue' |
|
25 |
poolDictionaries:'' |
|
26 |
category:'Interface-Browsers-New' |
|
5591 | 27 |
! |
28 |
||
29 |
!MethodList class methodsFor:'documentation'! |
|
30 |
||
31 |
copyright |
|
32 |
" |
|
33 |
COPYRIGHT (c) 2000 by eXept Software AG |
|
10388 | 34 |
All Rights Reserved |
5591 | 35 |
|
36 |
This software is furnished under a license and may be used |
|
37 |
only in accordance with the terms of that license and with the |
|
38 |
inclusion of the above copyright notice. This software may not |
|
39 |
be provided or otherwise made available to, or used by, any |
|
40 |
other person. No title to or ownership of the software is |
|
41 |
hereby transferred. |
|
42 |
" |
|
43 |
! ! |
|
44 |
||
45 |
!MethodList class methodsFor:'interface specs'! |
|
46 |
||
47 |
singleMethodWindowSpec |
|
48 |
"This resource specification was automatically generated |
|
49 |
by the UIPainter of ST/X." |
|
50 |
||
51 |
"Do not manually edit this!! If it is corrupted, |
|
52 |
the UIPainter may not be able to read the specification." |
|
53 |
||
54 |
" |
|
55 |
UIPainter new openOnClass:MethodList andSelector:#singleMethodWindowSpec |
|
56 |
MethodList new openInterface:#singleMethodWindowSpec |
|
57 |
" |
|
58 |
||
59 |
<resource: #canvas> |
|
60 |
||
61 |
^ |
|
62 |
#(#FullSpec |
|
63 |
#name: #singleMethodWindowSpec |
|
64 |
#window: |
|
65 |
#(#WindowSpec |
|
66 |
#label: 'SingleSelectorList' |
|
67 |
#name: 'SingleSelectorList' |
|
68 |
#min: #(#Point 0 0) |
|
69 |
#max: #(#Point 1024 721) |
|
70 |
#bounds: #(#Rectangle 12 22 312 322) |
|
71 |
) |
|
72 |
#component: |
|
73 |
#(#SpecCollection |
|
74 |
#collection: #( |
|
75 |
#(#LabelSpec |
|
76 |
#label: 'MethodName' |
|
77 |
#name: 'MethodLabel' |
|
78 |
#layout: #(#LayoutFrame 0 0.0 0 0 0 1.0 25 0) |
|
79 |
#translateLabel: true |
|
80 |
#labelChannel: #methodLabelHolder |
|
81 |
#menu: #menuHolder |
|
82 |
) |
|
83 |
) |
|
84 |
||
85 |
) |
|
86 |
) |
|
87 |
||
88 |
"Modified: / 1.3.2000 / 20:50:15 / cg" |
|
89 |
! |
|
90 |
||
91 |
windowSpec |
|
92 |
"This resource specification was automatically generated |
|
93 |
by the UIPainter of ST/X." |
|
94 |
||
95 |
"Do not manually edit this!! If it is corrupted, |
|
96 |
the UIPainter may not be able to read the specification." |
|
97 |
||
98 |
" |
|
99 |
UIPainter new openOnClass:MethodList andSelector:#windowSpec |
|
100 |
MethodList new openInterface:#windowSpec |
|
101 |
MethodList open |
|
102 |
" |
|
103 |
||
104 |
<resource: #canvas> |
|
105 |
||
106 |
^ |
|
107 |
#(#FullSpec |
|
108 |
#name: #windowSpec |
|
109 |
#window: |
|
110 |
#(#WindowSpec |
|
111 |
#label: 'SelectorList' |
|
112 |
#name: 'SelectorList' |
|
113 |
#min: #(#Point 0 0) |
|
114 |
#bounds: #(#Rectangle 12 22 312 322) |
|
115 |
) |
|
116 |
#component: |
|
117 |
#(#SpecCollection |
|
118 |
#collection: #( |
|
119 |
#(#SequenceViewSpec |
|
120 |
#name: 'List' |
|
121 |
#layout: #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0) |
|
122 |
#tabable: true |
|
123 |
#model: #selectedMethodNameIndices |
|
124 |
#menu: #menuHolder |
|
125 |
#hasHorizontalScrollBar: true |
|
126 |
#hasVerticalScrollBar: true |
|
127 |
#miniScrollerHorizontal: true |
|
128 |
#isMultiSelect: true |
|
129 |
#valueChangeSelector: #selectionChangedByClick |
|
130 |
#useIndex: true |
|
131 |
#sequenceList: #browserNameList |
|
132 |
#doubleClickChannel: #doubleClickChannel |
|
6774
ae9ed5b0b548
move method via drag and drop
Claus Gittinger <cg@exept.de>
parents:
6697
diff
changeset
|
133 |
#properties: |
ae9ed5b0b548
move method via drag and drop
Claus Gittinger <cg@exept.de>
parents:
6697
diff
changeset
|
134 |
#(#PropertyListDictionary |
ae9ed5b0b548
move method via drag and drop
Claus Gittinger <cg@exept.de>
parents:
6697
diff
changeset
|
135 |
#dragArgument: nil |
ae9ed5b0b548
move method via drag and drop
Claus Gittinger <cg@exept.de>
parents:
6697
diff
changeset
|
136 |
#dropArgument: nil |
ae9ed5b0b548
move method via drag and drop
Claus Gittinger <cg@exept.de>
parents:
6697
diff
changeset
|
137 |
#canDropSelector: #canDropContext: |
ae9ed5b0b548
move method via drag and drop
Claus Gittinger <cg@exept.de>
parents:
6697
diff
changeset
|
138 |
#dropSelector: #doDropContext: |
ae9ed5b0b548
move method via drag and drop
Claus Gittinger <cg@exept.de>
parents:
6697
diff
changeset
|
139 |
) |
5591 | 140 |
) |
141 |
) |
|
142 |
||
143 |
) |
|
144 |
) |
|
145 |
! ! |
|
146 |
||
147 |
!MethodList class methodsFor:'plugIn spec'! |
|
148 |
||
149 |
aspectSelectors |
|
150 |
"This resource specification was automatically generated |
|
151 |
by the UIPainter of ST/X." |
|
152 |
||
153 |
"Do not manually edit this. If it is corrupted, |
|
154 |
the UIPainter may not be able to read the specification." |
|
155 |
||
156 |
"Return a description of exported aspects; |
|
157 |
these can be connected to aspects of an embedding application |
|
158 |
(if this app is embedded in a subCanvas)." |
|
159 |
||
160 |
^ #( |
|
9421 | 161 |
"/ #classHolder |
6259
e440c14b02aa
experimental display of method complexity
Claus Gittinger <cg@exept.de>
parents:
5998
diff
changeset
|
162 |
#(#doubleClickChannel #action ) |
e440c14b02aa
experimental display of method complexity
Claus Gittinger <cg@exept.de>
parents:
5998
diff
changeset
|
163 |
#forceGeneratorTrigger |
e440c14b02aa
experimental display of method complexity
Claus Gittinger <cg@exept.de>
parents:
5998
diff
changeset
|
164 |
#immediateUpdate |
e440c14b02aa
experimental display of method complexity
Claus Gittinger <cg@exept.de>
parents:
5998
diff
changeset
|
165 |
#inGeneratorHolder |
e440c14b02aa
experimental display of method complexity
Claus Gittinger <cg@exept.de>
parents:
5998
diff
changeset
|
166 |
#menuHolder |
e440c14b02aa
experimental display of method complexity
Claus Gittinger <cg@exept.de>
parents:
5998
diff
changeset
|
167 |
#methodCategoryHolder |
e440c14b02aa
experimental display of method complexity
Claus Gittinger <cg@exept.de>
parents:
5998
diff
changeset
|
168 |
#packageFilter |
e440c14b02aa
experimental display of method complexity
Claus Gittinger <cg@exept.de>
parents:
5998
diff
changeset
|
169 |
#selectedMethods |
e440c14b02aa
experimental display of method complexity
Claus Gittinger <cg@exept.de>
parents:
5998
diff
changeset
|
170 |
#selectionChangeCondition |
e440c14b02aa
experimental display of method complexity
Claus Gittinger <cg@exept.de>
parents:
5998
diff
changeset
|
171 |
#updateTrigger |
e440c14b02aa
experimental display of method complexity
Claus Gittinger <cg@exept.de>
parents:
5998
diff
changeset
|
172 |
#variableFilter |
e440c14b02aa
experimental display of method complexity
Claus Gittinger <cg@exept.de>
parents:
5998
diff
changeset
|
173 |
#filterClassVars |
e440c14b02aa
experimental display of method complexity
Claus Gittinger <cg@exept.de>
parents:
5998
diff
changeset
|
174 |
#showMethodInheritance |
e440c14b02aa
experimental display of method complexity
Claus Gittinger <cg@exept.de>
parents:
5998
diff
changeset
|
175 |
#showMethodComplexity |
6268 | 176 |
#showMethodTypeIcon |
8197
3b1c5bd94fdd
preps for showResourceImages
Claus Gittinger <cg@exept.de>
parents:
7994
diff
changeset
|
177 |
#showImageResourceMethodsImages |
6259
e440c14b02aa
experimental display of method complexity
Claus Gittinger <cg@exept.de>
parents:
5998
diff
changeset
|
178 |
#sortBy |
9438 | 179 |
#showCoverageInformation |
5591 | 180 |
). |
9421 | 181 |
|
9438 | 182 |
"Modified: / 27-04-2010 / 16:13:57 / cg" |
5591 | 183 |
! ! |
184 |
||
185 |
!MethodList methodsFor:'aspects'! |
|
186 |
||
187 |
browserNameList |
|
188 |
browserNameList isNil ifTrue:[ |
|
10388 | 189 |
browserNameList := List new. |
5591 | 190 |
]. |
191 |
^ browserNameList. |
|
192 |
||
193 |
"Modified: / 31.1.2000 / 00:42:44 / cg" |
|
194 |
"Created: / 5.2.2000 / 22:38:32 / cg" |
|
195 |
! |
|
196 |
||
197 |
defaultSlaveModeValue |
|
198 |
^ false. |
|
199 |
! |
|
200 |
||
201 |
filterClassVars |
|
202 |
filterClassVars isNil ifTrue:[ |
|
10388 | 203 |
filterClassVars := false asValue. |
204 |
filterClassVars addDependent:self |
|
5591 | 205 |
]. |
206 |
^ filterClassVars |
|
207 |
! |
|
208 |
||
209 |
filterClassVars:aValueHolder |
|
210 |
filterClassVars notNil ifTrue:[ |
|
10388 | 211 |
filterClassVars removeDependent:self |
5591 | 212 |
]. |
213 |
filterClassVars := aValueHolder. |
|
214 |
filterClassVars notNil ifTrue:[ |
|
10388 | 215 |
filterClassVars addDependent:self |
5591 | 216 |
]. |
217 |
! |
|
218 |
||
219 |
methodLabelHolder |
|
220 |
^ self pseudoListLabelHolder |
|
221 |
||
222 |
"Created: / 1.3.2000 / 20:50:07 / cg" |
|
223 |
! |
|
224 |
||
225 |
methodList |
|
226 |
^ methodList |
|
227 |
! |
|
228 |
||
229 |
selectedMethodNameIndices |
|
230 |
selectedMethodNameIndices isNil ifTrue:[ |
|
10388 | 231 |
selectedMethodNameIndices := ValueHolder new. |
232 |
selectedMethodNameIndices addDependent:self |
|
5591 | 233 |
]. |
234 |
^ selectedMethodNameIndices. |
|
235 |
||
236 |
"Modified: / 5.2.2000 / 00:31:48 / cg" |
|
237 |
"Created: / 5.2.2000 / 22:59:31 / cg" |
|
238 |
! |
|
239 |
||
240 |
selectedMethods |
|
241 |
^ self selectionHolder |
|
242 |
! |
|
243 |
||
244 |
selectedMethods:aValueHolder |
|
245 |
^ self selectionHolder:aValueHolder |
|
246 |
! |
|
247 |
||
8197
3b1c5bd94fdd
preps for showResourceImages
Claus Gittinger <cg@exept.de>
parents:
7994
diff
changeset
|
248 |
showImageResourceMethodsImages |
3b1c5bd94fdd
preps for showResourceImages
Claus Gittinger <cg@exept.de>
parents:
7994
diff
changeset
|
249 |
showImageResourceMethodsImages isNil ifTrue:[ |
3b1c5bd94fdd
preps for showResourceImages
Claus Gittinger <cg@exept.de>
parents:
7994
diff
changeset
|
250 |
showImageResourceMethodsImages := false asValue. |
3b1c5bd94fdd
preps for showResourceImages
Claus Gittinger <cg@exept.de>
parents:
7994
diff
changeset
|
251 |
showImageResourceMethodsImages addDependent:self |
3b1c5bd94fdd
preps for showResourceImages
Claus Gittinger <cg@exept.de>
parents:
7994
diff
changeset
|
252 |
]. |
3b1c5bd94fdd
preps for showResourceImages
Claus Gittinger <cg@exept.de>
parents:
7994
diff
changeset
|
253 |
^ showImageResourceMethodsImages |
3b1c5bd94fdd
preps for showResourceImages
Claus Gittinger <cg@exept.de>
parents:
7994
diff
changeset
|
254 |
! |
3b1c5bd94fdd
preps for showResourceImages
Claus Gittinger <cg@exept.de>
parents:
7994
diff
changeset
|
255 |
|
3b1c5bd94fdd
preps for showResourceImages
Claus Gittinger <cg@exept.de>
parents:
7994
diff
changeset
|
256 |
showImageResourceMethodsImages:aValueHolder |
3b1c5bd94fdd
preps for showResourceImages
Claus Gittinger <cg@exept.de>
parents:
7994
diff
changeset
|
257 |
showImageResourceMethodsImages notNil ifTrue:[ |
3b1c5bd94fdd
preps for showResourceImages
Claus Gittinger <cg@exept.de>
parents:
7994
diff
changeset
|
258 |
showImageResourceMethodsImages removeDependent:self |
3b1c5bd94fdd
preps for showResourceImages
Claus Gittinger <cg@exept.de>
parents:
7994
diff
changeset
|
259 |
]. |
3b1c5bd94fdd
preps for showResourceImages
Claus Gittinger <cg@exept.de>
parents:
7994
diff
changeset
|
260 |
showImageResourceMethodsImages := aValueHolder. |
3b1c5bd94fdd
preps for showResourceImages
Claus Gittinger <cg@exept.de>
parents:
7994
diff
changeset
|
261 |
showImageResourceMethodsImages notNil ifTrue:[ |
3b1c5bd94fdd
preps for showResourceImages
Claus Gittinger <cg@exept.de>
parents:
7994
diff
changeset
|
262 |
showImageResourceMethodsImages addDependent:self |
3b1c5bd94fdd
preps for showResourceImages
Claus Gittinger <cg@exept.de>
parents:
7994
diff
changeset
|
263 |
]. |
3b1c5bd94fdd
preps for showResourceImages
Claus Gittinger <cg@exept.de>
parents:
7994
diff
changeset
|
264 |
! |
3b1c5bd94fdd
preps for showResourceImages
Claus Gittinger <cg@exept.de>
parents:
7994
diff
changeset
|
265 |
|
6259
e440c14b02aa
experimental display of method complexity
Claus Gittinger <cg@exept.de>
parents:
5998
diff
changeset
|
266 |
showMethodComplexity |
e440c14b02aa
experimental display of method complexity
Claus Gittinger <cg@exept.de>
parents:
5998
diff
changeset
|
267 |
showMethodComplexity isNil ifTrue:[ |
e440c14b02aa
experimental display of method complexity
Claus Gittinger <cg@exept.de>
parents:
5998
diff
changeset
|
268 |
showMethodComplexity := false asValue. |
e440c14b02aa
experimental display of method complexity
Claus Gittinger <cg@exept.de>
parents:
5998
diff
changeset
|
269 |
showMethodComplexity addDependent:self |
e440c14b02aa
experimental display of method complexity
Claus Gittinger <cg@exept.de>
parents:
5998
diff
changeset
|
270 |
]. |
e440c14b02aa
experimental display of method complexity
Claus Gittinger <cg@exept.de>
parents:
5998
diff
changeset
|
271 |
^ showMethodComplexity |
e440c14b02aa
experimental display of method complexity
Claus Gittinger <cg@exept.de>
parents:
5998
diff
changeset
|
272 |
! |
e440c14b02aa
experimental display of method complexity
Claus Gittinger <cg@exept.de>
parents:
5998
diff
changeset
|
273 |
|
e440c14b02aa
experimental display of method complexity
Claus Gittinger <cg@exept.de>
parents:
5998
diff
changeset
|
274 |
showMethodComplexity:aValueHolder |
e440c14b02aa
experimental display of method complexity
Claus Gittinger <cg@exept.de>
parents:
5998
diff
changeset
|
275 |
showMethodComplexity notNil ifTrue:[ |
e440c14b02aa
experimental display of method complexity
Claus Gittinger <cg@exept.de>
parents:
5998
diff
changeset
|
276 |
showMethodComplexity removeDependent:self |
e440c14b02aa
experimental display of method complexity
Claus Gittinger <cg@exept.de>
parents:
5998
diff
changeset
|
277 |
]. |
e440c14b02aa
experimental display of method complexity
Claus Gittinger <cg@exept.de>
parents:
5998
diff
changeset
|
278 |
showMethodComplexity := aValueHolder. |
e440c14b02aa
experimental display of method complexity
Claus Gittinger <cg@exept.de>
parents:
5998
diff
changeset
|
279 |
showMethodComplexity notNil ifTrue:[ |
e440c14b02aa
experimental display of method complexity
Claus Gittinger <cg@exept.de>
parents:
5998
diff
changeset
|
280 |
showMethodComplexity addDependent:self |
e440c14b02aa
experimental display of method complexity
Claus Gittinger <cg@exept.de>
parents:
5998
diff
changeset
|
281 |
]. |
e440c14b02aa
experimental display of method complexity
Claus Gittinger <cg@exept.de>
parents:
5998
diff
changeset
|
282 |
! |
e440c14b02aa
experimental display of method complexity
Claus Gittinger <cg@exept.de>
parents:
5998
diff
changeset
|
283 |
|
5591 | 284 |
showMethodInheritance |
285 |
showMethodInheritance isNil ifTrue:[ |
|
10388 | 286 |
showMethodInheritance := false asValue. |
287 |
showMethodInheritance addDependent:self |
|
5591 | 288 |
]. |
289 |
^ showMethodInheritance |
|
290 |
! |
|
291 |
||
292 |
showMethodInheritance:aValueHolder |
|
293 |
showMethodInheritance notNil ifTrue:[ |
|
10388 | 294 |
showMethodInheritance removeDependent:self |
5591 | 295 |
]. |
296 |
showMethodInheritance := aValueHolder. |
|
297 |
showMethodInheritance notNil ifTrue:[ |
|
10388 | 298 |
showMethodInheritance addDependent:self |
5591 | 299 |
]. |
300 |
! |
|
301 |
||
6268 | 302 |
showMethodTypeIcon |
303 |
showMethodTypeIcon isNil ifTrue:[ |
|
304 |
showMethodTypeIcon := true asValue. |
|
305 |
showMethodTypeIcon addDependent:self |
|
306 |
]. |
|
307 |
^ showMethodTypeIcon |
|
308 |
! |
|
309 |
||
310 |
showMethodTypeIcon:aValueHolder |
|
311 |
showMethodTypeIcon notNil ifTrue:[ |
|
312 |
showMethodTypeIcon removeDependent:self |
|
313 |
]. |
|
314 |
showMethodTypeIcon := aValueHolder. |
|
315 |
showMethodTypeIcon notNil ifTrue:[ |
|
316 |
showMethodTypeIcon addDependent:self |
|
317 |
]. |
|
318 |
! |
|
319 |
||
5591 | 320 |
variableFilter |
321 |
variableFilter isNil ifTrue:[ |
|
10388 | 322 |
variableFilter := nil asValue. |
323 |
variableFilter addDependent:self |
|
5591 | 324 |
]. |
325 |
^ variableFilter |
|
326 |
! |
|
327 |
||
328 |
variableFilter:aValueHolder |
|
329 |
variableFilter notNil ifTrue:[ |
|
10388 | 330 |
variableFilter removeDependent:self |
5591 | 331 |
]. |
332 |
variableFilter := aValueHolder. |
|
333 |
variableFilter notNil ifTrue:[ |
|
10388 | 334 |
variableFilter addDependent:self |
5591 | 335 |
]. |
336 |
! ! |
|
337 |
||
338 |
!MethodList methodsFor:'change & update'! |
|
339 |
||
340 |
delayedUpdate:something with:aParameter from:changedObject |
|
341 |
|cls sel oldMethod newMethod methods newSelection |
|
342 |
selectionHolder selection needSelectionChange| |
|
343 |
||
344 |
selectionHolder := self selectedMethods. |
|
345 |
selection := selectionHolder value. |
|
346 |
||
347 |
changedObject == Smalltalk ifTrue:[ |
|
5998 | 348 |
classes notNil ifTrue:[ |
10388 | 349 |
something == #classDefinition ifTrue:[ |
350 |
cls := aParameter. |
|
351 |
(classes contains:[:aClass | aClass name == cls name]) ifFalse:[ |
|
352 |
^ self "/ I dont care for that class |
|
353 |
]. |
|
354 |
classes := classes collect:[:eachClass | eachClass isMeta ifTrue:[ |
|
355 |
(Smalltalk at:eachClass theNonMetaclass name) class |
|
356 |
] ifFalse:[ |
|
357 |
Smalltalk at:eachClass name |
|
358 |
] |
|
359 |
]. |
|
360 |
self invalidateList. |
|
361 |
"/ self updateList. |
|
362 |
^ self. |
|
363 |
]. |
|
364 |
||
5998 | 365 |
something == #methodCategory ifTrue:[ |
366 |
"/ ignore here - methodCategoryList will tell me if required |
|
367 |
^ self |
|
368 |
]. |
|
6663
1453d4f33815
changed change-update aspect when changing some method category
Claus Gittinger <cg@exept.de>
parents:
6575
diff
changeset
|
369 |
(something == #classOrganization |
1453d4f33815
changed change-update aspect when changing some method category
Claus Gittinger <cg@exept.de>
parents:
6575
diff
changeset
|
370 |
or:[ something == #methodCategoryAdded |
1453d4f33815
changed change-update aspect when changing some method category
Claus Gittinger <cg@exept.de>
parents:
6575
diff
changeset
|
371 |
or:[ something == #methodCategoryRemoved |
1453d4f33815
changed change-update aspect when changing some method category
Claus Gittinger <cg@exept.de>
parents:
6575
diff
changeset
|
372 |
or:[ something == #methodCategoriesRemoved |
1453d4f33815
changed change-update aspect when changing some method category
Claus Gittinger <cg@exept.de>
parents:
6575
diff
changeset
|
373 |
or:[ something == #methodCategoryRenamed ]]]]) ifTrue:[ |
5998 | 374 |
"/ ignore here - methodCategoryList will tell me if required |
375 |
^ self |
|
376 |
]. |
|
5591 | 377 |
|
5998 | 378 |
something == #methodInClass ifTrue:[ |
379 |
"/ a method has been added/changed |
|
380 |
cls := aParameter at:1. |
|
381 |
(classes includesIdentical:cls) ifTrue:[ |
|
382 |
sel := aParameter at:2. |
|
383 |
oldMethod := aParameter at:3. |
|
384 |
newMethod := cls compiledMethodAt:sel. |
|
385 |
(oldMethod notNil and:[newMethod notNil]) ifTrue:[ |
|
386 |
"a method was changed & acccepted; |
|
387 |
No need for a rescan of the methodDictionary; |
|
388 |
however, ensure that the refs to the old method are updated |
|
389 |
" |
|
390 |
methods := selection. |
|
391 |
methods size > 0 ifTrue:[ |
|
392 |
(methods includesIdentical:oldMethod) ifTrue:[ |
|
393 |
needSelectionChange := true. |
|
394 |
] |
|
395 |
]. |
|
396 |
methodList replaceAllIdentical:oldMethod with:newMethod. |
|
397 |
lastSelectedMethods notNil ifTrue:[ |
|
398 |
lastSelectedMethods replaceAllIdentical:oldMethod with:newMethod |
|
399 |
]. |
|
400 |
methods size > 0 ifTrue:[ |
|
401 |
methods := methods asOrderedCollection. |
|
402 |
methods replaceAllIdentical:oldMethod with:newMethod. |
|
403 |
]. |
|
5591 | 404 |
|
5998 | 405 |
needSelectionChange == true ifTrue:[ |
406 |
selectionHolder setValue:methods. |
|
6575
94f336bcb07b
update notifiaction from other browsers (refix)
Claus Gittinger <cg@exept.de>
parents:
6490
diff
changeset
|
407 |
"/ self enqueueDelayedMethodsSelectionChanged. |
94f336bcb07b
update notifiaction from other browsers (refix)
Claus Gittinger <cg@exept.de>
parents:
6490
diff
changeset
|
408 |
"/ need this to inform my browser that method was changed |
94f336bcb07b
update notifiaction from other browsers (refix)
Claus Gittinger <cg@exept.de>
parents:
6490
diff
changeset
|
409 |
"/ by someone else. |
94f336bcb07b
update notifiaction from other browsers (refix)
Claus Gittinger <cg@exept.de>
parents:
6490
diff
changeset
|
410 |
selectionHolder changed. |
5998 | 411 |
]. |
10376
8a61751a59fa
method entry updating fixed (it is updated whenever a method is changed)
vrany
parents:
10363
diff
changeset
|
412 |
"/JV@2011-07-22: Update always - I need to see immediately that |
8a61751a59fa
method entry updating fixed (it is updated whenever a method is changed)
vrany
parents:
10363
diff
changeset
|
413 |
"/the method has changed. Also, add/remove breakpoint etc. |
8a61751a59fa
method entry updating fixed (it is updated whenever a method is changed)
vrany
parents:
10363
diff
changeset
|
414 |
|
8a61751a59fa
method entry updating fixed (it is updated whenever a method is changed)
vrany
parents:
10363
diff
changeset
|
415 |
"/ (variableFilter value size > 0 |
8a61751a59fa
method entry updating fixed (it is updated whenever a method is changed)
vrany
parents:
10363
diff
changeset
|
416 |
"/ or:[oldMethod package ~= newMethod package |
8a61751a59fa
method entry updating fixed (it is updated whenever a method is changed)
vrany
parents:
10363
diff
changeset
|
417 |
"/ or:[oldMethod resources ~= newMethod resources |
8a61751a59fa
method entry updating fixed (it is updated whenever a method is changed)
vrany
parents:
10363
diff
changeset
|
418 |
"/ or:[showMethodComplexity value == true]]]) |
8a61751a59fa
method entry updating fixed (it is updated whenever a method is changed)
vrany
parents:
10363
diff
changeset
|
419 |
true |
8a61751a59fa
method entry updating fixed (it is updated whenever a method is changed)
vrany
parents:
10363
diff
changeset
|
420 |
ifTrue:[ |
5998 | 421 |
"/ only update that methods entry |
422 |
self updateListEntryFor:newMethod. |
|
423 |
"/ sigh - must invalidate |
|
424 |
"/ self invalidateList. |
|
425 |
]. |
|
426 |
^ self. |
|
427 |
]. |
|
428 |
"/ method was added - update the methodList |
|
429 |
"/ Q: is this needed (methodCategoryList should send me a new inGenerator) |
|
430 |
self invalidateList. |
|
431 |
]. |
|
432 |
^ self. |
|
433 |
]. |
|
434 |
||
435 |
something == #methodInClassRemoved ifTrue:[ |
|
436 |
cls := aParameter at:1. |
|
437 |
(classes includesIdentical:cls) ifTrue:[ |
|
438 |
sel := aParameter at:2. |
|
439 |
"/ method was removed - update the methodList |
|
440 |
"/ Q: is this needed (methodCategoryList should send me a new inGenerator) |
|
441 |
self invalidateList. |
|
442 |
]. |
|
443 |
^ self. |
|
444 |
]. |
|
5591 | 445 |
|
10357 | 446 |
something == #methodCoverageInfo ifTrue:[ |
447 |
"/ already checked if it is one of my classes |
|
10363 | 448 |
listValid == true ifTrue:[ |
449 |
self invalidateList. |
|
450 |
]. |
|
10357 | 451 |
^ self. |
452 |
]. |
|
453 |
||
5998 | 454 |
(something == #methodTrap |
455 |
or:[ something == #privacyOfMethod ]) ifTrue:[ |
|
456 |
cls := aParameter at:1. |
|
457 |
sel := aParameter at:2. |
|
458 |
(classes includesIdentical:cls) ifFalse:[ ^ self]. |
|
459 |
newMethod := cls compiledMethodAt:sel. |
|
460 |
newMethod isNil ifTrue:[ |
|
461 |
self invalidateList. |
|
462 |
^ self |
|
463 |
]. |
|
5591 | 464 |
|
5998 | 465 |
(something == #privacyOfMethod) ifTrue:[ |
466 |
self updateListEntryFor:newMethod. |
|
467 |
]. |
|
468 |
||
469 |
(something == #methodTrap) ifTrue:[ |
|
470 |
newMethod isWrapped ifTrue:[ |
|
471 |
oldMethod := newMethod originalMethod |
|
472 |
] ifFalse:[ |
|
473 |
selection size > 0 ifTrue:[ |
|
474 |
oldMethod := selection detect:[:each | each isWrapped and:[each originalMethod == newMethod]] ifNone:nil. |
|
475 |
] |
|
476 |
]. |
|
5591 | 477 |
|
5998 | 478 |
selection size > 0 ifTrue:[ |
479 |
(selection includesIdentical:oldMethod) ifTrue:[ |
|
480 |
needSelectionChange := true. |
|
481 |
] |
|
482 |
]. |
|
483 |
methodList replaceAllIdentical:oldMethod with:newMethod. |
|
484 |
lastSelectedMethods notNil ifTrue:[ |
|
485 |
lastSelectedMethods replaceAllIdentical:oldMethod with:newMethod |
|
486 |
]. |
|
487 |
selection size > 0 ifTrue:[ |
|
488 |
selection := selection asOrderedCollection. |
|
489 |
selection replaceAllIdentical:oldMethod with:newMethod. |
|
490 |
]. |
|
491 |
needSelectionChange == true ifTrue:[ |
|
492 |
selectionHolder changed. |
|
493 |
]. |
|
5591 | 494 |
|
5998 | 495 |
"/ actually, could just change that single item ... |
496 |
"/ ... might be cheaper, if list is huge. |
|
497 |
"/ only update that methods entry |
|
498 |
self updateListEntryFor:newMethod. |
|
499 |
"/ self invalidateList. |
|
500 |
]. |
|
501 |
^ self |
|
502 |
]. |
|
5591 | 503 |
|
6846 | 504 |
(something == #projectOrganization |
505 |
or:[something == #lastTestRunResult]) ifTrue:[ |
|
5998 | 506 |
aParameter notNil ifTrue:[ |
507 |
cls := aParameter at:1. |
|
508 |
cls notNil ifTrue:[ |
|
509 |
((classes includesIdentical:cls theNonMetaclass) |
|
510 |
or:[(classes includesIdentical:cls theMetaclass)]) ifTrue:[ |
|
511 |
self invalidateList. |
|
512 |
]. |
|
513 |
]. |
|
514 |
] ifFalse:[ |
|
515 |
self invalidateList. |
|
516 |
]. |
|
517 |
^ self |
|
518 |
]. |
|
6846 | 519 |
|
5998 | 520 |
"/ everything else is ignored |
521 |
"/ self halt. |
|
522 |
]. |
|
523 |
^ self |
|
5591 | 524 |
]. |
525 |
||
526 |
"/ something == #organization ifTrue:[ |
|
527 |
"/self halt:'no longer'. |
|
528 |
"/^ self. |
|
529 |
"/ "/ a methods cateory has changed |
|
530 |
"/ (classes includesIdentical:changedObject) ifTrue:[ |
|
531 |
"/ aParameter isSymbol ifTrue:[ |
|
532 |
"/ "/ a method with a new category |
|
533 |
"/ (self methodList includesIdentical:(changedObject compiledMethodAt:aParameter)) ifTrue:[ |
|
534 |
"/ self invalidateList. |
|
535 |
"/ ]. |
|
536 |
"/ ^ self. |
|
537 |
"/ ]. |
|
538 |
"/ "/ a new category (no method yet) |
|
539 |
"/ self invalidateList |
|
540 |
"/ ]. |
|
541 |
"/ ^ self |
|
542 |
"/ ]. |
|
543 |
||
544 |
"/ something == #methodDictionary ifTrue:[ |
|
545 |
"/self halt:'no longer'. |
|
546 |
"/^ self. |
|
547 |
"/ "/ a method has been added/removed |
|
548 |
"/ (classes includesIdentical:changedObject) ifTrue:[ |
|
549 |
"/ aParameter isArray ifTrue:[ |
|
550 |
"/ sel := aParameter at:1. |
|
551 |
"/ oldMethod := aParameter at:2. |
|
552 |
"/ newMethod := changedObject compiledMethodAt:sel. |
|
553 |
"/ oldMethod notNil ifTrue:[ |
|
554 |
"/ "a method was changed & acccepted; |
|
555 |
"/ No need for a rescan of the methodDictionary; |
|
556 |
"/ however, ensure that the refs to the old method are updated |
|
557 |
"/ " |
|
558 |
"/ methods := selection. |
|
559 |
"/ methods size > 0 ifTrue:[ |
|
560 |
"/ (methods includesIdentical:oldMethod) ifTrue:[ |
|
561 |
"/ needSelectionChange := true. |
|
562 |
"/ ] |
|
563 |
"/ ]. |
|
564 |
"/ methodList replaceAllIdentical:oldMethod with:newMethod. |
|
565 |
"/ lastSelectedMethods notNil ifTrue:[ |
|
566 |
"/ lastSelectedMethods replaceAllIdentical:oldMethod with:newMethod |
|
567 |
"/ ]. |
|
568 |
"/ methods size > 0 ifTrue:[ |
|
569 |
"/ methods := methods asOrderedCollection. |
|
570 |
"/ methods replaceAllIdentical:oldMethod with:newMethod. |
|
571 |
"/ ]. |
|
572 |
"/ needSelectionChange == true ifTrue:[ |
|
573 |
"/ selectionHolder setValue:methods. |
|
574 |
"/ selectionHolder changed. |
|
575 |
"/ ]. |
|
576 |
"/ ^ self. |
|
577 |
"/ ] |
|
578 |
"/ ]. |
|
579 |
"/ "/ class has changed must update the methodList |
|
580 |
"/ self invalidateList. |
|
581 |
"/ ]. |
|
582 |
"/ ^ self. |
|
583 |
"/ ]. |
|
584 |
||
585 |
"/ something == #projectOrganization ifTrue:[ |
|
586 |
"/ ((classes includesIdentical:changedObject theNonMetaclass) |
|
587 |
"/ or:[(classes includesIdentical:changedObject theMetaclass)]) ifTrue:[ |
|
588 |
"/ self invalidateList. |
|
589 |
"/ ]. |
|
590 |
"/ ^ self |
|
591 |
"/ ]. |
|
592 |
||
593 |
changedObject == sortBy ifTrue:[ |
|
5998 | 594 |
listValid ~~ true ifTrue:[ "/ could be nil |
595 |
inGeneratorHolder value isNil ifTrue:[ |
|
596 |
"/ ok, no need to react on that one |
|
597 |
"/ (will invalidate anyway, once I have more info at hand) |
|
598 |
^ self |
|
599 |
]. |
|
600 |
]. |
|
601 |
self invalidateList. |
|
602 |
^ self |
|
5591 | 603 |
]. |
604 |
||
605 |
(changedObject == variableFilter |
|
606 |
or:[changedObject == filterClassVars |
|
6259
e440c14b02aa
experimental display of method complexity
Claus Gittinger <cg@exept.de>
parents:
5998
diff
changeset
|
607 |
or:[changedObject == showMethodInheritance |
e440c14b02aa
experimental display of method complexity
Claus Gittinger <cg@exept.de>
parents:
5998
diff
changeset
|
608 |
or:[changedObject == showMethodComplexity]]]) ifTrue:[ |
5998 | 609 |
self invalidateList. |
610 |
^ self |
|
5591 | 611 |
]. |
612 |
||
613 |
changedObject == selectedMethodNameIndices ifTrue:[ |
|
5998 | 614 |
newSelection := self selectedMethodNameIndices value collect:[:idx | methodList at:idx]. |
615 |
newSelection ~= selection ifTrue:[ |
|
616 |
selectionHolder value:newSelection. |
|
617 |
lastSelectedMethods := newSelection. |
|
618 |
lastSelectedMethods notNil ifTrue:[ |
|
619 |
lastSelectedMethods := lastSelectedMethods asOrderedCollection |
|
620 |
]. |
|
621 |
] ifFalse:[ |
|
622 |
"/ a reselect - force update |
|
5591 | 623 |
"/ selection size == 1 ifTrue:[ |
5998 | 624 |
selectionHolder setValue:newSelection. |
625 |
selectionHolder changed:#value. |
|
5591 | 626 |
"/ ]. |
5998 | 627 |
]. |
628 |
^ self |
|
5591 | 629 |
]. |
630 |
changedObject == selectionHolder ifTrue:[ |
|
5998 | 631 |
self selectedMethodsChanged. |
632 |
lastSelectedMethods := selectionHolder value. |
|
633 |
lastSelectedMethods notNil ifTrue:[ |
|
634 |
lastSelectedMethods := lastSelectedMethods asOrderedCollection |
|
635 |
]. |
|
636 |
^ self |
|
5591 | 637 |
]. |
638 |
"/ something == #methodTrap ifTrue:[ |
|
639 |
"/self halt:'no longer'. |
|
640 |
"/^ self. |
|
641 |
"/ (classes includesIdentical:changedObject) ifTrue:[ |
|
642 |
"/ newMethod := changedObject compiledMethodAt:aParameter. |
|
643 |
"/ newMethod isNil ifTrue:[ |
|
644 |
"/ self invalidateList. |
|
645 |
"/ ^ self |
|
646 |
"/ ]. |
|
647 |
"/ newMethod isWrapped ifTrue:[ |
|
648 |
"/ oldMethod := newMethod originalMethod |
|
649 |
"/ ] ifFalse:[ |
|
650 |
"/ selection size > 0 ifTrue:[ |
|
651 |
"/ oldMethod := selection detect:[:each | each isWrapped and:[each originalMethod == newMethod]] ifNone:nil. |
|
652 |
"/ ] |
|
653 |
"/ ]. |
|
654 |
"/ |
|
655 |
"/ selection size > 0 ifTrue:[ |
|
656 |
"/ (selection includesIdentical:oldMethod) ifTrue:[ |
|
657 |
"/ needSelectionChange := true. |
|
658 |
"/ ] |
|
659 |
"/ ]. |
|
660 |
"/"/ methodList replaceAllIdentical:oldMethod with:newMethod. |
|
661 |
"/ lastSelectedMethods notNil ifTrue:[ |
|
662 |
"/ lastSelectedMethods replaceAllIdentical:oldMethod with:newMethod |
|
663 |
"/ ]. |
|
664 |
"/ selection size > 0 ifTrue:[ |
|
665 |
"/ selection := selection asOrderedCollection. |
|
666 |
"/ selection replaceAllIdentical:oldMethod with:newMethod. |
|
667 |
"/ ]. |
|
668 |
"/ needSelectionChange == true ifTrue:[ |
|
669 |
"/ selectionHolder changed. |
|
670 |
"/ ]. |
|
671 |
"/ self invalidateList. |
|
672 |
"/ ^ self |
|
673 |
"/ ]. |
|
674 |
"/ ^ self |
|
675 |
"/ ]. |
|
676 |
super delayedUpdate:something with:aParameter from:changedObject |
|
677 |
||
6846 | 678 |
"Created: / 05-02-2000 / 13:42:14 / cg" |
10363 | 679 |
"Modified: / 20-07-2011 / 18:56:23 / cg" |
10376
8a61751a59fa
method entry updating fixed (it is updated whenever a method is changed)
vrany
parents:
10363
diff
changeset
|
680 |
"Modified: / 22-07-2011 / 18:12:23 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
5591 | 681 |
! |
682 |
||
683 |
selectedMethodsChanged |
|
684 |
"the set of selected methods has changed; |
|
685 |
update the selection-index collection (for the selectionInListView)" |
|
686 |
||
687 |
|indices methods reverseMap |
|
688 |
selectedMethodsHolder selectedMethods selectedMethodNameIndicesHolder| |
|
689 |
||
690 |
methods := methodList ? #(). |
|
691 |
methods size == 0 ifTrue:[ |
|
10388 | 692 |
"/ this may happen during early startup, |
693 |
"/ when invoked with a preset methodSelection, |
|
694 |
"/ and the methodGenerator has not yet been setup |
|
695 |
"/ to not clobber the selection, defer the update |
|
696 |
"/ until the methodList arrives ... |
|
697 |
^ self |
|
5591 | 698 |
]. |
699 |
||
700 |
selectedMethodsHolder := self selectedMethods. |
|
701 |
selectedMethods := selectedMethodsHolder value. |
|
702 |
||
703 |
"/ check if all is selected (likely) |
|
704 |
((selectedMethods size == methodList size) |
|
705 |
and:[selectedMethods = methodList]) ifTrue:[ |
|
10388 | 706 |
indices := (1 to:selectedMethods size) |
5591 | 707 |
] ifFalse:[ |
10388 | 708 |
selectedMethods size > 100 ifTrue:[ |
709 |
"/ check if all is selected (likely) |
|
710 |
((selectedMethods size == methodList size) |
|
711 |
and:[selectedMethods = methodList]) ifTrue:[ |
|
712 |
indices := (1 to:selectedMethods size) |
|
713 |
] ifFalse:[ |
|
714 |
"/ for big collections, generate a reverse map |
|
715 |
reverseMap := IdentityDictionary new. |
|
716 |
methods keysAndValuesDo:[:idx :mthd | reverseMap at:mthd put:idx]. |
|
717 |
indices := selectedMethods collect:[:eachSelectedMethod | |
|
718 |
reverseMap at:eachSelectedMethod ifAbsent:0 |
|
719 |
] |
|
720 |
] |
|
721 |
] ifFalse:[ |
|
722 |
indices := (selectedMethods ? #()) collect:[:eachSelectedMethod | |
|
723 |
methods identityIndexOf:eachSelectedMethod. |
|
724 |
] |
|
725 |
]. |
|
726 |
indices := indices select:[:idx | idx ~= 0]. |
|
5591 | 727 |
]. |
728 |
||
729 |
selectedMethodNameIndicesHolder := self selectedMethodNameIndices. |
|
730 |
selectedMethodNameIndicesHolder value ~= indices ifTrue:[ |
|
10388 | 731 |
selectedMethodNameIndicesHolder value:indices. |
5591 | 732 |
] |
733 |
! |
|
734 |
||
735 |
selectionChanged |
|
736 |
|methods| |
|
737 |
||
738 |
methods := ((self selectedMethodNameIndices value) ? #()) collect:[:idx | methodList at:idx]. |
|
739 |
methods notEmpty ifTrue:[ |
|
10388 | 740 |
lastSelectedMethods := methods asOrderedCollection. |
5591 | 741 |
]. |
742 |
"/ to allow reselect, change my valueHolder, even if the same collection |
|
743 |
"/ self selectedMethods value ~= methods ifTrue:[ |
|
10388 | 744 |
self selectedMethods value:methods |
5591 | 745 |
"/ ] |
746 |
||
747 |
"Created: / 5.2.2000 / 13:42:14 / cg" |
|
748 |
"Modified: / 5.2.2000 / 23:32:20 / cg" |
|
749 |
! |
|
750 |
||
751 |
selectionChangedByClick |
|
752 |
"we are not interested in that - get another notification |
|
753 |
via the changed valueHolder" |
|
754 |
||
755 |
! |
|
756 |
||
757 |
update:something with:aParameter from:changedObject |
|
10357 | 758 |
|cls mthd| |
5591 | 759 |
|
760 |
"/ some can be ignored immediately |
|
761 |
changedObject == Smalltalk ifTrue:[ |
|
762 |
classes isNil ifTrue:[ |
|
763 |
^ self. |
|
764 |
]. |
|
765 |
something isNil ifTrue:[ |
|
766 |
"/ self halt "/ huh - Smalltalk changed - so what ? |
|
767 |
^ self. |
|
768 |
]. |
|
5998 | 769 |
|
5591 | 770 |
something == #classComment ifTrue:[ |
771 |
^ self. |
|
772 |
]. |
|
773 |
something == #classVariables ifTrue:[ |
|
774 |
^ self. |
|
775 |
]. |
|
776 |
something == #organization ifTrue:[ |
|
777 |
^ self. |
|
778 |
]. |
|
779 |
something == #methodCategory ifTrue:[ |
|
780 |
"/ ignore here - methodCategoryList will tell me if required |
|
781 |
^ self |
|
782 |
]. |
|
6663
1453d4f33815
changed change-update aspect when changing some method category
Claus Gittinger <cg@exept.de>
parents:
6575
diff
changeset
|
783 |
(something == #classOrganization |
1453d4f33815
changed change-update aspect when changing some method category
Claus Gittinger <cg@exept.de>
parents:
6575
diff
changeset
|
784 |
or:[ something == #methodCategoryAdded |
1453d4f33815
changed change-update aspect when changing some method category
Claus Gittinger <cg@exept.de>
parents:
6575
diff
changeset
|
785 |
or:[ something == #methodCategoryRemoved |
1453d4f33815
changed change-update aspect when changing some method category
Claus Gittinger <cg@exept.de>
parents:
6575
diff
changeset
|
786 |
or:[ something == #methodCategoriesRemoved |
1453d4f33815
changed change-update aspect when changing some method category
Claus Gittinger <cg@exept.de>
parents:
6575
diff
changeset
|
787 |
or:[ something == #methodCategoryRenamed ]]]]) ifTrue:[ |
5591 | 788 |
"/ ignore here - methodCategoryList will tell me if required |
789 |
^ self |
|
790 |
]. |
|
10357 | 791 |
|
792 |
something == #methodCoverageInfo ifTrue:[ |
|
10363 | 793 |
listValid ifFalse:[^ self]. |
10357 | 794 |
self showCoverageInformation value ifFalse:[^ self]. |
795 |
mthd := aParameter. |
|
796 |
(classes notNil and:[classes includesIdentical:mthd mclass]) ifFalse:[ |
|
797 |
^ self "/ I dont care for that class |
|
798 |
]. |
|
10363 | 799 |
listValid ifFalse:[^ self]. |
10357 | 800 |
]. |
801 |
||
5998 | 802 |
(something == #methodTrap |
6846 | 803 |
or:[ something == #methodPrivacy |
804 |
or:[ something == #lastTestRunResult] ]) ifTrue:[ |
|
5998 | 805 |
self window shown ifFalse:[ |
806 |
changedObject removeDependent:self. "/ ????? |
|
807 |
^ self |
|
808 |
]. |
|
5591 | 809 |
cls := aParameter at:1. |
810 |
(classes includesIdentical:cls) ifFalse:[ |
|
5998 | 811 |
^ self "/ I dont care for that class |
5591 | 812 |
]. |
813 |
]. |
|
814 |
||
6846 | 815 |
"/ as the organisation changes, flush my remembered redefinition-cache-info |
5591 | 816 |
classAndSelectorsRedefinedBySubclassesOfClass := nil. |
817 |
||
818 |
something == #classDefinition ifTrue:[ |
|
819 |
cls := aParameter. |
|
820 |
(classes contains:[:aClass | aClass name == cls name]) ifFalse:[ |
|
821 |
^ self "/ I dont care for that class |
|
822 |
]. |
|
10388 | 823 |
"/ classes := classes collect:[:eachClass | eachClass isMeta ifTrue:[ |
824 |
"/ (Smalltalk at:eachClass theNonMetaclass name) class |
|
825 |
"/ ] ifFalse:[ |
|
826 |
"/ Smalltalk at:eachClass name |
|
827 |
"/ ] |
|
828 |
"/ ]. |
|
829 |
"/ self updateList. |
|
830 |
self enqueueDelayedUpdate:something with:aParameter from:changedObject. |
|
5591 | 831 |
^ self. |
832 |
]. |
|
833 |
something == #newClass ifTrue:[ |
|
834 |
^ self. |
|
835 |
]. |
|
836 |
something == #classRemove ifTrue:[ |
|
837 |
^ self. |
|
838 |
]. |
|
839 |
something == #classRename ifTrue:[ |
|
840 |
^ self. |
|
841 |
]. |
|
842 |
]. |
|
843 |
||
844 |
"/ these must lead to immediate update of the selectedMethods collection |
|
845 |
"/ (otherwise, that collection might be updated too late, leading to |
|
846 |
"/ an obsolete methods code being shown by the codeView. |
|
847 |
something == #methodInClass ifTrue:[ |
|
6846 | 848 |
"/ as the organisation changes, flush my remembered redefinition-cache-info |
5591 | 849 |
classAndSelectorsRedefinedBySubclassesOfClass := nil. |
850 |
cls := aParameter at:1. |
|
851 |
(classes includesIdentical:cls) ifFalse:[ |
|
852 |
^ self "/ I dont care for that class |
|
853 |
]. |
|
854 |
self enqueueDelayedUpdate:something with:aParameter from:changedObject. |
|
855 |
^ self |
|
856 |
]. |
|
857 |
||
858 |
something == #methodInClassRemoved ifTrue:[ |
|
859 |
cls := aParameter at:1. |
|
860 |
(classes includesIdentical:cls) ifFalse:[ |
|
861 |
^ self "/ I dont care for that class |
|
862 |
]. |
|
863 |
]. |
|
864 |
||
865 |
super update:something with:aParameter from:changedObject |
|
6846 | 866 |
|
10363 | 867 |
"Modified: / 20-07-2011 / 18:54:04 / cg" |
10376
8a61751a59fa
method entry updating fixed (it is updated whenever a method is changed)
vrany
parents:
10363
diff
changeset
|
868 |
"Modified (format): / 22-07-2011 / 18:13:28 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
5591 | 869 |
! ! |
870 |
||
6774
ae9ed5b0b548
move method via drag and drop
Claus Gittinger <cg@exept.de>
parents:
6697
diff
changeset
|
871 |
!MethodList methodsFor:'drag & drop'! |
ae9ed5b0b548
move method via drag and drop
Claus Gittinger <cg@exept.de>
parents:
6697
diff
changeset
|
872 |
|
ae9ed5b0b548
move method via drag and drop
Claus Gittinger <cg@exept.de>
parents:
6697
diff
changeset
|
873 |
canDropContext:aDropContext |
ae9ed5b0b548
move method via drag and drop
Claus Gittinger <cg@exept.de>
parents:
6697
diff
changeset
|
874 |
|methods| |
ae9ed5b0b548
move method via drag and drop
Claus Gittinger <cg@exept.de>
parents:
6697
diff
changeset
|
875 |
|
ae9ed5b0b548
move method via drag and drop
Claus Gittinger <cg@exept.de>
parents:
6697
diff
changeset
|
876 |
aDropContext sourceWidget == aDropContext targetWidget ifTrue:[^ false]. |
ae9ed5b0b548
move method via drag and drop
Claus Gittinger <cg@exept.de>
parents:
6697
diff
changeset
|
877 |
|
ae9ed5b0b548
move method via drag and drop
Claus Gittinger <cg@exept.de>
parents:
6697
diff
changeset
|
878 |
methods := aDropContext dropObjects collect:[:obj | obj theObject]. |
7122 | 879 |
(methods conform:[:aMethod | aMethod isMethod]) ifFalse:[^ false]. |
6774
ae9ed5b0b548
move method via drag and drop
Claus Gittinger <cg@exept.de>
parents:
6697
diff
changeset
|
880 |
|
ae9ed5b0b548
move method via drag and drop
Claus Gittinger <cg@exept.de>
parents:
6697
diff
changeset
|
881 |
self masterApplication theSingleSelectedClass isNil ifTrue:[^ false]. |
ae9ed5b0b548
move method via drag and drop
Claus Gittinger <cg@exept.de>
parents:
6697
diff
changeset
|
882 |
^ true |
7122 | 883 |
|
884 |
"Modified: / 13-09-2006 / 11:43:54 / cg" |
|
6774
ae9ed5b0b548
move method via drag and drop
Claus Gittinger <cg@exept.de>
parents:
6697
diff
changeset
|
885 |
! |
ae9ed5b0b548
move method via drag and drop
Claus Gittinger <cg@exept.de>
parents:
6697
diff
changeset
|
886 |
|
ae9ed5b0b548
move method via drag and drop
Claus Gittinger <cg@exept.de>
parents:
6697
diff
changeset
|
887 |
doDropContext:aDropContext |
8596 | 888 |
|methods browser| |
6774
ae9ed5b0b548
move method via drag and drop
Claus Gittinger <cg@exept.de>
parents:
6697
diff
changeset
|
889 |
|
ae9ed5b0b548
move method via drag and drop
Claus Gittinger <cg@exept.de>
parents:
6697
diff
changeset
|
890 |
methods := aDropContext dropObjects collect:[:aDropObject | aDropObject theObject]. |
7122 | 891 |
(methods conform:[:something | something isMethod]) ifFalse:[^ self]. |
6774
ae9ed5b0b548
move method via drag and drop
Claus Gittinger <cg@exept.de>
parents:
6697
diff
changeset
|
892 |
|
8596 | 893 |
browser := self masterApplication. |
894 |
aDropContext dragType == DropContext dragTypeCopy ifTrue:[ |
|
895 |
browser |
|
896 |
copyMethods:methods |
|
897 |
toClass:(browser theSingleSelectedClass). |
|
898 |
] ifFalse:[ |
|
899 |
browser |
|
900 |
moveMethods:methods |
|
901 |
toClass:(browser theSingleSelectedClass). |
|
902 |
]. |
|
7122 | 903 |
|
904 |
"Modified: / 13-09-2006 / 11:43:44 / cg" |
|
6774
ae9ed5b0b548
move method via drag and drop
Claus Gittinger <cg@exept.de>
parents:
6697
diff
changeset
|
905 |
! ! |
ae9ed5b0b548
move method via drag and drop
Claus Gittinger <cg@exept.de>
parents:
6697
diff
changeset
|
906 |
|
5591 | 907 |
!MethodList methodsFor:'private'! |
908 |
||
909 |
listOfMethodNames |
|
10257 | 910 |
|methods entries selectorBag newNameList allClasses newClasses |
911 |
allCategories "allSelectors" |
|
912 |
generator doShowClass doShowClassFirst doShowCategory enforceClassAndProtocolInList theMethod sortByClass anyMethodToWatch mclass| |
|
5591 | 913 |
|
914 |
generator := inGeneratorHolder value. |
|
10257 | 915 |
generator isNil ifTrue:[ |
916 |
^ #() |
|
917 |
]. |
|
5591 | 918 |
allClasses := IdentitySet new. |
10257 | 919 |
allCategories := IdentitySet new. |
920 |
||
5591 | 921 |
"/ allSelectors := Set new. |
10257 | 922 |
|
5591 | 923 |
newClasses := IdentitySet new. |
924 |
selectorBag := Bag new. |
|
925 |
entries := OrderedCollection new. |
|
926 |
enforceClassAndProtocolInList := false. |
|
927 |
anyMethodToWatch := false. |
|
10257 | 928 |
|
5591 | 929 |
"/ generator generates nil-selector entries |
930 |
"/ to pass multiple-class and multiple-protocol info |
|
10257 | 931 |
|
932 |
generator do:[:cls :cat :sel :mthd | |
|
933 |
(cls isNil and:[ cat isNil and:[ sel isNil ] ]) ifTrue:[ |
|
934 |
enforceClassAndProtocolInList := true |
|
935 |
] ifFalse:[ |
|
936 |
cls notNil ifTrue:[ |
|
937 |
allClasses add:cls. |
|
938 |
]. |
|
939 |
cat notNil ifTrue:[ |
|
940 |
allCategories add:cat. |
|
941 |
]. |
|
942 |
"JV: Filter method through package filter" |
|
943 |
(mthd notNil |
|
944 |
and:[ |
|
945 |
mthd isSynthetic not |
|
946 |
and:[ |
|
947 |
sel notNil |
|
948 |
and:[ |
|
949 |
packageFilter value isNil |
|
950 |
or:[ packageFilter value includes:mthd package ] |
|
951 |
] |
|
952 |
] |
|
953 |
]) |
|
954 |
ifTrue:[ |
|
955 |
entries add:(Array |
|
956 |
with:cls |
|
957 |
with:sel |
|
958 |
with:mthd). |
|
959 |
selectorBag add:sel. |
|
960 |
newClasses add:cls. |
|
961 |
||
962 |
"/ allSelectors add:sel. |
|
963 |
] |
|
964 |
]. |
|
965 |
(mthd notNil and:[ mthd isWrapped ]) ifTrue:[ |
|
966 |
(mthd isTiming or:[ mthd isCounting or:[ mthd isCountingMemoryUsage ] ]) ifTrue:[ |
|
967 |
anyMethodToWatch := true |
|
968 |
] |
|
969 |
]. |
|
970 |
]. |
|
5591 | 971 |
showMethodInheritance value ~~ false ifTrue:[ |
972 |
"/ collect redefinition information once (big speedup for #methodIsRedefinedbelow) |
|
973 |
classAndSelectorsRedefinedBySubclassesOfClass isNil ifTrue:[ |
|
974 |
classAndSelectorsRedefinedBySubclassesOfClass := IdentityDictionary new. |
|
975 |
]. |
|
10257 | 976 |
allClasses do:[:cls | |
977 |
|d| |
|
978 |
||
5591 | 979 |
d := classAndSelectorsRedefinedBySubclassesOfClass. |
980 |
(d notNil and:[ (d includesKey:cls) not ]) ifTrue:[ |
|
8206 | 981 |
cls isLoaded ifTrue:[ |
982 |
d at:cls put:(self setOfAllSelectorsImplementedBelow:cls) |
|
983 |
] |
|
5591 | 984 |
] |
985 |
]. |
|
986 |
]. |
|
10257 | 987 |
|
5591 | 988 |
"/ multiple classes must: add the className for some |
10257 | 989 |
|
990 |
doShowClass := enforceClassAndProtocolInList or:[ allClasses size > 1 ]. |
|
991 |
||
5591 | 992 |
"/ multiple categories: must add the categorie for some |
10257 | 993 |
|
994 |
doShowCategory := enforceClassAndProtocolInList |
|
995 |
or:[ allCategories size > 1 ]. |
|
996 |
doShowClassFirst := doShowClass. |
|
5591 | 997 |
doShowClassFirst := doShowClass and:[ sortBy value == #class ]. |
998 |
sortBy value == false ifTrue:[ |
|
999 |
"/ do not sort |
|
1000 |
] ifFalse:[ |
|
1001 |
(doShowClass not and:[ sortBy value == #class ]) ifTrue:[ |
|
1002 |
"/ multiple classes must add the className for some |
|
1003 |
"/ check, if doShowClass must be enforced |
|
10257 | 1004 |
entries do:[:entry | |
5591 | 1005 |
|cls sel mthd s needClass| |
1006 |
||
1007 |
cls := entry at:1. |
|
1008 |
sel := entry at:2. |
|
1009 |
mthd := entry at:3. |
|
1010 |
doShowClass ifFalse:[ |
|
1011 |
doShowClass := (selectorBag occurrencesOf:sel) > 1 |
|
1012 |
]. |
|
1013 |
]. |
|
1014 |
]. |
|
1015 |
sortByClass := doShowClass and:[ sortBy value == #class ]. |
|
1016 |
sortByClass ifTrue:[ |
|
10257 | 1017 |
entries |
1018 |
sort:[:a :b | |
|
1019 |
|nmA nmB clsNmA clsNmB nsNmA nsNmB| |
|
1020 |
||
1021 |
clsNmA := (a at:1) name. |
|
1022 |
clsNmB := (b at:1) name. |
|
1023 |
clsNmA = clsNmB ifTrue:[ |
|
1024 |
nmA := (a at:2) asSymbol selector. |
|
1025 |
nmB := (b at:2) asSymbol selector. |
|
1026 |
nmA = nmB ifTrue:[ |
|
1027 |
nsNmA := (a at:3) nameSpaceName. |
|
1028 |
nsNmB := (b at:3) nameSpaceName. |
|
1029 |
nsNmA < nsNmB |
|
1030 |
] ifFalse:[ nmA < nmB ] |
|
1031 |
] ifFalse:[ |
|
1032 |
clsNmA < clsNmB |
|
1033 |
] |
|
1034 |
]. |
|
5591 | 1035 |
] ifFalse:[ |
7610 | 1036 |
sortBy value == #category ifTrue:[ |
10257 | 1037 |
entries |
1038 |
sort:[:a :b | |
|
1039 |
|nmA nmB catA catB clsNmA clsNmB nsNmA nsNmB| |
|
1040 |
||
1041 |
catA := (a at:3) category. |
|
1042 |
catB := (b at:3) category. |
|
1043 |
catA = catB ifTrue:[ |
|
1044 |
nmA := (a at:2) asSymbol selector. |
|
1045 |
nmB := (b at:2) asSymbol selector. |
|
1046 |
nmA = nmB ifTrue:[ |
|
1047 |
clsNmA := (a at:1) name. |
|
1048 |
clsNmB := (b at:1) name. |
|
1049 |
clsNmA = clsNmB ifTrue:[ |
|
1050 |
nsNmA := (a at:3) nameSpaceName. |
|
1051 |
nsNmB := (b at:3) nameSpaceName. |
|
1052 |
nsNmA < nsNmB |
|
1053 |
] ifFalse:[ |
|
1054 |
clsNmA < clsNmB |
|
1055 |
] |
|
1056 |
] ifFalse:[ nmA < nmB ] |
|
1057 |
] ifFalse:[ |
|
1058 |
catA < catB |
|
1059 |
] |
|
1060 |
]. |
|
7610 | 1061 |
] ifFalse:[ |
10257 | 1062 |
entries |
1063 |
sort:[:a :b | |
|
1064 |
|nmA nmB clsNmA clsNmB nsNmA nsNmB| |
|
1065 |
||
1066 |
nmA := (a at:2) asSymbol selector. |
|
1067 |
nmB := (b at:2) asSymbol selector. |
|
1068 |
nmA = nmB ifTrue:[ |
|
1069 |
clsNmA := (a at:1) name. |
|
1070 |
clsNmB := (b at:1) name. |
|
1071 |
clsNmA = clsNmB ifTrue:[ |
|
1072 |
nsNmA := (a at:3) nameSpaceName. |
|
1073 |
nsNmB := (b at:3) nameSpaceName. |
|
1074 |
nsNmA < nsNmB |
|
1075 |
] ifFalse:[ |
|
1076 |
clsNmA < clsNmB |
|
1077 |
] |
|
1078 |
] ifFalse:[ nmA < nmB ] |
|
1079 |
]. |
|
7610 | 1080 |
]. |
5591 | 1081 |
]. |
1082 |
]. |
|
1083 |
methods := OrderedCollection new:(entries size). |
|
10257 | 1084 |
|
5591 | 1085 |
"/ first generate the new methodList, and see if it is different ... |
10257 | 1086 |
|
1087 |
entries do:[:entry | |
|
5591 | 1088 |
|sel mthd| |
1089 |
||
1090 |
mthd := entry at:3. |
|
1091 |
methods add:mthd. |
|
1092 |
]. |
|
1093 |
false "methodList = methods" "does not care for changed icons" ifTrue:[ |
|
1094 |
"/ same list |
|
1095 |
newNameList := self browserNameList. |
|
1096 |
] ifFalse:[ |
|
1097 |
newNameList := OrderedCollection new:(entries size). |
|
10257 | 1098 |
|
5591 | 1099 |
"/ multiple classes must add the className for some |
10257 | 1100 |
|
1101 |
entries do:[:entry | |
|
5591 | 1102 |
|cls sel mthd s needClass| |
1103 |
||
1104 |
cls := entry at:1. |
|
1105 |
sel := entry at:2. |
|
1106 |
mthd := entry at:3. |
|
1107 |
needClass := doShowClass. |
|
10257 | 1108 |
|
5591 | 1109 |
"/ needClass ifFalse:[ |
1110 |
"/ needClass := (selectorBag occurrencesOf:sel) > 1 |
|
1111 |
"/ ]. |
|
10257 | 1112 |
|
5591 | 1113 |
s := self |
10257 | 1114 |
listEntryForMethod:mthd |
1115 |
selector:sel |
|
1116 |
class:cls |
|
1117 |
showClass:needClass |
|
1118 |
showCategory:doShowCategory |
|
1119 |
classFirst:doShowClassFirst. |
|
1120 |
||
5591 | 1121 |
"/ s := mthd printStringForBrowserWithSelector:sel inClass:cls. |
1122 |
"/ needClass ifTrue:[ |
|
1123 |
"/ s := s , ' [' , cls name , ']'. |
|
1124 |
"/ ]. |
|
1125 |
"/ doShowCategory ifTrue:[ |
|
1126 |
"/ s := s , ' {' , mthd category "asText allItalic" , '}' |
|
1127 |
"/ ]. |
|
10257 | 1128 |
|
5591 | 1129 |
newNameList add:s. |
1130 |
]. |
|
1131 |
]. |
|
1132 |
self makeIndependent. |
|
1133 |
classes := newClasses. |
|
1134 |
self makeDependent. |
|
1135 |
methodList := methods. |
|
1136 |
methods size == 1 ifTrue:[ |
|
1137 |
theMethod := methods first. |
|
1138 |
mclass := theMethod mclass. |
|
1139 |
mclass isNil ifTrue:[ |
|
1140 |
theMethod isWrapped ifTrue:[ |
|
1141 |
theMethod := theMethod originalMethod. |
|
1142 |
mclass := theMethod mclass. |
|
1143 |
]. |
|
1144 |
]. |
|
10257 | 1145 |
self methodLabelHolder value:(mclass isNil |
1146 |
ifTrue:[ ('???' , ' ' , '???') ] |
|
1147 |
ifFalse:[ (mclass name , ' ' , theMethod selector) ]) |
|
5591 | 1148 |
]. |
1149 |
anyMethodToWatch ifTrue:[ |
|
1150 |
self startWatchProcess. |
|
1151 |
] ifFalse:[ |
|
1152 |
self stopWatchProcess. |
|
1153 |
]. |
|
10257 | 1154 |
|
5591 | 1155 |
"/ remember these, in case of an incremental (single method only) |
1156 |
"/ update in the future. |
|
10257 | 1157 |
|
5591 | 1158 |
lastShowClass := doShowClass. |
1159 |
lastShowClassFirst := doShowClassFirst. |
|
1160 |
lastShowCategory := doShowCategory. |
|
1161 |
^ newNameList. |
|
1162 |
||
7610 | 1163 |
"Created: / 05-02-2000 / 22:43:40 / cg" |
1164 |
"Modified: / 26-01-2007 / 14:58:59 / cg" |
|
10257 | 1165 |
"Modified: / 20-07-2010 / 11:21:15 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
1166 |
"Modified: / 24-08-2010 / 20:34:09 / Jan Vrany <enter your email here>" |
|
5591 | 1167 |
! |
1168 |
||
1169 |
makeDependent |
|
1170 |
Smalltalk addDependent:self. |
|
7502 | 1171 |
"/ ChangeSet addDependent:self. |
1172 |
||
1173 |
"Modified: / 10-11-2006 / 17:57:01 / cg" |
|
5591 | 1174 |
! |
1175 |
||
1176 |
makeIndependent |
|
1177 |
Smalltalk removeDependent:self. |
|
8218 | 1178 |
"/ ChangeSet removeDependent:self. |
5591 | 1179 |
! |
1180 |
||
1181 |
method:mthd includesModsOfClassVariable:variablesToHighLight |
|
1182 |
^ self method:mthd includesRefsToVariable:variablesToHighLight askParserWith:#modifiedClassVars |
|
1183 |
! |
|
1184 |
||
1185 |
method:mthd includesModsOfInstanceVariable:variablesToHighLight |
|
1186 |
^ self method:mthd includesRefsToVariable:variablesToHighLight askParserWith:#modifiedInstVars |
|
1187 |
! |
|
1188 |
||
1189 |
method:mthd includesRefsToClassVariable:variablesToHighLight |
|
1190 |
^ self method:mthd includesRefsToVariable:variablesToHighLight askParserWith:#usedClassVars |
|
1191 |
! |
|
1192 |
||
1193 |
method:mthd includesRefsToInstanceVariable:variablesToHighLight |
|
1194 |
^ self method:mthd includesRefsToVariable:variablesToHighLight askParserWith:#usedInstVars |
|
1195 |
! |
|
1196 |
||
1197 |
method:mthd includesRefsToVariable:variablesToHighLight askParserWith:querySelector |
|
1198 |
|cls src parser usedVars anyVarNameAccessable| |
|
1199 |
||
1200 |
cls := mthd mclass. |
|
5885 | 1201 |
cls isNil ifTrue:[^ false]. |
1202 |
||
5591 | 1203 |
anyVarNameAccessable := cls allInstVarNames includesAny:variablesToHighLight. |
1204 |
anyVarNameAccessable ifFalse:[ |
|
5885 | 1205 |
anyVarNameAccessable := cls theNonMetaclass allClassVarNames includesAny:variablesToHighLight. |
5591 | 1206 |
]. |
1207 |
anyVarNameAccessable ifFalse:[ |
|
5885 | 1208 |
"/ no need to parse |
1209 |
^ false |
|
5591 | 1210 |
]. |
1211 |
||
1212 |
src := mthd source. |
|
1213 |
src notNil ifTrue:[ |
|
5885 | 1214 |
" |
1215 |
before doing a slow parse, quickly scan the |
|
1216 |
methods source for the variables name ... |
|
1217 |
" |
|
1218 |
(variablesToHighLight contains:[:varName | (src findString:varName) ~~ 0]) ifTrue:[ |
|
1219 |
parser := Parser |
|
1220 |
parseMethod:src |
|
1221 |
in:cls |
|
1222 |
ignoreErrors:true |
|
1223 |
ignoreWarnings:true. |
|
1224 |
(parser notNil and:[parser ~~ #Error]) ifTrue:[ |
|
1225 |
usedVars := parser perform:querySelector. |
|
1226 |
(usedVars includesAny:variablesToHighLight) |
|
1227 |
ifTrue:[ |
|
1228 |
^ true |
|
1229 |
] |
|
1230 |
] |
|
1231 |
] |
|
5591 | 1232 |
]. |
1233 |
^ false |
|
1234 |
! |
|
1235 |
||
1236 |
methodIsInheritedFromAbove:aMethod |
|
1237 |
|mClass| |
|
1238 |
||
1239 |
mClass := aMethod mclass. |
|
1240 |
(mClass notNil and:[mClass superclass notNil]) ifTrue:[ |
|
6789 | 1241 |
^ (mClass superclass whichClassIncludesSelector:aMethod selector) notNil. |
5591 | 1242 |
]. |
1243 |
^ false |
|
1244 |
! |
|
1245 |
||
1246 |
methodIsRedefinedBelow:aMethod |
|
1247 |
|mclass subClasses setOfRedefinedSelectors| |
|
1248 |
||
1249 |
mclass := aMethod mclass. |
|
1250 |
mclass isNil ifTrue:[^ false]. |
|
1251 |
||
1252 |
"/ if possible, make use of info prepared by listOfMethodNames |
|
1253 |
classAndSelectorsRedefinedBySubclassesOfClass notNil |
|
1254 |
ifTrue:[ |
|
9004
fbd6a4c325f6
changed: #methodIsRedefinedBelow:
Claus Gittinger <cg@exept.de>
parents:
8644
diff
changeset
|
1255 |
setOfRedefinedSelectors := classAndSelectorsRedefinedBySubclassesOfClass at:mclass ifAbsent:nil. |
fbd6a4c325f6
changed: #methodIsRedefinedBelow:
Claus Gittinger <cg@exept.de>
parents:
8644
diff
changeset
|
1256 |
setOfRedefinedSelectors notNil ifTrue:[ |
fbd6a4c325f6
changed: #methodIsRedefinedBelow:
Claus Gittinger <cg@exept.de>
parents:
8644
diff
changeset
|
1257 |
^ setOfRedefinedSelectors includes:aMethod selector |
fbd6a4c325f6
changed: #methodIsRedefinedBelow:
Claus Gittinger <cg@exept.de>
parents:
8644
diff
changeset
|
1258 |
] |
5591 | 1259 |
]. |
1260 |
||
1261 |
lastMethodClass == mclass ifTrue:[ |
|
9004
fbd6a4c325f6
changed: #methodIsRedefinedBelow:
Claus Gittinger <cg@exept.de>
parents:
8644
diff
changeset
|
1262 |
subClasses := lastMethodClassesSubclasses |
5591 | 1263 |
] ifFalse:[ |
9004
fbd6a4c325f6
changed: #methodIsRedefinedBelow:
Claus Gittinger <cg@exept.de>
parents:
8644
diff
changeset
|
1264 |
subClasses := aMethod mclass allSubclasses. |
fbd6a4c325f6
changed: #methodIsRedefinedBelow:
Claus Gittinger <cg@exept.de>
parents:
8644
diff
changeset
|
1265 |
lastMethodClassesSubclasses := subClasses. |
fbd6a4c325f6
changed: #methodIsRedefinedBelow:
Claus Gittinger <cg@exept.de>
parents:
8644
diff
changeset
|
1266 |
lastMethodClass := mclass. |
5591 | 1267 |
]. |
9004
fbd6a4c325f6
changed: #methodIsRedefinedBelow:
Claus Gittinger <cg@exept.de>
parents:
8644
diff
changeset
|
1268 |
^ subClasses contains:[:cls | cls includesSelector:aMethod selector]. |
5591 | 1269 |
! |
1270 |
||
1271 |
redefinedOrInheritedIconFor:aMethod |
|
5761
b350e042dc9f
Icons for subclassResponsibility and deprecated methods
Stefan Vogel <sv@exept.de>
parents:
5591
diff
changeset
|
1272 |
|inherited redefined subclassResponsibility| |
5591 | 1273 |
|
1274 |
inherited := self methodIsInheritedFromAbove:aMethod. |
|
1275 |
redefined := self methodIsRedefinedBelow:aMethod. |
|
1276 |
||
1277 |
inherited ifTrue:[ |
|
5761
b350e042dc9f
Icons for subclassResponsibility and deprecated methods
Stefan Vogel <sv@exept.de>
parents:
5591
diff
changeset
|
1278 |
redefined ifTrue:[ |
b350e042dc9f
Icons for subclassResponsibility and deprecated methods
Stefan Vogel <sv@exept.de>
parents:
5591
diff
changeset
|
1279 |
^ self methodInheritedFromAboveAndRedefinedBelowIcon. |
b350e042dc9f
Icons for subclassResponsibility and deprecated methods
Stefan Vogel <sv@exept.de>
parents:
5591
diff
changeset
|
1280 |
]. |
b350e042dc9f
Icons for subclassResponsibility and deprecated methods
Stefan Vogel <sv@exept.de>
parents:
5591
diff
changeset
|
1281 |
^ self methodInheritedFromAboveIcon. |
5591 | 1282 |
]. |
5761
b350e042dc9f
Icons for subclassResponsibility and deprecated methods
Stefan Vogel <sv@exept.de>
parents:
5591
diff
changeset
|
1283 |
|
b350e042dc9f
Icons for subclassResponsibility and deprecated methods
Stefan Vogel <sv@exept.de>
parents:
5591
diff
changeset
|
1284 |
subclassResponsibility := aMethod sends:#subclassResponsibility. |
5591 | 1285 |
redefined ifTrue:[ |
5761
b350e042dc9f
Icons for subclassResponsibility and deprecated methods
Stefan Vogel <sv@exept.de>
parents:
5591
diff
changeset
|
1286 |
subclassResponsibility ifTrue:[ |
b350e042dc9f
Icons for subclassResponsibility and deprecated methods
Stefan Vogel <sv@exept.de>
parents:
5591
diff
changeset
|
1287 |
^ self methodIsSubclassResponsibilityAndRedefinedBelowIcon. |
b350e042dc9f
Icons for subclassResponsibility and deprecated methods
Stefan Vogel <sv@exept.de>
parents:
5591
diff
changeset
|
1288 |
]. |
b350e042dc9f
Icons for subclassResponsibility and deprecated methods
Stefan Vogel <sv@exept.de>
parents:
5591
diff
changeset
|
1289 |
^ self methodRedefinedBelowIcon. |
b350e042dc9f
Icons for subclassResponsibility and deprecated methods
Stefan Vogel <sv@exept.de>
parents:
5591
diff
changeset
|
1290 |
]. |
b350e042dc9f
Icons for subclassResponsibility and deprecated methods
Stefan Vogel <sv@exept.de>
parents:
5591
diff
changeset
|
1291 |
subclassResponsibility ifTrue:[ |
b350e042dc9f
Icons for subclassResponsibility and deprecated methods
Stefan Vogel <sv@exept.de>
parents:
5591
diff
changeset
|
1292 |
^ self methodIsSubclassResponsibilityIcon. |
5591 | 1293 |
]. |
1294 |
||
1295 |
^ self methodEmptyInheritedIcon |
|
1296 |
! |
|
1297 |
||
1298 |
release |
|
1299 |
super release. |
|
1300 |
||
1301 |
filterClassVars removeDependent:self. |
|
1302 |
selectedMethodNameIndices removeDependent:self. |
|
1303 |
showMethodInheritance removeDependent:self. |
|
1304 |
variableFilter removeDependent:self. |
|
1305 |
! |
|
1306 |
||
1307 |
resourceIconForMethod:aMethod |
|
6903 | 1308 |
^ SystemBrowser resourceIconForMethod:aMethod |
5591 | 1309 |
|
6903 | 1310 |
"Modified: / 17-08-2006 / 09:09:01 / cg" |
5591 | 1311 |
! |
1312 |
||
1313 |
setOfAllSelectorsImplementedBelow:aClass |
|
1314 |
|set| |
|
1315 |
||
1316 |
set := IdentitySet new. |
|
1317 |
aClass allSubclassesDo:[:eachSubclass | |
|
10388 | 1318 |
set addAll:(eachSubclass methodDictionary keys). |
5591 | 1319 |
]. |
1320 |
^ set |
|
1321 |
! |
|
1322 |
||
1323 |
updateList |
|
1324 |
|prevSelection newList newSelection newSelIdx reverseMap sameContents newListSize oldListSize |
|
1325 |
prevClasses methodSet selectedMethodsHolder| |
|
1326 |
||
1327 |
selectedMethodsHolder := self selectedMethods. |
|
1328 |
prevSelection := selectedMethodsHolder value ? #(). |
|
1329 |
||
1330 |
prevClasses := classes ifNil:[ #() ] ifNotNil:[ classes copy ]. |
|
1331 |
||
1332 |
oldListSize := self browserNameList size. |
|
1333 |
||
8644 | 1334 |
self topApplication withWaitCursorDo:[ |
1335 |
newList := self listOfMethodNames. |
|
1336 |
]. |
|
7702 | 1337 |
newListSize := newList size. |
1338 |
sameContents := self updateListFor:newList. |
|
5591 | 1339 |
|
7702 | 1340 |
sameContents ifFalse:[ |
5591 | 1341 |
"/ self browserNameList value:newList. |
1342 |
||
7702 | 1343 |
(prevSelection size == 0 |
1344 |
and:[selectedMethodsHolder value size ~~ 0]) ifTrue:[ |
|
1345 |
"/ this happens during early startup time, |
|
1346 |
"/ when the selection is already (pre-)set, |
|
1347 |
"/ and the methodList is generated the first time |
|
1348 |
"/ (i.e. when opened with preset selection |
|
5591 | 1349 |
|
7702 | 1350 |
"/ do not clobber the selection in this case. |
1351 |
prevSelection := selectedMethodsHolder value. |
|
1352 |
]. |
|
5591 | 1353 |
|
7702 | 1354 |
(methodList size == 0 or:[prevSelection size == 0]) ifTrue:[ |
1355 |
newSelection := #() |
|
1356 |
] ifFalse:[ |
|
1357 |
methodSet := methodList. |
|
5591 | 1358 |
|
7702 | 1359 |
"/ inclusion test is much faster with sets, if the number of items is large |
1360 |
methodList size > 30 ifTrue:[ |
|
1361 |
"/ however, only if its worth building the set ... |
|
1362 |
prevSelection size > 5 ifTrue:[ |
|
1363 |
methodSet := methodSet asIdentitySet. |
|
1364 |
] |
|
1365 |
]. |
|
1366 |
newSelection := prevSelection select:[:item | methodSet includesIdentical:item]. |
|
1367 |
]. |
|
1368 |
newSelection size > 0 ifTrue:[ |
|
1369 |
newSelection size > 100 ifTrue:[ |
|
1370 |
"/ need selection indices - might be expensive if done straight forward... |
|
1371 |
reverseMap := IdentityDictionary new. |
|
1372 |
methodList keysAndValuesDo:[:idx :mthd | reverseMap at:mthd put:idx]. |
|
1373 |
newSelIdx := newSelection collect:[:mthd | reverseMap at:mthd]. |
|
1374 |
] ifFalse:[ |
|
1375 |
newSelIdx := newSelection collect:[:mthd | methodList identityIndexOf:mthd] |
|
1376 |
]. |
|
5591 | 1377 |
"/ self halt. |
7702 | 1378 |
"/ force change (for dependents) |
1379 |
newSelIdx ~= selectedMethodNameIndices value ifTrue:[ |
|
1380 |
selectedMethodNameIndices value:newSelIdx. |
|
1381 |
]. |
|
1382 |
] ifFalse:[ |
|
1383 |
lastSelectedMethods := selectedMethodsHolder value. |
|
1384 |
lastSelectedMethods notNil ifTrue:[ |
|
1385 |
lastSelectedMethods := lastSelectedMethods asOrderedCollection |
|
1386 |
]. |
|
1387 |
selectedMethodNameIndices value size > 0 ifTrue:[ |
|
1388 |
selectedMethodNameIndices value:#(). |
|
1389 |
] |
|
1390 |
]. |
|
5591 | 1391 |
|
7702 | 1392 |
newSelection ~= prevSelection ifTrue:[ |
1393 |
self selectionChanged. |
|
1394 |
] |
|
1395 |
] ifTrue:[ |
|
1396 |
"/ same list - but classes might have changed |
|
1397 |
"/ that is the case, if the class selection has been changed, |
|
1398 |
"/ to another class which has the same categories. |
|
5591 | 1399 |
|
7702 | 1400 |
(prevClasses size ~= classes size |
1401 |
or:[prevClasses asOrderedCollection ~= (classes ? #()) asOrderedCollection ]) ifTrue:[ |
|
1402 |
(newListSize > 0 or:[oldListSize > 0]) ifTrue:[ |
|
1403 |
self selectionChanged. |
|
1404 |
] |
|
1405 |
] |
|
1406 |
] |
|
5591 | 1407 |
"/ ]. |
1408 |
||
7702 | 1409 |
"Modified: / 05-03-2007 / 16:07:24 / cg" |
5591 | 1410 |
! |
1411 |
||
1412 |
updateListEntryFor:aMethod |
|
1413 |
"update my list for a single method. |
|
1414 |
(used when a single methods package, code or whatever changes, and a full udpate |
|
1415 |
would be too slow)" |
|
1416 |
||
1417 |
|s idx| |
|
1418 |
||
1419 |
s := self |
|
6268 | 1420 |
listEntryForMethod:aMethod |
1421 |
selector:aMethod selector |
|
1422 |
class:aMethod mclass |
|
1423 |
showClass:lastShowClass |
|
1424 |
showCategory:lastShowCategory |
|
1425 |
classFirst:lastShowClassFirst. |
|
5591 | 1426 |
|
1427 |
idx := methodList identityIndexOf:aMethod. |
|
1428 |
idx == 0 ifTrue:[ |
|
6268 | 1429 |
aMethod isWrapped ifTrue:[ |
1430 |
idx := methodList identityIndexOf:aMethod originalMethod. |
|
1431 |
] |
|
5591 | 1432 |
]. |
1433 |
idx == 0 ifTrue:[ |
|
6268 | 1434 |
self invalidateList |
5591 | 1435 |
] ifFalse:[ |
6268 | 1436 |
self browserNameList at:idx put:s. |
5591 | 1437 |
] |
1438 |
! ! |
|
1439 |
||
6271 | 1440 |
!MethodList methodsFor:'private-presentation'! |
1441 |
||
9451
79d033f585b9
added: #colorForCoverageInformationOfMethod:
Claus Gittinger <cg@exept.de>
parents:
9448
diff
changeset
|
1442 |
colorForCoverageInformationOfMethod:aMethod |
9430 | 1443 |
aMethod isInstrumented ifFalse:[^ nil]. |
9448
f9258f99d465
changed: #emphasisForCoverageInformationOfMethod:
Claus Gittinger <cg@exept.de>
parents:
9438
diff
changeset
|
1444 |
aMethod category = 'documentation' ifTrue:[^ nil]. |
9430 | 1445 |
|
1446 |
aMethod hasBeenCalled ifTrue:[ |
|
1447 |
aMethod haveAllBlocksBeenExecuted ifTrue:[ |
|
9451
79d033f585b9
added: #colorForCoverageInformationOfMethod:
Claus Gittinger <cg@exept.de>
parents:
9448
diff
changeset
|
1448 |
^ UserPreferences current colorForInstrumentedFullyCoveredCode |
9430 | 1449 |
]. |
9451
79d033f585b9
added: #colorForCoverageInformationOfMethod:
Claus Gittinger <cg@exept.de>
parents:
9448
diff
changeset
|
1450 |
^ UserPreferences current colorForInstrumentedPartiallyCoveredCode |
9430 | 1451 |
]. |
9451
79d033f585b9
added: #colorForCoverageInformationOfMethod:
Claus Gittinger <cg@exept.de>
parents:
9448
diff
changeset
|
1452 |
^ UserPreferences current colorForInstrumentedNeverCalledCode |
9430 | 1453 |
|
9451
79d033f585b9
added: #colorForCoverageInformationOfMethod:
Claus Gittinger <cg@exept.de>
parents:
9448
diff
changeset
|
1454 |
"Created: / 30-04-2010 / 11:53:38 / cg" |
9430 | 1455 |
! |
1456 |
||
6271 | 1457 |
listEntryForMethod:aMethod selector:selector class:cls showClass:showClass showCategory:showCategory classFirst:showClassFirst |
1458 |
"answer a method list entry |
|
1459 |
gimmics: |
|
1460 |
adding a little image to breakPointed methods, |
|
1461 |
inheritance indicators, |
|
1462 |
highlight accessors of variable" |
|
1463 |
||
1464 |
|clsName s icn variablesToHighlight classVarsToHighLight |
|
9451
79d033f585b9
added: #colorForCoverageInformationOfMethod:
Claus Gittinger <cg@exept.de>
parents:
9448
diff
changeset
|
1465 |
doHighLight doHighLightRed clr emp cat l redefIcon |
7502 | 1466 |
metrics complexity complexityString complexityIcon mark| |
6271 | 1467 |
|
9038
9b56d0b8c38e
required missing protocol display
Claus Gittinger <cg@exept.de>
parents:
9004
diff
changeset
|
1468 |
aMethod isNil ifTrue:[ |
9b56d0b8c38e
required missing protocol display
Claus Gittinger <cg@exept.de>
parents:
9004
diff
changeset
|
1469 |
"/ a non-existing (pseudo) method (such as required protocol) |
9b56d0b8c38e
required missing protocol display
Claus Gittinger <cg@exept.de>
parents:
9004
diff
changeset
|
1470 |
^ selector colorizeAllWith:Color red. |
9b56d0b8c38e
required missing protocol display
Claus Gittinger <cg@exept.de>
parents:
9004
diff
changeset
|
1471 |
]. |
9b56d0b8c38e
required missing protocol display
Claus Gittinger <cg@exept.de>
parents:
9004
diff
changeset
|
1472 |
|
6271 | 1473 |
aMethod isAssociation ifTrue:[ |
1474 |
self halt:'should not happen'. |
|
1475 |
]. |
|
1476 |
||
8638 | 1477 |
selector isNil ifTrue:[ |
1478 |
s := '???' |
|
1479 |
] ifFalse:[ |
|
1480 |
s := aMethod printStringForBrowserWithSelector:selector inClass:cls. |
|
1481 |
]. |
|
6271 | 1482 |
showClassFirst ifTrue:[ |
1483 |
clsName := cls nameInBrowser. |
|
1484 |
s := clsName , ' ' , s allBold |
|
1485 |
]. |
|
1486 |
||
1487 |
"/ |
|
1488 |
"/ wrap icons (i.e. break- or trace points) |
|
1489 |
"/ have higher prio ... |
|
1490 |
"/ |
|
9038
9b56d0b8c38e
required missing protocol display
Claus Gittinger <cg@exept.de>
parents:
9004
diff
changeset
|
1491 |
(aMethod notNil and:[aMethod isWrapped]) ifTrue:[ |
6271 | 1492 |
(s endsWith:' !!') ifTrue:[ |
1493 |
s := s copyWithoutLast:2 |
|
1494 |
]. |
|
1495 |
aMethod isBreakpointed ifTrue:[ |
|
1496 |
icn := self stopIcon |
|
1497 |
] ifFalse:[ |
|
1498 |
aMethod isTimed ifTrue:[ |
|
1499 |
icn := self timeIcon |
|
1500 |
] ifFalse:[ |
|
1501 |
icn := self traceIcon |
|
1502 |
] |
|
1503 |
]. |
|
1504 |
]. |
|
1505 |
||
1506 |
icn isNil ifTrue:[ |
|
8198 | 1507 |
self showImageResourceMethodsImages value ~~ false ifTrue:[ |
9252
ee7770f155ca
changed: #listEntryForMethod:selector:class:showClass:showCategory:classFirst:
Claus Gittinger <cg@exept.de>
parents:
9038
diff
changeset
|
1508 |
(aMethod hasImageResource) ifTrue:[ |
8474 | 1509 |
aMethod mclass isMeta ifTrue:[ |
1510 |
icn := aMethod valueWithReceiver:nil arguments:nil . |
|
8197
3b1c5bd94fdd
preps for showResourceImages
Claus Gittinger <cg@exept.de>
parents:
7994
diff
changeset
|
1511 |
]. |
3b1c5bd94fdd
preps for showResourceImages
Claus Gittinger <cg@exept.de>
parents:
7994
diff
changeset
|
1512 |
]. |
3b1c5bd94fdd
preps for showResourceImages
Claus Gittinger <cg@exept.de>
parents:
7994
diff
changeset
|
1513 |
]. |
3b1c5bd94fdd
preps for showResourceImages
Claus Gittinger <cg@exept.de>
parents:
7994
diff
changeset
|
1514 |
]. |
3b1c5bd94fdd
preps for showResourceImages
Claus Gittinger <cg@exept.de>
parents:
7994
diff
changeset
|
1515 |
|
3b1c5bd94fdd
preps for showResourceImages
Claus Gittinger <cg@exept.de>
parents:
7994
diff
changeset
|
1516 |
icn isNil ifTrue:[ |
6271 | 1517 |
showMethodTypeIcon value ~~ false ifTrue:[ |
1518 |
icn := self resourceIconForMethod:aMethod. |
|
1519 |
]. |
|
1520 |
icn isNil ifTrue:[ |
|
1521 |
aMethod isProtected ifTrue:[ |
|
1522 |
icn := self protectedMethodIcon |
|
1523 |
] ifFalse:[ |
|
1524 |
aMethod isPrivate ifTrue:[ |
|
1525 |
icn := self privateMethodIcon |
|
1526 |
] ifFalse:[ |
|
1527 |
(aMethod isIgnored) ifTrue:[ |
|
1528 |
icn := self ignoredMethodIcon |
|
1529 |
] ifFalse:[ |
|
1530 |
(aMethod isJavaMethod and:[aMethod isAbstract]) ifTrue:[ |
|
1531 |
icn := self abstractMethodIcon |
|
1532 |
] |
|
1533 |
] |
|
1534 |
] |
|
1535 |
]. |
|
1536 |
]. |
|
1537 |
]. |
|
1538 |
icn isNil ifTrue:[ |
|
1539 |
(selector startsWith:'test') ifTrue:[ |
|
10257 | 1540 |
((cls isSubclassOf:TestCase) |
1541 |
and:[cls isAbstract not]) ifTrue:[ |
|
1542 |
cls lastTestRunResultOrNil "== false" notNil ifTrue:[ |
|
6271 | 1543 |
(cls testSelectorFailed:selector) ifTrue:[ |
1544 |
icn := SystemBrowser testCaseFailedIcon |
|
1545 |
] ifFalse:[ |
|
10257 | 1546 |
(cls testSelectorPassed: selector) ifTrue: |
1547 |
[icn := SystemBrowser testCasePassedIcon] |
|
6271 | 1548 |
]. |
1549 |
] |
|
1550 |
]. |
|
1551 |
] |
|
1552 |
]. |
|
1553 |
||
1554 |
showClass ifTrue:[ |
|
1555 |
showClassFirst ifFalse:[ |
|
1556 |
s := s , ' [' , cls name allBold , ']'. |
|
1557 |
] |
|
1558 |
]. |
|
1559 |
showCategory ifTrue:[ |
|
1560 |
cat := aMethod category. |
|
1561 |
cat notNil ifTrue:[ |
|
1562 |
s := s , ' {' , cat "asText allItalic" , '}' |
|
1563 |
] |
|
1564 |
]. |
|
7502 | 1565 |
|
10257 | 1566 |
self showCoverageInformation value ifTrue:[ |
9451
79d033f585b9
added: #colorForCoverageInformationOfMethod:
Claus Gittinger <cg@exept.de>
parents:
9448
diff
changeset
|
1567 |
clr := self colorForCoverageInformationOfMethod:aMethod. |
79d033f585b9
added: #colorForCoverageInformationOfMethod:
Claus Gittinger <cg@exept.de>
parents:
9448
diff
changeset
|
1568 |
clr notNil ifTrue:[ |
79d033f585b9
added: #colorForCoverageInformationOfMethod:
Claus Gittinger <cg@exept.de>
parents:
9448
diff
changeset
|
1569 |
s := self colorize:s with:(#color->clr). |
9430 | 1570 |
"/ aMethod isInstrumented ifTrue:[ |
1571 |
"/ icn := self instrumentationIcon |
|
1572 |
"/ ]. |
|
1573 |
]. |
|
1574 |
] ifFalse:[ |
|
1575 |
(ChangeSet current includesChangeForClass:cls selector:selector) ifTrue:[ |
|
1576 |
mark := self class markForBeingInChangeList. |
|
1577 |
"/ mark := self colorizeForChangedCode:mark. |
|
1578 |
s := s , mark. |
|
1579 |
"/ cg: I dont know why this was disabled - it is req'd to |
|
1580 |
"/ see changed methods in a method list (implementors...) |
|
1581 |
s := self colorizeForChangedCode:s. |
|
1582 |
]. |
|
1583 |
||
1584 |
(SmallTeam notNil and:[SmallTeam includesChangeForClass:cls selector:selector]) ifTrue:[ |
|
1585 |
s := (self colorizeForChangedCodeInSmallTeam:'!! '),s |
|
1586 |
]. |
|
6841
6d72f92ed6cd
mark changed methods with a '*'
Claus Gittinger <cg@exept.de>
parents:
6789
diff
changeset
|
1587 |
]. |
6271 | 1588 |
|
1589 |
variablesToHighlight := variableFilter value. |
|
1590 |
variablesToHighlight size > 0 ifTrue:[ |
|
1591 |
classVarsToHighLight := filterClassVars value. |
|
1592 |
classVarsToHighLight ifTrue:[ |
|
1593 |
doHighLight := self method:aMethod includesRefsToClassVariable:variablesToHighlight. |
|
1594 |
doHighLight ifTrue:[ |
|
1595 |
doHighLightRed := self method:aMethod includesModsOfClassVariable:variablesToHighlight. |
|
1596 |
]. |
|
1597 |
] ifFalse:[ |
|
1598 |
doHighLight := self method:aMethod includesRefsToInstanceVariable:variablesToHighlight. |
|
1599 |
doHighLight ifTrue:[ |
|
1600 |
doHighLightRed := self method:aMethod includesModsOfInstanceVariable:variablesToHighlight |
|
1601 |
] |
|
1602 |
]. |
|
1603 |
doHighLight ifTrue:[ |
|
1604 |
s := s allBold. |
|
1605 |
doHighLightRed ifTrue:[ |
|
1606 |
emp := (UserPreferences current emphasisForWrittenVariable) |
|
1607 |
] ifFalse:[ |
|
1608 |
emp := (UserPreferences current emphasisForReadVariable) |
|
1609 |
]. |
|
1610 |
s := s emphasisAllAdd:emp |
|
1611 |
] |
|
1612 |
]. |
|
1613 |
||
6694 | 1614 |
(showMethodComplexity value == true |
6271 | 1615 |
and:[ OOM::MethodMetrics notNil ]) ifTrue:[ |
8197
3b1c5bd94fdd
preps for showResourceImages
Claus Gittinger <cg@exept.de>
parents:
7994
diff
changeset
|
1616 |
icn isNil ifTrue:[ |
3b1c5bd94fdd
preps for showResourceImages
Claus Gittinger <cg@exept.de>
parents:
7994
diff
changeset
|
1617 |
metrics := OOM::MethodMetrics forMethod:aMethod. |
3b1c5bd94fdd
preps for showResourceImages
Claus Gittinger <cg@exept.de>
parents:
7994
diff
changeset
|
1618 |
complexity := metrics complexity ? 0. |
3b1c5bd94fdd
preps for showResourceImages
Claus Gittinger <cg@exept.de>
parents:
7994
diff
changeset
|
1619 |
complexityIcon := OOM::MethodMetrics iconForComplexity:complexity. |
6271 | 1620 |
|
8197
3b1c5bd94fdd
preps for showResourceImages
Claus Gittinger <cg@exept.de>
parents:
7994
diff
changeset
|
1621 |
ShowComplexityValue == true ifTrue:[ |
3b1c5bd94fdd
preps for showResourceImages
Claus Gittinger <cg@exept.de>
parents:
7994
diff
changeset
|
1622 |
complexityString := '{' , complexity printString , '}'. |
3b1c5bd94fdd
preps for showResourceImages
Claus Gittinger <cg@exept.de>
parents:
7994
diff
changeset
|
1623 |
s := complexityString , ' ' , s. |
3b1c5bd94fdd
preps for showResourceImages
Claus Gittinger <cg@exept.de>
parents:
7994
diff
changeset
|
1624 |
]. |
3b1c5bd94fdd
preps for showResourceImages
Claus Gittinger <cg@exept.de>
parents:
7994
diff
changeset
|
1625 |
"/ icn := icn ? complexityIcon. |
3b1c5bd94fdd
preps for showResourceImages
Claus Gittinger <cg@exept.de>
parents:
7994
diff
changeset
|
1626 |
s := LabelAndIcon icon:complexityIcon string:s. |
6271 | 1627 |
]. |
1628 |
]. |
|
1629 |
||
1630 |
showMethodInheritance value ~~ false ifTrue:[ |
|
1631 |
redefIcon := self redefinedOrInheritedIconFor:aMethod. |
|
1632 |
]. |
|
1633 |
||
1634 |
(icn notNil or:[redefIcon notNil]) ifTrue:[ |
|
10257 | 1635 |
"/eXept version |
1636 |
"/l := LabelAndIcon icon:redefIcon string:s. |
|
1637 |
"/l image:icn. |
|
1638 |
"/JV: |
|
1639 |
l := LabelAndIcon icon:icn string:s. |
|
1640 |
l image:redefIcon. |
|
1641 |
icn ifNil:[l offset: 13]. |
|
1642 |
l gap:1. |
|
6271 | 1643 |
^ l |
1644 |
]. |
|
1645 |
^ s |
|
1646 |
||
6841
6d72f92ed6cd
mark changed methods with a '*'
Claus Gittinger <cg@exept.de>
parents:
6789
diff
changeset
|
1647 |
"Created: / 22-10-1996 / 19:51:00 / cg" |
10257 | 1648 |
"Modified: / 30-04-2010 / 11:54:32 / cg" |
1649 |
"Modified: / 15-08-2009 / 13:13:32 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
1650 |
"Modified: / 15-03-2010 / 18:16:54 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
6271 | 1651 |
! ! |
1652 |
||
5591 | 1653 |
!MethodList methodsFor:'private-watching'! |
1654 |
||
1655 |
startWatchProcess |
|
1656 |
updateProcess notNil ifTrue:[ |
|
10388 | 1657 |
^ self |
5591 | 1658 |
]. |
1659 |
updateProcess := [ |
|
10388 | 1660 |
[true] whileTrue:[ |
1661 |
Delay waitForSeconds:1. |
|
1662 |
self enqueueDelayedUpdateList |
|
1663 |
] |
|
1664 |
] fork. |
|
5591 | 1665 |
! |
1666 |
||
1667 |
stopWatchProcess |
|
1668 |
|p| |
|
1669 |
||
1670 |
(p := updateProcess) notNil ifTrue:[ |
|
10388 | 1671 |
updateProcess := nil. |
1672 |
p terminate |
|
5591 | 1673 |
]. |
1674 |
! ! |
|
1675 |
||
1676 |
!MethodList methodsFor:'setup'! |
|
1677 |
||
1678 |
postBuildWith:aBuilder |
|
1679 |
|methodListView| |
|
1680 |
||
1681 |
super postBuildWith:aBuilder. |
|
1682 |
||
1683 |
methodListView := aBuilder componentAt:'List'. |
|
1684 |
methodListView notNil ifTrue:[ |
|
6277 | 1685 |
methodListView allowDrag:true. |
1686 |
methodListView dragObjectConverter:[:obj | |
|
1687 |
|nm method idx| |
|
5591 | 1688 |
|
6277 | 1689 |
nm := obj theObject asString string string. |
1690 |
idx := browserNameList value findFirst:[:item | item string string = nm]. |
|
1691 |
method := methodList value at:idx. |
|
1692 |
DropObject newMethod:method. |
|
1693 |
]. |
|
5591 | 1694 |
] |
1695 |
! ! |
|
1696 |
||
1697 |
!MethodList class methodsFor:'documentation'! |
|
1698 |
||
10363 | 1699 |
version |
10388 | 1700 |
^ '$Header: /cvs/stx/stx/libtool/Tools_MethodList.st,v 1.56 2011-07-24 09:37:57 cg Exp $' |
10363 | 1701 |
! |
1702 |
||
9004
fbd6a4c325f6
changed: #methodIsRedefinedBelow:
Claus Gittinger <cg@exept.de>
parents:
8644
diff
changeset
|
1703 |
version_CVS |
10388 | 1704 |
^ '$Header: /cvs/stx/stx/libtool/Tools_MethodList.st,v 1.56 2011-07-24 09:37:57 cg Exp $' |
5591 | 1705 |
! ! |