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