author | Claus Gittinger <cg@exept.de> |
Mon, 21 Sep 2009 15:11:31 +0200 | |
changeset 8733 | 31c0ffee640f |
parent 8723 | 2d676b11e886 |
child 8735 | 325a0d90b312 |
permissions | -rw-r--r-- |
5591 | 1 |
" |
2 |
COPYRIGHT (c) 2000 by eXept Software AG |
|
3 |
All Rights Reserved |
|
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 |
|
17 |
instanceVariableNames:'variableFilter filterClassVars lastSelectedProtocols classes |
|
18 |
leafClasses protocolList rawProtocolList selectedProtocolIndices |
|
8694 | 19 |
lastGeneratedProtocols packageFilterOnInput |
20 |
methodVisibilityHolder noAllItem noPseudoItems |
|
21 |
showPseudoProtocols' |
|
5591 | 22 |
classVariableNames:'AdditionalEmptyCategoriesPerClassName' |
23 |
poolDictionaries:'' |
|
24 |
category:'Interface-Browsers-New' |
|
25 |
! |
|
26 |
||
27 |
!MethodCategoryList class methodsFor:'documentation'! |
|
28 |
||
29 |
copyright |
|
30 |
" |
|
31 |
COPYRIGHT (c) 2000 by eXept Software AG |
|
32 |
All Rights Reserved |
|
33 |
||
34 |
This software is furnished under a license and may be used |
|
35 |
only in accordance with the terms of that license and with the |
|
36 |
inclusion of the above copyright notice. This software may not |
|
37 |
be provided or otherwise made available to, or used by, any |
|
38 |
other person. No title to or ownership of the software is |
|
39 |
hereby transferred. |
|
40 |
" |
|
41 |
! ! |
|
42 |
||
43 |
!MethodCategoryList class methodsFor:'interface specs'! |
|
44 |
||
45 |
singleProtocolWindowSpec |
|
46 |
"This resource specification was automatically generated |
|
47 |
by the UIPainter of ST/X." |
|
48 |
||
49 |
"Do not manually edit this!! If it is corrupted, |
|
50 |
the UIPainter may not be able to read the specification." |
|
51 |
||
52 |
" |
|
53 |
UIPainter new openOnClass:MethodCategoryList andSelector:#singleProtocolWindowSpec |
|
54 |
MethodCategoryList new openInterface:#singleProtocolWindowSpec |
|
55 |
" |
|
56 |
||
57 |
<resource: #canvas> |
|
58 |
||
59 |
^ |
|
60 |
#(#FullSpec |
|
5592 | 61 |
#name: #singleProtocolWindowSpec |
62 |
#window: |
|
5591 | 63 |
#(#WindowSpec |
5592 | 64 |
#label: 'ProtocolList' |
65 |
#name: 'ProtocolList' |
|
66 |
#min: #(#Point 0 0) |
|
67 |
#max: #(#Point 1024 721) |
|
68 |
#bounds: #(#Rectangle 12 22 312 322) |
|
69 |
) |
|
70 |
#component: |
|
5591 | 71 |
#(#SpecCollection |
5592 | 72 |
#collection: #( |
73 |
#(#LabelSpec |
|
74 |
#label: 'ProtocolName' |
|
75 |
#name: 'ProtocolLabel' |
|
76 |
#layout: #(#LayoutFrame 0 0.0 0 0 0 1.0 25 0) |
|
77 |
#translateLabel: true |
|
78 |
#labelChannel: #protocolLabelHolder |
|
79 |
#menu: #menuHolder |
|
80 |
) |
|
81 |
) |
|
5591 | 82 |
|
5592 | 83 |
) |
5591 | 84 |
) |
85 |
! |
|
86 |
||
87 |
windowSpec |
|
88 |
"This resource specification was automatically generated |
|
89 |
by the UIPainter of ST/X." |
|
90 |
||
91 |
"Do not manually edit this!! If it is corrupted, |
|
92 |
the UIPainter may not be able to read the specification." |
|
93 |
||
94 |
" |
|
95 |
UIPainter new openOnClass:MethodCategoryList andSelector:#windowSpec |
|
96 |
MethodCategoryList new openInterface:#windowSpec |
|
97 |
MethodCategoryList open |
|
98 |
" |
|
99 |
||
100 |
<resource: #canvas> |
|
101 |
||
102 |
^ |
|
103 |
#(#FullSpec |
|
6469 | 104 |
#name: #windowSpec |
105 |
#window: |
|
5591 | 106 |
#(#WindowSpec |
6469 | 107 |
#label: 'ProtocolList' |
108 |
#name: 'ProtocolList' |
|
109 |
#min: #(#Point 0 0) |
|
110 |
#max: #(#Point 1024 721) |
|
111 |
#bounds: #(#Rectangle 16 46 316 346) |
|
112 |
) |
|
113 |
#component: |
|
5591 | 114 |
#(#SpecCollection |
6469 | 115 |
#collection: #( |
116 |
#(#SequenceViewSpec |
|
117 |
#name: 'List' |
|
118 |
#layout: #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0) |
|
119 |
#tabable: true |
|
120 |
#model: #selectedProtocolIndices |
|
121 |
#menu: #menuHolder |
|
122 |
#hasHorizontalScrollBar: true |
|
123 |
#hasVerticalScrollBar: true |
|
124 |
#miniScrollerHorizontal: true |
|
125 |
#isMultiSelect: true |
|
126 |
#valueChangeSelector: #selectionChangedByClick |
|
127 |
#useIndex: true |
|
128 |
#sequenceList: #protocolList |
|
129 |
#doubleClickChannel: #doubleClickChannel |
|
130 |
#properties: |
|
131 |
#(#PropertyListDictionary |
|
132 |
#dragArgument: nil |
|
133 |
#dropArgument: nil |
|
134 |
#canDropSelector: #canDropContext: |
|
135 |
#dropSelector: #doDropContext: |
|
136 |
) |
|
137 |
) |
|
138 |
) |
|
5591 | 139 |
|
6469 | 140 |
) |
5591 | 141 |
) |
142 |
! ! |
|
143 |
||
144 |
!MethodCategoryList class methodsFor:'plugIn spec'! |
|
145 |
||
146 |
aspectSelectors |
|
147 |
"This resource specification was automatically generated |
|
148 |
by the UIPainter of ST/X." |
|
149 |
||
150 |
"Do not manually edit this. If it is corrupted, |
|
151 |
the UIPainter may not be able to read the specification." |
|
152 |
||
153 |
"Return a description of exported aspects; |
|
154 |
these can be connected to aspects of an embedding application |
|
155 |
(if this app is embedded in a subCanvas)." |
|
156 |
||
157 |
^ #( |
|
8694 | 158 |
#(#doubleClickChannel #action ) |
159 |
#filterClassVars |
|
160 |
#forceGeneratorTrigger |
|
161 |
#immediateUpdate |
|
162 |
#inGeneratorHolder |
|
163 |
#menuHolder |
|
164 |
#noAllItem |
|
165 |
#showPseudoProtocols |
|
166 |
#outGeneratorHolder |
|
167 |
#packageFilter |
|
168 |
#packageFilterOnInput |
|
169 |
#selectedProtocols |
|
170 |
#selectionChangeCondition |
|
171 |
#updateTrigger |
|
172 |
#variableFilter |
|
173 |
#methodVisibilityHolder |
|
5591 | 174 |
). |
175 |
! ! |
|
176 |
||
177 |
!MethodCategoryList methodsFor:'aspects'! |
|
178 |
||
179 |
browserNameList |
|
180 |
^ self protocolList |
|
181 |
! |
|
182 |
||
183 |
defaultSlaveModeValue |
|
184 |
^ false. |
|
185 |
! |
|
186 |
||
187 |
filterClassVars |
|
188 |
filterClassVars isNil ifTrue:[ |
|
189 |
filterClassVars := false asValue. |
|
190 |
filterClassVars addDependent:self |
|
191 |
]. |
|
192 |
^ filterClassVars |
|
193 |
||
194 |
"Modified: / 31.1.2000 / 00:56:31 / cg" |
|
195 |
"Created: / 5.2.2000 / 13:42:10 / cg" |
|
196 |
! |
|
197 |
||
198 |
filterClassVars:aValueHolder |
|
199 |
filterClassVars notNil ifTrue:[ |
|
200 |
filterClassVars removeDependent:self |
|
201 |
]. |
|
202 |
filterClassVars := aValueHolder. |
|
203 |
filterClassVars notNil ifTrue:[ |
|
204 |
filterClassVars addDependent:self |
|
205 |
]. |
|
206 |
||
207 |
"Modified: / 31.1.2000 / 00:56:31 / cg" |
|
208 |
"Created: / 5.2.2000 / 13:42:10 / cg" |
|
209 |
! |
|
210 |
||
211 |
methodVisibilityHolder |
|
212 |
methodVisibilityHolder isNil ifTrue:[ |
|
213 |
methodVisibilityHolder := false asValue. |
|
214 |
methodVisibilityHolder addDependent:self |
|
215 |
]. |
|
216 |
^ methodVisibilityHolder |
|
217 |
! |
|
218 |
||
219 |
methodVisibilityHolder:aValueHolder |
|
220 |
methodVisibilityHolder notNil ifTrue:[ |
|
221 |
methodVisibilityHolder removeDependent:self |
|
222 |
]. |
|
223 |
methodVisibilityHolder := aValueHolder. |
|
224 |
methodVisibilityHolder notNil ifTrue:[ |
|
225 |
methodVisibilityHolder addDependent:self |
|
226 |
]. |
|
227 |
||
228 |
"Modified: / 31.1.2000 / 00:56:31 / cg" |
|
229 |
"Created: / 5.2.2000 / 13:42:10 / cg" |
|
230 |
! |
|
231 |
||
232 |
noAllItem |
|
233 |
noAllItem isNil ifTrue:[ |
|
234 |
noAllItem := false asValue. |
|
235 |
noAllItem addDependent:self |
|
236 |
]. |
|
237 |
^ noAllItem |
|
238 |
! |
|
239 |
||
240 |
noAllItem:aValueHolder |
|
241 |
noAllItem notNil ifTrue:[ |
|
242 |
noAllItem removeDependent:self |
|
243 |
]. |
|
244 |
noAllItem := aValueHolder. |
|
245 |
noAllItem notNil ifTrue:[ |
|
246 |
noAllItem addDependent:self |
|
247 |
]. |
|
248 |
! |
|
249 |
||
250 |
packageFilterOnInput |
|
251 |
packageFilterOnInput isNil ifTrue:[ |
|
252 |
packageFilterOnInput := nil asValue. |
|
253 |
packageFilterOnInput addDependent:self |
|
254 |
]. |
|
255 |
^ packageFilterOnInput |
|
256 |
! |
|
257 |
||
258 |
packageFilterOnInput:aValueHolder |
|
259 |
|prevFilter| |
|
260 |
||
261 |
prevFilter := packageFilterOnInput value. |
|
262 |
packageFilterOnInput notNil ifTrue:[ |
|
263 |
packageFilterOnInput removeDependent:self |
|
264 |
]. |
|
265 |
packageFilterOnInput := aValueHolder. |
|
266 |
packageFilterOnInput notNil ifTrue:[ |
|
267 |
packageFilterOnInput addDependent:self |
|
268 |
]. |
|
269 |
prevFilter ~= packageFilterOnInput value ifTrue:[ |
|
270 |
self enqueueDelayedUpdateList |
|
271 |
]. |
|
272 |
! |
|
273 |
||
274 |
protocolLabelHolder |
|
275 |
^ self pseudoListLabelHolder |
|
276 |
! |
|
277 |
||
278 |
protocolList |
|
279 |
protocolList isNil ifTrue:[ |
|
280 |
protocolList := List new. "/ ValueHolder new |
|
281 |
]. |
|
282 |
^ protocolList |
|
283 |
||
284 |
"Modified: / 31.1.2000 / 00:56:31 / cg" |
|
285 |
"Created: / 5.2.2000 / 13:42:10 / cg" |
|
286 |
! |
|
287 |
||
288 |
rawProtocolList |
|
289 |
rawProtocolList isNil ifTrue:[ |
|
290 |
rawProtocolList := List new. |
|
291 |
]. |
|
292 |
^ rawProtocolList |
|
293 |
! |
|
294 |
||
295 |
selectedProtocolIndices |
|
296 |
selectedProtocolIndices isNil ifTrue:[ |
|
297 |
selectedProtocolIndices := ValueHolder new. |
|
298 |
selectedProtocolIndices addDependent:self |
|
299 |
]. |
|
300 |
^ selectedProtocolIndices. |
|
301 |
! |
|
302 |
||
303 |
selectedProtocols |
|
304 |
^ self selectionHolder |
|
305 |
! |
|
306 |
||
307 |
selectedProtocols:aValueHolder |
|
308 |
^ self selectionHolder:aValueHolder |
|
309 |
! |
|
310 |
||
8694 | 311 |
showPseudoProtocols |
312 |
showPseudoProtocols isNil ifTrue:[ |
|
313 |
showPseudoProtocols := true asValue. |
|
314 |
showPseudoProtocols addDependent:self |
|
315 |
]. |
|
316 |
^ showPseudoProtocols |
|
317 |
! |
|
318 |
||
319 |
showPseudoProtocols:aValueHolder |
|
320 |
showPseudoProtocols notNil ifTrue:[ |
|
321 |
showPseudoProtocols removeDependent:self |
|
322 |
]. |
|
323 |
showPseudoProtocols := aValueHolder. |
|
324 |
showPseudoProtocols notNil ifTrue:[ |
|
325 |
showPseudoProtocols addDependent:self |
|
326 |
]. |
|
327 |
! |
|
328 |
||
5591 | 329 |
variableFilter |
330 |
variableFilter isNil ifTrue:[ |
|
331 |
variableFilter := false asValue. |
|
332 |
variableFilter addDependent:self |
|
333 |
]. |
|
334 |
^ variableFilter |
|
335 |
||
336 |
"Modified: / 31.1.2000 / 00:56:31 / cg" |
|
337 |
"Created: / 5.2.2000 / 13:42:10 / cg" |
|
338 |
! |
|
339 |
||
340 |
variableFilter:aValueHolder |
|
341 |
variableFilter notNil ifTrue:[ |
|
342 |
variableFilter removeDependent:self |
|
343 |
]. |
|
344 |
variableFilter := aValueHolder. |
|
345 |
variableFilter notNil ifTrue:[ |
|
346 |
variableFilter addDependent:self |
|
347 |
]. |
|
348 |
||
349 |
"Modified: / 31.1.2000 / 00:56:31 / cg" |
|
350 |
"Created: / 5.2.2000 / 13:42:10 / cg" |
|
351 |
! ! |
|
352 |
||
353 |
!MethodCategoryList methodsFor:'change & update'! |
|
354 |
||
355 |
classDefinitionChanged:aClass |
|
356 |
|refetch anyChange| |
|
357 |
||
358 |
anyChange := false. |
|
359 |
refetch := [:oldClass | |
|
360 |
|nm cls newClass| |
|
361 |
||
362 |
nm := oldClass theNonMetaclass name. |
|
363 |
oldClass isMeta ifTrue:[ |
|
364 |
newClass := Smalltalk at:nm. |
|
365 |
newClass isNil ifTrue:[ |
|
366 |
Transcript showCR:'oops - browser lost class ' , nm. |
|
367 |
newClass := oldClass |
|
368 |
] ifFalse:[ |
|
369 |
newClass := newClass theMetaclass |
|
370 |
] |
|
371 |
] ifFalse:[ |
|
372 |
newClass := Smalltalk at:nm |
|
373 |
]. |
|
374 |
newClass ~~ oldClass ifTrue:[ |
|
375 |
anyChange := true. |
|
376 |
]. |
|
377 |
newClass |
|
378 |
]. |
|
379 |
||
380 |
classes := classes collect:refetch. |
|
381 |
leafClasses := leafClasses collect:refetch. |
|
382 |
anyChange ifTrue:[ |
|
383 |
self updateOutputGenerator |
|
384 |
]. |
|
385 |
! |
|
386 |
||
387 |
delayedUpdate:something with:aParameter from:changedObject |
|
388 |
|sel oldMethod newMethod mthd selectedCategories selectedProtocolsHolder oldProtocol newProtocol |
|
389 |
rawProtocolListHolder rawProtocolList oldSelectedProtocols newSelectedProtocols newIndices idx cls listView| |
|
390 |
||
391 |
selectedProtocolsHolder := self selectedProtocols. |
|
392 |
rawProtocolListHolder := self rawProtocolList. |
|
393 |
||
394 |
changedObject == Smalltalk ifTrue:[ |
|
6412 | 395 |
classes notNil ifTrue:[ |
396 |
something == #methodCategory ifTrue:[ |
|
397 |
cls := aParameter at:1. |
|
398 |
(cls notNil and:[classes includesIdentical:cls]) ifTrue:[ |
|
399 |
mthd := aParameter at:2. |
|
400 |
newProtocol := mthd category. |
|
401 |
oldProtocol := aParameter at:3. |
|
5591 | 402 |
|
6412 | 403 |
self invalidateList. |
5591 | 404 |
|
6412 | 405 |
selectedCategories := selectedProtocolsHolder value. |
406 |
selectedCategories size > 0 ifTrue:[ |
|
407 |
selectedCategories := selectedCategories collect:[:each | each ifNil:[self class nameListEntryForNILCategory]]. |
|
408 |
selectedCategories := selectedCategories collect:[:each | each string]. |
|
5591 | 409 |
|
6412 | 410 |
((selectedCategories includes:oldProtocol) |
411 |
or:[ (selectedCategories includes:newProtocol) |
|
412 |
or:[ selectedCategories includes:(self class nameListEntryForALL) ]]) |
|
413 |
ifTrue:[ |
|
414 |
self updateOutputGenerator. |
|
415 |
]. |
|
416 |
]. |
|
5591 | 417 |
|
6412 | 418 |
]. |
419 |
^ self |
|
420 |
]. |
|
5591 | 421 |
|
6412 | 422 |
something == #methodInClass ifTrue:[ |
423 |
"/ a method has been added/removed/changed |
|
424 |
cls := aParameter at:1. |
|
425 |
(classes includesIdentical:cls) ifTrue:[ |
|
426 |
sel := aParameter at:2. |
|
427 |
oldMethod := aParameter at:3. |
|
428 |
newMethod := cls compiledMethodAt:sel. |
|
429 |
oldMethod notNil ifTrue:[ |
|
430 |
variableFilter value size > 0 ifTrue:[ |
|
431 |
"/ sigh - must invalidate |
|
432 |
self invalidateList. |
|
433 |
]. |
|
434 |
^ self. |
|
435 |
]. |
|
436 |
"/ method was added - update the methodList |
|
437 |
"/ Q: is this needed (methodCategoryList should send me a new inGenerator) |
|
438 |
self invalidateList. |
|
5591 | 439 |
|
6412 | 440 |
"/ if its category is selected, updateOutputGenerator |
441 |
selectedCategories := selectedProtocolsHolder value. |
|
442 |
selectedCategories size > 0 ifTrue:[ |
|
443 |
selectedCategories := selectedCategories collect:[:each | each ifNil:[self class nameListEntryForNILCategory]]. |
|
444 |
selectedCategories := selectedCategories collect:[:each | each string]. |
|
5591 | 445 |
|
6412 | 446 |
((oldMethod notNil and:[selectedCategories includes:(oldMethod category)]) |
447 |
or:[ (newMethod notNil and:[selectedCategories includes:(newMethod category)])]) |
|
448 |
ifTrue:[ |
|
449 |
self updateOutputGenerator. |
|
450 |
]. |
|
451 |
]. |
|
452 |
]. |
|
453 |
^ self. |
|
454 |
]. |
|
5591 | 455 |
|
6412 | 456 |
something == #methodInClassRemoved ifTrue:[ |
457 |
cls := aParameter at:1. |
|
458 |
(classes includesIdentical:cls) ifTrue:[ |
|
459 |
sel := aParameter at:2. |
|
460 |
"/ method was removed - update the list and output generator |
|
461 |
self invalidateList. |
|
462 |
"/ self updateOutputGenerator. |
|
463 |
self slaveMode value == true ifFalse:[ |
|
464 |
self enqueueDelayedUpdateOutputGenerator. |
|
465 |
] |
|
466 |
]. |
|
467 |
^ self. |
|
468 |
]. |
|
5591 | 469 |
|
6664
50eb2e92aaed
changed change-update aspect when changing some method category
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
470 |
(something == #classOrganization |
50eb2e92aaed
changed change-update aspect when changing some method category
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
471 |
or:[ something == #methodCategoryAdded |
50eb2e92aaed
changed change-update aspect when changing some method category
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
472 |
or:[ something == #methodCategoryRemoved |
50eb2e92aaed
changed change-update aspect when changing some method category
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
473 |
or:[ something == #methodCategoriesRemoved |
50eb2e92aaed
changed change-update aspect when changing some method category
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
474 |
or:[ something == #methodCategoryRenamed ]]]]) ifTrue:[ |
50eb2e92aaed
changed change-update aspect when changing some method category
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
475 |
cls := (something == #classOrganization) ifTrue:aParameter ifFalse:[aParameter first]. |
6412 | 476 |
(classes includesIdentical:cls) ifTrue:[ |
477 |
self invalidateList. |
|
478 |
] ifFalse:[ |
|
479 |
(classes contains:[:aClass | aClass name = cls name]) ifTrue:[ |
|
480 |
self invalidateList. |
|
481 |
"/ self error:'obsolete class: should not happen'. |
|
482 |
] |
|
483 |
]. |
|
484 |
^ self. |
|
485 |
]. |
|
5591 | 486 |
|
6412 | 487 |
something == #projectOrganization ifTrue:[ |
488 |
aParameter notNil ifTrue:[ |
|
489 |
cls := aParameter at:1. |
|
490 |
cls notNil ifTrue:[ |
|
491 |
((classes includes:cls theMetaclass) |
|
492 |
or:[(classes includes:cls theNonMetaclass)]) ifTrue:[ |
|
493 |
self invalidateList. |
|
494 |
self slaveMode value == true ifFalse:[ |
|
495 |
self enqueueDelayedUpdateOutputGenerator. |
|
496 |
] |
|
497 |
]. |
|
498 |
]. |
|
499 |
] ifFalse:[ |
|
500 |
self invalidateList. |
|
501 |
]. |
|
502 |
^ self |
|
503 |
]. |
|
5591 | 504 |
|
6412 | 505 |
(something == #classDefinition or:[something == #classVariables]) |
506 |
ifTrue:[ |
|
507 |
self classDefinitionChanged:aParameter. |
|
508 |
^ self |
|
509 |
]. |
|
5591 | 510 |
|
6412 | 511 |
"/ everything else is ignored |
512 |
"/ self halt. |
|
513 |
]. |
|
514 |
^ self |
|
5591 | 515 |
]. |
516 |
||
517 |
changedObject == self selectedProtocolIndices ifTrue:[ |
|
6412 | 518 |
oldSelectedProtocols := selectedProtocolsHolder value ? #(). |
519 |
oldSelectedProtocols := oldSelectedProtocols collect:[:each | each ifNil:[self class nameListEntryForNILCategory]]. |
|
520 |
oldSelectedProtocols := oldSelectedProtocols collect:[:each | each string]. |
|
521 |
newSelectedProtocols := self getSelectedProtocolsFromIndices. |
|
522 |
oldSelectedProtocols ~= newSelectedProtocols ifTrue:[ |
|
523 |
selectedProtocolsHolder value:newSelectedProtocols. |
|
524 |
]. |
|
525 |
newSelectedProtocols size > 1 ifTrue:[ |
|
526 |
(newSelectedProtocols includes:(self class nameListEntryForALL)) ifTrue:[ |
|
527 |
rawProtocolList := rawProtocolListHolder value. |
|
528 |
idx := rawProtocolList indexOf: (newSelectedProtocols copy remove:(self class nameListEntryForALL); yourself) first. |
|
529 |
idx ~~ 0 ifTrue:[ |
|
530 |
(listView := self builder componentAt:#List) notNil ifTrue:[ |
|
531 |
listView makeLineVisible:idx. |
|
532 |
] |
|
533 |
] |
|
534 |
] |
|
535 |
]. |
|
5591 | 536 |
|
6412 | 537 |
^ self |
5591 | 538 |
]. |
539 |
||
540 |
changedObject == selectedProtocolsHolder ifTrue:[ |
|
6412 | 541 |
rawProtocolList := rawProtocolListHolder value. |
542 |
rawProtocolList size == 0 ifTrue:[ |
|
543 |
self updateList. |
|
544 |
rawProtocolList := rawProtocolListHolder value. |
|
545 |
]. |
|
546 |
rawProtocolList notNil ifTrue:[ |
|
547 |
selectedCategories := selectedProtocolsHolder value ? #(). |
|
548 |
selectedCategories := selectedCategories collect:[:each | each ifNil:[self class nameListEntryForNILCategory]]. |
|
549 |
newIndices := selectedCategories |
|
550 |
collect:[:each | rawProtocolList findFirst:[:p | p string = each string]]. |
|
551 |
newIndices := newIndices select:[:each | each ~~ 0]. |
|
552 |
newIndices ~= self selectedProtocolIndices value ifTrue:[ |
|
553 |
self selectedProtocolIndices setValue:nil. "/ to force update |
|
554 |
self selectedProtocolIndices value:newIndices |
|
555 |
]. |
|
556 |
(lastGeneratedProtocols notNil |
|
557 |
and:[(lastGeneratedProtocols includes:self class nameListEntryForALL) |
|
558 |
and:[(selectedProtocolsHolder value ? #()) includes:self class nameListEntryForALL]]) |
|
559 |
ifTrue:[ |
|
560 |
"/ no need to update generator |
|
561 |
] ifFalse:[ |
|
562 |
self updateOutputGenerator. |
|
563 |
] |
|
564 |
]. |
|
565 |
^ self |
|
5591 | 566 |
]. |
567 |
||
568 |
(changedObject == variableFilter |
|
569 |
or:[changedObject == filterClassVars |
|
570 |
or:[changedObject == packageFilterOnInput]]) ifTrue:[ |
|
6412 | 571 |
self invalidateList. |
572 |
^ self |
|
5591 | 573 |
]. |
574 |
||
575 |
changedObject == methodVisibilityHolder ifTrue:[ |
|
6412 | 576 |
self invalidateList. |
577 |
self updateOutputGenerator. |
|
578 |
^ self |
|
5591 | 579 |
]. |
580 |
||
581 |
lastGeneratedProtocols := nil. |
|
582 |
||
583 |
changedObject == inGeneratorHolder ifTrue:[ |
|
6412 | 584 |
selectedCategories := selectedProtocolsHolder value. |
5591 | 585 |
|
6412 | 586 |
selectedCategories size > 0 ifTrue:[ |
587 |
oldSelectedProtocols := selectedCategories ? #(). |
|
588 |
oldSelectedProtocols := oldSelectedProtocols collect:[:each | each ifNil:[self class nameListEntryForNILCategory]]. |
|
589 |
oldSelectedProtocols := oldSelectedProtocols collect:[:each | each string]. |
|
590 |
self updateList. |
|
591 |
rawProtocolList := rawProtocolListHolder value. |
|
592 |
newSelectedProtocols := oldSelectedProtocols select:[:each | rawProtocolList includes:each]. |
|
5591 | 593 |
"/ selectedProtocolsHolder setValue:nil. "/ to force update |
6412 | 594 |
selectedProtocolsHolder value:newSelectedProtocols. |
595 |
^ self |
|
596 |
]. |
|
5591 | 597 |
]. |
598 |
||
599 |
super delayedUpdate:something with:aParameter from:changedObject |
|
600 |
||
601 |
"Created: / 5.2.2000 / 13:42:10 / cg" |
|
602 |
"Modified: / 29.2.2000 / 11:11:39 / cg" |
|
603 |
! |
|
604 |
||
605 |
getSelectedProtocolsFromIndices |
|
606 |
|l| |
|
607 |
||
608 |
l := self rawProtocolList value. |
|
609 |
^ self selectedProtocolIndices value collect:[:idx | l at:idx]. |
|
610 |
! |
|
611 |
||
612 |
selectionChanged |
|
613 |
|newSelectedCategories allEntry| |
|
614 |
||
615 |
newSelectedCategories := self selectedProtocols value. |
|
616 |
||
617 |
"/ the outputGenerator is only to be updated, if the output would really |
|
618 |
"/ change ... |
|
619 |
allEntry := self class nameListEntryForALL. |
|
620 |
||
621 |
(lastSelectedProtocols notNil |
|
622 |
and:[newSelectedCategories notNil |
|
623 |
and:[(lastSelectedProtocols includes:(allEntry)) |
|
624 |
and:[newSelectedCategories includes:(allEntry)]]]) ifTrue:[ |
|
625 |
"/ no change ... |
|
626 |
^ self |
|
627 |
]. |
|
628 |
||
629 |
super selectionChanged. |
|
630 |
||
631 |
"Created: / 5.2.2000 / 13:42:10 / cg" |
|
632 |
"Modified: / 24.2.2000 / 14:12:12 / cg" |
|
633 |
! |
|
634 |
||
635 |
selectionChangedByClick |
|
636 |
"we are not interested in that - get another notification |
|
637 |
via the changed valueHolder" |
|
638 |
||
639 |
lastSelectedProtocols := self getSelectedProtocolsFromIndices |
|
640 |
! |
|
641 |
||
642 |
update:something with:aParameter from:changedObject |
|
6855
93bacd7fcf14
much faster update (only invalidate once, when multiple methods are compiled)
Claus Gittinger <cg@exept.de>
parents:
6706
diff
changeset
|
643 |
|cls sel oldMethod newMethod| |
5591 | 644 |
|
645 |
"/ some can be ignored immediately |
|
646 |
changedObject == Smalltalk ifTrue:[ |
|
6855
93bacd7fcf14
much faster update (only invalidate once, when multiple methods are compiled)
Claus Gittinger <cg@exept.de>
parents:
6706
diff
changeset
|
647 |
something isNil ifTrue:[ |
93bacd7fcf14
much faster update (only invalidate once, when multiple methods are compiled)
Claus Gittinger <cg@exept.de>
parents:
6706
diff
changeset
|
648 |
"/ self halt "/ huh - Smalltalk changed - so what ? |
93bacd7fcf14
much faster update (only invalidate once, when multiple methods are compiled)
Claus Gittinger <cg@exept.de>
parents:
6706
diff
changeset
|
649 |
^ self. |
93bacd7fcf14
much faster update (only invalidate once, when multiple methods are compiled)
Claus Gittinger <cg@exept.de>
parents:
6706
diff
changeset
|
650 |
]. |
6880 | 651 |
|
652 |
something == #currentChangeSet ifTrue:[ |
|
653 |
self invalidateList. |
|
654 |
^ self. |
|
655 |
]. |
|
656 |
||
6855
93bacd7fcf14
much faster update (only invalidate once, when multiple methods are compiled)
Claus Gittinger <cg@exept.de>
parents:
6706
diff
changeset
|
657 |
something == #methodInClass ifTrue:[ |
93bacd7fcf14
much faster update (only invalidate once, when multiple methods are compiled)
Claus Gittinger <cg@exept.de>
parents:
6706
diff
changeset
|
658 |
"/ 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
|
659 |
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
|
660 |
(classes notNil and:[classes includesIdentical:cls]) ifFalse:[^ self]. |
93bacd7fcf14
much faster update (only invalidate once, when multiple methods are compiled)
Claus Gittinger <cg@exept.de>
parents:
6706
diff
changeset
|
661 |
sel := aParameter at:2. |
93bacd7fcf14
much faster update (only invalidate once, when multiple methods are compiled)
Claus Gittinger <cg@exept.de>
parents:
6706
diff
changeset
|
662 |
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
|
663 |
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
|
664 |
oldMethod notNil ifTrue:[ |
93bacd7fcf14
much faster update (only invalidate once, when multiple methods are compiled)
Claus Gittinger <cg@exept.de>
parents:
6706
diff
changeset
|
665 |
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
|
666 |
"/ sigh - must invalidate |
93bacd7fcf14
much faster update (only invalidate once, when multiple methods are compiled)
Claus Gittinger <cg@exept.de>
parents:
6706
diff
changeset
|
667 |
self invalidateList. |
93bacd7fcf14
much faster update (only invalidate once, when multiple methods are compiled)
Claus Gittinger <cg@exept.de>
parents:
6706
diff
changeset
|
668 |
^ self. |
93bacd7fcf14
much faster update (only invalidate once, when multiple methods are compiled)
Claus Gittinger <cg@exept.de>
parents:
6706
diff
changeset
|
669 |
]. |
93bacd7fcf14
much faster update (only invalidate once, when multiple methods are compiled)
Claus Gittinger <cg@exept.de>
parents:
6706
diff
changeset
|
670 |
oldMethod category ~= newMethod category ifTrue:[ |
93bacd7fcf14
much faster update (only invalidate once, when multiple methods are compiled)
Claus Gittinger <cg@exept.de>
parents:
6706
diff
changeset
|
671 |
self invalidateList. |
93bacd7fcf14
much faster update (only invalidate once, when multiple methods are compiled)
Claus Gittinger <cg@exept.de>
parents:
6706
diff
changeset
|
672 |
^ self. |
93bacd7fcf14
much faster update (only invalidate once, when multiple methods are compiled)
Claus Gittinger <cg@exept.de>
parents:
6706
diff
changeset
|
673 |
]. |
93bacd7fcf14
much faster update (only invalidate once, when multiple methods are compiled)
Claus Gittinger <cg@exept.de>
parents:
6706
diff
changeset
|
674 |
"/ mhmh - its now changed (so coloring will change). |
93bacd7fcf14
much faster update (only invalidate once, when multiple methods are compiled)
Claus Gittinger <cg@exept.de>
parents:
6706
diff
changeset
|
675 |
self invalidateList. |
93bacd7fcf14
much faster update (only invalidate once, when multiple methods are compiled)
Claus Gittinger <cg@exept.de>
parents:
6706
diff
changeset
|
676 |
^ self. |
93bacd7fcf14
much faster update (only invalidate once, when multiple methods are compiled)
Claus Gittinger <cg@exept.de>
parents:
6706
diff
changeset
|
677 |
]. |
93bacd7fcf14
much faster update (only invalidate once, when multiple methods are compiled)
Claus Gittinger <cg@exept.de>
parents:
6706
diff
changeset
|
678 |
]. |
93bacd7fcf14
much faster update (only invalidate once, when multiple methods are compiled)
Claus Gittinger <cg@exept.de>
parents:
6706
diff
changeset
|
679 |
|
5591 | 680 |
"/ something == #classDefinition ifTrue:[ |
681 |
"/ ^ self. |
|
682 |
"/ ]. |
|
6855
93bacd7fcf14
much faster update (only invalidate once, when multiple methods are compiled)
Claus Gittinger <cg@exept.de>
parents:
6706
diff
changeset
|
683 |
something == #newClass ifTrue:[ |
93bacd7fcf14
much faster update (only invalidate once, when multiple methods are compiled)
Claus Gittinger <cg@exept.de>
parents:
6706
diff
changeset
|
684 |
^ self. |
93bacd7fcf14
much faster update (only invalidate once, when multiple methods are compiled)
Claus Gittinger <cg@exept.de>
parents:
6706
diff
changeset
|
685 |
]. |
93bacd7fcf14
much faster update (only invalidate once, when multiple methods are compiled)
Claus Gittinger <cg@exept.de>
parents:
6706
diff
changeset
|
686 |
something == #classRemove ifTrue:[ |
93bacd7fcf14
much faster update (only invalidate once, when multiple methods are compiled)
Claus Gittinger <cg@exept.de>
parents:
6706
diff
changeset
|
687 |
^ self. |
93bacd7fcf14
much faster update (only invalidate once, when multiple methods are compiled)
Claus Gittinger <cg@exept.de>
parents:
6706
diff
changeset
|
688 |
]. |
93bacd7fcf14
much faster update (only invalidate once, when multiple methods are compiled)
Claus Gittinger <cg@exept.de>
parents:
6706
diff
changeset
|
689 |
something == #classRename ifTrue:[ |
93bacd7fcf14
much faster update (only invalidate once, when multiple methods are compiled)
Claus Gittinger <cg@exept.de>
parents:
6706
diff
changeset
|
690 |
^ self. |
93bacd7fcf14
much faster update (only invalidate once, when multiple methods are compiled)
Claus Gittinger <cg@exept.de>
parents:
6706
diff
changeset
|
691 |
]. |
5591 | 692 |
"/ something == #classVariables ifTrue:[ |
693 |
"/ ^ self. |
|
694 |
"/ ]. |
|
6855
93bacd7fcf14
much faster update (only invalidate once, when multiple methods are compiled)
Claus Gittinger <cg@exept.de>
parents:
6706
diff
changeset
|
695 |
something == #classComment ifTrue:[ |
93bacd7fcf14
much faster update (only invalidate once, when multiple methods are compiled)
Claus Gittinger <cg@exept.de>
parents:
6706
diff
changeset
|
696 |
^ self. |
93bacd7fcf14
much faster update (only invalidate once, when multiple methods are compiled)
Claus Gittinger <cg@exept.de>
parents:
6706
diff
changeset
|
697 |
]. |
93bacd7fcf14
much faster update (only invalidate once, when multiple methods are compiled)
Claus Gittinger <cg@exept.de>
parents:
6706
diff
changeset
|
698 |
something == #organization ifTrue:[ |
93bacd7fcf14
much faster update (only invalidate once, when multiple methods are compiled)
Claus Gittinger <cg@exept.de>
parents:
6706
diff
changeset
|
699 |
^ self. |
93bacd7fcf14
much faster update (only invalidate once, when multiple methods are compiled)
Claus Gittinger <cg@exept.de>
parents:
6706
diff
changeset
|
700 |
]. |
93bacd7fcf14
much faster update (only invalidate once, when multiple methods are compiled)
Claus Gittinger <cg@exept.de>
parents:
6706
diff
changeset
|
701 |
something == #methodTrap ifTrue:[ |
93bacd7fcf14
much faster update (only invalidate once, when multiple methods are compiled)
Claus Gittinger <cg@exept.de>
parents:
6706
diff
changeset
|
702 |
^ self |
93bacd7fcf14
much faster update (only invalidate once, when multiple methods are compiled)
Claus Gittinger <cg@exept.de>
parents:
6706
diff
changeset
|
703 |
]. |
5591 | 704 |
]. |
705 |
||
706 |
super update:something with:aParameter from:changedObject. |
|
6880 | 707 |
|
708 |
"Modified: / 10-08-2006 / 17:23:48 / cg" |
|
5591 | 709 |
! ! |
710 |
||
711 |
!MethodCategoryList methodsFor:'drag & drop'! |
|
712 |
||
6469 | 713 |
canDropContext:aDropContext |
5591 | 714 |
|cat methods| |
715 |
||
716 |
methods := aDropContext dropObjects collect:[:obj | obj theObject]. |
|
7123 | 717 |
(methods conform:[:aMethod | aMethod isMethod]) ifFalse:[^ false]. |
5591 | 718 |
|
719 |
cat := self categoryAtTargetPointOf:aDropContext. |
|
6492 | 720 |
cat isNil ifTrue:[^ false]. |
5591 | 721 |
|
722 |
(methods contains:[:aMethod | aMethod category ~= cat]) ifFalse:[^ false]. |
|
6492 | 723 |
^ true |
7123 | 724 |
|
725 |
"Modified: / 13-09-2006 / 11:44:02 / cg" |
|
5591 | 726 |
! |
727 |
||
728 |
categoryAtTargetPointOf:aDropContext |
|
729 |
|p methodListView lineNr cat| |
|
730 |
||
731 |
p := aDropContext targetPoint. |
|
732 |
||
733 |
methodListView := aDropContext targetWidget. |
|
734 |
||
735 |
lineNr := methodListView lineAtY:p y. |
|
736 |
lineNr isNil ifTrue:[^ nil]. |
|
737 |
||
738 |
cat := rawProtocolList at:lineNr. |
|
739 |
cat := cat string. |
|
740 |
cat = self class nameListEntryForALL ifTrue:[^ nil]. |
|
741 |
||
742 |
^ cat |
|
743 |
! |
|
744 |
||
6469 | 745 |
doDropContext:aDropContext |
5591 | 746 |
|cat methods| |
747 |
||
748 |
methods := aDropContext dropObjects collect:[:aDropObject | aDropObject theObject]. |
|
7123 | 749 |
(methods conform:[:something | something isMethod]) ifFalse:[^ self]. |
5591 | 750 |
|
751 |
cat := self categoryAtTargetPointOf:aDropContext. |
|
752 |
cat notNil ifTrue:[ |
|
6469 | 753 |
self masterApplication moveMethods:methods toProtocol:cat. |
5591 | 754 |
]. |
7123 | 755 |
|
756 |
"Modified: / 13-09-2006 / 11:43:23 / cg" |
|
5591 | 757 |
! ! |
758 |
||
759 |
!MethodCategoryList methodsFor:'generators'! |
|
760 |
||
761 |
makeGenerator |
|
762 |
"return a generator which enumerates the methods from the selected protocol; |
|
763 |
that generator generates 4-element elements (includes the class and protocol), |
|
764 |
in order to make the consumers only depend on one input |
|
765 |
(i.e. to pass multiple-class and multiple-protocol info |
|
766 |
without a need for another classHolder/protocolHolder in the methodList)." |
|
767 |
||
8694 | 768 |
^ Iterator |
769 |
on:[:whatToDo | |
|
770 |
|protocols |
|
8733 | 771 |
allProtocols superSendProtocols uncommentedProtocols obsoleteProtocols documentationProtocols |
8694 | 772 |
noCat static notStatic classSelectorPairsAlreadyDone |
773 |
packages remainingClasses remainingCategories classesAlreadyDone noPackage| |
|
5591 | 774 |
|
8694 | 775 |
noPackage := Project noProjectID. |
776 |
noCat := (self class nameListEntryForNILCategory). |
|
777 |
static := (self class nameListEntryForStatic). |
|
778 |
notStatic := (self class nameListEntryForNonStatic). |
|
5591 | 779 |
|
8694 | 780 |
protocols := self selectedProtocols value ? #(). |
781 |
protocols := protocols collect:[:each | (each ifNil:[noCat]) string]. |
|
782 |
lastGeneratedProtocols := protocols. |
|
783 |
protocols := protocols asSet. |
|
784 |
||
785 |
(leafClasses size > 0 and:[protocols size > 0]) ifTrue:[ |
|
786 |
allProtocols := protocols includes:(self class nameListEntryForALL). |
|
787 |
superSendProtocols := protocols includes:(self class nameListEntryForSuperSend). |
|
788 |
uncommentedProtocols := protocols includes:(self class nameListEntryForUncommented). |
|
8718 | 789 |
obsoleteProtocols := protocols includes:(self class nameListEntryForObsolete). |
8733 | 790 |
documentationProtocols := protocols includes:(self class nameListEntryForDocumentation). |
5591 | 791 |
|
8694 | 792 |
"/ packages := packageFilter value value. |
793 |
"/ (packages notNil and:[packages includes:(self class nameListEntryForALL)]) ifTrue:[ |
|
794 |
"/ packages := nil. |
|
795 |
"/ ]. |
|
5591 | 796 |
|
8694 | 797 |
remainingClasses := leafClasses copy asIdentitySet. |
798 |
remainingCategories := protocols copy asSet. |
|
5591 | 799 |
|
8694 | 800 |
classesAlreadyDone := IdentitySet new. |
801 |
classSelectorPairsAlreadyDone := Set new. |
|
5591 | 802 |
|
8694 | 803 |
leafClasses do:[:aLeafClass | |
804 |
(self classesToProcessForClasses:(Array with:aLeafClass)) do:[:aClass | |
|
805 |
|supportsMethodCategories isJavaClass anyInThisClass| |
|
5591 | 806 |
|
8694 | 807 |
(classesAlreadyDone includes:aClass) ifFalse:[ |
808 |
classesAlreadyDone add:aClass. |
|
5591 | 809 |
|
8694 | 810 |
supportsMethodCategories := aClass supportsMethodCategories. |
811 |
isJavaClass := aClass isJavaClass. |
|
812 |
anyInThisClass := false. |
|
5591 | 813 |
|
8694 | 814 |
aClass methodDictionary keysAndValuesDo:[:sel :mthd | |
815 |
|cat mPkg| |
|
5591 | 816 |
|
8694 | 817 |
supportsMethodCategories ifTrue:[ |
818 |
cat := mthd category. |
|
819 |
] ifFalse:[ |
|
820 |
isJavaClass ifTrue:[ |
|
821 |
cat := mthd isStatic ifTrue:[static] ifFalse:[notStatic] |
|
822 |
] ifFalse:[ |
|
823 |
cat := noCat. |
|
824 |
] |
|
825 |
]. |
|
826 |
(allProtocols |
|
827 |
or:[ (protocols includes:cat) |
|
828 |
or:[ (superSendProtocols and:[ mthd superMessages notEmptyOrNil ]) |
|
8733 | 829 |
or:[ (uncommentedProtocols and:[ mthd comment isEmptyOrNil and:[ mthd isVersionMethod not]]) |
830 |
or:[ (obsoleteProtocols and:[ mthd isObsolete ]) |
|
831 |
or:[ (documentationProtocols and:[mthd isDocumentationMethod]) ]]]]]) ifTrue:[ |
|
8694 | 832 |
mPkg := mthd package. |
833 |
(packages isNil or:[mPkg = noPackage or:[packages includes:mPkg]]) |
|
834 |
ifTrue:[ |
|
835 |
(methodVisibilityHolder value == #class) ifTrue:[ |
|
836 |
whatToDo value:aClass value:cat value:sel value:mthd. |
|
837 |
] ifFalse:[ |
|
838 |
(classSelectorPairsAlreadyDone includes:(aLeafClass->sel)) ifFalse:[ |
|
839 |
classSelectorPairsAlreadyDone add:(aLeafClass->sel). |
|
840 |
whatToDo value:aClass value:cat value:sel value:mthd. |
|
841 |
]. |
|
842 |
]. |
|
5591 | 843 |
|
8694 | 844 |
anyInThisClass := true. |
845 |
remainingCategories remove:cat ifAbsent:nil. |
|
846 |
] |
|
847 |
] |
|
7296
dfea12500274
do not suppress loose methods
Claus Gittinger <cg@exept.de>
parents:
7123
diff
changeset
|
848 |
]. |
8694 | 849 |
anyInThisClass ifTrue:[ remainingClasses remove:aClass ifAbsent:nil. ]. |
850 |
]. |
|
851 |
]. |
|
852 |
]. |
|
853 |
remainingClasses do:[:aClass | |
|
854 |
whatToDo value:aClass value:nil value:nil value:nil. |
|
855 |
]. |
|
856 |
remainingCategories do:[:cat | |
|
857 |
whatToDo value:nil value:cat value:nil value:nil. |
|
858 |
] |
|
859 |
] |
|
860 |
] |
|
5591 | 861 |
|
7296
dfea12500274
do not suppress loose methods
Claus Gittinger <cg@exept.de>
parents:
7123
diff
changeset
|
862 |
"Created: / 05-02-2000 / 13:42:10 / cg" |
7398
8a3a5fac2001
also show methods for other packages in the generated list
Claus Gittinger <cg@exept.de>
parents:
7296
diff
changeset
|
863 |
"Modified: / 13-10-2006 / 01:16:17 / cg" |
5591 | 864 |
! ! |
865 |
||
866 |
!MethodCategoryList methodsFor:'private'! |
|
867 |
||
868 |
class:cls protocol:cat includesMethodsInAnyPackage:packageFilter |
|
869 |
cls methodDictionary keysAndValuesDo:[:sel :mthd | |
|
870 |
mthd category == cat ifTrue:[ |
|
871 |
(packageFilter includes:mthd package) ifTrue:[ |
|
872 |
^ true |
|
873 |
] |
|
874 |
] |
|
875 |
]. |
|
876 |
^ false |
|
877 |
! |
|
878 |
||
879 |
class:cls protocol:cat includesModsOfClassVariable:variablesToHighLight |
|
880 |
^ self class:cls protocol:cat includesRefsToVariable:variablesToHighLight askParserWith:#modifiedClassVars |
|
881 |
! |
|
882 |
||
883 |
class:cls protocol:cat includesModsOfInstanceVariable:variablesToHighLight |
|
884 |
^ self class:cls protocol:cat includesRefsToVariable:variablesToHighLight askParserWith:#modifiedInstVars |
|
885 |
! |
|
886 |
||
887 |
class:cls protocol:cat includesRefsToClassVariable:variablesToHighLight |
|
888 |
^ self class:cls protocol:cat includesRefsToVariable:variablesToHighLight askParserWith:#usedClassVars |
|
889 |
! |
|
890 |
||
891 |
class:cls protocol:cat includesRefsToInstanceVariable:variablesToHighLight |
|
892 |
^ self class:cls protocol:cat includesRefsToVariable:variablesToHighLight askParserWith:#usedInstVars |
|
893 |
! |
|
894 |
||
895 |
class:cls protocol:cat includesRefsToVariable:variablesToHighLight askParserWith:querySelector |
|
896 |
|anyVarNameAccessable| |
|
897 |
||
898 |
anyVarNameAccessable := cls allInstVarNames includesAny:variablesToHighLight. |
|
899 |
anyVarNameAccessable ifFalse:[ |
|
900 |
anyVarNameAccessable := cls theNonMetaclass allClassVarNames includesAny:variablesToHighLight. |
|
901 |
]. |
|
902 |
anyVarNameAccessable ifFalse:[ |
|
903 |
"/ no need to parse |
|
904 |
^ false |
|
905 |
]. |
|
906 |
||
907 |
cls selectorsAndMethodsDo:[:sel :mthd | |
|
908 |
|src parser usedVars| |
|
909 |
||
910 |
mthd category = cat ifTrue:[ |
|
911 |
src := mthd source. |
|
912 |
src notNil ifTrue:[ |
|
913 |
" |
|
914 |
before doing a slow parse, quickly scan the |
|
915 |
methods source for the variables name ... |
|
916 |
" |
|
917 |
(variablesToHighLight contains:[:varName | (src findString:varName) ~~ 0]) ifTrue:[ |
|
918 |
parser := Parser |
|
919 |
parseMethod:src |
|
920 |
in:cls |
|
921 |
ignoreErrors:true |
|
922 |
ignoreWarnings:true. |
|
923 |
(parser notNil and:[parser ~~ #Error]) ifTrue:[ |
|
924 |
usedVars := parser perform:querySelector. |
|
925 |
(usedVars includesAny:variablesToHighLight) |
|
926 |
ifTrue:[ |
|
927 |
^ true |
|
928 |
] |
|
929 |
] |
|
930 |
] |
|
931 |
] ifFalse:[ |
|
932 |
Transcript showCR:'Oops - cannot access methods source'. |
|
933 |
] |
|
934 |
] |
|
935 |
]. |
|
936 |
^ false |
|
937 |
! |
|
938 |
||
939 |
classesToProcessForClasses:classes |
|
940 |
^ self classesToProcessForClasses:classes withVisibility:methodVisibilityHolder value. |
|
941 |
! |
|
942 |
||
943 |
listOfMethodCategories |
|
944 |
|categoryList plainCategories classesProcessed leafClassesProcessed |
|
945 |
generator nm variablesToHighlight classVarsToHighLight |
|
946 |
itemsWithVarRefs itemsWithVarMods itemsWithExtensions itemsWithSuppressedExtensions |
|
7501 | 947 |
itemsInChangeSet itemsInRemoteChangeSet |
8723 | 948 |
packageFilterOnInput packageFilter nameListEntryForALL changeSet |
949 |
emphasizedPlus emphasisForRef emphasisForMod |
|
8733 | 950 |
numObsolete numSuper numUncommented numDocumentation| |
5591 | 951 |
|
952 |
generator := inGeneratorHolder value. |
|
953 |
generator isNil ifTrue:[ ^ #() ]. |
|
954 |
||
955 |
nameListEntryForALL := self class nameListEntryForALL. |
|
956 |
||
957 |
packageFilterOnInput := self packageFilterOnInput value. |
|
958 |
(packageFilterOnInput notNil and:[packageFilterOnInput includes:nameListEntryForALL]) ifTrue:[ |
|
5814 | 959 |
packageFilterOnInput := nil |
5591 | 960 |
]. |
961 |
packageFilter := self packageFilter value. |
|
962 |
(packageFilter notNil and:[packageFilter includes:nameListEntryForALL]) ifTrue:[ |
|
5814 | 963 |
packageFilter := nil |
5591 | 964 |
]. |
965 |
||
966 |
categoryList := Set new. |
|
967 |
itemsWithVarRefs := Set new. |
|
968 |
itemsWithVarMods := Set new. |
|
969 |
itemsWithExtensions := Set new. |
|
970 |
itemsWithSuppressedExtensions := Set new. |
|
971 |
itemsInChangeSet := Set new. |
|
7501 | 972 |
itemsInRemoteChangeSet := Set new. |
5591 | 973 |
plainCategories := Set new. |
974 |
classesProcessed := IdentitySet new. |
|
975 |
leafClassesProcessed := IdentitySet new. |
|
976 |
variablesToHighlight := variableFilter value. |
|
977 |
classVarsToHighLight := filterClassVars value. |
|
8733 | 978 |
numObsolete := numSuper := numUncommented := numDocumentation := 0. |
5591 | 979 |
|
980 |
generator do:[:clsIn :catIn | |
|
5814 | 981 |
|emptyProtocols clsName doHighLight doHighLightRed suppress| |
5591 | 982 |
|
5814 | 983 |
leafClassesProcessed add:clsIn. |
984 |
(self classesToProcessForClasses:(Array with:clsIn)) do:[:cls | |
|
985 |
|cats| |
|
5591 | 986 |
|
5814 | 987 |
classesProcessed add:cls. |
5591 | 988 |
|
5814 | 989 |
cls ~~ clsIn ifTrue:[ |
990 |
cats := cls categories |
|
991 |
] ifFalse:[ |
|
992 |
cats := Array with:catIn. |
|
993 |
]. |
|
994 |
cats do:[:cat | |
|
995 |
cat notNil ifTrue:[ |
|
996 |
suppress := packageFilterOnInput notNil |
|
997 |
and:[ (self class:cls protocol:cat includesMethodsInAnyPackage:packageFilterOnInput) not ]. |
|
5591 | 998 |
|
5814 | 999 |
suppress ifFalse:[ |
8723 | 1000 |
variablesToHighlight notEmptyOrNil ifTrue:[ |
5814 | 1001 |
(itemsWithVarRefs includes:cat) ifFalse:[ |
1002 |
classVarsToHighLight ifTrue:[ |
|
1003 |
doHighLight := self class:cls protocol:cat includesRefsToClassVariable:variablesToHighlight. |
|
1004 |
doHighLight ifTrue:[ |
|
1005 |
doHighLightRed := self class:cls protocol:cat includesModsOfClassVariable:variablesToHighlight. |
|
1006 |
]. |
|
1007 |
] ifFalse:[ |
|
1008 |
doHighLight := self class:cls protocol:cat includesRefsToInstanceVariable:variablesToHighlight. |
|
1009 |
doHighLight ifTrue:[ |
|
1010 |
doHighLightRed := self class:cls protocol:cat includesModsOfInstanceVariable:variablesToHighlight. |
|
1011 |
]. |
|
1012 |
]. |
|
1013 |
doHighLight ifTrue:[ |
|
1014 |
itemsWithVarRefs add:cat. |
|
1015 |
doHighLightRed ifTrue:[ |
|
1016 |
itemsWithVarMods add:cat. |
|
1017 |
]. |
|
1018 |
] |
|
1019 |
] |
|
8733 | 1020 |
]. |
8723 | 1021 |
cls selectorsAndMethodsDo:[:sel :mthd | |
1022 |
mthd category = cat ifTrue:[ |
|
1023 |
mthd isObsolete ifTrue:[ numObsolete := numObsolete + 1 ]. |
|
1024 |
mthd superMessages notEmptyOrNil ifTrue:[ numSuper := numSuper + 1 ]. |
|
8733 | 1025 |
mthd comment isEmptyOrNil ifTrue:[ |
1026 |
"/ version method does not count !! |
|
1027 |
mthd isVersionMethod ifFalse:[ |
|
1028 |
numUncommented := numUncommented + 1 |
|
1029 |
]. |
|
1030 |
] ifFalse:[ |
|
1031 |
mthd isDocumentationMethod ifTrue:[ |
|
1032 |
numDocumentation := numDocumentation + 1 |
|
1033 |
]. |
|
1034 |
]. |
|
8723 | 1035 |
] |
1036 |
]. |
|
1037 |
||
5814 | 1038 |
categoryList add:cat. |
5591 | 1039 |
|
5814 | 1040 |
AdditionalEmptyCategoriesPerClassName size > 0 ifTrue:[ |
1041 |
clsName := cls name. |
|
1042 |
emptyProtocols := AdditionalEmptyCategoriesPerClassName at:clsName ifAbsent:nil. |
|
1043 |
emptyProtocols size > 0 ifTrue:[ |
|
1044 |
emptyProtocols remove:cat ifAbsent:nil. |
|
1045 |
]. |
|
1046 |
emptyProtocols size == 0 ifTrue:[ |
|
1047 |
AdditionalEmptyCategoriesPerClassName removeKey:clsName ifAbsent:nil |
|
1048 |
]. |
|
1049 |
]. |
|
1050 |
] |
|
1051 |
] |
|
1052 |
] |
|
1053 |
] |
|
1054 |
]. |
|
1055 |
||
1056 |
changeSet := ChangeSet current. |
|
5591 | 1057 |
|
1058 |
classesProcessed do:[:eachClass | |
|
5814 | 1059 |
|classPackage| |
5591 | 1060 |
|
5814 | 1061 |
classPackage := eachClass package. |
6706 | 1062 |
eachClass methodDictionary keysAndValuesDo:[:mSelector :mthd | |
5814 | 1063 |
|mPackage mCategory| |
5591 | 1064 |
|
5814 | 1065 |
mPackage := mthd package. |
1066 |
mCategory := mthd category. |
|
5591 | 1067 |
|
5814 | 1068 |
#fixme. |
1069 |
mPackage = classPackage ifTrue:[ |
|
1070 |
mPackage ~~ classPackage ifTrue:[ |
|
1071 |
mthd setPackage:(mPackage := mPackage string asSymbol). |
|
1072 |
] |
|
1073 |
]. |
|
1074 |
mPackage ~~ classPackage ifTrue:[ |
|
6877 | 1075 |
mPackage ~= Project noProjectID ifTrue:[ |
1076 |
itemsWithExtensions add:mCategory. |
|
5591 | 1077 |
|
6877 | 1078 |
(packageFilter notNil |
1079 |
and:[ (packageFilter includes:mPackage) not]) |
|
1080 |
ifTrue:[ |
|
1081 |
itemsWithSuppressedExtensions add:mCategory. |
|
1082 |
]. |
|
5814 | 1083 |
]. |
1084 |
]. |
|
6706 | 1085 |
(changeSet includesChangeForClass:eachClass selector:mSelector) ifTrue:[ |
1086 |
itemsInChangeSet add:mCategory. |
|
7501 | 1087 |
]. |
1088 |
(SmallTeam notNil and:[ SmallTeam includesChangeForClass:eachClass selector:mSelector] ) ifTrue:[ |
|
1089 |
itemsInRemoteChangeSet add:mCategory. |
|
1090 |
]. |
|
5814 | 1091 |
] |
5591 | 1092 |
]. |
1093 |
||
1094 |
categoryList := categoryList asOrderedCollection. |
|
1095 |
self rawProtocolList removeAll. |
|
1096 |
rawProtocolList addAll:categoryList. |
|
1097 |
||
6698 | 1098 |
emphasizedPlus := (self colorizeForDifferentPackage:' [ + ]'). |
1099 |
emphasisForRef := UserPreferences current emphasisForReadVariable. |
|
1100 |
emphasisForMod := UserPreferences current emphasisForWrittenVariable. |
|
1101 |
||
6704 | 1102 |
(itemsInChangeSet notEmpty |
7501 | 1103 |
or:[itemsInRemoteChangeSet notEmpty |
6704 | 1104 |
or:[itemsWithExtensions notEmpty |
7501 | 1105 |
or:[itemsWithVarRefs notEmpty]] ]) ifTrue:[ |
6698 | 1106 |
rawProtocolList keysAndValuesDo:[:idx :cat | |
7501 | 1107 |
|item inChangeSet inRemoteChangeSet hasExtensions hasVarRef hasVarMod| |
5591 | 1108 |
|
6698 | 1109 |
item := cat. |
7501 | 1110 |
|
6701 | 1111 |
inChangeSet := itemsInChangeSet includes:cat. |
1112 |
inChangeSet ifTrue:[ |
|
1113 |
item := self colorizeForChangedCode:cat. |
|
1114 |
]. |
|
1115 |
||
7501 | 1116 |
inRemoteChangeSet := itemsInRemoteChangeSet includes:cat. |
1117 |
inRemoteChangeSet ifTrue:[ |
|
1118 |
item := (self colorizeForChangedCodeInSmallTeam:'!! '),item. |
|
1119 |
]. |
|
1120 |
||
6698 | 1121 |
hasVarRef := itemsWithVarRefs includes:cat. |
1122 |
hasVarRef ifTrue:[ |
|
1123 |
hasVarMod := itemsWithVarMods includes:cat. |
|
6701 | 1124 |
item := item asText |
1125 |
emphasisAllAdd:(hasVarMod ifTrue:emphasisForMod ifFalse:emphasisForRef). |
|
1126 |
]. |
|
5591 | 1127 |
|
6701 | 1128 |
hasExtensions := itemsWithExtensions includes:cat. |
1129 |
hasExtensions ifTrue:[ |
|
1130 |
item := item , emphasizedPlus. |
|
6698 | 1131 |
]. |
6877 | 1132 |
inChangeSet ifTrue:[ |
7056 | 1133 |
item := item , self class markForBeingInChangeList. |
6877 | 1134 |
]. |
6698 | 1135 |
categoryList at:idx put:item. |
1136 |
] |
|
5591 | 1137 |
]. |
1138 |
||
1139 |
classesProcessed size > 0 ifTrue:[ |
|
5814 | 1140 |
"/ those are simulated - in ST/X, empty categories do not |
1141 |
"/ really exist; however, during browsing, it makes sense. |
|
1142 |
AdditionalEmptyCategoriesPerClassName size > 0 ifTrue:[ |
|
1143 |
AdditionalEmptyCategoriesPerClassName keysAndValuesDo:[:clsName :protocols | |
|
1144 |
(classesProcessed contains:[:cls | cls name = clsName]) ifTrue:[ |
|
1145 |
categoryList addAll:protocols. |
|
1146 |
rawProtocolList addAll:protocols. |
|
1147 |
] |
|
1148 |
] |
|
1149 |
]. |
|
5591 | 1150 |
]. |
1151 |
||
1152 |
self makeIndependent. |
|
1153 |
classes := classesProcessed. |
|
1154 |
leafClasses := leafClassesProcessed. |
|
1155 |
self makeDependent. |
|
1156 |
||
1157 |
rawProtocolList sortWith:categoryList. |
|
1158 |
categoryList size == 1 ifTrue:[ |
|
5814 | 1159 |
nm := categoryList first string. |
1160 |
classes size == 1 ifTrue:[ |
|
1161 |
nm := classes first name , '-' , nm |
|
1162 |
]. |
|
1163 |
self protocolLabelHolder value:nm |
|
5591 | 1164 |
]. |
1165 |
categoryList notEmpty ifTrue:[ |
|
5814 | 1166 |
noAllItem value ~~ true ifTrue:[ |
8694 | 1167 |
categoryList addFirst:(nameListEntryForALL asText allItalic). |
5814 | 1168 |
rawProtocolList addFirst:nameListEntryForALL. |
8694 | 1169 |
]. |
1170 |
self showPseudoProtocols value ifTrue:[ |
|
8723 | 1171 |
numSuper > 0 ifTrue:[ |
1172 |
categoryList add:((self class nameListEntryForSuperSend bindWith:numSuper) asText allItalic). |
|
1173 |
rawProtocolList add:self class nameListEntryForSuperSend. |
|
1174 |
]. |
|
8733 | 1175 |
numDocumentation > 0 ifTrue:[ |
1176 |
categoryList add:((self class nameListEntryForDocumentation bindWith:numDocumentation) asText allItalic). |
|
1177 |
rawProtocolList add:self class nameListEntryForDocumentation. |
|
1178 |
]. |
|
8723 | 1179 |
numUncommented > 0 ifTrue:[ |
1180 |
categoryList add:((self class nameListEntryForUncommented bindWith:numUncommented) asText allItalic). |
|
1181 |
rawProtocolList add:self class nameListEntryForUncommented. |
|
1182 |
]. |
|
1183 |
numObsolete > 0 ifTrue:[ |
|
1184 |
categoryList add:((self class nameListEntryForObsolete bindWith:numObsolete) asText allItalic). |
|
1185 |
rawProtocolList add:self class nameListEntryForObsolete. |
|
8733 | 1186 |
]. |
8694 | 1187 |
]. |
5591 | 1188 |
]. |
1189 |
^ categoryList |
|
1190 |
||
6877 | 1191 |
"Created: / 05-02-2000 / 13:42:11 / cg" |
7501 | 1192 |
"Modified: / 10-11-2006 / 17:35:53 / cg" |
5591 | 1193 |
! |
1194 |
||
1195 |
makeDependent |
|
7501 | 1196 |
Smalltalk addDependent:self. |
1197 |
"/ ChangeSet addDependent:self. |
|
1198 |
||
1199 |
"Modified: / 10-11-2006 / 17:57:13 / cg" |
|
5591 | 1200 |
! |
1201 |
||
1202 |
makeIndependent |
|
1203 |
Smalltalk removeDependent:self. |
|
8219 | 1204 |
"/ ChangeSet removeDependent:self. |
5591 | 1205 |
! |
1206 |
||
1207 |
release |
|
1208 |
super release. |
|
1209 |
||
1210 |
filterClassVars removeDependent:self. |
|
1211 |
methodVisibilityHolder removeDependent:self. |
|
1212 |
noAllItem removeDependent:self. |
|
1213 |
packageFilterOnInput removeDependent:self. |
|
1214 |
selectedProtocolIndices removeDependent:self. |
|
1215 |
variableFilter removeDependent:self. |
|
1216 |
! |
|
1217 |
||
1218 |
updateList |
|
1219 |
|prevClasses prevSelection newSelection newList oldList sameContents selectedProtocolsHolder rawList| |
|
1220 |
||
1221 |
selectedProtocolsHolder := self selectedProtocols. |
|
1222 |
||
1223 |
prevClasses := classes ifNil:[ #() ] ifNotNil:[ classes copy ]. |
|
1224 |
oldList := self protocolList value copy. |
|
1225 |
newList := self listOfMethodCategories. |
|
1226 |
||
1227 |
"/ oldListSize := self browserNameList size. |
|
1228 |
"/ newListSize := newList size. |
|
1229 |
self selectedProtocolIndices removeDependent:self. |
|
1230 |
sameContents := self updateListFor:newList. |
|
1231 |
self selectedProtocolIndices addDependent:self. |
|
1232 |
sameContents ifFalse:[ |
|
1233 |
prevSelection := lastSelectedProtocols ? (selectedProtocolsHolder value) ? #(). |
|
1234 |
"/ prevSelection := selectedProtocolsHolder value ? lastSelectedProtocols ? #(). |
|
1235 |
||
1236 |
rawList := self rawProtocolList value. |
|
1237 |
newSelection := prevSelection select:[:item | rawList includes:item string]. |
|
1238 |
||
1239 |
newSelection size > 0 ifTrue:[ |
|
1240 |
"/ force change (for dependents) |
|
1241 |
"/ selectedProtocolsHolder value:nil. |
|
1242 |
"/ selectedProtocolsHolder value:newSelection. |
|
1243 |
selectedProtocolsHolder setValue:newSelection. |
|
1244 |
selectedProtocolsHolder changed:#value. |
|
1245 |
] ifFalse:[ |
|
1246 |
prevSelection := selectedProtocolsHolder value. |
|
1247 |
selectedProtocolsHolder value:nil. |
|
1248 |
]. |
|
1249 |
(prevSelection size > 0 or:[newSelection size > 0]) ifTrue:[ |
|
1250 |
self enqueueDelayedUpdateOutputGenerator. |
|
1251 |
"/ self updateOutputGenerator. |
|
1252 |
]. |
|
1253 |
||
1254 |
"/ prevSelection notNil ifTrue:[ |
|
1255 |
"/ lastSelectedProtocols := prevSelection. |
|
1256 |
"/ ]. |
|
1257 |
] ifTrue:[ |
|
1258 |
"/ same list - but classes might have changed |
|
1259 |
"/ that is the case, if the class selection has been changed, |
|
1260 |
"/ to another class which has the same categories. |
|
1261 |
(prevClasses size ~= classes size |
|
1262 |
or:[prevClasses asOrderedCollection ~= (classes ? #()) asOrderedCollection ]) ifTrue:[ |
|
1263 |
(newList size > 0 or:[oldList size > 0]) ifTrue:[ |
|
1264 |
self updateOutputGenerator |
|
1265 |
] |
|
1266 |
] ifFalse:[ |
|
1267 |
"/ self protocolList value:newList. |
|
1268 |
] |
|
1269 |
]. |
|
1270 |
listValid := true. |
|
1271 |
||
1272 |
"Created: / 5.2.2000 / 13:42:11 / cg" |
|
1273 |
"Modified: / 29.2.2000 / 11:08:55 / cg" |
|
1274 |
! ! |
|
1275 |
||
1276 |
!MethodCategoryList methodsFor:'special'! |
|
1277 |
||
1278 |
addAdditionalProtocol:aProtocol forClass:aClass |
|
1279 |
|categories| |
|
1280 |
||
1281 |
"/ those are simulated - in ST/X, empty categories do not |
|
1282 |
"/ really exist; however, during browsing, it makes sense. |
|
1283 |
AdditionalEmptyCategoriesPerClassName isNil ifTrue:[ |
|
6664
50eb2e92aaed
changed change-update aspect when changing some method category
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
1284 |
AdditionalEmptyCategoriesPerClassName := Dictionary new. |
5591 | 1285 |
]. |
1286 |
categories := AdditionalEmptyCategoriesPerClassName at:aClass name ifAbsent:nil. |
|
1287 |
categories isNil ifTrue:[ |
|
6664
50eb2e92aaed
changed change-update aspect when changing some method category
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
1288 |
categories := Set new. |
50eb2e92aaed
changed change-update aspect when changing some method category
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
1289 |
AdditionalEmptyCategoriesPerClassName at:aClass name put:categories. |
5591 | 1290 |
]. |
1291 |
categories add:aProtocol. |
|
6664
50eb2e92aaed
changed change-update aspect when changing some method category
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
1292 |
aClass changed:#organization. "/ not really ... to force update |
50eb2e92aaed
changed change-update aspect when changing some method category
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
1293 |
Smalltalk changed:#methodCategoryAdded with:(Array with:aClass with:aProtocol). "/ not really ... to force update |
5591 | 1294 |
! |
1295 |
||
1296 |
additionalProtocolForClass:aClass |
|
1297 |
"/ those are simulated - in ST/X, empty categories do not |
|
1298 |
"/ really exist; however, during browsing, it makes sense. |
|
1299 |
AdditionalEmptyCategoriesPerClassName isNil ifTrue:[ ^ #() ]. |
|
1300 |
^ AdditionalEmptyCategoriesPerClassName at:aClass name ifAbsent:[ #() ]. |
|
1301 |
! |
|
1302 |
||
1303 |
clearLastSelectedProtocol |
|
1304 |
lastSelectedProtocols := nil |
|
1305 |
! |
|
1306 |
||
6342
698b45d51014
new method-category initial offer
Claus Gittinger <cg@exept.de>
parents:
5950
diff
changeset
|
1307 |
lastSelectedProtocols |
698b45d51014
new method-category initial offer
Claus Gittinger <cg@exept.de>
parents:
5950
diff
changeset
|
1308 |
^ lastSelectedProtocols |
698b45d51014
new method-category initial offer
Claus Gittinger <cg@exept.de>
parents:
5950
diff
changeset
|
1309 |
! |
698b45d51014
new method-category initial offer
Claus Gittinger <cg@exept.de>
parents:
5950
diff
changeset
|
1310 |
|
5591 | 1311 |
removeAdditionalProtocol:aListOfProtocols forClass:aClass |
1312 |
|categories| |
|
1313 |
||
1314 |
"/ those are simulated - in ST/X, empty categories do not |
|
1315 |
"/ really exist; however, during browsing, it makes sense. |
|
1316 |
||
1317 |
AdditionalEmptyCategoriesPerClassName isNil ifTrue:[^ self]. |
|
1318 |
||
1319 |
categories := AdditionalEmptyCategoriesPerClassName at:aClass name ifAbsent:nil. |
|
1320 |
categories isNil ifTrue:[^ self]. |
|
1321 |
categories removeAllFoundIn:aListOfProtocols. |
|
1322 |
categories isEmpty ifTrue:[ |
|
6664
50eb2e92aaed
changed change-update aspect when changing some method category
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
1323 |
AdditionalEmptyCategoriesPerClassName removeKey:aClass name. |
5591 | 1324 |
]. |
1325 |
||
1326 |
aClass changed:#organization. "/ not really ... to force update |
|
6664
50eb2e92aaed
changed change-update aspect when changing some method category
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
1327 |
Smalltalk changed:#methodCategoriesRemoved with:(Array with:aClass with:aListOfProtocols). "/ not really ... to force update |
5591 | 1328 |
! |
1329 |
||
1330 |
removeAllAdditionalProtocol |
|
1331 |
"/ those are simulated - in ST/X, empty categories do not |
|
1332 |
"/ really exist; however, during browsing, it makes sense. |
|
1333 |
AdditionalEmptyCategoriesPerClassName := nil |
|
1334 |
||
1335 |
||
1336 |
! |
|
1337 |
||
1338 |
removeAllAdditionalProtocolForClass:aClass |
|
1339 |
"/ those are simulated - in ST/X, empty categories do not |
|
1340 |
"/ really exist; however, during browsing, it makes sense. |
|
1341 |
AdditionalEmptyCategoriesPerClassName notNil ifTrue:[ |
|
1342 |
AdditionalEmptyCategoriesPerClassName removeKey:aClass name ifAbsent:nil |
|
1343 |
]. |
|
1344 |
||
1345 |
||
1346 |
! |
|
1347 |
||
1348 |
renameAdditionalProtocol:oldName to:newName forClass:aClass |
|
1349 |
|categories| |
|
1350 |
||
1351 |
"/ those are simulated - in ST/X, empty categories do not |
|
1352 |
"/ really exist; however, during browsing, it makes sense. |
|
1353 |
||
1354 |
AdditionalEmptyCategoriesPerClassName isNil ifTrue:[^ self]. |
|
1355 |
categories := AdditionalEmptyCategoriesPerClassName at:aClass name ifAbsent:nil. |
|
1356 |
categories isNil ifTrue:[^ self]. |
|
1357 |
categories remove:oldName ifAbsent:nil. |
|
1358 |
categories add:newName. |
|
1359 |
||
1360 |
aClass changed:#organization. "/ not really ... to force update |
|
6664
50eb2e92aaed
changed change-update aspect when changing some method category
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
1361 |
Smalltalk changed:#methodCategoryRenamed with:(Array with:aClass with:oldName with:newName). "/ not really ... to force update |
5591 | 1362 |
! ! |
1363 |
||
1364 |
!MethodCategoryList class methodsFor:'documentation'! |
|
1365 |
||
1366 |
version |
|
8733 | 1367 |
^ '$Header: /cvs/stx/stx/libtool/Tools_MethodCategoryList.st,v 1.27 2009-09-21 13:11:31 cg Exp $' |
5591 | 1368 |
! ! |