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
|
5592
|
122 |
#name: #windowSpec
|
|
123 |
#window:
|
5591
|
124 |
#(#WindowSpec
|
5592
|
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
|
5592
|
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: #canDrop:
|
|
153 |
#dropSelector: #doDrop:
|
|
154 |
)
|
|
155 |
)
|
|
156 |
)
|
5591
|
157 |
|
5592
|
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 |
|
|
879 |
canDrop:aDropContext
|
|
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.
|
|
887 |
|
|
888 |
(methods contains:[:aMethod | aMethod mclass ~= cls]) ifFalse:[^ false].
|
|
889 |
|
|
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 |
|
|
907 |
doDrop:aDropContext
|
|
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:[
|
|
915 |
cls := cls theMetaclass
|
|
916 |
].
|
|
917 |
|
|
918 |
cls notNil ifTrue:[
|
|
919 |
self masterApplication moveMethods:methods toClass:cls.
|
|
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 |
].
|
|
1285 |
cls isStartableWithMain ifTrue:[
|
6207
|
1286 |
^ SystemBrowser startableClassIcon
|
|
1287 |
].
|
|
1288 |
cls isStartableWithStart ifTrue:[
|
|
1289 |
^ SystemBrowser startableClassIcon
|
5591
|
1290 |
].
|
|
1291 |
cls isLoaded ifFalse:[
|
6207
|
1292 |
^ SystemBrowser autoloadedClassIcon
|
5591
|
1293 |
].
|
|
1294 |
c := cls.
|
|
1295 |
[c notNil] whileTrue:[
|
6207
|
1296 |
c == Warning ifTrue:[
|
|
1297 |
^ SystemBrowser warningClassIcon
|
|
1298 |
].
|
|
1299 |
c == Query ifTrue:[
|
|
1300 |
^ SystemBrowser queryClassIcon
|
|
1301 |
].
|
|
1302 |
c == Notification ifTrue:[
|
|
1303 |
^ SystemBrowser notificationClassIcon
|
|
1304 |
].
|
|
1305 |
c == Error ifTrue:[
|
|
1306 |
^ SystemBrowser errorClassIcon
|
|
1307 |
].
|
|
1308 |
c == GenericException ifTrue:[
|
|
1309 |
^ SystemBrowser exceptionClassIcon
|
|
1310 |
].
|
|
1311 |
c == SimpleView ifTrue:[
|
|
1312 |
^ SystemBrowser windowClassIcon
|
|
1313 |
].
|
|
1314 |
c == Collection ifTrue:[
|
|
1315 |
^ SystemBrowser containerClassIcon
|
|
1316 |
].
|
|
1317 |
(c == TestCase and:[cls isAbstract not "cls ~~ TestCase"]) ifTrue:[
|
|
1318 |
^ SystemBrowser testCaseClassIconFor:cls
|
|
1319 |
].
|
|
1320 |
c := c superclass
|
5591
|
1321 |
].
|
|
1322 |
^ nil
|
|
1323 |
!
|
|
1324 |
|
|
1325 |
reconstructNameList
|
|
1326 |
"only reconstruct the names - class list & selection remains
|
|
1327 |
unschanged. Invoked when the organizerMode mode changes"
|
|
1328 |
|
|
1329 |
|prevMode listView oldNameList newNameList sav|
|
|
1330 |
|
|
1331 |
self classList value isNil ifTrue:[
|
5592
|
1332 |
self updateList
|
5591
|
1333 |
].
|
|
1334 |
|
|
1335 |
newNameList := self nameListForClasses:(classList value ? #()).
|
|
1336 |
oldNameList := self classNameList value ? #().
|
|
1337 |
(newNameList
|
5592
|
1338 |
sameContentsAs: oldNameList
|
|
1339 |
whenComparedWith:[:a :b | (a sameStringAndEmphasisAs: b)
|
|
1340 |
and:[ a hasImage == b hasImage
|
|
1341 |
and:[ a hasIcon == b hasIcon ]]]
|
5591
|
1342 |
)
|
|
1343 |
ifTrue:[
|
5592
|
1344 |
"/ no need to update
|
5591
|
1345 |
] ifFalse:[
|
5592
|
1346 |
listView := builder componentAt:#List.
|
|
1347 |
(listView isNil or:[listView scrolledView isNil]) ifTrue:[
|
|
1348 |
"/ invoked very early during setup
|
|
1349 |
self classNameList value:newNameList
|
|
1350 |
] ifFalse:[
|
|
1351 |
"/ avoid flicker and useless redraws
|
5591
|
1352 |
|
5592
|
1353 |
prevMode := listView scrollWhenUpdating.
|
|
1354 |
listView scrollWhenUpdating:nil.
|
5591
|
1355 |
|
5592
|
1356 |
"/ this will lead to a selectionIndex change (done by the selListView);
|
|
1357 |
"/ however, we dont want this here, since it recurses into
|
|
1358 |
"/ a selectionChange. Therefore, temporarily disconnect the selectionIndexHolder...
|
|
1359 |
[
|
|
1360 |
self selectedClassNameIndices removeDependent:self.
|
|
1361 |
"/ also, dont want a callback (selectionChangedByClick)
|
|
1362 |
sav := listView action.
|
|
1363 |
listView action:nil.
|
|
1364 |
self classNameList value:newNameList.
|
|
1365 |
] ensure:[
|
|
1366 |
listView action:sav.
|
|
1367 |
self selectedClassNameIndices addDependent:self.
|
|
1368 |
listView scrollWhenUpdating:prevMode.
|
|
1369 |
].
|
|
1370 |
]
|
5591
|
1371 |
].
|
|
1372 |
|
|
1373 |
"Modified: / 31.10.2001 / 11:33:21 / cg"
|
|
1374 |
!
|
|
1375 |
|
|
1376 |
release
|
|
1377 |
super release.
|
|
1378 |
|
|
1379 |
currentNamespace removeDependent:self.
|
|
1380 |
hidePrivateClasses removeDependent:self.
|
|
1381 |
markApplicationsHolder removeDependent:self.
|
|
1382 |
meta removeDependent:self.
|
|
1383 |
selectedClassNameIndices removeDependent:self.
|
|
1384 |
showClassPackages removeDependent:self.
|
|
1385 |
|
|
1386 |
"Created: / 5.2.2000 / 13:42:18 / cg"
|
|
1387 |
!
|
|
1388 |
|
|
1389 |
updateClassesIn:aCollection
|
|
1390 |
"replace any obsolete class in aCollection;
|
|
1391 |
return true, if any was found"
|
|
1392 |
|
|
1393 |
|found meta classes|
|
|
1394 |
|
|
1395 |
found := false.
|
|
1396 |
|
|
1397 |
aCollection isSequenceable ifFalse:[
|
|
1398 |
classes := aCollection copy.
|
|
1399 |
aCollection removeAll.
|
|
1400 |
classes do:[:cls |
|
|
1401 |
|newClass|
|
|
1402 |
|
|
1403 |
meta := cls isMeta.
|
|
1404 |
newClass := Smalltalk at:(cls theNonMetaclass name).
|
|
1405 |
newClass isNil ifTrue:[
|
|
1406 |
newClass := cls
|
|
1407 |
] ifFalse:[
|
|
1408 |
meta ifTrue:[
|
|
1409 |
newClass := newClass class
|
|
1410 |
]
|
|
1411 |
].
|
|
1412 |
found := cls ~~ newClass.
|
|
1413 |
aCollection add:newClass.
|
|
1414 |
].
|
|
1415 |
] ifTrue:[
|
|
1416 |
aCollection keysAndValuesDo:[:idx :cls |
|
|
1417 |
|newClass|
|
|
1418 |
|
|
1419 |
cls notNil ifTrue:[
|
|
1420 |
meta := cls isMeta.
|
|
1421 |
newClass := Smalltalk at:(cls theNonMetaclass name).
|
|
1422 |
newClass isNil ifTrue:[
|
|
1423 |
newClass := cls
|
|
1424 |
] ifFalse:[
|
|
1425 |
meta ifTrue:[
|
|
1426 |
newClass := newClass class
|
|
1427 |
]
|
|
1428 |
].
|
|
1429 |
found := cls ~~ newClass.
|
|
1430 |
aCollection at:idx put:newClass.
|
|
1431 |
]
|
|
1432 |
].
|
|
1433 |
].
|
|
1434 |
^ found
|
|
1435 |
!
|
|
1436 |
|
|
1437 |
updateList
|
|
1438 |
|prevSelection oldList newList newSelectionIndices
|
|
1439 |
forceSelectionChange selectedClassNameIndicesHolder classList|
|
|
1440 |
|
|
1441 |
newList := self listOfClasses.
|
|
1442 |
classList := self classList.
|
|
1443 |
oldList := classList value ? #().
|
|
1444 |
|
|
1445 |
(newList ~= oldList
|
|
1446 |
or:[self classNameList value isNil and:[newList size > 0]]) ifTrue:[
|
|
1447 |
prevSelection := lastSelectedClasses ? #().
|
|
1448 |
prevSelection := prevSelection select:[:each | each notNil].
|
|
1449 |
|
|
1450 |
(newList collect:[:each | each name]) = (oldList collect:[:each | each name]) ifTrue:[
|
|
1451 |
"/ no need to tell anybody
|
|
1452 |
classList setValue:newList.
|
|
1453 |
] ifFalse:[
|
|
1454 |
classList value:newList.
|
|
1455 |
].
|
|
1456 |
self reconstructNameList.
|
|
1457 |
|
|
1458 |
(prevSelection size == 0
|
|
1459 |
and:[self selectedClasses value size ~~ 0]) ifTrue:[
|
|
1460 |
"/ this happens during early startup time,
|
|
1461 |
"/ when the selection is already (pre-)set,
|
|
1462 |
"/ and the classList is generated the first time
|
|
1463 |
"/ (i.e. when opened with preset selection)
|
|
1464 |
|
|
1465 |
"/ do not clobber the selection in this case.
|
|
1466 |
prevSelection := self selectedClasses value.
|
|
1467 |
"/ simulate a change, to force selection update in listView
|
|
1468 |
forceSelectionChange := true.
|
|
1469 |
].
|
|
1470 |
|
|
1471 |
newSelectionIndices := prevSelection
|
|
1472 |
collect:[:item | |cls|
|
|
1473 |
cls := Smalltalk at:item theNonMetaclass name.
|
|
1474 |
newList identityIndexOf:cls]
|
|
1475 |
thenSelect:[:index | index ~~ 0].
|
|
1476 |
|
|
1477 |
selectedClassNameIndicesHolder := self selectedClassNameIndices.
|
|
1478 |
((selectedClassNameIndicesHolder value size ~~ self selectedClasses value size)
|
|
1479 |
or:[newSelectionIndices ~= selectedClassNameIndicesHolder value])
|
|
1480 |
ifTrue:[
|
|
1481 |
newSelectionIndices notEmpty ifTrue:[
|
|
1482 |
"/ force change (for dependents)
|
|
1483 |
"/ selectedClassNameIndicesHolder value:newSelectionIndices.
|
|
1484 |
] ifFalse:[
|
|
1485 |
prevSelection := self selectedClasses value.
|
|
1486 |
newSelectionIndices := #().
|
|
1487 |
].
|
|
1488 |
selectedClassNameIndicesHolder value:newSelectionIndices.
|
|
1489 |
|
|
1490 |
prevSelection notNil ifTrue:[
|
|
1491 |
lastSelectedClasses := prevSelection.
|
|
1492 |
].
|
|
1493 |
self updateOutputGenerator.
|
|
1494 |
].
|
|
1495 |
|
|
1496 |
] ifFalse:[
|
|
1497 |
"/ same classes - but name(s) could be differnet
|
|
1498 |
newList size > 0 ifTrue:[
|
|
1499 |
self reconstructNameList
|
|
1500 |
]
|
|
1501 |
].
|
|
1502 |
listValid := true.
|
|
1503 |
|
|
1504 |
"Created: / 5.2.2000 / 13:42:18 / cg"
|
|
1505 |
"Modified: / 31.10.2001 / 11:35:39 / cg"
|
|
1506 |
!
|
|
1507 |
|
|
1508 |
updateListsFor:aClass
|
|
1509 |
|classes found foundInSelection|
|
|
1510 |
|
|
1511 |
found := foundInSelection := false.
|
|
1512 |
|
|
1513 |
"/ update for a changed class in the classList
|
|
1514 |
(classes := classList value) size > 0 ifTrue:[
|
5592
|
1515 |
(self updateClassesIn:classes) ifTrue:[
|
|
1516 |
found := true
|
|
1517 |
].
|
|
1518 |
(classes includes:nil) ifTrue:[
|
5591
|
1519 |
self halt:'should not happen'.
|
5592
|
1520 |
classList value:(classes := classes select:[:each | each notNil]).
|
|
1521 |
].
|
5591
|
1522 |
].
|
|
1523 |
"/ possibly in the generator
|
|
1524 |
((classes := inGeneratorHolder value) isOrderedCollection
|
|
1525 |
and:[classes size > 0]) ifTrue:[
|
5592
|
1526 |
(self updateClassesIn:classes) ifTrue:[
|
|
1527 |
found := true
|
|
1528 |
].
|
|
1529 |
(classes includes:nil) ifTrue:[
|
5591
|
1530 |
self halt:'should not happen'.
|
5592
|
1531 |
inGeneratorHolder value:(classes select:[:each | each notNil]).
|
|
1532 |
]
|
5591
|
1533 |
].
|
|
1534 |
"/ and in the selection
|
|
1535 |
(classes := self selectedClasses value) size > 0 ifTrue:[
|
5592
|
1536 |
(self updateClassesIn:classes) ifTrue:[
|
|
1537 |
found := true.
|
|
1538 |
foundInSelection := true.
|
|
1539 |
].
|
|
1540 |
(classes includes:nil) ifTrue:[
|
5591
|
1541 |
self halt:'should not happen'.
|
5592
|
1542 |
self selectedClasses value:(classes select:[:each | each notNil]).
|
|
1543 |
]
|
5591
|
1544 |
].
|
|
1545 |
"/ and in the last selection
|
|
1546 |
(classes := lastSelectedClasses) size > 0 ifTrue:[
|
5592
|
1547 |
(self updateClassesIn:classes) ifTrue:[
|
|
1548 |
found := true
|
|
1549 |
].
|
|
1550 |
(classes includes:nil) ifTrue:[
|
5591
|
1551 |
self halt:'should not happen'.
|
5592
|
1552 |
lastSelectedClasses := (classes select:[:each | each notNil]).
|
|
1553 |
]
|
5591
|
1554 |
].
|
|
1555 |
|
|
1556 |
found ifFalse:[
|
5592
|
1557 |
"/ could be a new class (or no-longer autolaoded one).
|
|
1558 |
listValid ifTrue:[
|
|
1559 |
self enqueueDelayedUpdateList.
|
|
1560 |
].
|
|
1561 |
listValid := false.
|
5591
|
1562 |
].
|
|
1563 |
foundInSelection ifTrue:[
|
5592
|
1564 |
"/ force update of output generator
|
|
1565 |
self selectedClasses
|
|
1566 |
removeDependent:self;
|
|
1567 |
changed;
|
|
1568 |
addDependent:self.
|
5591
|
1569 |
].
|
|
1570 |
|
|
1571 |
"Modified: / 25.2.2000 / 23:54:19 / cg"
|
|
1572 |
! !
|
|
1573 |
|
|
1574 |
!ClassList methodsFor:'setup'!
|
|
1575 |
|
|
1576 |
postBuildWith:aBuilder
|
|
1577 |
|classListView|
|
|
1578 |
|
|
1579 |
super postBuildWith:aBuilder.
|
|
1580 |
|
|
1581 |
classListView := aBuilder componentAt:'List'.
|
|
1582 |
classListView notNil ifTrue:[
|
|
1583 |
classListView allowDrag:true.
|
|
1584 |
classListView dragObjectConverter:[:obj |
|
|
1585 |
|nm class idx|
|
|
1586 |
|
|
1587 |
nm := obj theObject asString.
|
|
1588 |
idx := classNameList value indexOf:nm.
|
|
1589 |
idx == 0 ifTrue:[
|
|
1590 |
idx := classNameList value indexOf:nm string.
|
|
1591 |
].
|
|
1592 |
class := classList value at:idx.
|
|
1593 |
DropObject newClass:class.
|
|
1594 |
].
|
|
1595 |
]
|
|
1596 |
! !
|
|
1597 |
|
|
1598 |
!ClassList class methodsFor:'documentation'!
|
|
1599 |
|
|
1600 |
version
|
6207
|
1601 |
^ '$Header: /cvs/stx/stx/libtool/Tools_ClassList.st,v 1.6 2005-02-25 16:41:48 cg Exp $'
|
5591
|
1602 |
! !
|