author | Claus Gittinger <cg@exept.de> |
Mon, 12 Oct 2009 18:06:21 +0200 | |
changeset 8961 | 37e61f2e4cf1 |
parent 8931 | 8c8ce24dadb2 |
child 8964 | c10e1d1fd7a7 |
permissions | -rw-r--r-- |
5591 | 1 |
" |
2 |
COPYRIGHT (c) 2000 by eXept Software AG |
|
3 |
All Rights Reserved |
|
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 |
" |
|
5592 | 12 |
"{ Package: 'stx:libtool' }" |
5591 | 13 |
|
14 |
"{ NameSpace: Tools }" |
|
15 |
||
16 |
BrowserList subclass:#MethodCategoryList |
|
17 |
instanceVariableNames:'variableFilter filterClassVars lastSelectedProtocols classes |
|
18 |
leafClasses protocolList rawProtocolList selectedProtocolIndices |
|
8694 | 19 |
lastGeneratedProtocols packageFilterOnInput |
20 |
methodVisibilityHolder noAllItem noPseudoItems |
|
8860
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
21 |
showPseudoProtocols' |
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
22 |
classVariableNames:'AdditionalEmptyCategoriesPerClassName MethodInfoCache |
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
23 |
MethodInfoCacheAccessLock' |
5591 | 24 |
poolDictionaries:'' |
25 |
category:'Interface-Browsers-New' |
|
26 |
! |
|
27 |
||
8781
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
28 |
Object subclass:#CachedMethodInfo |
8860
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
29 |
instanceVariableNames:'flags' |
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
30 |
classVariableNames:'FlagObsolete FlagSendsSuper FlagIsUncommented |
8931 | 31 |
FlagIsDocumentationMethod FlagIsLongMethod FlagIsExtension |
32 |
FlagIsOverride' |
|
8781
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
33 |
poolDictionaries:'' |
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
34 |
privateIn:MethodCategoryList |
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
35 |
! |
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
36 |
|
5591 | 37 |
!MethodCategoryList class methodsFor:'documentation'! |
38 |
||
39 |
copyright |
|
40 |
" |
|
41 |
COPYRIGHT (c) 2000 by eXept Software AG |
|
42 |
All Rights Reserved |
|
43 |
||
44 |
This software is furnished under a license and may be used |
|
45 |
only in accordance with the terms of that license and with the |
|
46 |
inclusion of the above copyright notice. This software may not |
|
47 |
be provided or otherwise made available to, or used by, any |
|
48 |
other person. No title to or ownership of the software is |
|
49 |
hereby transferred. |
|
50 |
" |
|
51 |
! ! |
|
52 |
||
8860
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
53 |
!MethodCategoryList class methodsFor:'initialization'! |
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
54 |
|
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
55 |
flushMethodInfo |
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
56 |
MethodInfoCache := Dictionary new. |
8867 | 57 |
|
58 |
" |
|
59 |
self flushMethodInfo |
|
60 |
" |
|
8860
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
61 |
! |
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
62 |
|
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
63 |
initialize |
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
64 |
MethodInfoCache := Dictionary new. |
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
65 |
MethodInfoCacheAccessLock := RecursionLock new. |
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
66 |
! ! |
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
67 |
|
5591 | 68 |
!MethodCategoryList class methodsFor:'interface specs'! |
69 |
||
70 |
singleProtocolWindowSpec |
|
71 |
"This resource specification was automatically generated |
|
72 |
by the UIPainter of ST/X." |
|
73 |
||
74 |
"Do not manually edit this!! If it is corrupted, |
|
75 |
the UIPainter may not be able to read the specification." |
|
76 |
||
77 |
" |
|
78 |
UIPainter new openOnClass:MethodCategoryList andSelector:#singleProtocolWindowSpec |
|
79 |
MethodCategoryList new openInterface:#singleProtocolWindowSpec |
|
80 |
" |
|
81 |
||
82 |
<resource: #canvas> |
|
83 |
||
84 |
^ |
|
85 |
#(#FullSpec |
|
5592 | 86 |
#name: #singleProtocolWindowSpec |
87 |
#window: |
|
5591 | 88 |
#(#WindowSpec |
5592 | 89 |
#label: 'ProtocolList' |
90 |
#name: 'ProtocolList' |
|
91 |
#min: #(#Point 0 0) |
|
92 |
#max: #(#Point 1024 721) |
|
93 |
#bounds: #(#Rectangle 12 22 312 322) |
|
94 |
) |
|
95 |
#component: |
|
5591 | 96 |
#(#SpecCollection |
5592 | 97 |
#collection: #( |
98 |
#(#LabelSpec |
|
99 |
#label: 'ProtocolName' |
|
100 |
#name: 'ProtocolLabel' |
|
101 |
#layout: #(#LayoutFrame 0 0.0 0 0 0 1.0 25 0) |
|
102 |
#translateLabel: true |
|
103 |
#labelChannel: #protocolLabelHolder |
|
104 |
#menu: #menuHolder |
|
105 |
) |
|
106 |
) |
|
5591 | 107 |
|
5592 | 108 |
) |
5591 | 109 |
) |
110 |
! |
|
111 |
||
112 |
windowSpec |
|
113 |
"This resource specification was automatically generated |
|
114 |
by the UIPainter of ST/X." |
|
115 |
||
116 |
"Do not manually edit this!! If it is corrupted, |
|
117 |
the UIPainter may not be able to read the specification." |
|
118 |
||
119 |
" |
|
120 |
UIPainter new openOnClass:MethodCategoryList andSelector:#windowSpec |
|
121 |
MethodCategoryList new openInterface:#windowSpec |
|
122 |
MethodCategoryList open |
|
123 |
" |
|
124 |
||
125 |
<resource: #canvas> |
|
126 |
||
127 |
^ |
|
128 |
#(#FullSpec |
|
6469 | 129 |
#name: #windowSpec |
130 |
#window: |
|
5591 | 131 |
#(#WindowSpec |
6469 | 132 |
#label: 'ProtocolList' |
133 |
#name: 'ProtocolList' |
|
134 |
#min: #(#Point 0 0) |
|
135 |
#max: #(#Point 1024 721) |
|
136 |
#bounds: #(#Rectangle 16 46 316 346) |
|
137 |
) |
|
138 |
#component: |
|
5591 | 139 |
#(#SpecCollection |
6469 | 140 |
#collection: #( |
141 |
#(#SequenceViewSpec |
|
142 |
#name: 'List' |
|
143 |
#layout: #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0) |
|
144 |
#tabable: true |
|
145 |
#model: #selectedProtocolIndices |
|
146 |
#menu: #menuHolder |
|
147 |
#hasHorizontalScrollBar: true |
|
148 |
#hasVerticalScrollBar: true |
|
149 |
#miniScrollerHorizontal: true |
|
150 |
#isMultiSelect: true |
|
151 |
#valueChangeSelector: #selectionChangedByClick |
|
152 |
#useIndex: true |
|
153 |
#sequenceList: #protocolList |
|
154 |
#doubleClickChannel: #doubleClickChannel |
|
155 |
#properties: |
|
156 |
#(#PropertyListDictionary |
|
157 |
#dragArgument: nil |
|
158 |
#dropArgument: nil |
|
159 |
#canDropSelector: #canDropContext: |
|
160 |
#dropSelector: #doDropContext: |
|
161 |
) |
|
162 |
) |
|
163 |
) |
|
5591 | 164 |
|
6469 | 165 |
) |
5591 | 166 |
) |
167 |
! ! |
|
168 |
||
169 |
!MethodCategoryList class methodsFor:'plugIn spec'! |
|
170 |
||
171 |
aspectSelectors |
|
172 |
"This resource specification was automatically generated |
|
173 |
by the UIPainter of ST/X." |
|
174 |
||
175 |
"Do not manually edit this. If it is corrupted, |
|
176 |
the UIPainter may not be able to read the specification." |
|
177 |
||
178 |
"Return a description of exported aspects; |
|
179 |
these can be connected to aspects of an embedding application |
|
180 |
(if this app is embedded in a subCanvas)." |
|
181 |
||
182 |
^ #( |
|
8694 | 183 |
#(#doubleClickChannel #action ) |
184 |
#filterClassVars |
|
185 |
#forceGeneratorTrigger |
|
186 |
#immediateUpdate |
|
187 |
#inGeneratorHolder |
|
188 |
#menuHolder |
|
189 |
#noAllItem |
|
190 |
#showPseudoProtocols |
|
191 |
#outGeneratorHolder |
|
192 |
#packageFilter |
|
193 |
#packageFilterOnInput |
|
194 |
#selectedProtocols |
|
195 |
#selectionChangeCondition |
|
196 |
#updateTrigger |
|
197 |
#variableFilter |
|
198 |
#methodVisibilityHolder |
|
5591 | 199 |
). |
200 |
! ! |
|
201 |
||
202 |
!MethodCategoryList methodsFor:'aspects'! |
|
203 |
||
204 |
browserNameList |
|
205 |
^ self protocolList |
|
206 |
! |
|
207 |
||
208 |
defaultSlaveModeValue |
|
209 |
^ false. |
|
210 |
! |
|
211 |
||
212 |
filterClassVars |
|
213 |
filterClassVars isNil ifTrue:[ |
|
214 |
filterClassVars := false asValue. |
|
215 |
filterClassVars addDependent:self |
|
216 |
]. |
|
217 |
^ filterClassVars |
|
218 |
||
219 |
"Modified: / 31.1.2000 / 00:56:31 / cg" |
|
220 |
"Created: / 5.2.2000 / 13:42:10 / cg" |
|
221 |
! |
|
222 |
||
223 |
filterClassVars:aValueHolder |
|
224 |
filterClassVars notNil ifTrue:[ |
|
225 |
filterClassVars removeDependent:self |
|
226 |
]. |
|
227 |
filterClassVars := aValueHolder. |
|
228 |
filterClassVars notNil ifTrue:[ |
|
229 |
filterClassVars addDependent:self |
|
230 |
]. |
|
231 |
||
232 |
"Modified: / 31.1.2000 / 00:56:31 / cg" |
|
233 |
"Created: / 5.2.2000 / 13:42:10 / cg" |
|
234 |
! |
|
235 |
||
236 |
methodVisibilityHolder |
|
237 |
methodVisibilityHolder isNil ifTrue:[ |
|
238 |
methodVisibilityHolder := false asValue. |
|
239 |
methodVisibilityHolder addDependent:self |
|
240 |
]. |
|
241 |
^ methodVisibilityHolder |
|
242 |
! |
|
243 |
||
244 |
methodVisibilityHolder:aValueHolder |
|
245 |
methodVisibilityHolder notNil ifTrue:[ |
|
246 |
methodVisibilityHolder removeDependent:self |
|
247 |
]. |
|
248 |
methodVisibilityHolder := aValueHolder. |
|
249 |
methodVisibilityHolder notNil ifTrue:[ |
|
250 |
methodVisibilityHolder addDependent:self |
|
251 |
]. |
|
252 |
||
253 |
"Modified: / 31.1.2000 / 00:56:31 / cg" |
|
254 |
"Created: / 5.2.2000 / 13:42:10 / cg" |
|
255 |
! |
|
256 |
||
257 |
noAllItem |
|
258 |
noAllItem isNil ifTrue:[ |
|
259 |
noAllItem := false asValue. |
|
260 |
noAllItem addDependent:self |
|
261 |
]. |
|
262 |
^ noAllItem |
|
263 |
! |
|
264 |
||
265 |
noAllItem:aValueHolder |
|
266 |
noAllItem notNil ifTrue:[ |
|
267 |
noAllItem removeDependent:self |
|
268 |
]. |
|
269 |
noAllItem := aValueHolder. |
|
270 |
noAllItem notNil ifTrue:[ |
|
271 |
noAllItem addDependent:self |
|
272 |
]. |
|
273 |
! |
|
274 |
||
275 |
packageFilterOnInput |
|
276 |
packageFilterOnInput isNil ifTrue:[ |
|
277 |
packageFilterOnInput := nil asValue. |
|
278 |
packageFilterOnInput addDependent:self |
|
279 |
]. |
|
280 |
^ packageFilterOnInput |
|
281 |
! |
|
282 |
||
283 |
packageFilterOnInput:aValueHolder |
|
284 |
|prevFilter| |
|
285 |
||
286 |
prevFilter := packageFilterOnInput value. |
|
287 |
packageFilterOnInput notNil ifTrue:[ |
|
288 |
packageFilterOnInput removeDependent:self |
|
289 |
]. |
|
290 |
packageFilterOnInput := aValueHolder. |
|
291 |
packageFilterOnInput notNil ifTrue:[ |
|
292 |
packageFilterOnInput addDependent:self |
|
293 |
]. |
|
294 |
prevFilter ~= packageFilterOnInput value ifTrue:[ |
|
295 |
self enqueueDelayedUpdateList |
|
296 |
]. |
|
297 |
! |
|
298 |
||
299 |
protocolLabelHolder |
|
300 |
^ self pseudoListLabelHolder |
|
301 |
! |
|
302 |
||
303 |
protocolList |
|
304 |
protocolList isNil ifTrue:[ |
|
305 |
protocolList := List new. "/ ValueHolder new |
|
306 |
]. |
|
307 |
^ protocolList |
|
308 |
||
309 |
"Modified: / 31.1.2000 / 00:56:31 / cg" |
|
310 |
"Created: / 5.2.2000 / 13:42:10 / cg" |
|
311 |
! |
|
312 |
||
313 |
rawProtocolList |
|
314 |
rawProtocolList isNil ifTrue:[ |
|
315 |
rawProtocolList := List new. |
|
316 |
]. |
|
317 |
^ rawProtocolList |
|
318 |
! |
|
319 |
||
320 |
selectedProtocolIndices |
|
321 |
selectedProtocolIndices isNil ifTrue:[ |
|
322 |
selectedProtocolIndices := ValueHolder new. |
|
323 |
selectedProtocolIndices addDependent:self |
|
324 |
]. |
|
325 |
^ selectedProtocolIndices. |
|
326 |
! |
|
327 |
||
328 |
selectedProtocols |
|
329 |
^ self selectionHolder |
|
330 |
! |
|
331 |
||
332 |
selectedProtocols:aValueHolder |
|
333 |
^ self selectionHolder:aValueHolder |
|
334 |
! |
|
335 |
||
8694 | 336 |
showPseudoProtocols |
337 |
showPseudoProtocols isNil ifTrue:[ |
|
338 |
showPseudoProtocols := true asValue. |
|
339 |
showPseudoProtocols addDependent:self |
|
340 |
]. |
|
341 |
^ showPseudoProtocols |
|
342 |
! |
|
343 |
||
344 |
showPseudoProtocols:aValueHolder |
|
345 |
showPseudoProtocols notNil ifTrue:[ |
|
346 |
showPseudoProtocols removeDependent:self |
|
347 |
]. |
|
348 |
showPseudoProtocols := aValueHolder. |
|
349 |
showPseudoProtocols notNil ifTrue:[ |
|
350 |
showPseudoProtocols addDependent:self |
|
351 |
]. |
|
352 |
! |
|
353 |
||
5591 | 354 |
variableFilter |
355 |
variableFilter isNil ifTrue:[ |
|
356 |
variableFilter := false asValue. |
|
357 |
variableFilter addDependent:self |
|
358 |
]. |
|
359 |
^ variableFilter |
|
360 |
||
361 |
"Modified: / 31.1.2000 / 00:56:31 / cg" |
|
362 |
"Created: / 5.2.2000 / 13:42:10 / cg" |
|
363 |
! |
|
364 |
||
365 |
variableFilter:aValueHolder |
|
366 |
variableFilter notNil ifTrue:[ |
|
367 |
variableFilter removeDependent:self |
|
368 |
]. |
|
369 |
variableFilter := aValueHolder. |
|
370 |
variableFilter notNil ifTrue:[ |
|
371 |
variableFilter addDependent:self |
|
372 |
]. |
|
373 |
||
374 |
"Modified: / 31.1.2000 / 00:56:31 / cg" |
|
375 |
"Created: / 5.2.2000 / 13:42:10 / cg" |
|
376 |
! ! |
|
377 |
||
378 |
!MethodCategoryList methodsFor:'change & update'! |
|
379 |
||
380 |
classDefinitionChanged:aClass |
|
381 |
|refetch anyChange| |
|
382 |
||
383 |
anyChange := false. |
|
384 |
refetch := [:oldClass | |
|
385 |
|nm cls newClass| |
|
386 |
||
387 |
nm := oldClass theNonMetaclass name. |
|
388 |
oldClass isMeta ifTrue:[ |
|
389 |
newClass := Smalltalk at:nm. |
|
390 |
newClass isNil ifTrue:[ |
|
391 |
Transcript showCR:'oops - browser lost class ' , nm. |
|
392 |
newClass := oldClass |
|
393 |
] ifFalse:[ |
|
394 |
newClass := newClass theMetaclass |
|
395 |
] |
|
396 |
] ifFalse:[ |
|
397 |
newClass := Smalltalk at:nm |
|
398 |
]. |
|
399 |
newClass ~~ oldClass ifTrue:[ |
|
400 |
anyChange := true. |
|
401 |
]. |
|
402 |
newClass |
|
403 |
]. |
|
404 |
||
405 |
classes := classes collect:refetch. |
|
406 |
leafClasses := leafClasses collect:refetch. |
|
407 |
anyChange ifTrue:[ |
|
408 |
self updateOutputGenerator |
|
409 |
]. |
|
410 |
! |
|
411 |
||
412 |
delayedUpdate:something with:aParameter from:changedObject |
|
413 |
|sel oldMethod newMethod mthd selectedCategories selectedProtocolsHolder oldProtocol newProtocol |
|
414 |
rawProtocolListHolder rawProtocolList oldSelectedProtocols newSelectedProtocols newIndices idx cls listView| |
|
415 |
||
416 |
selectedProtocolsHolder := self selectedProtocols. |
|
417 |
rawProtocolListHolder := self rawProtocolList. |
|
418 |
||
419 |
changedObject == Smalltalk ifTrue:[ |
|
6412 | 420 |
classes notNil ifTrue:[ |
421 |
something == #methodCategory ifTrue:[ |
|
422 |
cls := aParameter at:1. |
|
423 |
(cls notNil and:[classes includesIdentical:cls]) ifTrue:[ |
|
424 |
mthd := aParameter at:2. |
|
425 |
newProtocol := mthd category. |
|
426 |
oldProtocol := aParameter at:3. |
|
5591 | 427 |
|
6412 | 428 |
self invalidateList. |
5591 | 429 |
|
6412 | 430 |
selectedCategories := selectedProtocolsHolder value. |
431 |
selectedCategories size > 0 ifTrue:[ |
|
432 |
selectedCategories := selectedCategories collect:[:each | each ifNil:[self class nameListEntryForNILCategory]]. |
|
433 |
selectedCategories := selectedCategories collect:[:each | each string]. |
|
5591 | 434 |
|
6412 | 435 |
((selectedCategories includes:oldProtocol) |
436 |
or:[ (selectedCategories includes:newProtocol) |
|
437 |
or:[ selectedCategories includes:(self class nameListEntryForALL) ]]) |
|
438 |
ifTrue:[ |
|
439 |
self updateOutputGenerator. |
|
440 |
]. |
|
441 |
]. |
|
5591 | 442 |
|
6412 | 443 |
]. |
444 |
^ self |
|
445 |
]. |
|
5591 | 446 |
|
6412 | 447 |
something == #methodInClass ifTrue:[ |
448 |
"/ a method has been added/removed/changed |
|
449 |
cls := aParameter at:1. |
|
450 |
(classes includesIdentical:cls) ifTrue:[ |
|
451 |
sel := aParameter at:2. |
|
8781
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
452 |
self flushMethodInfoForClassNamed:cls name selector:sel. |
6412 | 453 |
oldMethod := aParameter at:3. |
454 |
newMethod := cls compiledMethodAt:sel. |
|
455 |
oldMethod notNil ifTrue:[ |
|
456 |
variableFilter value size > 0 ifTrue:[ |
|
457 |
"/ sigh - must invalidate |
|
458 |
self invalidateList. |
|
459 |
]. |
|
460 |
^ self. |
|
461 |
]. |
|
462 |
"/ method was added - update the methodList |
|
463 |
"/ Q: is this needed (methodCategoryList should send me a new inGenerator) |
|
464 |
self invalidateList. |
|
5591 | 465 |
|
6412 | 466 |
"/ if its category is selected, updateOutputGenerator |
467 |
selectedCategories := selectedProtocolsHolder value. |
|
468 |
selectedCategories size > 0 ifTrue:[ |
|
469 |
selectedCategories := selectedCategories collect:[:each | each ifNil:[self class nameListEntryForNILCategory]]. |
|
470 |
selectedCategories := selectedCategories collect:[:each | each string]. |
|
5591 | 471 |
|
6412 | 472 |
((oldMethod notNil and:[selectedCategories includes:(oldMethod category)]) |
473 |
or:[ (newMethod notNil and:[selectedCategories includes:(newMethod category)])]) |
|
474 |
ifTrue:[ |
|
475 |
self updateOutputGenerator. |
|
476 |
]. |
|
477 |
]. |
|
478 |
]. |
|
479 |
^ self. |
|
480 |
]. |
|
5591 | 481 |
|
6412 | 482 |
something == #methodInClassRemoved ifTrue:[ |
483 |
cls := aParameter at:1. |
|
484 |
(classes includesIdentical:cls) ifTrue:[ |
|
485 |
sel := aParameter at:2. |
|
8781
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
486 |
self flushMethodInfoForClassNamed:cls name selector:sel. |
6412 | 487 |
"/ method was removed - update the list and output generator |
488 |
self invalidateList. |
|
489 |
"/ self updateOutputGenerator. |
|
490 |
self slaveMode value == true ifFalse:[ |
|
491 |
self enqueueDelayedUpdateOutputGenerator. |
|
492 |
] |
|
493 |
]. |
|
494 |
^ self. |
|
495 |
]. |
|
5591 | 496 |
|
6664
50eb2e92aaed
changed change-update aspect when changing some method category
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
497 |
(something == #classOrganization |
50eb2e92aaed
changed change-update aspect when changing some method category
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
498 |
or:[ something == #methodCategoryAdded |
50eb2e92aaed
changed change-update aspect when changing some method category
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
499 |
or:[ something == #methodCategoryRemoved |
50eb2e92aaed
changed change-update aspect when changing some method category
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
500 |
or:[ something == #methodCategoriesRemoved |
50eb2e92aaed
changed change-update aspect when changing some method category
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
501 |
or:[ something == #methodCategoryRenamed ]]]]) ifTrue:[ |
50eb2e92aaed
changed change-update aspect when changing some method category
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
502 |
cls := (something == #classOrganization) ifTrue:aParameter ifFalse:[aParameter first]. |
6412 | 503 |
(classes includesIdentical:cls) ifTrue:[ |
504 |
self invalidateList. |
|
505 |
] ifFalse:[ |
|
506 |
(classes contains:[:aClass | aClass name = cls name]) ifTrue:[ |
|
507 |
self invalidateList. |
|
508 |
"/ self error:'obsolete class: should not happen'. |
|
509 |
] |
|
510 |
]. |
|
511 |
^ self. |
|
512 |
]. |
|
5591 | 513 |
|
6412 | 514 |
something == #projectOrganization ifTrue:[ |
515 |
aParameter notNil ifTrue:[ |
|
516 |
cls := aParameter at:1. |
|
517 |
cls notNil ifTrue:[ |
|
518 |
((classes includes:cls theMetaclass) |
|
519 |
or:[(classes includes:cls theNonMetaclass)]) ifTrue:[ |
|
520 |
self invalidateList. |
|
521 |
self slaveMode value == true ifFalse:[ |
|
522 |
self enqueueDelayedUpdateOutputGenerator. |
|
523 |
] |
|
524 |
]. |
|
525 |
]. |
|
526 |
] ifFalse:[ |
|
527 |
self invalidateList. |
|
528 |
]. |
|
529 |
^ self |
|
530 |
]. |
|
5591 | 531 |
|
6412 | 532 |
(something == #classDefinition or:[something == #classVariables]) |
533 |
ifTrue:[ |
|
534 |
self classDefinitionChanged:aParameter. |
|
535 |
^ self |
|
536 |
]. |
|
5591 | 537 |
|
6412 | 538 |
"/ everything else is ignored |
539 |
"/ self halt. |
|
540 |
]. |
|
541 |
^ self |
|
5591 | 542 |
]. |
543 |
||
544 |
changedObject == self selectedProtocolIndices ifTrue:[ |
|
6412 | 545 |
oldSelectedProtocols := selectedProtocolsHolder value ? #(). |
546 |
oldSelectedProtocols := oldSelectedProtocols collect:[:each | each ifNil:[self class nameListEntryForNILCategory]]. |
|
547 |
oldSelectedProtocols := oldSelectedProtocols collect:[:each | each string]. |
|
548 |
newSelectedProtocols := self getSelectedProtocolsFromIndices. |
|
549 |
oldSelectedProtocols ~= newSelectedProtocols ifTrue:[ |
|
550 |
selectedProtocolsHolder value:newSelectedProtocols. |
|
551 |
]. |
|
552 |
newSelectedProtocols size > 1 ifTrue:[ |
|
553 |
(newSelectedProtocols includes:(self class nameListEntryForALL)) ifTrue:[ |
|
554 |
rawProtocolList := rawProtocolListHolder value. |
|
555 |
idx := rawProtocolList indexOf: (newSelectedProtocols copy remove:(self class nameListEntryForALL); yourself) first. |
|
556 |
idx ~~ 0 ifTrue:[ |
|
8742 | 557 |
(listView := self componentAt:#List) notNil ifTrue:[ |
6412 | 558 |
listView makeLineVisible:idx. |
559 |
] |
|
560 |
] |
|
561 |
] |
|
562 |
]. |
|
5591 | 563 |
|
6412 | 564 |
^ self |
5591 | 565 |
]. |
566 |
||
567 |
changedObject == selectedProtocolsHolder ifTrue:[ |
|
6412 | 568 |
rawProtocolList := rawProtocolListHolder value. |
569 |
rawProtocolList size == 0 ifTrue:[ |
|
570 |
self updateList. |
|
571 |
rawProtocolList := rawProtocolListHolder value. |
|
572 |
]. |
|
573 |
rawProtocolList notNil ifTrue:[ |
|
574 |
selectedCategories := selectedProtocolsHolder value ? #(). |
|
575 |
selectedCategories := selectedCategories collect:[:each | each ifNil:[self class nameListEntryForNILCategory]]. |
|
576 |
newIndices := selectedCategories |
|
577 |
collect:[:each | rawProtocolList findFirst:[:p | p string = each string]]. |
|
578 |
newIndices := newIndices select:[:each | each ~~ 0]. |
|
579 |
newIndices ~= self selectedProtocolIndices value ifTrue:[ |
|
580 |
self selectedProtocolIndices setValue:nil. "/ to force update |
|
581 |
self selectedProtocolIndices value:newIndices |
|
582 |
]. |
|
583 |
(lastGeneratedProtocols notNil |
|
584 |
and:[(lastGeneratedProtocols includes:self class nameListEntryForALL) |
|
585 |
and:[(selectedProtocolsHolder value ? #()) includes:self class nameListEntryForALL]]) |
|
586 |
ifTrue:[ |
|
587 |
"/ no need to update generator |
|
588 |
] ifFalse:[ |
|
589 |
self updateOutputGenerator. |
|
590 |
] |
|
591 |
]. |
|
592 |
^ self |
|
5591 | 593 |
]. |
594 |
||
595 |
(changedObject == variableFilter |
|
596 |
or:[changedObject == filterClassVars |
|
597 |
or:[changedObject == packageFilterOnInput]]) ifTrue:[ |
|
6412 | 598 |
self invalidateList. |
599 |
^ self |
|
5591 | 600 |
]. |
601 |
||
602 |
changedObject == methodVisibilityHolder ifTrue:[ |
|
6412 | 603 |
self invalidateList. |
604 |
self updateOutputGenerator. |
|
605 |
^ self |
|
5591 | 606 |
]. |
607 |
||
608 |
lastGeneratedProtocols := nil. |
|
609 |
||
610 |
changedObject == inGeneratorHolder ifTrue:[ |
|
6412 | 611 |
selectedCategories := selectedProtocolsHolder value. |
5591 | 612 |
|
6412 | 613 |
selectedCategories size > 0 ifTrue:[ |
614 |
oldSelectedProtocols := selectedCategories ? #(). |
|
615 |
oldSelectedProtocols := oldSelectedProtocols collect:[:each | each ifNil:[self class nameListEntryForNILCategory]]. |
|
616 |
oldSelectedProtocols := oldSelectedProtocols collect:[:each | each string]. |
|
617 |
self updateList. |
|
618 |
rawProtocolList := rawProtocolListHolder value. |
|
619 |
newSelectedProtocols := oldSelectedProtocols select:[:each | rawProtocolList includes:each]. |
|
5591 | 620 |
"/ selectedProtocolsHolder setValue:nil. "/ to force update |
6412 | 621 |
selectedProtocolsHolder value:newSelectedProtocols. |
622 |
^ self |
|
623 |
]. |
|
5591 | 624 |
]. |
625 |
||
626 |
super delayedUpdate:something with:aParameter from:changedObject |
|
627 |
||
628 |
"Created: / 5.2.2000 / 13:42:10 / cg" |
|
629 |
"Modified: / 29.2.2000 / 11:11:39 / cg" |
|
630 |
! |
|
631 |
||
632 |
getSelectedProtocolsFromIndices |
|
633 |
|l| |
|
634 |
||
635 |
l := self rawProtocolList value. |
|
636 |
^ self selectedProtocolIndices value collect:[:idx | l at:idx]. |
|
637 |
! |
|
638 |
||
639 |
selectionChanged |
|
640 |
|newSelectedCategories allEntry| |
|
641 |
||
642 |
newSelectedCategories := self selectedProtocols value. |
|
643 |
||
644 |
"/ the outputGenerator is only to be updated, if the output would really |
|
645 |
"/ change ... |
|
646 |
allEntry := self class nameListEntryForALL. |
|
647 |
||
648 |
(lastSelectedProtocols notNil |
|
649 |
and:[newSelectedCategories notNil |
|
650 |
and:[(lastSelectedProtocols includes:(allEntry)) |
|
651 |
and:[newSelectedCategories includes:(allEntry)]]]) ifTrue:[ |
|
652 |
"/ no change ... |
|
653 |
^ self |
|
654 |
]. |
|
655 |
||
656 |
super selectionChanged. |
|
657 |
||
658 |
"Created: / 5.2.2000 / 13:42:10 / cg" |
|
659 |
"Modified: / 24.2.2000 / 14:12:12 / cg" |
|
660 |
! |
|
661 |
||
662 |
selectionChangedByClick |
|
663 |
"we are not interested in that - get another notification |
|
664 |
via the changed valueHolder" |
|
665 |
||
666 |
lastSelectedProtocols := self getSelectedProtocolsFromIndices |
|
667 |
! |
|
668 |
||
669 |
update:something with:aParameter from:changedObject |
|
6855
93bacd7fcf14
much faster update (only invalidate once, when multiple methods are compiled)
Claus Gittinger <cg@exept.de>
parents:
6706
diff
changeset
|
670 |
|cls sel oldMethod newMethod| |
5591 | 671 |
|
672 |
"/ some can be ignored immediately |
|
673 |
changedObject == Smalltalk ifTrue:[ |
|
6855
93bacd7fcf14
much faster update (only invalidate once, when multiple methods are compiled)
Claus Gittinger <cg@exept.de>
parents:
6706
diff
changeset
|
674 |
something isNil ifTrue:[ |
93bacd7fcf14
much faster update (only invalidate once, when multiple methods are compiled)
Claus Gittinger <cg@exept.de>
parents:
6706
diff
changeset
|
675 |
"/ self halt "/ huh - Smalltalk changed - so what ? |
93bacd7fcf14
much faster update (only invalidate once, when multiple methods are compiled)
Claus Gittinger <cg@exept.de>
parents:
6706
diff
changeset
|
676 |
^ self. |
93bacd7fcf14
much faster update (only invalidate once, when multiple methods are compiled)
Claus Gittinger <cg@exept.de>
parents:
6706
diff
changeset
|
677 |
]. |
6880 | 678 |
|
679 |
something == #currentChangeSet ifTrue:[ |
|
680 |
self invalidateList. |
|
681 |
^ self. |
|
682 |
]. |
|
683 |
||
6855
93bacd7fcf14
much faster update (only invalidate once, when multiple methods are compiled)
Claus Gittinger <cg@exept.de>
parents:
6706
diff
changeset
|
684 |
something == #methodInClass ifTrue:[ |
93bacd7fcf14
much faster update (only invalidate once, when multiple methods are compiled)
Claus Gittinger <cg@exept.de>
parents:
6706
diff
changeset
|
685 |
"/ a method has been added/removed/changed |
93bacd7fcf14
much faster update (only invalidate once, when multiple methods are compiled)
Claus Gittinger <cg@exept.de>
parents:
6706
diff
changeset
|
686 |
cls := aParameter at:1. |
93bacd7fcf14
much faster update (only invalidate once, when multiple methods are compiled)
Claus Gittinger <cg@exept.de>
parents:
6706
diff
changeset
|
687 |
(classes notNil and:[classes includesIdentical:cls]) ifFalse:[^ self]. |
8781
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
688 |
|
6855
93bacd7fcf14
much faster update (only invalidate once, when multiple methods are compiled)
Claus Gittinger <cg@exept.de>
parents:
6706
diff
changeset
|
689 |
sel := aParameter at:2. |
8781
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
690 |
self flushMethodInfoForClassNamed:cls name selector:sel. |
6855
93bacd7fcf14
much faster update (only invalidate once, when multiple methods are compiled)
Claus Gittinger <cg@exept.de>
parents:
6706
diff
changeset
|
691 |
oldMethod := aParameter at:3. |
93bacd7fcf14
much faster update (only invalidate once, when multiple methods are compiled)
Claus Gittinger <cg@exept.de>
parents:
6706
diff
changeset
|
692 |
newMethod := cls compiledMethodAt:sel. |
93bacd7fcf14
much faster update (only invalidate once, when multiple methods are compiled)
Claus Gittinger <cg@exept.de>
parents:
6706
diff
changeset
|
693 |
oldMethod notNil ifTrue:[ |
93bacd7fcf14
much faster update (only invalidate once, when multiple methods are compiled)
Claus Gittinger <cg@exept.de>
parents:
6706
diff
changeset
|
694 |
variableFilter value size > 0 ifTrue:[ |
93bacd7fcf14
much faster update (only invalidate once, when multiple methods are compiled)
Claus Gittinger <cg@exept.de>
parents:
6706
diff
changeset
|
695 |
"/ sigh - must invalidate |
93bacd7fcf14
much faster update (only invalidate once, when multiple methods are compiled)
Claus Gittinger <cg@exept.de>
parents:
6706
diff
changeset
|
696 |
self invalidateList. |
93bacd7fcf14
much faster update (only invalidate once, when multiple methods are compiled)
Claus Gittinger <cg@exept.de>
parents:
6706
diff
changeset
|
697 |
^ self. |
93bacd7fcf14
much faster update (only invalidate once, when multiple methods are compiled)
Claus Gittinger <cg@exept.de>
parents:
6706
diff
changeset
|
698 |
]. |
93bacd7fcf14
much faster update (only invalidate once, when multiple methods are compiled)
Claus Gittinger <cg@exept.de>
parents:
6706
diff
changeset
|
699 |
oldMethod category ~= newMethod category ifTrue:[ |
93bacd7fcf14
much faster update (only invalidate once, when multiple methods are compiled)
Claus Gittinger <cg@exept.de>
parents:
6706
diff
changeset
|
700 |
self invalidateList. |
93bacd7fcf14
much faster update (only invalidate once, when multiple methods are compiled)
Claus Gittinger <cg@exept.de>
parents:
6706
diff
changeset
|
701 |
^ self. |
93bacd7fcf14
much faster update (only invalidate once, when multiple methods are compiled)
Claus Gittinger <cg@exept.de>
parents:
6706
diff
changeset
|
702 |
]. |
93bacd7fcf14
much faster update (only invalidate once, when multiple methods are compiled)
Claus Gittinger <cg@exept.de>
parents:
6706
diff
changeset
|
703 |
"/ mhmh - its now changed (so coloring will change). |
93bacd7fcf14
much faster update (only invalidate once, when multiple methods are compiled)
Claus Gittinger <cg@exept.de>
parents:
6706
diff
changeset
|
704 |
self invalidateList. |
93bacd7fcf14
much faster update (only invalidate once, when multiple methods are compiled)
Claus Gittinger <cg@exept.de>
parents:
6706
diff
changeset
|
705 |
^ self. |
93bacd7fcf14
much faster update (only invalidate once, when multiple methods are compiled)
Claus Gittinger <cg@exept.de>
parents:
6706
diff
changeset
|
706 |
]. |
93bacd7fcf14
much faster update (only invalidate once, when multiple methods are compiled)
Claus Gittinger <cg@exept.de>
parents:
6706
diff
changeset
|
707 |
]. |
93bacd7fcf14
much faster update (only invalidate once, when multiple methods are compiled)
Claus Gittinger <cg@exept.de>
parents:
6706
diff
changeset
|
708 |
|
5591 | 709 |
"/ something == #classDefinition ifTrue:[ |
710 |
"/ ^ self. |
|
711 |
"/ ]. |
|
6855
93bacd7fcf14
much faster update (only invalidate once, when multiple methods are compiled)
Claus Gittinger <cg@exept.de>
parents:
6706
diff
changeset
|
712 |
something == #newClass ifTrue:[ |
93bacd7fcf14
much faster update (only invalidate once, when multiple methods are compiled)
Claus Gittinger <cg@exept.de>
parents:
6706
diff
changeset
|
713 |
^ self. |
93bacd7fcf14
much faster update (only invalidate once, when multiple methods are compiled)
Claus Gittinger <cg@exept.de>
parents:
6706
diff
changeset
|
714 |
]. |
93bacd7fcf14
much faster update (only invalidate once, when multiple methods are compiled)
Claus Gittinger <cg@exept.de>
parents:
6706
diff
changeset
|
715 |
something == #classRemove ifTrue:[ |
93bacd7fcf14
much faster update (only invalidate once, when multiple methods are compiled)
Claus Gittinger <cg@exept.de>
parents:
6706
diff
changeset
|
716 |
^ self. |
93bacd7fcf14
much faster update (only invalidate once, when multiple methods are compiled)
Claus Gittinger <cg@exept.de>
parents:
6706
diff
changeset
|
717 |
]. |
93bacd7fcf14
much faster update (only invalidate once, when multiple methods are compiled)
Claus Gittinger <cg@exept.de>
parents:
6706
diff
changeset
|
718 |
something == #classRename ifTrue:[ |
93bacd7fcf14
much faster update (only invalidate once, when multiple methods are compiled)
Claus Gittinger <cg@exept.de>
parents:
6706
diff
changeset
|
719 |
^ self. |
93bacd7fcf14
much faster update (only invalidate once, when multiple methods are compiled)
Claus Gittinger <cg@exept.de>
parents:
6706
diff
changeset
|
720 |
]. |
5591 | 721 |
"/ something == #classVariables ifTrue:[ |
722 |
"/ ^ self. |
|
723 |
"/ ]. |
|
6855
93bacd7fcf14
much faster update (only invalidate once, when multiple methods are compiled)
Claus Gittinger <cg@exept.de>
parents:
6706
diff
changeset
|
724 |
something == #classComment ifTrue:[ |
93bacd7fcf14
much faster update (only invalidate once, when multiple methods are compiled)
Claus Gittinger <cg@exept.de>
parents:
6706
diff
changeset
|
725 |
^ self. |
93bacd7fcf14
much faster update (only invalidate once, when multiple methods are compiled)
Claus Gittinger <cg@exept.de>
parents:
6706
diff
changeset
|
726 |
]. |
93bacd7fcf14
much faster update (only invalidate once, when multiple methods are compiled)
Claus Gittinger <cg@exept.de>
parents:
6706
diff
changeset
|
727 |
something == #organization ifTrue:[ |
93bacd7fcf14
much faster update (only invalidate once, when multiple methods are compiled)
Claus Gittinger <cg@exept.de>
parents:
6706
diff
changeset
|
728 |
^ self. |
93bacd7fcf14
much faster update (only invalidate once, when multiple methods are compiled)
Claus Gittinger <cg@exept.de>
parents:
6706
diff
changeset
|
729 |
]. |
93bacd7fcf14
much faster update (only invalidate once, when multiple methods are compiled)
Claus Gittinger <cg@exept.de>
parents:
6706
diff
changeset
|
730 |
something == #methodTrap ifTrue:[ |
93bacd7fcf14
much faster update (only invalidate once, when multiple methods are compiled)
Claus Gittinger <cg@exept.de>
parents:
6706
diff
changeset
|
731 |
^ self |
93bacd7fcf14
much faster update (only invalidate once, when multiple methods are compiled)
Claus Gittinger <cg@exept.de>
parents:
6706
diff
changeset
|
732 |
]. |
5591 | 733 |
]. |
734 |
||
735 |
super update:something with:aParameter from:changedObject. |
|
6880 | 736 |
|
737 |
"Modified: / 10-08-2006 / 17:23:48 / cg" |
|
5591 | 738 |
! ! |
739 |
||
740 |
!MethodCategoryList methodsFor:'drag & drop'! |
|
741 |
||
6469 | 742 |
canDropContext:aDropContext |
5591 | 743 |
|cat methods| |
744 |
||
745 |
methods := aDropContext dropObjects collect:[:obj | obj theObject]. |
|
7123 | 746 |
(methods conform:[:aMethod | aMethod isMethod]) ifFalse:[^ false]. |
5591 | 747 |
|
748 |
cat := self categoryAtTargetPointOf:aDropContext. |
|
6492 | 749 |
cat isNil ifTrue:[^ false]. |
5591 | 750 |
|
751 |
(methods contains:[:aMethod | aMethod category ~= cat]) ifFalse:[^ false]. |
|
6492 | 752 |
^ true |
7123 | 753 |
|
754 |
"Modified: / 13-09-2006 / 11:44:02 / cg" |
|
5591 | 755 |
! |
756 |
||
757 |
categoryAtTargetPointOf:aDropContext |
|
758 |
|p methodListView lineNr cat| |
|
759 |
||
760 |
p := aDropContext targetPoint. |
|
761 |
||
762 |
methodListView := aDropContext targetWidget. |
|
763 |
||
764 |
lineNr := methodListView lineAtY:p y. |
|
765 |
lineNr isNil ifTrue:[^ nil]. |
|
766 |
||
767 |
cat := rawProtocolList at:lineNr. |
|
768 |
cat := cat string. |
|
769 |
cat = self class nameListEntryForALL ifTrue:[^ nil]. |
|
770 |
||
771 |
^ cat |
|
772 |
! |
|
773 |
||
6469 | 774 |
doDropContext:aDropContext |
5591 | 775 |
|cat methods| |
776 |
||
777 |
methods := aDropContext dropObjects collect:[:aDropObject | aDropObject theObject]. |
|
7123 | 778 |
(methods conform:[:something | something isMethod]) ifFalse:[^ self]. |
5591 | 779 |
|
780 |
cat := self categoryAtTargetPointOf:aDropContext. |
|
781 |
cat notNil ifTrue:[ |
|
6469 | 782 |
self masterApplication moveMethods:methods toProtocol:cat. |
5591 | 783 |
]. |
7123 | 784 |
|
785 |
"Modified: / 13-09-2006 / 11:43:23 / cg" |
|
5591 | 786 |
! ! |
787 |
||
788 |
!MethodCategoryList methodsFor:'generators'! |
|
789 |
||
790 |
makeGenerator |
|
791 |
"return a generator which enumerates the methods from the selected protocol; |
|
792 |
that generator generates 4-element elements (includes the class and protocol), |
|
793 |
in order to make the consumers only depend on one input |
|
794 |
(i.e. to pass multiple-class and multiple-protocol info |
|
795 |
without a need for another classHolder/protocolHolder in the methodList)." |
|
796 |
||
8694 | 797 |
^ Iterator |
798 |
on:[:whatToDo | |
|
799 |
|protocols |
|
8867 | 800 |
allProtocols superSendProtocols uncommentedProtocols obsoleteProtocols |
8931 | 801 |
documentationProtocols longProtocols extensionProtocols overrideProtocols |
8694 | 802 |
noCat static notStatic classSelectorPairsAlreadyDone |
803 |
packages remainingClasses remainingCategories classesAlreadyDone noPackage| |
|
5591 | 804 |
|
8694 | 805 |
noPackage := Project noProjectID. |
806 |
noCat := (self class nameListEntryForNILCategory). |
|
807 |
static := (self class nameListEntryForStatic). |
|
808 |
notStatic := (self class nameListEntryForNonStatic). |
|
5591 | 809 |
|
8694 | 810 |
protocols := self selectedProtocols value ? #(). |
811 |
protocols := protocols collect:[:each | (each ifNil:[noCat]) string]. |
|
812 |
lastGeneratedProtocols := protocols. |
|
813 |
protocols := protocols asSet. |
|
814 |
||
815 |
(leafClasses size > 0 and:[protocols size > 0]) ifTrue:[ |
|
816 |
allProtocols := protocols includes:(self class nameListEntryForALL). |
|
817 |
superSendProtocols := protocols includes:(self class nameListEntryForSuperSend). |
|
818 |
uncommentedProtocols := protocols includes:(self class nameListEntryForUncommented). |
|
8718 | 819 |
obsoleteProtocols := protocols includes:(self class nameListEntryForObsolete). |
8733 | 820 |
documentationProtocols := protocols includes:(self class nameListEntryForDocumentation). |
8867 | 821 |
longProtocols := protocols includes:(self class nameListEntryForLong). |
8931 | 822 |
extensionProtocols := protocols includes:(self class nameListEntryForExtensions). |
823 |
overrideProtocols := protocols includes:(self class nameListEntryForOverride). |
|
5591 | 824 |
|
8694 | 825 |
"/ packages := packageFilter value value. |
826 |
"/ (packages notNil and:[packages includes:(self class nameListEntryForALL)]) ifTrue:[ |
|
827 |
"/ packages := nil. |
|
828 |
"/ ]. |
|
5591 | 829 |
|
8694 | 830 |
remainingClasses := leafClasses copy asIdentitySet. |
831 |
remainingCategories := protocols copy asSet. |
|
5591 | 832 |
|
8694 | 833 |
classesAlreadyDone := IdentitySet new. |
834 |
classSelectorPairsAlreadyDone := Set new. |
|
5591 | 835 |
|
8694 | 836 |
leafClasses do:[:aLeafClass | |
837 |
(self classesToProcessForClasses:(Array with:aLeafClass)) do:[:aClass | |
|
838 |
|supportsMethodCategories isJavaClass anyInThisClass| |
|
5591 | 839 |
|
8694 | 840 |
(classesAlreadyDone includes:aClass) ifFalse:[ |
841 |
classesAlreadyDone add:aClass. |
|
5591 | 842 |
|
8694 | 843 |
supportsMethodCategories := aClass supportsMethodCategories. |
844 |
isJavaClass := aClass isJavaClass. |
|
845 |
anyInThisClass := false. |
|
5591 | 846 |
|
8694 | 847 |
aClass methodDictionary keysAndValuesDo:[:sel :mthd | |
8781
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
848 |
|cat mPkg includeIt info| |
5591 | 849 |
|
8694 | 850 |
supportsMethodCategories ifTrue:[ |
851 |
cat := mthd category. |
|
852 |
] ifFalse:[ |
|
853 |
isJavaClass ifTrue:[ |
|
854 |
cat := mthd isStatic ifTrue:[static] ifFalse:[notStatic] |
|
855 |
] ifFalse:[ |
|
856 |
cat := noCat. |
|
857 |
] |
|
858 |
]. |
|
8781
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
859 |
mPkg := mthd package. |
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
860 |
(packages isNil or:[mPkg = noPackage or:[packages includes:mPkg]]) |
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
861 |
ifTrue:[ |
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
862 |
"/ used to be a more readable or, but to reuse info, I've splitted it. |
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
863 |
"/ because we should use the parser only once, we reuse the same methodInfo. |
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
864 |
"/ otherwise, the list update becomes too slow for long classes (NewSystemBrowser) |
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
865 |
includeIt := allProtocols. |
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
866 |
includeIt ifFalse:[ includeIt := protocols includes:cat ]. |
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
867 |
includeIt ifFalse:[ |
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
868 |
superSendProtocols ifTrue:[ |
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
869 |
info isNil ifTrue:[ info := self methodInfoFor:mthd ]. |
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
870 |
includeIt := info sendsSuper ]]. |
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
871 |
includeIt ifFalse:[ |
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
872 |
uncommentedProtocols ifTrue:[ |
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
873 |
info isNil ifTrue:[ info := self methodInfoFor:mthd ]. |
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
874 |
includeIt := info isUncommented ]]. |
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
875 |
includeIt ifFalse:[ |
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
876 |
obsoleteProtocols ifTrue:[ |
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
877 |
info isNil ifTrue:[ info := self methodInfoFor:mthd ]. |
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
878 |
includeIt := info isObsolete ]]. |
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
879 |
includeIt ifFalse:[ |
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
880 |
documentationProtocols ifTrue:[ |
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
881 |
info isNil ifTrue:[ info := self methodInfoFor:mthd ]. |
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
882 |
includeIt := info isDocumentationMethod ]]. |
8867 | 883 |
includeIt ifFalse:[ |
884 |
longProtocols ifTrue:[ |
|
885 |
info isNil ifTrue:[ info := self methodInfoFor:mthd ]. |
|
886 |
includeIt := info isLongMethod ]]. |
|
8931 | 887 |
includeIt ifFalse:[ |
888 |
extensionProtocols ifTrue:[ |
|
889 |
info isNil ifTrue:[ info := self methodInfoFor:mthd ]. |
|
890 |
includeIt := info isExtensionMethod ]]. |
|
891 |
includeIt ifFalse:[ |
|
892 |
overrideProtocols ifTrue:[ |
|
893 |
info isNil ifTrue:[ info := self methodInfoFor:mthd ]. |
|
894 |
includeIt := info isOverride ]]. |
|
8781
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
895 |
|
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
896 |
includeIt ifTrue:[ |
8694 | 897 |
(methodVisibilityHolder value == #class) ifTrue:[ |
898 |
whatToDo value:aClass value:cat value:sel value:mthd. |
|
899 |
] ifFalse:[ |
|
900 |
(classSelectorPairsAlreadyDone includes:(aLeafClass->sel)) ifFalse:[ |
|
901 |
classSelectorPairsAlreadyDone add:(aLeafClass->sel). |
|
902 |
whatToDo value:aClass value:cat value:sel value:mthd. |
|
903 |
]. |
|
904 |
]. |
|
905 |
anyInThisClass := true. |
|
906 |
remainingCategories remove:cat ifAbsent:nil. |
|
907 |
] |
|
908 |
] |
|
7296
dfea12500274
do not suppress loose methods
Claus Gittinger <cg@exept.de>
parents:
7123
diff
changeset
|
909 |
]. |
8694 | 910 |
anyInThisClass ifTrue:[ remainingClasses remove:aClass ifAbsent:nil. ]. |
911 |
]. |
|
912 |
]. |
|
913 |
]. |
|
914 |
remainingClasses do:[:aClass | |
|
915 |
whatToDo value:aClass value:nil value:nil value:nil. |
|
916 |
]. |
|
917 |
remainingCategories do:[:cat | |
|
918 |
whatToDo value:nil value:cat value:nil value:nil. |
|
919 |
] |
|
920 |
] |
|
921 |
] |
|
5591 | 922 |
|
7296
dfea12500274
do not suppress loose methods
Claus Gittinger <cg@exept.de>
parents:
7123
diff
changeset
|
923 |
"Created: / 05-02-2000 / 13:42:10 / cg" |
7398
8a3a5fac2001
also show methods for other packages in the generated list
Claus Gittinger <cg@exept.de>
parents:
7296
diff
changeset
|
924 |
"Modified: / 13-10-2006 / 01:16:17 / cg" |
5591 | 925 |
! ! |
926 |
||
927 |
!MethodCategoryList methodsFor:'private'! |
|
928 |
||
929 |
class:cls protocol:cat includesMethodsInAnyPackage:packageFilter |
|
930 |
cls methodDictionary keysAndValuesDo:[:sel :mthd | |
|
931 |
mthd category == cat ifTrue:[ |
|
932 |
(packageFilter includes:mthd package) ifTrue:[ |
|
933 |
^ true |
|
934 |
] |
|
935 |
] |
|
936 |
]. |
|
937 |
^ false |
|
938 |
! |
|
939 |
||
940 |
class:cls protocol:cat includesModsOfClassVariable:variablesToHighLight |
|
941 |
^ self class:cls protocol:cat includesRefsToVariable:variablesToHighLight askParserWith:#modifiedClassVars |
|
942 |
! |
|
943 |
||
944 |
class:cls protocol:cat includesModsOfInstanceVariable:variablesToHighLight |
|
945 |
^ self class:cls protocol:cat includesRefsToVariable:variablesToHighLight askParserWith:#modifiedInstVars |
|
946 |
! |
|
947 |
||
948 |
class:cls protocol:cat includesRefsToClassVariable:variablesToHighLight |
|
949 |
^ self class:cls protocol:cat includesRefsToVariable:variablesToHighLight askParserWith:#usedClassVars |
|
950 |
! |
|
951 |
||
952 |
class:cls protocol:cat includesRefsToInstanceVariable:variablesToHighLight |
|
953 |
^ self class:cls protocol:cat includesRefsToVariable:variablesToHighLight askParserWith:#usedInstVars |
|
954 |
! |
|
955 |
||
956 |
class:cls protocol:cat includesRefsToVariable:variablesToHighLight askParserWith:querySelector |
|
957 |
|anyVarNameAccessable| |
|
958 |
||
959 |
anyVarNameAccessable := cls allInstVarNames includesAny:variablesToHighLight. |
|
960 |
anyVarNameAccessable ifFalse:[ |
|
961 |
anyVarNameAccessable := cls theNonMetaclass allClassVarNames includesAny:variablesToHighLight. |
|
962 |
]. |
|
963 |
anyVarNameAccessable ifFalse:[ |
|
964 |
"/ no need to parse |
|
965 |
^ false |
|
966 |
]. |
|
967 |
||
968 |
cls selectorsAndMethodsDo:[:sel :mthd | |
|
969 |
|src parser usedVars| |
|
970 |
||
971 |
mthd category = cat ifTrue:[ |
|
972 |
src := mthd source. |
|
973 |
src notNil ifTrue:[ |
|
974 |
" |
|
975 |
before doing a slow parse, quickly scan the |
|
976 |
methods source for the variables name ... |
|
977 |
" |
|
978 |
(variablesToHighLight contains:[:varName | (src findString:varName) ~~ 0]) ifTrue:[ |
|
979 |
parser := Parser |
|
980 |
parseMethod:src |
|
981 |
in:cls |
|
982 |
ignoreErrors:true |
|
983 |
ignoreWarnings:true. |
|
984 |
(parser notNil and:[parser ~~ #Error]) ifTrue:[ |
|
985 |
usedVars := parser perform:querySelector. |
|
986 |
(usedVars includesAny:variablesToHighLight) |
|
987 |
ifTrue:[ |
|
988 |
^ true |
|
989 |
] |
|
990 |
] |
|
991 |
] |
|
992 |
] ifFalse:[ |
|
993 |
Transcript showCR:'Oops - cannot access methods source'. |
|
994 |
] |
|
995 |
] |
|
996 |
]. |
|
997 |
^ false |
|
998 |
! |
|
999 |
||
1000 |
classesToProcessForClasses:classes |
|
1001 |
^ self classesToProcessForClasses:classes withVisibility:methodVisibilityHolder value. |
|
1002 |
! |
|
1003 |
||
8961 | 1004 |
commonPostOpen |
1005 |
super commonPostOpen. |
|
1006 |
||
1007 |
self showPseudoProtocols ifTrue:[ |
|
1008 |
"/ revalidate my list, because it was only shown lazy |
|
1009 |
self invalidateList. |
|
1010 |
]. |
|
1011 |
! |
|
1012 |
||
8781
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
1013 |
flushMethodInfoForClassNamed:className selector:selector |
8860
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
1014 |
MethodInfoCacheAccessLock critical:[ |
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
1015 |
MethodInfoCache |
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
1016 |
removeKey:(className,'>>',selector) |
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
1017 |
ifAbsent:[] |
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
1018 |
] |
8781
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
1019 |
! |
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
1020 |
|
5591 | 1021 |
listOfMethodCategories |
1022 |
|categoryList plainCategories classesProcessed leafClassesProcessed |
|
1023 |
generator nm variablesToHighlight classVarsToHighLight |
|
1024 |
itemsWithVarRefs itemsWithVarMods itemsWithExtensions itemsWithSuppressedExtensions |
|
7501 | 1025 |
itemsInChangeSet itemsInRemoteChangeSet |
8723 | 1026 |
packageFilterOnInput packageFilter nameListEntryForALL changeSet |
1027 |
emphasizedPlus emphasisForRef emphasisForMod |
|
8931 | 1028 |
numObsolete numSuper numUncommented numDocumentation numLong numOverride |
8961 | 1029 |
numExtension showPseudoProtocols| |
5591 | 1030 |
|
1031 |
generator := inGeneratorHolder value. |
|
1032 |
generator isNil ifTrue:[ ^ #() ]. |
|
1033 |
||
8961 | 1034 |
showPseudoProtocols := self showPseudoProtocols |
1035 |
and:[ builder window shown ]. |
|
1036 |
||
5591 | 1037 |
nameListEntryForALL := self class nameListEntryForALL. |
1038 |
||
1039 |
packageFilterOnInput := self packageFilterOnInput value. |
|
1040 |
(packageFilterOnInput notNil and:[packageFilterOnInput includes:nameListEntryForALL]) ifTrue:[ |
|
5814 | 1041 |
packageFilterOnInput := nil |
5591 | 1042 |
]. |
1043 |
packageFilter := self packageFilter value. |
|
1044 |
(packageFilter notNil and:[packageFilter includes:nameListEntryForALL]) ifTrue:[ |
|
5814 | 1045 |
packageFilter := nil |
5591 | 1046 |
]. |
1047 |
||
1048 |
categoryList := Set new. |
|
1049 |
itemsWithVarRefs := Set new. |
|
1050 |
itemsWithVarMods := Set new. |
|
1051 |
itemsWithExtensions := Set new. |
|
1052 |
itemsWithSuppressedExtensions := Set new. |
|
1053 |
itemsInChangeSet := Set new. |
|
7501 | 1054 |
itemsInRemoteChangeSet := Set new. |
5591 | 1055 |
plainCategories := Set new. |
1056 |
classesProcessed := IdentitySet new. |
|
1057 |
leafClassesProcessed := IdentitySet new. |
|
1058 |
variablesToHighlight := variableFilter value. |
|
1059 |
classVarsToHighLight := filterClassVars value. |
|
8867 | 1060 |
numObsolete := numSuper := numUncommented := numDocumentation := numLong := 0. |
8931 | 1061 |
numOverride := numExtension := 0. |
5591 | 1062 |
|
1063 |
generator do:[:clsIn :catIn | |
|
5814 | 1064 |
|emptyProtocols clsName doHighLight doHighLightRed suppress| |
5591 | 1065 |
|
5814 | 1066 |
leafClassesProcessed add:clsIn. |
1067 |
(self classesToProcessForClasses:(Array with:clsIn)) do:[:cls | |
|
1068 |
|cats| |
|
5591 | 1069 |
|
5814 | 1070 |
classesProcessed add:cls. |
5591 | 1071 |
|
5814 | 1072 |
cls ~~ clsIn ifTrue:[ |
1073 |
cats := cls categories |
|
1074 |
] ifFalse:[ |
|
1075 |
cats := Array with:catIn. |
|
1076 |
]. |
|
1077 |
cats do:[:cat | |
|
1078 |
cat notNil ifTrue:[ |
|
1079 |
suppress := packageFilterOnInput notNil |
|
1080 |
and:[ (self class:cls protocol:cat includesMethodsInAnyPackage:packageFilterOnInput) not ]. |
|
5591 | 1081 |
|
5814 | 1082 |
suppress ifFalse:[ |
8723 | 1083 |
variablesToHighlight notEmptyOrNil ifTrue:[ |
5814 | 1084 |
(itemsWithVarRefs includes:cat) ifFalse:[ |
1085 |
classVarsToHighLight ifTrue:[ |
|
1086 |
doHighLight := self class:cls protocol:cat includesRefsToClassVariable:variablesToHighlight. |
|
1087 |
doHighLight ifTrue:[ |
|
1088 |
doHighLightRed := self class:cls protocol:cat includesModsOfClassVariable:variablesToHighlight. |
|
1089 |
]. |
|
1090 |
] ifFalse:[ |
|
1091 |
doHighLight := self class:cls protocol:cat includesRefsToInstanceVariable:variablesToHighlight. |
|
1092 |
doHighLight ifTrue:[ |
|
1093 |
doHighLightRed := self class:cls protocol:cat includesModsOfInstanceVariable:variablesToHighlight. |
|
1094 |
]. |
|
1095 |
]. |
|
1096 |
doHighLight ifTrue:[ |
|
1097 |
itemsWithVarRefs add:cat. |
|
1098 |
doHighLightRed ifTrue:[ |
|
1099 |
itemsWithVarMods add:cat. |
|
1100 |
]. |
|
1101 |
] |
|
1102 |
] |
|
8733 | 1103 |
]. |
8961 | 1104 |
showPseudoProtocols value ifTrue:[ |
8742 | 1105 |
cls selectorsAndMethodsDo:[:sel :mthd | |
8781
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
1106 |
|info| |
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
1107 |
|
8742 | 1108 |
mthd category = cat ifTrue:[ |
8781
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
1109 |
info := self methodInfoFor:mthd. |
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
1110 |
info isObsolete ifTrue:[ numObsolete := numObsolete + 1 ]. |
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
1111 |
info sendsSuper ifTrue:[ numSuper := numSuper + 1 ]. |
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
1112 |
info isUncommented ifTrue:[ numUncommented := numUncommented + 1 ]. |
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
1113 |
info isDocumentationMethod ifTrue:[ numDocumentation := numDocumentation + 1 ]. |
8867 | 1114 |
info isLongMethod ifTrue:[ numLong := numLong + 1 ]. |
8931 | 1115 |
info isExtensionMethod ifTrue:[ numExtension := numExtension + 1 ]. |
1116 |
info isOverride ifTrue:[ numOverride := numOverride + 1 ]. |
|
8742 | 1117 |
] |
1118 |
]. |
|
8723 | 1119 |
]. |
1120 |
||
5814 | 1121 |
categoryList add:cat. |
5591 | 1122 |
|
5814 | 1123 |
AdditionalEmptyCategoriesPerClassName size > 0 ifTrue:[ |
1124 |
clsName := cls name. |
|
1125 |
emptyProtocols := AdditionalEmptyCategoriesPerClassName at:clsName ifAbsent:nil. |
|
1126 |
emptyProtocols size > 0 ifTrue:[ |
|
1127 |
emptyProtocols remove:cat ifAbsent:nil. |
|
1128 |
]. |
|
1129 |
emptyProtocols size == 0 ifTrue:[ |
|
1130 |
AdditionalEmptyCategoriesPerClassName removeKey:clsName ifAbsent:nil |
|
1131 |
]. |
|
1132 |
]. |
|
1133 |
] |
|
1134 |
] |
|
1135 |
] |
|
1136 |
] |
|
1137 |
]. |
|
1138 |
||
1139 |
changeSet := ChangeSet current. |
|
5591 | 1140 |
|
1141 |
classesProcessed do:[:eachClass | |
|
5814 | 1142 |
|classPackage| |
5591 | 1143 |
|
5814 | 1144 |
classPackage := eachClass package. |
6706 | 1145 |
eachClass methodDictionary keysAndValuesDo:[:mSelector :mthd | |
5814 | 1146 |
|mPackage mCategory| |
5591 | 1147 |
|
5814 | 1148 |
mPackage := mthd package. |
1149 |
mCategory := mthd category. |
|
5591 | 1150 |
|
5814 | 1151 |
#fixme. |
1152 |
mPackage = classPackage ifTrue:[ |
|
1153 |
mPackage ~~ classPackage ifTrue:[ |
|
1154 |
mthd setPackage:(mPackage := mPackage string asSymbol). |
|
1155 |
] |
|
1156 |
]. |
|
1157 |
mPackage ~~ classPackage ifTrue:[ |
|
6877 | 1158 |
mPackage ~= Project noProjectID ifTrue:[ |
1159 |
itemsWithExtensions add:mCategory. |
|
5591 | 1160 |
|
6877 | 1161 |
(packageFilter notNil |
1162 |
and:[ (packageFilter includes:mPackage) not]) |
|
1163 |
ifTrue:[ |
|
1164 |
itemsWithSuppressedExtensions add:mCategory. |
|
1165 |
]. |
|
5814 | 1166 |
]. |
1167 |
]. |
|
6706 | 1168 |
(changeSet includesChangeForClass:eachClass selector:mSelector) ifTrue:[ |
1169 |
itemsInChangeSet add:mCategory. |
|
7501 | 1170 |
]. |
1171 |
(SmallTeam notNil and:[ SmallTeam includesChangeForClass:eachClass selector:mSelector] ) ifTrue:[ |
|
1172 |
itemsInRemoteChangeSet add:mCategory. |
|
1173 |
]. |
|
5814 | 1174 |
] |
5591 | 1175 |
]. |
1176 |
||
1177 |
categoryList := categoryList asOrderedCollection. |
|
1178 |
self rawProtocolList removeAll. |
|
1179 |
rawProtocolList addAll:categoryList. |
|
1180 |
||
6698 | 1181 |
emphasizedPlus := (self colorizeForDifferentPackage:' [ + ]'). |
1182 |
emphasisForRef := UserPreferences current emphasisForReadVariable. |
|
1183 |
emphasisForMod := UserPreferences current emphasisForWrittenVariable. |
|
1184 |
||
6704 | 1185 |
(itemsInChangeSet notEmpty |
7501 | 1186 |
or:[itemsInRemoteChangeSet notEmpty |
6704 | 1187 |
or:[itemsWithExtensions notEmpty |
7501 | 1188 |
or:[itemsWithVarRefs notEmpty]] ]) ifTrue:[ |
6698 | 1189 |
rawProtocolList keysAndValuesDo:[:idx :cat | |
7501 | 1190 |
|item inChangeSet inRemoteChangeSet hasExtensions hasVarRef hasVarMod| |
5591 | 1191 |
|
6698 | 1192 |
item := cat. |
7501 | 1193 |
|
6701 | 1194 |
inChangeSet := itemsInChangeSet includes:cat. |
1195 |
inChangeSet ifTrue:[ |
|
1196 |
item := self colorizeForChangedCode:cat. |
|
1197 |
]. |
|
1198 |
||
7501 | 1199 |
inRemoteChangeSet := itemsInRemoteChangeSet includes:cat. |
1200 |
inRemoteChangeSet ifTrue:[ |
|
1201 |
item := (self colorizeForChangedCodeInSmallTeam:'!! '),item. |
|
1202 |
]. |
|
1203 |
||
6698 | 1204 |
hasVarRef := itemsWithVarRefs includes:cat. |
1205 |
hasVarRef ifTrue:[ |
|
1206 |
hasVarMod := itemsWithVarMods includes:cat. |
|
6701 | 1207 |
item := item asText |
1208 |
emphasisAllAdd:(hasVarMod ifTrue:emphasisForMod ifFalse:emphasisForRef). |
|
1209 |
]. |
|
5591 | 1210 |
|
6701 | 1211 |
hasExtensions := itemsWithExtensions includes:cat. |
1212 |
hasExtensions ifTrue:[ |
|
1213 |
item := item , emphasizedPlus. |
|
6698 | 1214 |
]. |
6877 | 1215 |
inChangeSet ifTrue:[ |
7056 | 1216 |
item := item , self class markForBeingInChangeList. |
6877 | 1217 |
]. |
6698 | 1218 |
categoryList at:idx put:item. |
1219 |
] |
|
5591 | 1220 |
]. |
1221 |
||
1222 |
classesProcessed size > 0 ifTrue:[ |
|
5814 | 1223 |
"/ those are simulated - in ST/X, empty categories do not |
1224 |
"/ really exist; however, during browsing, it makes sense. |
|
1225 |
AdditionalEmptyCategoriesPerClassName size > 0 ifTrue:[ |
|
1226 |
AdditionalEmptyCategoriesPerClassName keysAndValuesDo:[:clsName :protocols | |
|
1227 |
(classesProcessed contains:[:cls | cls name = clsName]) ifTrue:[ |
|
1228 |
categoryList addAll:protocols. |
|
1229 |
rawProtocolList addAll:protocols. |
|
1230 |
] |
|
1231 |
] |
|
1232 |
]. |
|
5591 | 1233 |
]. |
1234 |
||
1235 |
self makeIndependent. |
|
1236 |
classes := classesProcessed. |
|
1237 |
leafClasses := leafClassesProcessed. |
|
1238 |
self makeDependent. |
|
1239 |
||
1240 |
rawProtocolList sortWith:categoryList. |
|
1241 |
categoryList size == 1 ifTrue:[ |
|
5814 | 1242 |
nm := categoryList first string. |
1243 |
classes size == 1 ifTrue:[ |
|
1244 |
nm := classes first name , '-' , nm |
|
1245 |
]. |
|
1246 |
self protocolLabelHolder value:nm |
|
5591 | 1247 |
]. |
1248 |
categoryList notEmpty ifTrue:[ |
|
5814 | 1249 |
noAllItem value ~~ true ifTrue:[ |
8694 | 1250 |
categoryList addFirst:(nameListEntryForALL asText allItalic). |
5814 | 1251 |
rawProtocolList addFirst:nameListEntryForALL. |
8694 | 1252 |
]. |
8961 | 1253 |
showPseudoProtocols value ifTrue:[ |
8723 | 1254 |
numSuper > 0 ifTrue:[ |
1255 |
categoryList add:((self class nameListEntryForSuperSend bindWith:numSuper) asText allItalic). |
|
1256 |
rawProtocolList add:self class nameListEntryForSuperSend. |
|
1257 |
]. |
|
8733 | 1258 |
numDocumentation > 0 ifTrue:[ |
1259 |
categoryList add:((self class nameListEntryForDocumentation bindWith:numDocumentation) asText allItalic). |
|
1260 |
rawProtocolList add:self class nameListEntryForDocumentation. |
|
1261 |
]. |
|
8723 | 1262 |
numUncommented > 0 ifTrue:[ |
1263 |
categoryList add:((self class nameListEntryForUncommented bindWith:numUncommented) asText allItalic). |
|
1264 |
rawProtocolList add:self class nameListEntryForUncommented. |
|
1265 |
]. |
|
8867 | 1266 |
numLong > 0 ifTrue:[ |
1267 |
categoryList add:((self class nameListEntryForLong bindWith:numLong) asText allItalic). |
|
1268 |
rawProtocolList add:self class nameListEntryForLong. |
|
1269 |
]. |
|
8723 | 1270 |
numObsolete > 0 ifTrue:[ |
1271 |
categoryList add:((self class nameListEntryForObsolete bindWith:numObsolete) asText allItalic). |
|
1272 |
rawProtocolList add:self class nameListEntryForObsolete. |
|
8733 | 1273 |
]. |
8931 | 1274 |
numExtension > 0 ifTrue:[ |
1275 |
categoryList add:((self class nameListEntryForExtensions bindWith:numExtension) asText allItalic). |
|
1276 |
rawProtocolList add:self class nameListEntryForExtensions. |
|
1277 |
]. |
|
1278 |
numOverride > 0 ifTrue:[ |
|
1279 |
categoryList add:((self class nameListEntryForOverride bindWith:numOverride) asText allItalic). |
|
1280 |
rawProtocolList add:self class nameListEntryForOverride. |
|
1281 |
]. |
|
8694 | 1282 |
]. |
5591 | 1283 |
]. |
1284 |
^ categoryList |
|
1285 |
||
6877 | 1286 |
"Created: / 05-02-2000 / 13:42:11 / cg" |
7501 | 1287 |
"Modified: / 10-11-2006 / 17:35:53 / cg" |
5591 | 1288 |
! |
1289 |
||
1290 |
makeDependent |
|
7501 | 1291 |
Smalltalk addDependent:self. |
1292 |
"/ ChangeSet addDependent:self. |
|
1293 |
||
1294 |
"Modified: / 10-11-2006 / 17:57:13 / cg" |
|
5591 | 1295 |
! |
1296 |
||
1297 |
makeIndependent |
|
1298 |
Smalltalk removeDependent:self. |
|
8219 | 1299 |
"/ ChangeSet removeDependent:self. |
5591 | 1300 |
! |
1301 |
||
8781
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
1302 |
methodInfoFor:aMethod |
8860
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
1303 |
|info| |
8781
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
1304 |
|
8860
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
1305 |
MethodInfoCacheAccessLock critical:[ |
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
1306 |
info := MethodInfoCache |
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
1307 |
at:(aMethod mclass name,'>>',aMethod selector) |
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
1308 |
ifAbsentPut:[ |
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
1309 |
|info| |
8781
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
1310 |
|
8860
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
1311 |
true "aMethod mclass language isSmalltalk" ifTrue:[ |
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
1312 |
info := CachedMethodInfo new. |
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
1313 |
info isObsolete:(aMethod isObsolete). |
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
1314 |
info sendsSuper:(aMethod superMessages notEmptyOrNil). |
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
1315 |
info isUncommented:(aMethod comment isEmptyOrNil and:[aMethod isVersionMethod not]). |
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
1316 |
info isDocumentationMethod:( aMethod isDocumentationMethod). |
8867 | 1317 |
info isLongMethod:( aMethod source asCollectionOfLines size > UserPreferences current numberOfLinesForLongMethod ). |
8931 | 1318 |
info isExtensionMethod:( aMethod package ~= aMethod mclass package ). |
1319 |
info isOverride:( aMethod mclass superclass respondsTo:aMethod selector ). |
|
8860
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
1320 |
]. |
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
1321 |
info |
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
1322 |
] |
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
1323 |
]. |
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
1324 |
^ info |
8781
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
1325 |
! |
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
1326 |
|
5591 | 1327 |
release |
1328 |
super release. |
|
1329 |
||
1330 |
filterClassVars removeDependent:self. |
|
1331 |
methodVisibilityHolder removeDependent:self. |
|
1332 |
noAllItem removeDependent:self. |
|
1333 |
packageFilterOnInput removeDependent:self. |
|
1334 |
selectedProtocolIndices removeDependent:self. |
|
1335 |
variableFilter removeDependent:self. |
|
1336 |
! |
|
1337 |
||
1338 |
updateList |
|
1339 |
|prevClasses prevSelection newSelection newList oldList sameContents selectedProtocolsHolder rawList| |
|
1340 |
||
1341 |
selectedProtocolsHolder := self selectedProtocols. |
|
1342 |
||
1343 |
prevClasses := classes ifNil:[ #() ] ifNotNil:[ classes copy ]. |
|
1344 |
oldList := self protocolList value copy. |
|
1345 |
newList := self listOfMethodCategories. |
|
1346 |
||
1347 |
"/ oldListSize := self browserNameList size. |
|
1348 |
"/ newListSize := newList size. |
|
1349 |
self selectedProtocolIndices removeDependent:self. |
|
1350 |
sameContents := self updateListFor:newList. |
|
1351 |
self selectedProtocolIndices addDependent:self. |
|
1352 |
sameContents ifFalse:[ |
|
1353 |
prevSelection := lastSelectedProtocols ? (selectedProtocolsHolder value) ? #(). |
|
1354 |
"/ prevSelection := selectedProtocolsHolder value ? lastSelectedProtocols ? #(). |
|
1355 |
||
1356 |
rawList := self rawProtocolList value. |
|
1357 |
newSelection := prevSelection select:[:item | rawList includes:item string]. |
|
1358 |
||
1359 |
newSelection size > 0 ifTrue:[ |
|
1360 |
"/ force change (for dependents) |
|
1361 |
"/ selectedProtocolsHolder value:nil. |
|
1362 |
"/ selectedProtocolsHolder value:newSelection. |
|
1363 |
selectedProtocolsHolder setValue:newSelection. |
|
1364 |
selectedProtocolsHolder changed:#value. |
|
1365 |
] ifFalse:[ |
|
1366 |
prevSelection := selectedProtocolsHolder value. |
|
1367 |
selectedProtocolsHolder value:nil. |
|
1368 |
]. |
|
1369 |
(prevSelection size > 0 or:[newSelection size > 0]) ifTrue:[ |
|
1370 |
self enqueueDelayedUpdateOutputGenerator. |
|
1371 |
"/ self updateOutputGenerator. |
|
1372 |
]. |
|
1373 |
||
1374 |
"/ prevSelection notNil ifTrue:[ |
|
1375 |
"/ lastSelectedProtocols := prevSelection. |
|
1376 |
"/ ]. |
|
1377 |
] ifTrue:[ |
|
1378 |
"/ same list - but classes might have changed |
|
1379 |
"/ that is the case, if the class selection has been changed, |
|
1380 |
"/ to another class which has the same categories. |
|
1381 |
(prevClasses size ~= classes size |
|
1382 |
or:[prevClasses asOrderedCollection ~= (classes ? #()) asOrderedCollection ]) ifTrue:[ |
|
1383 |
(newList size > 0 or:[oldList size > 0]) ifTrue:[ |
|
1384 |
self updateOutputGenerator |
|
1385 |
] |
|
1386 |
] ifFalse:[ |
|
1387 |
"/ self protocolList value:newList. |
|
1388 |
] |
|
1389 |
]. |
|
1390 |
listValid := true. |
|
1391 |
||
1392 |
"Created: / 5.2.2000 / 13:42:11 / cg" |
|
1393 |
"Modified: / 29.2.2000 / 11:08:55 / cg" |
|
1394 |
! ! |
|
1395 |
||
1396 |
!MethodCategoryList methodsFor:'special'! |
|
1397 |
||
1398 |
addAdditionalProtocol:aProtocol forClass:aClass |
|
1399 |
|categories| |
|
1400 |
||
1401 |
"/ those are simulated - in ST/X, empty categories do not |
|
1402 |
"/ really exist; however, during browsing, it makes sense. |
|
1403 |
AdditionalEmptyCategoriesPerClassName isNil ifTrue:[ |
|
6664
50eb2e92aaed
changed change-update aspect when changing some method category
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
1404 |
AdditionalEmptyCategoriesPerClassName := Dictionary new. |
5591 | 1405 |
]. |
1406 |
categories := AdditionalEmptyCategoriesPerClassName at:aClass name ifAbsent:nil. |
|
1407 |
categories isNil ifTrue:[ |
|
6664
50eb2e92aaed
changed change-update aspect when changing some method category
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
1408 |
categories := Set new. |
50eb2e92aaed
changed change-update aspect when changing some method category
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
1409 |
AdditionalEmptyCategoriesPerClassName at:aClass name put:categories. |
5591 | 1410 |
]. |
1411 |
categories add:aProtocol. |
|
6664
50eb2e92aaed
changed change-update aspect when changing some method category
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
1412 |
aClass changed:#organization. "/ not really ... to force update |
50eb2e92aaed
changed change-update aspect when changing some method category
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
1413 |
Smalltalk changed:#methodCategoryAdded with:(Array with:aClass with:aProtocol). "/ not really ... to force update |
5591 | 1414 |
! |
1415 |
||
1416 |
additionalProtocolForClass:aClass |
|
1417 |
"/ those are simulated - in ST/X, empty categories do not |
|
1418 |
"/ really exist; however, during browsing, it makes sense. |
|
1419 |
AdditionalEmptyCategoriesPerClassName isNil ifTrue:[ ^ #() ]. |
|
1420 |
^ AdditionalEmptyCategoriesPerClassName at:aClass name ifAbsent:[ #() ]. |
|
1421 |
! |
|
1422 |
||
1423 |
clearLastSelectedProtocol |
|
1424 |
lastSelectedProtocols := nil |
|
1425 |
! |
|
1426 |
||
6342
698b45d51014
new method-category initial offer
Claus Gittinger <cg@exept.de>
parents:
5950
diff
changeset
|
1427 |
lastSelectedProtocols |
698b45d51014
new method-category initial offer
Claus Gittinger <cg@exept.de>
parents:
5950
diff
changeset
|
1428 |
^ lastSelectedProtocols |
698b45d51014
new method-category initial offer
Claus Gittinger <cg@exept.de>
parents:
5950
diff
changeset
|
1429 |
! |
698b45d51014
new method-category initial offer
Claus Gittinger <cg@exept.de>
parents:
5950
diff
changeset
|
1430 |
|
5591 | 1431 |
removeAdditionalProtocol:aListOfProtocols forClass:aClass |
1432 |
|categories| |
|
1433 |
||
1434 |
"/ those are simulated - in ST/X, empty categories do not |
|
1435 |
"/ really exist; however, during browsing, it makes sense. |
|
1436 |
||
1437 |
AdditionalEmptyCategoriesPerClassName isNil ifTrue:[^ self]. |
|
1438 |
||
1439 |
categories := AdditionalEmptyCategoriesPerClassName at:aClass name ifAbsent:nil. |
|
1440 |
categories isNil ifTrue:[^ self]. |
|
1441 |
categories removeAllFoundIn:aListOfProtocols. |
|
1442 |
categories isEmpty ifTrue:[ |
|
6664
50eb2e92aaed
changed change-update aspect when changing some method category
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
1443 |
AdditionalEmptyCategoriesPerClassName removeKey:aClass name. |
5591 | 1444 |
]. |
1445 |
||
1446 |
aClass changed:#organization. "/ not really ... to force update |
|
6664
50eb2e92aaed
changed change-update aspect when changing some method category
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
1447 |
Smalltalk changed:#methodCategoriesRemoved with:(Array with:aClass with:aListOfProtocols). "/ not really ... to force update |
5591 | 1448 |
! |
1449 |
||
1450 |
removeAllAdditionalProtocol |
|
1451 |
"/ those are simulated - in ST/X, empty categories do not |
|
1452 |
"/ really exist; however, during browsing, it makes sense. |
|
1453 |
AdditionalEmptyCategoriesPerClassName := nil |
|
1454 |
||
1455 |
||
1456 |
! |
|
1457 |
||
1458 |
removeAllAdditionalProtocolForClass:aClass |
|
1459 |
"/ those are simulated - in ST/X, empty categories do not |
|
1460 |
"/ really exist; however, during browsing, it makes sense. |
|
1461 |
AdditionalEmptyCategoriesPerClassName notNil ifTrue:[ |
|
1462 |
AdditionalEmptyCategoriesPerClassName removeKey:aClass name ifAbsent:nil |
|
1463 |
]. |
|
1464 |
||
1465 |
||
1466 |
! |
|
1467 |
||
1468 |
renameAdditionalProtocol:oldName to:newName forClass:aClass |
|
1469 |
|categories| |
|
1470 |
||
1471 |
"/ those are simulated - in ST/X, empty categories do not |
|
1472 |
"/ really exist; however, during browsing, it makes sense. |
|
1473 |
||
1474 |
AdditionalEmptyCategoriesPerClassName isNil ifTrue:[^ self]. |
|
1475 |
categories := AdditionalEmptyCategoriesPerClassName at:aClass name ifAbsent:nil. |
|
1476 |
categories isNil ifTrue:[^ self]. |
|
1477 |
categories remove:oldName ifAbsent:nil. |
|
1478 |
categories add:newName. |
|
1479 |
||
1480 |
aClass changed:#organization. "/ not really ... to force update |
|
6664
50eb2e92aaed
changed change-update aspect when changing some method category
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
1481 |
Smalltalk changed:#methodCategoryRenamed with:(Array with:aClass with:oldName with:newName). "/ not really ... to force update |
5591 | 1482 |
! ! |
1483 |
||
8860
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
1484 |
!MethodCategoryList::CachedMethodInfo class methodsFor:'initialization'! |
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
1485 |
|
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
1486 |
initialize |
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
1487 |
FlagObsolete := 1. |
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
1488 |
FlagSendsSuper := 2. |
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
1489 |
FlagIsUncommented := 4. |
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
1490 |
FlagIsDocumentationMethod := 8. |
8867 | 1491 |
FlagIsLongMethod := 16. |
8931 | 1492 |
FlagIsExtension := 32. |
1493 |
FlagIsOverride := 64. |
|
8860
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
1494 |
! ! |
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
1495 |
|
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
1496 |
!MethodCategoryList::CachedMethodInfo class methodsFor:'instance creation'! |
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
1497 |
|
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
1498 |
new |
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
1499 |
^ self basicNew flags:0. |
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
1500 |
! ! |
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
1501 |
|
8781
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
1502 |
!MethodCategoryList::CachedMethodInfo methodsFor:'accessing'! |
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
1503 |
|
8860
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
1504 |
flags:something |
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
1505 |
flags := something. |
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
1506 |
! |
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
1507 |
|
8781
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
1508 |
isDocumentationMethod |
8860
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
1509 |
^ (flags ? 0) bitTest: FlagIsDocumentationMethod |
8781
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
1510 |
! |
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
1511 |
|
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
1512 |
isDocumentationMethod:aBoolean |
8860
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
1513 |
flags := aBoolean |
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
1514 |
ifTrue:[ flags bitOr: FlagIsDocumentationMethod ] |
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
1515 |
ifFalse:[ flags bitClear: FlagIsDocumentationMethod] |
8781
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
1516 |
! |
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
1517 |
|
8931 | 1518 |
isExtensionMethod |
1519 |
^ (flags ? 0) bitTest: FlagIsExtension |
|
1520 |
! |
|
1521 |
||
1522 |
isExtensionMethod:aBoolean |
|
1523 |
flags := aBoolean |
|
1524 |
ifTrue:[ flags bitOr: FlagIsExtension ] |
|
1525 |
ifFalse:[ flags bitClear: FlagIsExtension] |
|
1526 |
! |
|
1527 |
||
8867 | 1528 |
isLongMethod |
1529 |
^ (flags ? 0) bitTest: FlagIsLongMethod |
|
1530 |
! |
|
1531 |
||
1532 |
isLongMethod:aBoolean |
|
1533 |
flags := aBoolean |
|
1534 |
ifTrue:[ flags bitOr: FlagIsLongMethod ] |
|
1535 |
ifFalse:[ flags bitClear: FlagIsLongMethod] |
|
1536 |
! |
|
1537 |
||
8781
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
1538 |
isObsolete |
8860
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
1539 |
^ (flags ? 0) bitTest: FlagObsolete |
8781
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
1540 |
! |
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
1541 |
|
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
1542 |
isObsolete:aBoolean |
8860
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
1543 |
flags := aBoolean |
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
1544 |
ifTrue:[ flags bitOr: FlagObsolete ] |
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
1545 |
ifFalse:[ flags bitClear: FlagObsolete] |
8781
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
1546 |
! |
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
1547 |
|
8931 | 1548 |
isOverride |
1549 |
^ (flags ? 0) bitTest: FlagIsOverride |
|
1550 |
! |
|
1551 |
||
1552 |
isOverride:aBoolean |
|
1553 |
flags := aBoolean |
|
1554 |
ifTrue:[ flags bitOr: FlagIsOverride ] |
|
1555 |
ifFalse:[ flags bitClear: FlagIsOverride] |
|
1556 |
! |
|
1557 |
||
8781
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
1558 |
isUncommented |
8860
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
1559 |
^ (flags ? 0) bitTest: FlagIsUncommented |
8781
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
1560 |
! |
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
1561 |
|
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
1562 |
isUncommented:aBoolean |
8860
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
1563 |
flags := aBoolean |
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
1564 |
ifTrue:[ flags bitOr: FlagIsUncommented ] |
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
1565 |
ifFalse:[ flags bitClear: FlagIsUncommented] |
8781
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
1566 |
! |
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
1567 |
|
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
1568 |
sendsSuper |
8860
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
1569 |
^ (flags ? 0) bitTest: FlagSendsSuper |
8781
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
1570 |
! |
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
1571 |
|
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
1572 |
sendsSuper:aBoolean |
8860
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
1573 |
flags := aBoolean |
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
1574 |
ifTrue:[ flags bitOr: FlagSendsSuper ] |
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
1575 |
ifFalse:[ flags bitClear: FlagSendsSuper] |
8781
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
1576 |
! ! |
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
1577 |
|
5591 | 1578 |
!MethodCategoryList class methodsFor:'documentation'! |
1579 |
||
1580 |
version |
|
8961 | 1581 |
^ '$Header: /cvs/stx/stx/libtool/Tools_MethodCategoryList.st,v 1.36 2009-10-12 16:06:21 cg Exp $' |
8848 | 1582 |
! |
1583 |
||
1584 |
version_CVS |
|
8961 | 1585 |
^ '$Header: /cvs/stx/stx/libtool/Tools_MethodCategoryList.st,v 1.36 2009-10-12 16:06:21 cg Exp $' |
5591 | 1586 |
! ! |
8860
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
1587 |
|
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
1588 |
MethodCategoryList initialize! |
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
1589 |
MethodCategoryList::CachedMethodInfo initialize! |