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