author | Claus Gittinger <cg@exept.de> |
Thu, 16 Mar 2006 23:33:21 +0100 | |
changeset 6712 | b044694deb7d |
parent 6492 | 9c446e709216 |
child 6716 | 4b255b8e6dfa |
permissions | -rw-r--r-- |
6179 | 1 |
" |
2 |
COPYRIGHT (c) 2004 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:#ClassList |
|
18 |
instanceVariableNames:'classList classNameList meta lastSelectedClasses |
|
19 |
selectedClassNameIndices currentNamespace hidePrivateClasses |
|
20 |
unloadedClassesColor markApplicationsHolder' |
|
21 |
classVariableNames:'' |
|
22 |
poolDictionaries:'' |
|
23 |
category:'Interface-Browsers-New' |
|
24 |
! |
|
25 |
||
26 |
!ClassList class methodsFor:'documentation'! |
|
27 |
||
6179 | 28 |
copyright |
29 |
" |
|
30 |
COPYRIGHT (c) 2004 by eXept Software AG |
|
31 |
All Rights Reserved |
|
32 |
||
33 |
This software is furnished under a license and may be used |
|
34 |
only in accordance with the terms of that license and with the |
|
35 |
inclusion of the above copyright notice. This software may not |
|
36 |
be provided or otherwise made available to, or used by, any |
|
37 |
other person. No title to or ownership of the software is |
|
38 |
hereby transferred. |
|
39 |
" |
|
40 |
! |
|
41 |
||
5591 | 42 |
documentation |
43 |
" |
|
44 |
embeddable application displaying the classes as listed by |
|
45 |
the inputGenerator. |
|
46 |
Provides an outputGenerator, which enumerates the classes and |
|
47 |
their protocols (method-categories) in the selected classes. |
|
48 |
||
49 |
[author:] |
|
50 |
Claus Gittinger (cg@exept.de) |
|
51 |
" |
|
52 |
||
53 |
||
54 |
! ! |
|
55 |
||
56 |
!ClassList class methodsFor:'interface specs'! |
|
57 |
||
58 |
singleClassWindowSpec |
|
59 |
"This resource specification was automatically generated |
|
60 |
by the UIPainter of ST/X." |
|
61 |
||
62 |
"Do not manually edit this!! If it is corrupted, |
|
63 |
the UIPainter may not be able to read the specification." |
|
64 |
||
65 |
" |
|
66 |
UIPainter new openOnClass:ClassList andSelector:#singleClassWindowSpec |
|
67 |
ClassList new openInterface:#singleClassWindowSpec |
|
68 |
" |
|
69 |
||
70 |
<resource: #canvas> |
|
71 |
||
72 |
^ |
|
73 |
#(#FullSpec |
|
5592 | 74 |
#name: #windowSpec |
75 |
#window: |
|
5591 | 76 |
#(#WindowSpec |
5592 | 77 |
#label: 'ClassList' |
78 |
#name: 'ClassList' |
|
79 |
#min: #(#Point 0 0) |
|
80 |
#max: #(#Point 1024 721) |
|
81 |
#bounds: #(#Rectangle 12 22 312 322) |
|
82 |
) |
|
83 |
#component: |
|
5591 | 84 |
#(#SpecCollection |
5592 | 85 |
#collection: #( |
86 |
#(#LabelSpec |
|
87 |
#label: 'ClassName' |
|
88 |
#name: 'ClassLabel' |
|
89 |
#layout: #(#LayoutFrame 0 0.0 0 0 0 1.0 25 0) |
|
90 |
#translateLabel: true |
|
91 |
#labelChannel: #classLabelHolder |
|
92 |
#menu: #menuHolder |
|
93 |
) |
|
5591 | 94 |
"/ #(#UISubSpecification |
95 |
"/ #name: 'MetaToggleSpec' |
|
96 |
"/ #layout: #(#LayoutFrame 0 0.0 -25 1.0 0 1.0 0 1.0) |
|
97 |
"/ #minorKey: #metaSpec |
|
98 |
"/ ) |
|
5592 | 99 |
) |
5591 | 100 |
|
5592 | 101 |
) |
5591 | 102 |
) |
103 |
! |
|
104 |
||
105 |
windowSpec |
|
106 |
"This resource specification was automatically generated |
|
107 |
by the UIPainter of ST/X." |
|
108 |
||
109 |
"Do not manually edit this!! If it is corrupted, |
|
110 |
the UIPainter may not be able to read the specification." |
|
111 |
||
112 |
" |
|
113 |
UIPainter new openOnClass:ClassList andSelector:#windowSpec |
|
114 |
ClassList new openInterface:#windowSpec |
|
115 |
ClassList open |
|
116 |
" |
|
117 |
||
118 |
<resource: #canvas> |
|
119 |
||
120 |
^ |
|
121 |
#(#FullSpec |
|
6468 | 122 |
#name: #windowSpec |
123 |
#window: |
|
5591 | 124 |
#(#WindowSpec |
6468 | 125 |
#label: 'ClassList' |
126 |
#name: 'ClassList' |
|
127 |
#min: #(#Point 0 0) |
|
128 |
#max: #(#Point 1024 721) |
|
129 |
#bounds: #(#Rectangle 16 46 316 346) |
|
130 |
) |
|
131 |
#component: |
|
5591 | 132 |
#(#SpecCollection |
6468 | 133 |
#collection: #( |
134 |
#(#SequenceViewSpec |
|
135 |
#name: 'List' |
|
136 |
#layout: #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0) |
|
137 |
#tabable: true |
|
138 |
#model: #selectedClassNameIndices |
|
139 |
#menu: #menuHolder |
|
140 |
#hasHorizontalScrollBar: true |
|
141 |
#hasVerticalScrollBar: true |
|
142 |
#miniScrollerHorizontal: true |
|
143 |
#isMultiSelect: true |
|
144 |
#valueChangeSelector: #selectionChangedByClick |
|
145 |
#useIndex: true |
|
146 |
#sequenceList: #classNameList |
|
147 |
#doubleClickChannel: #doubleClickChannel |
|
148 |
#properties: |
|
149 |
#(#PropertyListDictionary |
|
150 |
#dragArgument: nil |
|
151 |
#dropArgument: nil |
|
152 |
#canDropSelector: #canDropContext: |
|
153 |
#dropSelector: #doDropContext: |
|
154 |
) |
|
155 |
) |
|
156 |
) |
|
5591 | 157 |
|
6468 | 158 |
) |
5591 | 159 |
) |
160 |
! ! |
|
161 |
||
162 |
!ClassList class methodsFor:'plugIn spec'! |
|
163 |
||
164 |
aspectSelectors |
|
165 |
"This resource specification was automatically generated |
|
166 |
by the UIPainter of ST/X." |
|
167 |
||
168 |
"Do not manually edit this. If it is corrupted, |
|
169 |
the UIPainter may not be able to read the specification." |
|
170 |
||
171 |
"Return a description of exported aspects; |
|
172 |
these can be connected to aspects of an embedding application |
|
173 |
(if this app is embedded in a subCanvas)." |
|
174 |
||
175 |
^ #( |
|
176 |
#currentNamespace |
|
177 |
#(#doubleClickChannel #action ) |
|
178 |
#forceGeneratorTrigger |
|
179 |
#hidePrivateClasses |
|
180 |
#hideUnloadedClasses |
|
181 |
#immediateUpdate |
|
182 |
#inGeneratorHolder |
|
183 |
#menuHolder |
|
184 |
#meta |
|
185 |
#organizerMode |
|
186 |
#outGeneratorHolder |
|
187 |
#packageFilter |
|
188 |
#nameSpaceFilter |
|
189 |
#selectedClasses |
|
190 |
#selectionChangeCondition |
|
191 |
#showClassPackages |
|
192 |
#slaveMode |
|
193 |
#updateTrigger |
|
194 |
#markApplicationsHolder |
|
195 |
). |
|
196 |
||
197 |
"Modified: / 18.8.2000 / 18:49:08 / cg" |
|
198 |
! ! |
|
199 |
||
200 |
!ClassList methodsFor:'accessing'! |
|
201 |
||
202 |
markApplications |
|
203 |
"return the value of the instance variable 'markApplications' (automatically generated)" |
|
204 |
||
205 |
^ self markApplicationsHolder value |
|
206 |
||
207 |
"Created: / 3.11.2001 / 14:06:19 / cg" |
|
208 |
! |
|
209 |
||
210 |
markApplications:something |
|
211 |
"set the value of the instance variable 'markApplications' (automatically generated)" |
|
212 |
||
213 |
self markApplicationsHolder value:something. |
|
214 |
||
215 |
"Created: / 3.11.2001 / 14:06:25 / cg" |
|
216 |
! |
|
217 |
||
218 |
unloadedClassesColor |
|
219 |
"return the value of the instance variable 'unloadedClassesColor' (automatically generated)" |
|
220 |
||
221 |
^ unloadedClassesColor |
|
222 |
! |
|
223 |
||
224 |
unloadedClassesColor:something |
|
225 |
"set the value of the instance variable 'unloadedClassesColor' (automatically generated)" |
|
226 |
||
227 |
unloadedClassesColor := something. |
|
228 |
! ! |
|
229 |
||
230 |
!ClassList methodsFor:'aspects'! |
|
231 |
||
232 |
classLabelHolder |
|
233 |
^ self pseudoListLabelHolder |
|
234 |
! |
|
235 |
||
236 |
classList |
|
237 |
classList isNil ifTrue:[ |
|
238 |
classList := ValueHolder new. |
|
239 |
]. |
|
240 |
^ classList |
|
241 |
||
242 |
"Created: / 5.2.2000 / 13:42:16 / cg" |
|
243 |
"Modified: / 25.2.2000 / 02:21:07 / cg" |
|
244 |
! |
|
245 |
||
246 |
classNameList |
|
247 |
classNameList isNil ifTrue:[ |
|
248 |
classNameList := ValueHolder new |
|
249 |
]. |
|
250 |
^ classNameList |
|
251 |
! |
|
252 |
||
253 |
currentNamespace:aValueHolder |
|
254 |
currentNamespace notNil ifTrue:[ |
|
255 |
currentNamespace removeDependent:self |
|
256 |
]. |
|
257 |
currentNamespace := aValueHolder. |
|
258 |
currentNamespace notNil ifTrue:[ |
|
259 |
currentNamespace isBehavior ifTrue:[self halt:'should not happen']. |
|
260 |
currentNamespace addDependent:self |
|
261 |
]. |
|
262 |
||
263 |
"Modified: / 4.2.2000 / 23:34:28 / cg" |
|
264 |
"Created: / 5.2.2000 / 21:37:57 / cg" |
|
265 |
! |
|
266 |
||
267 |
doubleClick |
|
268 |
self halt:'should not happen'. |
|
269 |
! |
|
270 |
||
271 |
hidePrivateClasses |
|
272 |
hidePrivateClasses isNil ifTrue:[ |
|
273 |
hidePrivateClasses := false asValue. |
|
274 |
hidePrivateClasses addDependent:self. |
|
275 |
]. |
|
276 |
^ hidePrivateClasses. |
|
277 |
||
278 |
"Created: / 24.2.2000 / 15:06:44 / cg" |
|
279 |
! |
|
280 |
||
281 |
hidePrivateClasses:aValueHolder |
|
282 |
hidePrivateClasses notNil ifTrue:[ |
|
283 |
hidePrivateClasses removeDependent:self |
|
284 |
]. |
|
285 |
hidePrivateClasses := aValueHolder. |
|
286 |
hidePrivateClasses notNil ifTrue:[ |
|
287 |
hidePrivateClasses addDependent:self |
|
288 |
]. |
|
289 |
||
290 |
"Created: / 24.2.2000 / 15:06:46 / cg" |
|
291 |
! |
|
292 |
||
293 |
markApplicationsHolder |
|
294 |
markApplicationsHolder isNil ifTrue:[ |
|
295 |
markApplicationsHolder := true asValue. |
|
296 |
markApplicationsHolder addDependent:self. |
|
297 |
]. |
|
298 |
^ markApplicationsHolder. |
|
299 |
! |
|
300 |
||
301 |
markApplicationsHolder:aValueHolder |
|
302 |
markApplicationsHolder notNil ifTrue:[ |
|
303 |
markApplicationsHolder removeDependent:self |
|
304 |
]. |
|
305 |
markApplicationsHolder := aValueHolder. |
|
306 |
markApplicationsHolder notNil ifTrue:[ |
|
307 |
markApplicationsHolder addDependent:self |
|
308 |
]. |
|
309 |
||
310 |
"Created: / 24.2.2000 / 15:06:46 / cg" |
|
311 |
! |
|
312 |
||
313 |
meta |
|
314 |
meta isNil ifTrue:[ |
|
315 |
meta := false asValue. |
|
316 |
meta addDependent:self |
|
317 |
]. |
|
318 |
^ meta |
|
319 |
||
320 |
"Modified: / 31.1.2000 / 01:19:59 / cg" |
|
321 |
"Created: / 5.2.2000 / 13:42:16 / cg" |
|
322 |
! |
|
323 |
||
324 |
meta:aValueHolder |
|
325 |
"/ (aValueHolder == true or:[aValueHolder == false]) ifTrue:[self halt]. |
|
326 |
||
327 |
meta notNil ifTrue:[ |
|
328 |
meta removeDependent:self |
|
329 |
]. |
|
330 |
meta := aValueHolder. |
|
331 |
meta notNil ifTrue:[ |
|
332 |
meta addDependent:self |
|
333 |
]. |
|
334 |
! |
|
335 |
||
336 |
selectedClassNameIndices |
|
337 |
selectedClassNameIndices isNil ifTrue:[ |
|
338 |
selectedClassNameIndices := #() asValue. |
|
339 |
selectedClassNameIndices addDependent:self |
|
340 |
]. |
|
341 |
^ selectedClassNameIndices. |
|
342 |
||
343 |
"Created: / 5.2.2000 / 21:31:48 / cg" |
|
344 |
"Modified: / 5.2.2000 / 21:43:02 / cg" |
|
345 |
! |
|
346 |
||
347 |
selectedClasses |
|
348 |
^ self selectionHolder |
|
349 |
||
350 |
! |
|
351 |
||
352 |
selectedClasses:aValueHolder |
|
353 |
^ self selectionHolder:aValueHolder |
|
354 |
||
355 |
! |
|
356 |
||
357 |
showClassPackages |
|
358 |
showClassPackages isNil ifTrue:[ |
|
359 |
showClassPackages := false asValue. |
|
360 |
showClassPackages addDependent:self. |
|
361 |
]. |
|
362 |
^ showClassPackages. |
|
363 |
||
364 |
"Created: / 24.2.2000 / 15:06:44 / cg" |
|
365 |
! |
|
366 |
||
367 |
showClassPackages:aValueHolder |
|
368 |
showClassPackages notNil ifTrue:[ |
|
369 |
showClassPackages removeDependent:self |
|
370 |
]. |
|
371 |
showClassPackages := aValueHolder. |
|
372 |
showClassPackages notNil ifTrue:[ |
|
373 |
showClassPackages addDependent:self |
|
374 |
]. |
|
375 |
! ! |
|
376 |
||
377 |
!ClassList methodsFor:'change & update'! |
|
378 |
||
379 |
classDefinitionChanged:aClassOrNil |
|
380 |
||
381 |
listValid ifFalse:[^ self]. |
|
382 |
||
383 |
slaveMode value == true ifTrue:[ |
|
5592 | 384 |
self invalidateList. |
385 |
^ self. |
|
5591 | 386 |
]. |
387 |
self slaveMode value isNil ifTrue:[ |
|
5592 | 388 |
self window shown ifFalse:[ |
389 |
self invalidateList. |
|
390 |
^ self |
|
391 |
]. |
|
5591 | 392 |
]. |
393 |
||
394 |
aClassOrNil isNil ifTrue:[ |
|
5592 | 395 |
self halt:'should not happen'. |
5591 | 396 |
]. |
397 |
||
398 |
"/ if that class is in my list ... |
|
399 |
((self classList value ? #()) contains:[:cls | cls notNil and:[cls theNonMetaclass name = aClassOrNil theNonMetaclass name]]) |
|
400 |
ifTrue:[ |
|
5592 | 401 |
self updateListsFor:aClassOrNil. |
402 |
"/ force update |
|
403 |
self selectedClassNameIndices value:(self selectedClassNameIndices value). |
|
5591 | 404 |
|
5592 | 405 |
((self selectedClasses value ? #()) contains:[:cls | cls notNil ifTrue:[cls theNonMetaclass name = aClassOrNil theNonMetaclass name] ifFalse:[false]]) |
406 |
ifTrue:[ |
|
407 |
self updateOutputGenerator |
|
408 |
]. |
|
5591 | 409 |
] ifFalse:[ |
5592 | 410 |
self invalidateList |
5591 | 411 |
] |
412 |
||
413 |
||
414 |
"Modified: / 29.2.2000 / 00:15:23 / cg" |
|
415 |
! |
|
416 |
||
417 |
classRemoved:aClass |
|
418 |
|list| |
|
419 |
||
420 |
list := self classList value. |
|
421 |
list notNil ifTrue:[ |
|
422 |
(list includesIdentical:aClass) ifTrue:[ |
|
423 |
self invalidateList. |
|
424 |
] |
|
425 |
] |
|
426 |
||
427 |
"Modified: / 25.2.2000 / 23:53:51 / cg" |
|
428 |
! |
|
429 |
||
430 |
delayedUpdate:something with:aParameter from:changedObject |
|
431 |
|cls classes chgClass wg| |
|
432 |
||
433 |
classes := self classList value ? #(). |
|
434 |
||
435 |
self inSlaveModeOrInvisible ifTrue:[ |
|
5592 | 436 |
self invalidateList. |
437 |
^ self. |
|
5591 | 438 |
]. |
439 |
||
440 |
"/ (self slaveMode value == true) ifTrue:[^ self]. |
|
441 |
"/ self slaveMode value isNil ifTrue:[ |
|
442 |
"/ self window shown ifFalse:[ |
|
443 |
"/ self invalidateList. |
|
444 |
"/ ^ self |
|
445 |
"/ ]. |
|
446 |
"/ ]. |
|
447 |
||
448 |
changedObject == slaveMode ifTrue:[ |
|
5592 | 449 |
listValid ~~ true ifTrue:[ |
450 |
self enqueueDelayedUpdateList. |
|
451 |
]. |
|
452 |
self enqueueDelayedClassSelectionChanged. |
|
453 |
^ self |
|
5591 | 454 |
]. |
455 |
||
456 |
changedObject == Smalltalk ifTrue:[ |
|
5592 | 457 |
something == #methodInClass ifTrue:[ |
458 |
^ self "no interest" |
|
459 |
]. |
|
460 |
something == #methodInClassRemoved ifTrue:[ |
|
461 |
"/ must update the list, if the methods package is different from |
|
462 |
"/ the classes package (to undo any has-exension highlighting) |
|
463 |
cls := aParameter first. |
|
464 |
self updateListsFor:cls. |
|
465 |
^ self |
|
466 |
]. |
|
467 |
something == #organization ifTrue:[^ self "no interest" ]. |
|
5591 | 468 |
|
5592 | 469 |
(something == #classDefinition |
470 |
or:[something == #classVariables |
|
471 |
or:[something == #newClass]]) ifTrue:[ |
|
472 |
"/ update that class in my classList and the selection |
|
473 |
listValid ifTrue:[ |
|
474 |
self classDefinitionChanged:aParameter. |
|
475 |
]. |
|
476 |
^ self. |
|
477 |
]. |
|
478 |
(something == #lastTestRunResult) ifTrue:[ |
|
479 |
"/ update that class in my classList and the selection |
|
480 |
listValid ifTrue:[ |
|
481 |
self updateListsFor:aParameter. |
|
482 |
"/ self classDefinitionChanged:aParameter. |
|
483 |
]. |
|
484 |
^ self. |
|
485 |
]. |
|
486 |
something == #classRemove ifTrue:[ |
|
487 |
"/ update my classList and the selection |
|
488 |
self classRemoved:aParameter. |
|
489 |
^ self. |
|
490 |
]. |
|
491 |
something == #classRename ifTrue:[ |
|
492 |
"/ update that class in my classList and the selection |
|
493 |
listValid ifTrue:[ |
|
494 |
aParameter isArray ifTrue:[ |
|
495 |
cls := aParameter at:1. |
|
496 |
self classDefinitionChanged:cls. |
|
497 |
] |
|
498 |
]. |
|
499 |
^ self. |
|
500 |
]. |
|
5591 | 501 |
|
5592 | 502 |
something == #projectOrganization ifTrue:[ |
503 |
aParameter isNil ifTrue:[ |
|
504 |
self invalidateList. |
|
505 |
organizerMode value == #project ifTrue:[ |
|
506 |
self enqueueDelayedUpdateOutputGenerator. |
|
507 |
]. |
|
508 |
^ self |
|
509 |
]. |
|
5591 | 510 |
|
5592 | 511 |
cls := aParameter at:1. |
512 |
cls notNil ifTrue:[ "/ should not happen (but does occasionally) |
|
513 |
((classes includes:cls theMetaclass) |
|
514 |
or:[(classes includes:cls theNonMetaclass)]) ifTrue:[ |
|
515 |
self invalidateList. |
|
516 |
organizerMode value == #project ifTrue:[ |
|
517 |
self enqueueDelayedUpdateOutputGenerator. |
|
518 |
] |
|
519 |
]. |
|
520 |
]. |
|
521 |
^ self |
|
522 |
]. |
|
523 |
^ self. |
|
5591 | 524 |
]. |
525 |
||
526 |
(something == #lastTestRunResult) ifTrue:[ |
|
5592 | 527 |
^ self |
5591 | 528 |
]. |
529 |
||
530 |
changedObject == ChangeSet ifTrue:[ |
|
5592 | 531 |
wg := self windowGroup. |
532 |
wg isNil ifTrue:[ |
|
533 |
changedObject removeDependent:self. |
|
534 |
] ifFalse:[ |
|
535 |
"/ react on changes of the changeSet to recolorize items |
|
536 |
something == #addChange: ifTrue:[ |
|
537 |
chgClass := aParameter changeClass. |
|
538 |
chgClass notNil ifTrue:[ |
|
539 |
((classes includes:chgClass theNonMetaclass) |
|
540 |
or:[classes includes:chgClass theMetaclass]) ifTrue:[ |
|
541 |
"/ remove all other addChange notifications ... |
|
542 |
wg sensor |
|
543 |
flushEventsFor:self |
|
544 |
where:[:ev | ev isMessageSendEvent |
|
545 |
and:[ev selector == #delayedUpdate:with:from: |
|
546 |
and:[(ev arguments at:3) == ChangeSet]]]. |
|
547 |
self reconstructNameList. |
|
548 |
] |
|
549 |
] |
|
550 |
] ifFalse:[ |
|
551 |
"/ remove all other ChangeSet notifications ... |
|
552 |
wg sensor |
|
553 |
flushEventsFor:self |
|
554 |
where:[:ev | ev isMessageSendEvent |
|
555 |
and:[ev selector == #delayedUpdate:with:from: |
|
556 |
and:[(ev arguments at:3) == ChangeSet]]]. |
|
557 |
self reconstructNameList. |
|
558 |
]. |
|
559 |
]. |
|
560 |
^ self |
|
5591 | 561 |
]. |
562 |
||
563 |
changedObject == self selectedClasses ifTrue:[ |
|
5592 | 564 |
slaveMode value ~~ true ifTrue:[ |
565 |
listValid == true ifFalse:[ |
|
566 |
self updateList |
|
567 |
]. |
|
568 |
self selectedClassesChanged. |
|
569 |
self updateOutputGenerator. |
|
570 |
] ifFalse:[ |
|
571 |
listValid := false. |
|
572 |
]. |
|
573 |
^ self |
|
5591 | 574 |
]. |
575 |
||
576 |
(changedObject == meta |
|
577 |
or:[changedObject == selectedClassNameIndices]) ifTrue:[ |
|
5592 | 578 |
self selectionChanged. |
579 |
^ self |
|
5591 | 580 |
]. |
581 |
changedObject == showClassPackages ifTrue:[ |
|
5592 | 582 |
self classNameList value:nil. |
583 |
self invalidateList. |
|
584 |
^ self |
|
5591 | 585 |
]. |
586 |
||
587 |
(changedObject == hideUnloadedClasses |
|
588 |
or:[changedObject == hidePrivateClasses |
|
589 |
or:[changedObject == nameSpaceFilter |
|
590 |
or:[changedObject == packageFilter]]]) ifTrue:[ |
|
5592 | 591 |
self invalidateList. |
592 |
^ self |
|
5591 | 593 |
]. |
594 |
||
595 |
super delayedUpdate:something with:aParameter from:changedObject |
|
596 |
||
597 |
"Modified: / 13.11.2001 / 11:32:10 / cg" |
|
598 |
! |
|
599 |
||
600 |
enqueueDelayedClassSelectionChanged |
|
601 |
(NewSystemBrowser synchronousUpdate == true |
|
602 |
or:[ immediateUpdate value == true ]) |
|
603 |
ifTrue:[ |
|
604 |
self selectedClassesChanged. |
|
605 |
^ self. |
|
606 |
]. |
|
607 |
||
608 |
self enqueueMessage:#selectedClassesChanged for:self arguments:#() |
|
609 |
! |
|
610 |
||
611 |
getSelectedClassIndicesFromClasses |
|
612 |
"the class selection has changed; |
|
613 |
return a collection of selection-indices" |
|
614 |
||
615 |
|classes selectedClasses numSelected| |
|
616 |
||
617 |
classes := self classList value. |
|
618 |
selectedClasses := self selectedClasses value. |
|
619 |
||
620 |
numSelected := selectedClasses size. |
|
621 |
numSelected == 0 ifTrue:[ |
|
622 |
^ #() |
|
623 |
]. |
|
624 |
||
625 |
numSelected == classes size ifTrue:[ |
|
626 |
"/ all selected - easy |
|
627 |
^ (1 to:numSelected) asOrderedCollection |
|
628 |
]. |
|
629 |
meta value ifTrue:[ |
|
630 |
classes := classes collect:[:eachClass | eachClass theMetaclass]. |
|
631 |
]. |
|
632 |
||
633 |
classes := selectedClasses collect:[:aSelectedClass | classes identityIndexOf:aSelectedClass.]. |
|
634 |
classes := classes select:[:idx | idx ~= 0]. |
|
635 |
^ classes |
|
636 |
||
637 |
"Created: / 24.2.2000 / 19:47:52 / cg" |
|
638 |
! |
|
639 |
||
640 |
getSelectedClassesFromIndices |
|
641 |
"the selection-index collection has changed; |
|
642 |
return a collection of corresponding classes" |
|
643 |
||
644 |
|selected classes allEntrySelected isMeta anyLost selectedClassNameIndices| |
|
645 |
||
646 |
allEntrySelected := false. |
|
647 |
||
648 |
classes := classList value. |
|
649 |
isMeta := meta value. |
|
650 |
anyLost := false. |
|
651 |
||
652 |
selectedClassNameIndices := self selectedClassNameIndices value. |
|
653 |
selectedClassNameIndices size == classes size ifTrue:[ |
|
654 |
selectedClassNameIndices size == 0 ifTrue:[^ #()]. |
|
655 |
isMeta ifTrue:[ |
|
656 |
^ classes collect:[:eachClass | eachClass theMetaclass]. |
|
657 |
]. |
|
658 |
^ classes collect:[:eachClass | eachClass theNonMetaclass]. |
|
659 |
]. |
|
660 |
||
661 |
selected := selectedClassNameIndices |
|
662 |
collect:[:idx | |
|
663 |
|cls| |
|
664 |
||
665 |
cls := classes at:idx. |
|
666 |
cls == (self class nameListEntryForALL) ifTrue:[ |
|
667 |
allEntrySelected := true. |
|
668 |
] ifFalse:[ |
|
669 |
cls notNil ifTrue:[ |
|
670 |
isMeta ifTrue:[ |
|
671 |
cls := cls theMetaclass |
|
672 |
] ifFalse:[ |
|
673 |
cls := cls theNonMetaclass |
|
674 |
]. |
|
675 |
] ifFalse:[ |
|
676 |
anyLost := true |
|
677 |
]. |
|
678 |
]. |
|
679 |
cls |
|
680 |
]. |
|
681 |
anyLost ifTrue:[ |
|
682 |
selected := selected select:[:each | each notNil]. |
|
683 |
]. |
|
684 |
||
685 |
"/ allEntrySelected ifTrue:[ |
|
686 |
"/ selected := classList value select:[:cls | cls ~~ AllEntry]. |
|
687 |
"/ meta value ifTrue:[ |
|
688 |
"/ selected := selected collect:[:cls | cls theMetaclass]. |
|
689 |
"/ ] ifFalse:[ |
|
690 |
"/ selected := selected collect:[:cls | cls theNonMetaclass]. |
|
691 |
"/ ]. |
|
692 |
"/ ]. |
|
693 |
||
694 |
^ selected. |
|
695 |
||
696 |
"Created: / 24.2.2000 / 19:43:37 / cg" |
|
697 |
! |
|
698 |
||
699 |
selectedClassesChanged |
|
700 |
|indices selectedClassNameIndicesHolder| |
|
701 |
||
702 |
self classList value size == 0 ifTrue:[ |
|
703 |
"/ this may happen during early startup, |
|
704 |
"/ when invoked with a preset classSelection, |
|
705 |
"/ and the classGenerator has not yet been setup |
|
706 |
"/ to not clobber the selection, defer the update |
|
707 |
"/ until the classList arrives ... |
|
708 |
^ self |
|
709 |
]. |
|
710 |
"/ lastSelectedClasses := self selectedClasses value copy. |
|
711 |
||
712 |
indices := self getSelectedClassIndicesFromClasses. |
|
713 |
selectedClassNameIndicesHolder := self selectedClassNameIndices. |
|
714 |
selectedClassNameIndicesHolder value ~= indices ifTrue:[ |
|
715 |
"/ in slaveMode, do not update selectedClasses from indices |
|
716 |
true "slaveMode value" ifTrue:[ |
|
717 |
selectedClassNameIndicesHolder value:indices withoutNotifying:self |
|
718 |
] ifFalse:[ |
|
719 |
selectedClassNameIndicesHolder value:indices. |
|
720 |
] |
|
721 |
] |
|
722 |
||
723 |
"Created: / 13.2.2000 / 22:18:10 / cg" |
|
724 |
"Modified: / 24.2.2000 / 19:48:56 / cg" |
|
725 |
! |
|
726 |
||
727 |
selectionChanged |
|
728 |
"the lists selection has changed. Since the list uses indices, |
|
729 |
update the corresponding selectedClasses collection" |
|
730 |
||
731 |
|selected prevSelection selectedClassesHolder| |
|
732 |
||
733 |
selectedClassesHolder := self selectedClasses. |
|
734 |
"/ lastSelectedClasses := selectedClassesHolder value copy. |
|
735 |
||
736 |
selected := self getSelectedClassesFromIndices. |
|
737 |
||
738 |
prevSelection := selectedClassesHolder value ? #(). |
|
739 |
||
740 |
"/ to allow reselect, change my valueHolder, even if the same collection |
|
741 |
||
742 |
prevSelection ~= selected ifTrue:[ |
|
743 |
selectedClassesHolder value:selected. |
|
744 |
"/ ] ifFalse:[ |
|
745 |
"/ selectedClassesHolder value:selected withoutNotifying:self |
|
746 |
]. |
|
747 |
||
748 |
"/ (selectedClassesHolder value = lastSelectedClasses |
|
749 |
"/ and:[lastSelectedClasses size == 1]) ifTrue:[ |
|
750 |
"/ "/ thats a kludge - we want to turn off the protocol selection, |
|
751 |
"/ "/ when a class is reselected. |
|
752 |
"/ |
|
753 |
"/ (masterApplication notNil |
|
754 |
"/ and:[(mm := masterApplication masterApplication) notNil |
|
755 |
"/ and:[mm respondsTo:#selectedProtocols]]) ifTrue:[ |
|
756 |
"/ mm selectedProtocols value:#() |
|
757 |
"/ ]. |
|
758 |
"/ ]. |
|
759 |
! |
|
760 |
||
761 |
selectionChangedByClick |
|
762 |
"we are not interested in that - get another notification |
|
763 |
via the changed valueHolder" |
|
764 |
||
765 |
|selected master| |
|
766 |
||
767 |
selected := self getSelectedClassesFromIndices. |
|
768 |
(selected = lastSelectedClasses and:[selected size == 1]) |
|
769 |
ifTrue:[ |
|
770 |
"/ thats a kludge - we want to turn off the protocol selection, |
|
771 |
"/ when a class is reselected. |
|
772 |
||
773 |
masterApplication notNil ifTrue:[ |
|
774 |
master := masterApplication. |
|
775 |
masterApplication masterApplication notNil ifTrue:[ |
|
776 |
master := masterApplication masterApplication. |
|
777 |
]. |
|
778 |
(master respondsTo:#classReselected) ifTrue:[ |
|
779 |
master classReselected. |
|
780 |
]. |
|
781 |
] |
|
782 |
] ifFalse:[ |
|
783 |
lastSelectedClasses := selected copy. |
|
784 |
] |
|
785 |
! |
|
786 |
||
787 |
update:something with:aParameter from:changedObject |
|
788 |
|cls newMethod oldMethod idx classListValue| |
|
789 |
||
790 |
self slaveMode value == true ifTrue:[ |
|
5592 | 791 |
something == #methodInClass ifTrue:[ ^ self ]. |
792 |
something == #addChange: ifTrue:[ self invalidateList. ^ self ]. |
|
5591 | 793 |
]. |
794 |
"/ self window sensor isNil ifTrue:[ |
|
795 |
"/ "/ not visible ... |
|
796 |
"/ self invalidateList. |
|
797 |
"/ ^ self |
|
798 |
"/ ]. |
|
799 |
||
800 |
classListValue := classList value. |
|
801 |
||
802 |
changedObject == Smalltalk ifTrue:[ |
|
5592 | 803 |
something == #classComment ifTrue:[ |
804 |
^ self. |
|
805 |
]. |
|
806 |
something == #methodDictionary ifTrue:[ |
|
807 |
^ self |
|
808 |
]. |
|
809 |
something == #methodTrap ifTrue:[ |
|
810 |
^ self |
|
811 |
]. |
|
812 |
something == #methodInClassRemoved ifTrue:[ |
|
813 |
cls := aParameter at:1. |
|
814 |
cls notNil ifTrue:[ |
|
815 |
classListValue size > 0 ifTrue:[ |
|
816 |
((classListValue includesIdentical:cls theNonMetaclass) |
|
817 |
or:[(classListValue includesIdentical:cls theMetaclass)]) ifTrue:[ |
|
818 |
self enqueueDelayedUpdateList |
|
819 |
] |
|
820 |
] |
|
821 |
]. |
|
822 |
^ self |
|
823 |
]. |
|
5591 | 824 |
|
5592 | 825 |
something == #methodInClass ifTrue:[ |
826 |
cls := aParameter at:1. |
|
827 |
cls notNil ifTrue:[ |
|
828 |
classListValue size > 0 ifTrue:[ |
|
829 |
((classListValue includesIdentical:cls theNonMetaclass) |
|
830 |
or:[(classListValue includesIdentical:cls theMetaclass)]) ifTrue:[ |
|
831 |
newMethod := cls compiledMethodAt:(aParameter at:2). |
|
832 |
oldMethod := aParameter at:3. |
|
833 |
((oldMethod isNil |
|
834 |
and:[newMethod package ~= cls package]) |
|
835 |
or:[oldMethod notNil |
|
836 |
and:[newMethod package ~= oldMethod package]]) |
|
837 |
ifTrue:[ |
|
838 |
"/ must update the list (for the package-info) |
|
839 |
self enqueueDelayedUpdateList |
|
840 |
] |
|
841 |
] |
|
842 |
] |
|
843 |
]. |
|
844 |
^ self |
|
845 |
]. |
|
5591 | 846 |
|
5592 | 847 |
"/ kludge: must be careful if my inGenerator is a constant list. |
848 |
"/ in that case, I have to update it |
|
849 |
"/ (sigh - all a consequence of not #becoming the new class) |
|
850 |
((something == #classDefinition) or:[something == #newClass]) ifTrue:[ |
|
851 |
inGeneratorHolder value isOrderedCollection ifTrue:[ |
|
852 |
idx := inGeneratorHolder value findFirst:[:eachClass | eachClass name = aParameter theNonMetaclass name]. |
|
853 |
idx ~~ 0 ifTrue:[ |
|
854 |
inGeneratorHolder value at:idx put:aParameter. |
|
855 |
self updateListsFor:aParameter. |
|
856 |
"/ self enqueueDelayedUpdateList. |
|
857 |
] |
|
858 |
] ifFalse:[ |
|
859 |
classListValue size > 0 ifTrue:[ |
|
860 |
idx := classListValue findFirst:[:eachClass | eachClass name = aParameter theNonMetaclass name]. |
|
861 |
idx ~~ 0 ifTrue:[ |
|
862 |
listValid ifTrue:[ |
|
863 |
self classDefinitionChanged:aParameter. |
|
864 |
^ self. |
|
865 |
] |
|
866 |
] |
|
867 |
]. |
|
868 |
]. |
|
869 |
]. |
|
5591 | 870 |
]. |
871 |
||
872 |
super update:something with:aParameter from:changedObject |
|
873 |
||
874 |
"Modified: / 20.11.2001 / 21:54:56 / cg" |
|
875 |
! ! |
|
876 |
||
877 |
!ClassList methodsFor:'drag & drop'! |
|
878 |
||
6468 | 879 |
canDropContext:aDropContext |
5591 | 880 |
|methods cls| |
881 |
||
882 |
methods := aDropContext dropObjects collect:[:obj | obj theObject]. |
|
883 |
||
884 |
(methods contains:[:aMethod | aMethod isMethod not]) ifTrue:[^ false]. |
|
885 |
||
886 |
cls := self classAtTargetPointOf:aDropContext. |
|
6492 | 887 |
cls isNil ifTrue:[^ false]. |
5591 | 888 |
|
889 |
(methods contains:[:aMethod | aMethod mclass ~= cls]) ifFalse:[^ false]. |
|
890 |
^ true |
|
891 |
! |
|
892 |
||
893 |
classAtTargetPointOf:aDropContext |
|
894 |
|p classListView lineNr cls| |
|
895 |
||
896 |
p := aDropContext targetPoint. |
|
897 |
||
898 |
classListView := aDropContext targetWidget. |
|
899 |
||
900 |
lineNr := classListView lineAtY:p y. |
|
901 |
lineNr isNil ifTrue:[^ nil]. |
|
902 |
||
903 |
cls := classList value at:lineNr. |
|
904 |
^ cls |
|
905 |
! |
|
906 |
||
6468 | 907 |
doDropContext:aDropContext |
5591 | 908 |
|cls methods| |
909 |
||
910 |
methods := aDropContext dropObjects collect:[:aDropObject | aDropObject theObject]. |
|
911 |
(methods contains:[:something | something isMethod not]) ifTrue:[^ self]. |
|
912 |
||
913 |
cls := self classAtTargetPointOf:aDropContext. |
|
914 |
methods first mclass isMeta ifTrue:[ |
|
6468 | 915 |
cls := cls theMetaclass |
5591 | 916 |
]. |
917 |
||
918 |
cls notNil ifTrue:[ |
|
6468 | 919 |
self masterApplication moveMethods:methods toClass:cls. |
5591 | 920 |
]. |
921 |
! ! |
|
922 |
||
923 |
!ClassList methodsFor:'generators'! |
|
924 |
||
925 |
makeGenerator |
|
926 |
"return a generator which enumerates the method categories from the selected class; |
|
927 |
that generator generates 2-element elements (includes the class), in order |
|
928 |
to make the consumers only depend on one input (i.e. no need for another |
|
929 |
classHolder in the methodList)." |
|
930 |
||
931 |
^ Iterator on:[:whatToDo | |
|
932 |
|allEntry classes cls already anyMethod packages classIsInPackage| |
|
933 |
||
934 |
allEntry := self class nameListEntryForALL. |
|
935 |
||
936 |
classes := self selectedClasses value ? #(). |
|
937 |
packages := packageFilter value value. |
|
938 |
(packages notNil and:[packages includes:allEntry]) ifTrue:[packages := nil]. |
|
939 |
||
940 |
classes do:[:cls | |
|
941 |
(cls notNil and:[cls ~~ allEntry]) ifTrue:[ |
|
942 |
anyMethod := false. |
|
943 |
classIsInPackage := packages isNil or:[packages includes:cls package]. |
|
944 |
||
945 |
cls theNonMetaclass isJavaClass ifTrue:[ |
|
946 |
cls isMeta ifTrue:[ |
|
947 |
whatToDo value:cls theNonMetaclass value:(self class nameListEntryForStatic). |
|
948 |
] ifFalse:[ |
|
949 |
whatToDo value:cls value:(self class nameListEntryForNonStatic). |
|
950 |
] |
|
951 |
] ifFalse:[ |
|
952 |
cls supportsMethodCategories ifTrue:[ |
|
953 |
already := Set new. |
|
954 |
cls methodDictionary keysAndValuesDo:[:sel :mthd | |
|
955 |
|cat| |
|
956 |
||
957 |
cat := mthd category. |
|
958 |
(already includes:cat) ifFalse:[ |
|
959 |
(classIsInPackage |
|
960 |
or:[packages isNil |
|
961 |
or:[packages includes:mthd package]]) |
|
962 |
ifTrue:[ |
|
963 |
already add:cat. |
|
964 |
whatToDo value:cls value:cat. |
|
965 |
] |
|
966 |
] |
|
967 |
]. |
|
968 |
] ifFalse:[ |
|
969 |
whatToDo value:cls value:(self class nameListEntryForNILCategory). |
|
970 |
]. |
|
971 |
]. |
|
972 |
||
973 |
anyMethod ifFalse:[ |
|
974 |
"/ tell the one below, which classes are seen here, |
|
975 |
"/ (even if no method is present) |
|
976 |
"/ to allow him to decide if the className is to be shown in the list |
|
977 |
whatToDo value:cls value:nil. |
|
978 |
]. |
|
979 |
]. |
|
980 |
]. |
|
981 |
] |
|
982 |
||
983 |
"Modified: / 24.2.2000 / 23:18:26 / cg" |
|
984 |
! ! |
|
985 |
||
986 |
!ClassList methodsFor:'private'! |
|
987 |
||
988 |
listOfClasses |
|
989 |
|classesAlready classesOrdered generator nameSpaceFilter packageFilter allName hidePrivate |
|
990 |
privateClassesPerClass| |
|
991 |
||
992 |
allName := self class nameListEntryForALL. |
|
993 |
nameSpaceFilter := self nameSpaceFilter value. |
|
994 |
nameSpaceFilter notNil ifTrue:[ |
|
995 |
(nameSpaceFilter includes:allName) ifTrue:[nameSpaceFilter := nil]. |
|
996 |
]. |
|
997 |
packageFilter := self packageFilter value. |
|
998 |
packageFilter notNil ifTrue:[ |
|
999 |
(packageFilter includes:allName) ifTrue:[packageFilter := nil]. |
|
1000 |
]. |
|
1001 |
||
1002 |
inGeneratorHolder isNil ifTrue:[ |
|
1003 |
"/ for standAlone testing |
|
1004 |
generator := Smalltalk allClasses. |
|
1005 |
(self hideUnloadedClasses value) ifTrue:[ |
|
1006 |
generator := generator select:[:cls | cls isLoaded] |
|
1007 |
]. |
|
1008 |
] ifFalse:[ |
|
1009 |
generator := inGeneratorHolder value. |
|
1010 |
generator isNil ifTrue:[^ #() ]. |
|
1011 |
]. |
|
1012 |
||
1013 |
classesAlready := IdentitySet new. |
|
1014 |
classesOrdered := OrderedCollection new. |
|
1015 |
hidePrivate := self hidePrivateClasses value. |
|
1016 |
||
1017 |
privateClassesPerClass := IdentityDictionary new. |
|
1018 |
||
1019 |
generator do:[:cls | |
|
1020 |
|owner bucket| |
|
1021 |
||
1022 |
(hidePrivate not or:[cls isPrivate not]) |
|
1023 |
ifTrue:[ |
|
1024 |
(nameSpaceFilter isNil |
|
1025 |
or:[self isClass:cls shownWithNameSpaceFilter:nameSpaceFilter]) ifTrue:[ |
|
1026 |
(packageFilter isNil |
|
1027 |
or:[self isClass:cls shownWithPackageFilter:packageFilter]) ifTrue:[ |
|
1028 |
(classesAlready includes:cls) ifFalse:[ |
|
1029 |
classesAlready add:cls. |
|
1030 |
(owner := cls owningClass) notNil ifTrue:[ |
|
1031 |
bucket := privateClassesPerClass at:owner ifAbsentPut:[SortedCollection new sortBlock:[:a :b | a name < b name] ]. |
|
1032 |
bucket add:cls. |
|
1033 |
] ifFalse:[ |
|
1034 |
classesOrdered add:cls. |
|
1035 |
] |
|
1036 |
] |
|
1037 |
] |
|
1038 |
] |
|
1039 |
] |
|
1040 |
]. |
|
1041 |
||
1042 |
classesOrdered size == 1 ifTrue:[ |
|
1043 |
self classLabelHolder value:(classesOrdered first name) |
|
1044 |
] ifFalse:[ |
|
1045 |
"/ self classLabelHolder value:(classes size printString , ' classes'). |
|
1046 |
sortBy value ~~ #doNotSort ifTrue:[ |
|
1047 |
classesOrdered sort:[:a :b | a name < b name]. |
|
1048 |
] |
|
1049 |
]. |
|
1050 |
||
1051 |
privateClassesPerClass notEmpty ifTrue:[ |
|
1052 |
|stream action| |
|
1053 |
||
1054 |
stream := WriteStream on:(Array new). |
|
1055 |
||
1056 |
action := [:eachClass | |
|
1057 |
|bucket| |
|
1058 |
||
1059 |
stream nextPut:eachClass. |
|
1060 |
bucket := privateClassesPerClass at:eachClass ifAbsent:nil. |
|
1061 |
bucket notNil ifTrue:[ |
|
1062 |
bucket do:action. |
|
1063 |
] |
|
1064 |
]. |
|
1065 |
||
1066 |
classesOrdered do:action. |
|
1067 |
classesOrdered := stream contents. |
|
1068 |
]. |
|
1069 |
||
1070 |
"/ |
|
1071 |
"/ does not work (yet) |
|
1072 |
"/ classes addFirst:AllEntry. |
|
1073 |
^ classesOrdered |
|
1074 |
||
1075 |
"Modified: / 18.8.2000 / 20:34:10 / cg" |
|
1076 |
! |
|
1077 |
||
1078 |
makeDependent |
|
1079 |
Smalltalk addDependent:self. |
|
1080 |
ChangeSet addDependent:self. |
|
1081 |
||
1082 |
"Created: / 5.2.2000 / 13:42:17 / cg" |
|
1083 |
! |
|
1084 |
||
1085 |
makeIndependent |
|
1086 |
Smalltalk removeDependent:self. |
|
1087 |
ChangeSet removeDependent:self. |
|
1088 |
! |
|
1089 |
||
1090 |
nameListEntryFor:aClass withNameSpace:useFullName |
|
1091 |
|nm indent index owner orgMode indentString javaPackage| |
|
1092 |
||
1093 |
aClass == (self class nameListEntryForALL) ifTrue:[ ^ aClass ]. |
|
1094 |
||
1095 |
nm := aClass nameInBrowser. |
|
6006 | 1096 |
|
5591 | 1097 |
aClass isLoaded ifFalse:[ |
6006 | 1098 |
unloadedClassesColor notNil ifTrue:[ |
1099 |
nm := nm asText emphasizeAllWith:(#color->unloadedClassesColor) |
|
1100 |
] |
|
5591 | 1101 |
]. |
1102 |
||
1103 |
orgMode := organizerMode value. |
|
1104 |
orgMode == #hierarchy ifTrue:[ |
|
6006 | 1105 |
"/ always show the full name |
1106 |
^ nm |
|
5591 | 1107 |
]. |
1108 |
orgMode == #classHierarchy ifTrue:[ |
|
6006 | 1109 |
"/ always show the full name |
1110 |
^ nm |
|
5591 | 1111 |
]. |
1112 |
||
1113 |
aClass isJavaClass ifTrue:[ |
|
6006 | 1114 |
"/ only show the last name, unless multiple packages are shown in the list |
1115 |
javaPackage := aClass package. |
|
1116 |
(self classList value contains:[:cls | cls package ~= javaPackage]) ifTrue:[ |
|
1117 |
^ nm |
|
1118 |
]. |
|
1119 |
^ aClass lastName |
|
5591 | 1120 |
]. |
1121 |
||
1122 |
useFullName ifFalse:[ |
|
6006 | 1123 |
aClass isPrivate ifFalse:[ |
1124 |
^ aClass nameWithoutNameSpacePrefix |
|
1125 |
] |
|
5591 | 1126 |
]. |
1127 |
||
1128 |
"/ full name required if owner is not in the list |
|
1129 |
owner := aClass owningClass. |
|
1130 |
(owner isNil |
|
1131 |
or:[(self classList value includesIdentical:owner) not]) ifTrue:[ |
|
6006 | 1132 |
^ nm |
5591 | 1133 |
]. |
1134 |
||
1135 |
"/ namespace |
|
1136 |
indent := 0. |
|
1137 |
index := 1. |
|
1138 |
[(index := nm indexOf:$: startingAt:index) ~~ 0] whileTrue:[ |
|
6006 | 1139 |
indent := indent + 1. |
1140 |
index := index + 2. |
|
5591 | 1141 |
]. |
1142 |
indent == 0 ifFalse:[ |
|
6006 | 1143 |
indent <= 5 ifTrue:[ |
1144 |
indentString := #( |
|
1145 |
'' |
|
1146 |
' ' |
|
1147 |
' ' |
|
1148 |
' ' |
|
1149 |
' ' |
|
1150 |
' ' |
|
1151 |
) at:indent+1. |
|
1152 |
] ifFalse:[ |
|
1153 |
indentString := String new:indent*2 withAll:Character space. |
|
1154 |
]. |
|
1155 |
nm := indentString , '::' , aClass nameWithoutPrefix |
|
5591 | 1156 |
]. |
1157 |
^ nm |
|
1158 |
||
1159 |
"Modified: / 24.2.2000 / 17:52:28 / cg" |
|
1160 |
! |
|
1161 |
||
1162 |
nameListForClasses:aClassList |
|
1163 |
"only reconstruct the names - class list & selection remains |
|
1164 |
unschanged. Invoked when the organizerMode mode changes" |
|
1165 |
||
1166 |
|orgMode namespaces showNamespaces fullNameList nameList |
|
1167 |
filteredPackages filteredNameSpaces classesInCangeSet| |
|
1168 |
||
1169 |
showNamespaces := false. |
|
1170 |
||
1171 |
filteredNameSpaces := nameSpaceFilter value. |
|
1172 |
(filteredNameSpaces isNil |
|
1173 |
and:[self organizerMode value ~~ #namespace]) ifTrue:[ |
|
5950 | 1174 |
showNamespaces := true. "/ if no filter, always show the namespace. |
5591 | 1175 |
] ifFalse:[ |
5950 | 1176 |
(filteredNameSpaces size > 1 |
1177 |
or:[(filteredNameSpaces size > 0) |
|
1178 |
and:[filteredNameSpaces includes:(self class nameListEntryForALL)]]) ifTrue:[ |
|
1179 |
showNamespaces := true |
|
1180 |
] ifFalse:[ |
|
1181 |
"/ if there are classes from multiple namespaces, |
|
1182 |
"/ show the full name |
|
5591 | 1183 |
|
5950 | 1184 |
namespaces := IdentitySet new. |
1185 |
fullNameList := OrderedCollection new. |
|
5591 | 1186 |
|
5950 | 1187 |
aClassList |
1188 |
do:[:cls | |nm| |
|
1189 |
nm := cls nameInBrowser. |
|
1190 |
fullNameList add:nm. |
|
1191 |
namespaces add:cls topNameSpace. |
|
1192 |
]. |
|
1193 |
showNamespaces := namespaces size > 1 |
|
1194 |
]. |
|
5591 | 1195 |
]. |
1196 |
||
1197 |
orgMode := organizerMode value. |
|
1198 |
filteredPackages := packageFilter value value. |
|
1199 |
||
1200 |
classesInCangeSet := ChangeSet current changedClasses. |
|
1201 |
classesInCangeSet := classesInCangeSet collect:[:each | each theNonMetaclass]. |
|
1202 |
||
1203 |
nameList := aClassList |
|
5950 | 1204 |
collect:[:cls | |
5591 | 1205 |
|
5950 | 1206 |
|nm pkg emPkg hasExtensions isInChangeSet icon| |
5591 | 1207 |
|
5950 | 1208 |
isInChangeSet := classesInCangeSet includes:cls theNonMetaclass. |
5591 | 1209 |
|
5950 | 1210 |
nm := self nameListEntryFor:cls withNameSpace:showNamespaces. |
1211 |
isInChangeSet ifTrue:[ |
|
1212 |
nm := self emphasizeForChangedCode:nm |
|
1213 |
]. |
|
5591 | 1214 |
|
5950 | 1215 |
pkg := cls package. |
1216 |
hasExtensions := cls hasExtensions. |
|
1217 |
hasExtensions ifTrue:[ |
|
1218 |
emPkg := self emphasizeForDifferentPackage:'+'. "/ self emphasizeForDifferentPackage:pkg. |
|
1219 |
]. |
|
5591 | 1220 |
|
5950 | 1221 |
orgMode == #project ifTrue:[ |
1222 |
(filteredPackages notNil |
|
1223 |
and:[(filteredPackages includes:cls package) not]) ifTrue:[ |
|
1224 |
"/ class is in another packae; |
|
1225 |
"/ however, class is listed due to methods |
|
1226 |
"/ in the filtered package |
|
1227 |
hasExtensions ifTrue:[ |
|
1228 |
nm := nm , emPkg. |
|
1229 |
] ifFalse:[ |
|
1230 |
nm := nm , ' [ ' , pkg, ' ]'. |
|
1231 |
]. |
|
1232 |
] ifFalse:[ |
|
1233 |
"/ any methods from other packages in this class ? |
|
1234 |
hasExtensions ifTrue:[ |
|
1235 |
nm := nm , (self emphasizeForDifferentPackage:'+'). |
|
1236 |
]. |
|
1237 |
]. |
|
1238 |
] ifFalse:[ |
|
1239 |
showClassPackages value == true ifTrue:[ |
|
1240 |
"/ add the package; |
|
1241 |
hasExtensions ifTrue:[ |
|
6006 | 1242 |
nm := nm , ' [ ' , pkg, ' ]' , (self emphasizeForDifferentPackage:'+'). |
5950 | 1243 |
"/ isInChangeSet ifFalse:[ |
1244 |
"/ nm := self colorizeForDifferentPackage:nm |
|
1245 |
"/ ]. |
|
1246 |
] ifFalse:[ |
|
1247 |
nm := nm , (self colorizeGrey:(' [ ' , pkg, ' ]')). |
|
1248 |
]. |
|
1249 |
] ifFalse:[ |
|
1250 |
hasExtensions ifTrue:[ |
|
1251 |
nm := nm , emPkg. |
|
1252 |
"/ isInChangeSet ifFalse:[ |
|
1253 |
"/ nm := self colorizeForDifferentPackage:nm |
|
1254 |
"/ ] |
|
1255 |
]. |
|
1256 |
] |
|
1257 |
]. |
|
5591 | 1258 |
"/ cls isVisualStartable ifTrue:[ |
1259 |
"/ nm := LabelAndIcon icon:((SystemBrowser visualStartableClassIcon) |
|
1260 |
"/ onDevice:self window device) |
|
1261 |
"/ string:nm |
|
1262 |
"/ ]. |
|
5950 | 1263 |
markApplicationsHolder value== true ifTrue:[ |
1264 |
icon := self nameListIconForClass:cls. |
|
1265 |
icon isNil ifTrue:[ |
|
1266 |
icon := SystemBrowser emptyIcon |
|
1267 |
]. |
|
1268 |
nm := LabelAndIcon icon:icon string:nm |
|
5591 | 1269 |
|
5950 | 1270 |
]. |
1271 |
nm |
|
1272 |
]. |
|
5591 | 1273 |
|
1274 |
^ nameList |
|
1275 |
||
1276 |
"Modified: / 5.11.2001 / 09:50:27 / cg" |
|
1277 |
! |
|
1278 |
||
1279 |
nameListIconForClass:cls |
|
1280 |
|c| |
|
1281 |
||
1282 |
cls isVisualStartable ifTrue:[ |
|
6207 | 1283 |
^ SystemBrowser startableVisualAppIcon |
5591 | 1284 |
]. |
6208 | 1285 |
(cls isStartableWithMain |
1286 |
or:[ cls isStartableWithStart ]) ifTrue:[ |
|
6207 | 1287 |
^ SystemBrowser startableClassIcon |
5591 | 1288 |
]. |
1289 |
cls isLoaded ifFalse:[ |
|
6207 | 1290 |
^ SystemBrowser autoloadedClassIcon |
5591 | 1291 |
]. |
1292 |
c := cls. |
|
1293 |
[c notNil] whileTrue:[ |
|
6207 | 1294 |
c == Warning ifTrue:[ |
1295 |
^ SystemBrowser warningClassIcon |
|
1296 |
]. |
|
1297 |
c == Query ifTrue:[ |
|
1298 |
^ SystemBrowser queryClassIcon |
|
1299 |
]. |
|
1300 |
c == Notification ifTrue:[ |
|
1301 |
^ SystemBrowser notificationClassIcon |
|
1302 |
]. |
|
1303 |
c == Error ifTrue:[ |
|
1304 |
^ SystemBrowser errorClassIcon |
|
1305 |
]. |
|
1306 |
c == GenericException ifTrue:[ |
|
1307 |
^ SystemBrowser exceptionClassIcon |
|
1308 |
]. |
|
1309 |
c == SimpleView ifTrue:[ |
|
1310 |
^ SystemBrowser windowClassIcon |
|
1311 |
]. |
|
1312 |
c == Collection ifTrue:[ |
|
1313 |
^ SystemBrowser containerClassIcon |
|
1314 |
]. |
|
1315 |
(c == TestCase and:[cls isAbstract not "cls ~~ TestCase"]) ifTrue:[ |
|
1316 |
^ SystemBrowser testCaseClassIconFor:cls |
|
1317 |
]. |
|
1318 |
c := c superclass |
|
5591 | 1319 |
]. |
1320 |
^ nil |
|
1321 |
! |
|
1322 |
||
1323 |
reconstructNameList |
|
1324 |
"only reconstruct the names - class list & selection remains |
|
1325 |
unschanged. Invoked when the organizerMode mode changes" |
|
1326 |
||
1327 |
|prevMode listView oldNameList newNameList sav| |
|
1328 |
||
1329 |
self classList value isNil ifTrue:[ |
|
5592 | 1330 |
self updateList |
5591 | 1331 |
]. |
1332 |
||
1333 |
newNameList := self nameListForClasses:(classList value ? #()). |
|
1334 |
oldNameList := self classNameList value ? #(). |
|
1335 |
(newNameList |
|
5592 | 1336 |
sameContentsAs: oldNameList |
1337 |
whenComparedWith:[:a :b | (a sameStringAndEmphasisAs: b) |
|
1338 |
and:[ a hasImage == b hasImage |
|
1339 |
and:[ a hasIcon == b hasIcon ]]] |
|
5591 | 1340 |
) |
1341 |
ifTrue:[ |
|
5592 | 1342 |
"/ no need to update |
5591 | 1343 |
] ifFalse:[ |
5592 | 1344 |
listView := builder componentAt:#List. |
1345 |
(listView isNil or:[listView scrolledView isNil]) ifTrue:[ |
|
1346 |
"/ invoked very early during setup |
|
1347 |
self classNameList value:newNameList |
|
1348 |
] ifFalse:[ |
|
1349 |
"/ avoid flicker and useless redraws |
|
5591 | 1350 |
|
5592 | 1351 |
prevMode := listView scrollWhenUpdating. |
1352 |
listView scrollWhenUpdating:nil. |
|
5591 | 1353 |
|
5592 | 1354 |
"/ this will lead to a selectionIndex change (done by the selListView); |
1355 |
"/ however, we dont want this here, since it recurses into |
|
1356 |
"/ a selectionChange. Therefore, temporarily disconnect the selectionIndexHolder... |
|
1357 |
[ |
|
1358 |
self selectedClassNameIndices removeDependent:self. |
|
1359 |
"/ also, dont want a callback (selectionChangedByClick) |
|
1360 |
sav := listView action. |
|
1361 |
listView action:nil. |
|
1362 |
self classNameList value:newNameList. |
|
1363 |
] ensure:[ |
|
1364 |
listView action:sav. |
|
1365 |
self selectedClassNameIndices addDependent:self. |
|
1366 |
listView scrollWhenUpdating:prevMode. |
|
1367 |
]. |
|
1368 |
] |
|
5591 | 1369 |
]. |
1370 |
||
1371 |
"Modified: / 31.10.2001 / 11:33:21 / cg" |
|
1372 |
! |
|
1373 |
||
1374 |
release |
|
1375 |
super release. |
|
1376 |
||
1377 |
currentNamespace removeDependent:self. |
|
1378 |
hidePrivateClasses removeDependent:self. |
|
1379 |
markApplicationsHolder removeDependent:self. |
|
1380 |
meta removeDependent:self. |
|
1381 |
selectedClassNameIndices removeDependent:self. |
|
1382 |
showClassPackages removeDependent:self. |
|
1383 |
||
1384 |
"Created: / 5.2.2000 / 13:42:18 / cg" |
|
1385 |
! |
|
1386 |
||
1387 |
updateClassesIn:aCollection |
|
1388 |
"replace any obsolete class in aCollection; |
|
1389 |
return true, if any was found" |
|
1390 |
||
1391 |
|found meta classes| |
|
1392 |
||
1393 |
found := false. |
|
1394 |
||
1395 |
aCollection isSequenceable ifFalse:[ |
|
1396 |
classes := aCollection copy. |
|
1397 |
aCollection removeAll. |
|
1398 |
classes do:[:cls | |
|
1399 |
|newClass| |
|
1400 |
||
1401 |
meta := cls isMeta. |
|
1402 |
newClass := Smalltalk at:(cls theNonMetaclass name). |
|
1403 |
newClass isNil ifTrue:[ |
|
1404 |
newClass := cls |
|
1405 |
] ifFalse:[ |
|
1406 |
meta ifTrue:[ |
|
1407 |
newClass := newClass class |
|
1408 |
] |
|
1409 |
]. |
|
1410 |
found := cls ~~ newClass. |
|
1411 |
aCollection add:newClass. |
|
1412 |
]. |
|
1413 |
] ifTrue:[ |
|
1414 |
aCollection keysAndValuesDo:[:idx :cls | |
|
1415 |
|newClass| |
|
1416 |
||
1417 |
cls notNil ifTrue:[ |
|
1418 |
meta := cls isMeta. |
|
1419 |
newClass := Smalltalk at:(cls theNonMetaclass name). |
|
1420 |
newClass isNil ifTrue:[ |
|
1421 |
newClass := cls |
|
1422 |
] ifFalse:[ |
|
1423 |
meta ifTrue:[ |
|
1424 |
newClass := newClass class |
|
1425 |
] |
|
1426 |
]. |
|
1427 |
found := cls ~~ newClass. |
|
1428 |
aCollection at:idx put:newClass. |
|
1429 |
] |
|
1430 |
]. |
|
1431 |
]. |
|
1432 |
^ found |
|
1433 |
! |
|
1434 |
||
1435 |
updateList |
|
1436 |
|prevSelection oldList newList newSelectionIndices |
|
6712 | 1437 |
forceSelectionChange selectedClassNameIndicesHolder classList |
1438 |
classesAddedToList classesRemovedFromList newSet oldSet| |
|
5591 | 1439 |
|
1440 |
newList := self listOfClasses. |
|
1441 |
classList := self classList. |
|
1442 |
oldList := classList value ? #(). |
|
1443 |
||
6712 | 1444 |
autoSelect == true ifTrue:[ |
1445 |
classesRemovedFromList := OrderedCollection new. |
|
1446 |
newSet := newList asSet. |
|
1447 |
oldSet := oldList asSet. |
|
1448 |
classesAddedToList := newSet select:[:eachNewClass | (oldSet includes:eachNewClass) not]. |
|
1449 |
classesRemovedFromList := oldSet select:[:eachOldClass | (newSet includes:eachOldClass) not]. |
|
1450 |
]. |
|
1451 |
||
5591 | 1452 |
(newList ~= oldList |
1453 |
or:[self classNameList value isNil and:[newList size > 0]]) ifTrue:[ |
|
6318
9a3fc13f86be
care for non-existing class in selection
Claus Gittinger <cg@exept.de>
parents:
6208
diff
changeset
|
1454 |
prevSelection := lastSelectedClasses ? #(). |
9a3fc13f86be
care for non-existing class in selection
Claus Gittinger <cg@exept.de>
parents:
6208
diff
changeset
|
1455 |
prevSelection := prevSelection select:[:each | each notNil]. |
5591 | 1456 |
|
6318
9a3fc13f86be
care for non-existing class in selection
Claus Gittinger <cg@exept.de>
parents:
6208
diff
changeset
|
1457 |
(newList collect:[:each | each name]) = (oldList collect:[:each | each name]) ifTrue:[ |
9a3fc13f86be
care for non-existing class in selection
Claus Gittinger <cg@exept.de>
parents:
6208
diff
changeset
|
1458 |
"/ no need to tell anybody |
9a3fc13f86be
care for non-existing class in selection
Claus Gittinger <cg@exept.de>
parents:
6208
diff
changeset
|
1459 |
classList setValue:newList. |
9a3fc13f86be
care for non-existing class in selection
Claus Gittinger <cg@exept.de>
parents:
6208
diff
changeset
|
1460 |
] ifFalse:[ |
9a3fc13f86be
care for non-existing class in selection
Claus Gittinger <cg@exept.de>
parents:
6208
diff
changeset
|
1461 |
classList value:newList. |
9a3fc13f86be
care for non-existing class in selection
Claus Gittinger <cg@exept.de>
parents:
6208
diff
changeset
|
1462 |
]. |
9a3fc13f86be
care for non-existing class in selection
Claus Gittinger <cg@exept.de>
parents:
6208
diff
changeset
|
1463 |
self reconstructNameList. |
5591 | 1464 |
|
6318
9a3fc13f86be
care for non-existing class in selection
Claus Gittinger <cg@exept.de>
parents:
6208
diff
changeset
|
1465 |
(prevSelection size == 0 |
9a3fc13f86be
care for non-existing class in selection
Claus Gittinger <cg@exept.de>
parents:
6208
diff
changeset
|
1466 |
and:[self selectedClasses value size ~~ 0]) ifTrue:[ |
9a3fc13f86be
care for non-existing class in selection
Claus Gittinger <cg@exept.de>
parents:
6208
diff
changeset
|
1467 |
"/ this happens during early startup time, |
9a3fc13f86be
care for non-existing class in selection
Claus Gittinger <cg@exept.de>
parents:
6208
diff
changeset
|
1468 |
"/ when the selection is already (pre-)set, |
9a3fc13f86be
care for non-existing class in selection
Claus Gittinger <cg@exept.de>
parents:
6208
diff
changeset
|
1469 |
"/ and the classList is generated the first time |
9a3fc13f86be
care for non-existing class in selection
Claus Gittinger <cg@exept.de>
parents:
6208
diff
changeset
|
1470 |
"/ (i.e. when opened with preset selection) |
5591 | 1471 |
|
6318
9a3fc13f86be
care for non-existing class in selection
Claus Gittinger <cg@exept.de>
parents:
6208
diff
changeset
|
1472 |
"/ do not clobber the selection in this case. |
9a3fc13f86be
care for non-existing class in selection
Claus Gittinger <cg@exept.de>
parents:
6208
diff
changeset
|
1473 |
prevSelection := self selectedClasses value. |
9a3fc13f86be
care for non-existing class in selection
Claus Gittinger <cg@exept.de>
parents:
6208
diff
changeset
|
1474 |
prevSelection := prevSelection select:[:cls | cls notNil]. |
9a3fc13f86be
care for non-existing class in selection
Claus Gittinger <cg@exept.de>
parents:
6208
diff
changeset
|
1475 |
"/ simulate a change, to force selection update in listView |
9a3fc13f86be
care for non-existing class in selection
Claus Gittinger <cg@exept.de>
parents:
6208
diff
changeset
|
1476 |
forceSelectionChange := true. |
9a3fc13f86be
care for non-existing class in selection
Claus Gittinger <cg@exept.de>
parents:
6208
diff
changeset
|
1477 |
]. |
5591 | 1478 |
|
6712 | 1479 |
autoSelect == true ifTrue:[ |
1480 |
prevSelection isNil ifTrue:[ |
|
1481 |
prevSelection := OrderedCollection new |
|
1482 |
]. |
|
1483 |
prevSelection := prevSelection asOrderedCollection. |
|
1484 |
||
1485 |
classesAddedToList do:[:eachNewClass | |
|
1486 |
(prevSelection includes:eachNewClass) ifFalse:[ |
|
1487 |
prevSelection add:eachNewClass. |
|
1488 |
]. |
|
1489 |
]. |
|
1490 |
classesRemovedFromList do:[:eachOldClass | |
|
1491 |
prevSelection remove:eachOldClass ifAbsent:[]. |
|
1492 |
]. |
|
1493 |
]. |
|
1494 |
||
6318
9a3fc13f86be
care for non-existing class in selection
Claus Gittinger <cg@exept.de>
parents:
6208
diff
changeset
|
1495 |
newSelectionIndices := prevSelection |
9a3fc13f86be
care for non-existing class in selection
Claus Gittinger <cg@exept.de>
parents:
6208
diff
changeset
|
1496 |
collect:[:item | |cls| |
9a3fc13f86be
care for non-existing class in selection
Claus Gittinger <cg@exept.de>
parents:
6208
diff
changeset
|
1497 |
cls := Smalltalk at:item theNonMetaclass name. |
9a3fc13f86be
care for non-existing class in selection
Claus Gittinger <cg@exept.de>
parents:
6208
diff
changeset
|
1498 |
newList identityIndexOf:cls] |
9a3fc13f86be
care for non-existing class in selection
Claus Gittinger <cg@exept.de>
parents:
6208
diff
changeset
|
1499 |
thenSelect:[:index | index ~~ 0]. |
5591 | 1500 |
|
6318
9a3fc13f86be
care for non-existing class in selection
Claus Gittinger <cg@exept.de>
parents:
6208
diff
changeset
|
1501 |
selectedClassNameIndicesHolder := self selectedClassNameIndices. |
9a3fc13f86be
care for non-existing class in selection
Claus Gittinger <cg@exept.de>
parents:
6208
diff
changeset
|
1502 |
((selectedClassNameIndicesHolder value size ~~ self selectedClasses value size) |
9a3fc13f86be
care for non-existing class in selection
Claus Gittinger <cg@exept.de>
parents:
6208
diff
changeset
|
1503 |
or:[newSelectionIndices ~= selectedClassNameIndicesHolder value]) |
9a3fc13f86be
care for non-existing class in selection
Claus Gittinger <cg@exept.de>
parents:
6208
diff
changeset
|
1504 |
ifTrue:[ |
9a3fc13f86be
care for non-existing class in selection
Claus Gittinger <cg@exept.de>
parents:
6208
diff
changeset
|
1505 |
newSelectionIndices notEmpty ifTrue:[ |
9a3fc13f86be
care for non-existing class in selection
Claus Gittinger <cg@exept.de>
parents:
6208
diff
changeset
|
1506 |
"/ force change (for dependents) |
9a3fc13f86be
care for non-existing class in selection
Claus Gittinger <cg@exept.de>
parents:
6208
diff
changeset
|
1507 |
"/ selectedClassNameIndicesHolder value:newSelectionIndices. |
9a3fc13f86be
care for non-existing class in selection
Claus Gittinger <cg@exept.de>
parents:
6208
diff
changeset
|
1508 |
] ifFalse:[ |
9a3fc13f86be
care for non-existing class in selection
Claus Gittinger <cg@exept.de>
parents:
6208
diff
changeset
|
1509 |
prevSelection := self selectedClasses value. |
9a3fc13f86be
care for non-existing class in selection
Claus Gittinger <cg@exept.de>
parents:
6208
diff
changeset
|
1510 |
newSelectionIndices := #(). |
9a3fc13f86be
care for non-existing class in selection
Claus Gittinger <cg@exept.de>
parents:
6208
diff
changeset
|
1511 |
]. |
9a3fc13f86be
care for non-existing class in selection
Claus Gittinger <cg@exept.de>
parents:
6208
diff
changeset
|
1512 |
selectedClassNameIndicesHolder value:newSelectionIndices. |
5591 | 1513 |
|
6318
9a3fc13f86be
care for non-existing class in selection
Claus Gittinger <cg@exept.de>
parents:
6208
diff
changeset
|
1514 |
prevSelection notNil ifTrue:[ |
9a3fc13f86be
care for non-existing class in selection
Claus Gittinger <cg@exept.de>
parents:
6208
diff
changeset
|
1515 |
lastSelectedClasses := prevSelection. |
9a3fc13f86be
care for non-existing class in selection
Claus Gittinger <cg@exept.de>
parents:
6208
diff
changeset
|
1516 |
]. |
9a3fc13f86be
care for non-existing class in selection
Claus Gittinger <cg@exept.de>
parents:
6208
diff
changeset
|
1517 |
self updateOutputGenerator. |
9a3fc13f86be
care for non-existing class in selection
Claus Gittinger <cg@exept.de>
parents:
6208
diff
changeset
|
1518 |
]. |
5591 | 1519 |
|
1520 |
] ifFalse:[ |
|
6318
9a3fc13f86be
care for non-existing class in selection
Claus Gittinger <cg@exept.de>
parents:
6208
diff
changeset
|
1521 |
"/ same classes - but name(s) could be differnet |
9a3fc13f86be
care for non-existing class in selection
Claus Gittinger <cg@exept.de>
parents:
6208
diff
changeset
|
1522 |
newList size > 0 ifTrue:[ |
9a3fc13f86be
care for non-existing class in selection
Claus Gittinger <cg@exept.de>
parents:
6208
diff
changeset
|
1523 |
self reconstructNameList |
9a3fc13f86be
care for non-existing class in selection
Claus Gittinger <cg@exept.de>
parents:
6208
diff
changeset
|
1524 |
] |
5591 | 1525 |
]. |
1526 |
listValid := true. |
|
1527 |
||
1528 |
"Created: / 5.2.2000 / 13:42:18 / cg" |
|
1529 |
"Modified: / 31.10.2001 / 11:35:39 / cg" |
|
1530 |
! |
|
1531 |
||
1532 |
updateListsFor:aClass |
|
1533 |
|classes found foundInSelection| |
|
1534 |
||
1535 |
found := foundInSelection := false. |
|
1536 |
||
1537 |
"/ update for a changed class in the classList |
|
1538 |
(classes := classList value) size > 0 ifTrue:[ |
|
5592 | 1539 |
(self updateClassesIn:classes) ifTrue:[ |
1540 |
found := true |
|
1541 |
]. |
|
1542 |
(classes includes:nil) ifTrue:[ |
|
5591 | 1543 |
self halt:'should not happen'. |
5592 | 1544 |
classList value:(classes := classes select:[:each | each notNil]). |
1545 |
]. |
|
5591 | 1546 |
]. |
1547 |
"/ possibly in the generator |
|
1548 |
((classes := inGeneratorHolder value) isOrderedCollection |
|
1549 |
and:[classes size > 0]) ifTrue:[ |
|
5592 | 1550 |
(self updateClassesIn:classes) ifTrue:[ |
1551 |
found := true |
|
1552 |
]. |
|
1553 |
(classes includes:nil) ifTrue:[ |
|
5591 | 1554 |
self halt:'should not happen'. |
5592 | 1555 |
inGeneratorHolder value:(classes select:[:each | each notNil]). |
1556 |
] |
|
5591 | 1557 |
]. |
1558 |
"/ and in the selection |
|
1559 |
(classes := self selectedClasses value) size > 0 ifTrue:[ |
|
5592 | 1560 |
(self updateClassesIn:classes) ifTrue:[ |
1561 |
found := true. |
|
1562 |
foundInSelection := true. |
|
1563 |
]. |
|
1564 |
(classes includes:nil) ifTrue:[ |
|
5591 | 1565 |
self halt:'should not happen'. |
5592 | 1566 |
self selectedClasses value:(classes select:[:each | each notNil]). |
1567 |
] |
|
5591 | 1568 |
]. |
1569 |
"/ and in the last selection |
|
1570 |
(classes := lastSelectedClasses) size > 0 ifTrue:[ |
|
5592 | 1571 |
(self updateClassesIn:classes) ifTrue:[ |
1572 |
found := true |
|
1573 |
]. |
|
1574 |
(classes includes:nil) ifTrue:[ |
|
5591 | 1575 |
self halt:'should not happen'. |
5592 | 1576 |
lastSelectedClasses := (classes select:[:each | each notNil]). |
1577 |
] |
|
5591 | 1578 |
]. |
1579 |
||
1580 |
found ifFalse:[ |
|
5592 | 1581 |
"/ could be a new class (or no-longer autolaoded one). |
1582 |
listValid ifTrue:[ |
|
1583 |
self enqueueDelayedUpdateList. |
|
1584 |
]. |
|
1585 |
listValid := false. |
|
5591 | 1586 |
]. |
1587 |
foundInSelection ifTrue:[ |
|
5592 | 1588 |
"/ force update of output generator |
1589 |
self selectedClasses |
|
1590 |
removeDependent:self; |
|
1591 |
changed; |
|
1592 |
addDependent:self. |
|
5591 | 1593 |
]. |
1594 |
||
1595 |
"Modified: / 25.2.2000 / 23:54:19 / cg" |
|
1596 |
! ! |
|
1597 |
||
1598 |
!ClassList methodsFor:'setup'! |
|
1599 |
||
1600 |
postBuildWith:aBuilder |
|
1601 |
|classListView| |
|
1602 |
||
1603 |
super postBuildWith:aBuilder. |
|
1604 |
||
1605 |
classListView := aBuilder componentAt:'List'. |
|
1606 |
classListView notNil ifTrue:[ |
|
1607 |
classListView allowDrag:true. |
|
1608 |
classListView dragObjectConverter:[:obj | |
|
1609 |
|nm class idx| |
|
1610 |
||
1611 |
nm := obj theObject asString. |
|
1612 |
idx := classNameList value indexOf:nm. |
|
1613 |
idx == 0 ifTrue:[ |
|
1614 |
idx := classNameList value indexOf:nm string. |
|
1615 |
]. |
|
1616 |
class := classList value at:idx. |
|
1617 |
DropObject newClass:class. |
|
1618 |
]. |
|
1619 |
] |
|
1620 |
! ! |
|
1621 |
||
1622 |
!ClassList class methodsFor:'documentation'! |
|
1623 |
||
1624 |
version |
|
6712 | 1625 |
^ '$Header: /cvs/stx/stx/libtool/Tools_ClassList.st,v 1.11 2006-03-16 22:33:21 cg Exp $' |
5591 | 1626 |
! ! |