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