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