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