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