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