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