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