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