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