author | Stefan Vogel <sv@exept.de> |
Sat, 20 Mar 2004 16:45:22 +0100 | |
changeset 5782 | ae4720e83b49 |
parent 5592 | d9730a8d7c52 |
child 6468 | 8047fc185bd8 |
permissions | -rw-r--r-- |
5591 | 1 |
" |
2 |
COPYRIGHT (c) 2000 by eXept Software AG |
|
3 |
All Rights Reserved |
|
4 |
||
5 |
This software is furnished under a license and may be used |
|
6 |
only in accordance with the terms of that license and with the |
|
7 |
inclusion of the above copyright notice. This software may not |
|
8 |
be provided or otherwise made available to, or used by, any |
|
9 |
other person. No title to or ownership of the software is |
|
10 |
hereby transferred. |
|
11 |
" |
|
12 |
||
5592 | 13 |
"{ Package: 'stx:libtool' }" |
5591 | 14 |
|
15 |
"{ NameSpace: Tools }" |
|
16 |
||
17 |
BrowserList subclass:#ProjectList |
|
18 |
instanceVariableNames:'projectList' |
|
19 |
classVariableNames:'AdditionalEmptyProjects' |
|
20 |
poolDictionaries:'' |
|
21 |
category:'Interface-Browsers-New' |
|
22 |
! |
|
23 |
||
24 |
!ProjectList class methodsFor:'documentation'! |
|
25 |
||
26 |
copyright |
|
27 |
" |
|
28 |
COPYRIGHT (c) 2000 by eXept Software AG |
|
29 |
All Rights Reserved |
|
30 |
||
31 |
This software is furnished under a license and may be used |
|
32 |
only in accordance with the terms of that license and with the |
|
33 |
inclusion of the above copyright notice. This software may not |
|
34 |
be provided or otherwise made available to, or used by, any |
|
35 |
other person. No title to or ownership of the software is |
|
36 |
hereby transferred. |
|
37 |
" |
|
38 |
! ! |
|
39 |
||
40 |
!ProjectList class methodsFor:'interface specs'! |
|
41 |
||
42 |
singleProjectWindowSpec |
|
43 |
"This resource specification was automatically generated |
|
44 |
by the UIPainter of ST/X." |
|
45 |
||
46 |
"Do not manually edit this!! If it is corrupted, |
|
47 |
the UIPainter may not be able to read the specification." |
|
48 |
||
49 |
" |
|
50 |
UIPainter new openOnClass:ClassCategoryList andSelector:#singleCategoryWindowSpec |
|
51 |
ClassCategoryList new openInterface:#singleCategoryWindowSpec |
|
52 |
" |
|
53 |
||
54 |
<resource: #canvas> |
|
55 |
||
56 |
^ |
|
57 |
#(#FullSpec |
|
5592 | 58 |
#name: #singleProjectWindowSpec |
59 |
#window: |
|
5591 | 60 |
#(#WindowSpec |
5592 | 61 |
#label: 'ProjectList' |
62 |
#name: 'ProjectList' |
|
63 |
#min: #(#Point 0 0) |
|
64 |
#max: #(#Point 1024 721) |
|
65 |
#bounds: #(#Rectangle 218 175 518 475) |
|
66 |
) |
|
67 |
#component: |
|
5591 | 68 |
#(#SpecCollection |
5592 | 69 |
#collection: #( |
70 |
#(#LabelSpec |
|
71 |
#label: 'ProjectName' |
|
72 |
#name: 'ProjectLabel' |
|
73 |
#layout: #(#LayoutFrame 0 0.0 0 0 0 1.0 25 0) |
|
74 |
#translateLabel: true |
|
75 |
#labelChannel: #projectLabelHolder |
|
76 |
#menu: #menuHolder |
|
77 |
) |
|
78 |
) |
|
5591 | 79 |
|
5592 | 80 |
) |
5591 | 81 |
) |
82 |
! |
|
83 |
||
84 |
windowSpec |
|
85 |
"This resource specification was automatically generated |
|
86 |
by the UIPainter of ST/X." |
|
87 |
||
88 |
"Do not manually edit this!! If it is corrupted, |
|
89 |
the UIPainter may not be able to read the specification." |
|
90 |
||
91 |
" |
|
92 |
UIPainter new openOnClass:ProjectList andSelector:#windowSpec |
|
93 |
ProjectList new openInterface:#windowSpec |
|
94 |
ProjectList open |
|
95 |
" |
|
96 |
||
97 |
<resource: #canvas> |
|
98 |
||
99 |
^ |
|
100 |
#(#FullSpec |
|
5592 | 101 |
#name: #windowSpec |
102 |
#window: |
|
5591 | 103 |
#(#WindowSpec |
5592 | 104 |
#label: 'ProjectList' |
105 |
#name: 'ProjectList' |
|
106 |
#min: #(#Point 0 0) |
|
107 |
#max: #(#Point 1024 721) |
|
108 |
#bounds: #(#Rectangle 13 23 313 323) |
|
109 |
) |
|
110 |
#component: |
|
5591 | 111 |
#(#SpecCollection |
5592 | 112 |
#collection: #( |
113 |
#(#SequenceViewSpec |
|
114 |
#name: 'List' |
|
115 |
#layout: #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0) |
|
116 |
#tabable: true |
|
117 |
#model: #selectedProjects |
|
118 |
#menu: #menuHolder |
|
119 |
#hasHorizontalScrollBar: true |
|
120 |
#hasVerticalScrollBar: true |
|
121 |
#miniScrollerHorizontal: true |
|
122 |
#isMultiSelect: true |
|
123 |
#valueChangeSelector: #selectionChangedByClick |
|
124 |
#useIndex: false |
|
125 |
#sequenceList: #projectList |
|
126 |
#doubleClickChannel: #doubleClickChannel |
|
127 |
#properties: |
|
128 |
#(#PropertyListDictionary |
|
129 |
#dragArgument: nil |
|
130 |
#dropArgument: nil |
|
131 |
#canDropSelector: #canDrop: |
|
132 |
#dropSelector: #doDrop: |
|
133 |
) |
|
134 |
) |
|
135 |
) |
|
5591 | 136 |
|
5592 | 137 |
) |
5591 | 138 |
) |
139 |
||
140 |
"Created: / 17.2.2000 / 23:45:47 / cg" |
|
141 |
"Modified: / 17.2.2000 / 23:47:53 / cg" |
|
142 |
! ! |
|
143 |
||
144 |
!ProjectList class methodsFor:'queries-plugin'! |
|
145 |
||
146 |
aspectSelectors |
|
147 |
^ #( |
|
148 |
#(#doubleClickChannel #action ) |
|
149 |
immediateUpdate |
|
150 |
selectedProjects |
|
151 |
menuHolder |
|
152 |
outGeneratorHolder |
|
153 |
inGeneratorHolder |
|
154 |
selectionChangeCondition |
|
155 |
updateTrigger |
|
156 |
forceGeneratorTrigger |
|
157 |
hideUnloadedClasses |
|
158 |
organizerMode |
|
159 |
slaveMode |
|
160 |
) |
|
161 |
||
162 |
"Created: / 17.2.2000 / 23:46:18 / cg" |
|
163 |
"Modified: / 25.2.2000 / 22:32:10 / cg" |
|
164 |
! ! |
|
165 |
||
166 |
!ProjectList methodsFor:'aspects'! |
|
167 |
||
168 |
projectLabelHolder |
|
169 |
^ self pseudoListLabelHolder |
|
170 |
! |
|
171 |
||
172 |
projectList |
|
173 |
projectList isNil ifTrue:[ |
|
174 |
projectList := ValueHolder new. |
|
175 |
projectList addDependent:self. |
|
176 |
]. |
|
177 |
^ projectList |
|
178 |
||
179 |
"Created: / 17.2.2000 / 23:39:32 / cg" |
|
180 |
! |
|
181 |
||
182 |
selectedProjects |
|
183 |
^ self selectionHolder |
|
184 |
||
185 |
"Created: / 17.2.2000 / 23:39:57 / cg" |
|
186 |
! |
|
187 |
||
188 |
selectedProjects:aValueHolder |
|
189 |
^ self selectionHolder:aValueHolder |
|
190 |
! ! |
|
191 |
||
192 |
!ProjectList methodsFor:'change & update'! |
|
193 |
||
194 |
delayedUpdate:something with:aParameter from:changedObject |
|
195 |
|cls sel pkg mthd| |
|
196 |
||
197 |
self inSlaveModeOrInvisible |
|
198 |
"/ (self slaveMode value == true) |
|
199 |
ifTrue:[ |
|
200 |
changedObject == Smalltalk ifTrue:[ listValid := false]. |
|
201 |
something == #projectOrganization ifTrue:[ listValid := false]. |
|
202 |
^ self |
|
203 |
]. |
|
204 |
||
205 |
changedObject == slaveMode ifTrue:[ |
|
206 |
listValid ~~ true ifTrue:[ |
|
207 |
self enqueueDelayedUpdateList |
|
208 |
]. |
|
209 |
"/ self invalidateList. |
|
210 |
^ self |
|
211 |
]. |
|
212 |
||
213 |
||
214 |
changedObject == Smalltalk ifTrue:[ |
|
215 |
something == #projectOrganization ifTrue:[ |
|
216 |
self invalidateList. |
|
217 |
self enqueueDelayedUpdateOutputGenerator. |
|
218 |
^ self. |
|
219 |
]. |
|
220 |
something == #methodInClass ifTrue:[ |
|
221 |
listValid == true ifTrue:[ |
|
222 |
cls := aParameter at:1. |
|
223 |
sel := aParameter at:2. |
|
224 |
mthd := cls compiledMethodAt:sel. |
|
225 |
mthd notNil ifTrue:[ |
|
226 |
pkg := mthd package. |
|
227 |
(projectList value includes:pkg) ifFalse:[ |
|
228 |
self invalidateList. |
|
229 |
] |
|
230 |
]. |
|
231 |
]. |
|
232 |
^ self |
|
233 |
]. |
|
234 |
||
235 |
(something == #classDefinition |
|
236 |
or:[something == #newClass]) ifTrue:[ |
|
237 |
listValid == true ifTrue:[ |
|
238 |
cls := aParameter. |
|
239 |
pkg := cls package. |
|
240 |
(projectList value includes:pkg) ifFalse:[ |
|
241 |
self invalidateList. |
|
242 |
] ifTrue:[ |
|
243 |
self enqueueDelayedUpdateOutputGenerator |
|
244 |
]. |
|
245 |
] ifFalse:[ |
|
246 |
self invalidateList |
|
247 |
]. |
|
248 |
^ self |
|
249 |
]. |
|
250 |
(something == #classRemove) ifTrue:[ |
|
251 |
listValid == true ifTrue:[ |
|
252 |
cls := aParameter. |
|
253 |
pkg := cls package. |
|
254 |
]. |
|
255 |
]. |
|
256 |
^ self |
|
257 |
]. |
|
258 |
||
259 |
"/ something == #projectOrganization ifTrue:[ |
|
260 |
"/ aParameter isSymbol ifTrue:[ |
|
261 |
"/ "/ a single method has changed |
|
262 |
"/"/ sel := aParameter. |
|
263 |
"/"/ mthd := changedObject compiledMethodAt:sel. |
|
264 |
"/ self enqueueDelayedUpdateOutputGenerator. |
|
265 |
"/ ]. |
|
266 |
"/ ^ self |
|
267 |
"/ ]. |
|
268 |
||
269 |
(organizerMode notNil |
|
270 |
and:[organizerMode value ~~ #project]) ifTrue:[ |
|
271 |
self invalidateList. |
|
272 |
^ self |
|
273 |
]. |
|
274 |
super delayedUpdate:something with:aParameter from:changedObject |
|
275 |
||
276 |
"Created: / 17.2.2000 / 23:41:02 / cg" |
|
277 |
"Modified: / 26.2.2000 / 01:21:49 / cg" |
|
278 |
! |
|
279 |
||
280 |
selectionChangedByClick |
|
281 |
"we are not interested in that - get another notification |
|
282 |
via the changed valueHolder" |
|
283 |
||
284 |
"Created: / 17.2.2000 / 23:41:17 / cg" |
|
285 |
! |
|
286 |
||
287 |
update:something with:aParameter from:changedObject |
|
288 |
changedObject == Smalltalk ifTrue:[ |
|
289 |
something == #methodDictionary ifTrue:[ |
|
290 |
^ self |
|
291 |
]. |
|
292 |
something == #methodTrap ifTrue:[ |
|
293 |
^ self |
|
294 |
]. |
|
295 |
something == #methodInClass ifTrue:[ |
|
296 |
^ self |
|
297 |
]. |
|
298 |
something == #classVariables ifTrue:[ |
|
299 |
^ self |
|
300 |
]. |
|
301 |
something == #classComment ifTrue:[ |
|
302 |
^ self. |
|
303 |
]. |
|
304 |
something == #methodInClassRemoved ifTrue:[ |
|
305 |
^ self. |
|
306 |
]. |
|
307 |
]. |
|
308 |
super update:something with:aParameter from:changedObject |
|
309 |
! ! |
|
310 |
||
311 |
!ProjectList methodsFor:'drag & drop'! |
|
312 |
||
313 |
canDrop:aDropContext |
|
314 |
|methodsOrClasses package| |
|
315 |
||
316 |
methodsOrClasses := aDropContext dropObjects collect:[:obj | obj theObject]. |
|
317 |
||
318 |
(methodsOrClasses contains:[:aMethodOrClass | (aMethodOrClass isMethod or:[aMethodOrClass isClass]) not]) ifTrue:[^ false]. |
|
319 |
||
320 |
package := self packageAtTargetPointOf:aDropContext. |
|
321 |
package isNil ifTrue:[^ false]. |
|
322 |
||
323 |
(methodsOrClasses contains:[:aMethodOrClass | aMethodOrClass package ~= package]) ifFalse:[^ false]. |
|
324 |
||
325 |
^ true |
|
326 |
! |
|
327 |
||
328 |
doDrop:aDropContext |
|
329 |
|package methodsOrClasses methods classes| |
|
330 |
||
331 |
methodsOrClasses := aDropContext dropObjects collect:[:aDropObject | aDropObject theObject]. |
|
332 |
(methodsOrClasses contains:[:something | (something isMethod or:[something isClass]) not]) ifTrue:[^ self]. |
|
333 |
methods := methodsOrClasses select:[:something | something isMethod]. |
|
334 |
classes := methodsOrClasses select:[:something | something isClass]. |
|
335 |
||
336 |
package := self packageAtTargetPointOf:aDropContext. |
|
337 |
package notNil ifTrue:[ |
|
338 |
methods notEmpty ifTrue:[ |
|
339 |
self masterApplication moveMethods:methods toProject:package. |
|
340 |
]. |
|
341 |
classes notEmpty ifTrue:[ |
|
342 |
self masterApplication moveClasses:classes toProject:package. |
|
343 |
] |
|
344 |
]. |
|
345 |
! |
|
346 |
||
347 |
packageAtTargetPointOf:aDropContext |
|
348 |
|p packageListView lineNr item package dropInfo now |
|
349 |
overItem timeOverItem| |
|
350 |
||
351 |
p := aDropContext targetPoint. |
|
352 |
||
353 |
packageListView := aDropContext targetWidget. |
|
354 |
||
355 |
dropInfo := aDropContext dropInfo. |
|
356 |
||
357 |
lineNr := packageListView yVisibleToLineNr:p y. |
|
358 |
lineNr isNil ifTrue:[^ nil]. |
|
359 |
||
360 |
item := packageListView list value at:lineNr. |
|
361 |
item isNil ifTrue:[^ nil]. |
|
362 |
||
363 |
item canExpand ifTrue:[ |
|
5782
ae4720e83b49
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
5592
diff
changeset
|
364 |
now := Timestamp now. |
ae4720e83b49
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
5592
diff
changeset
|
365 |
overItem := dropInfo at:#overItem ifAbsentPut:[item]. |
ae4720e83b49
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
5592
diff
changeset
|
366 |
timeOverItem := dropInfo at:#timeOverItem ifAbsentPut:[now]. |
5591 | 367 |
|
5782
ae4720e83b49
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
5592
diff
changeset
|
368 |
overItem ~~ item ifTrue:[ |
ae4720e83b49
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
5592
diff
changeset
|
369 |
dropInfo at:#timeOverItem put:now. |
ae4720e83b49
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
5592
diff
changeset
|
370 |
dropInfo at:#overItem put:item. |
ae4720e83b49
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
5592
diff
changeset
|
371 |
aDropContext passiveAction:[ self packageAtTargetPointOf:aDropContext ]. |
ae4720e83b49
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
5592
diff
changeset
|
372 |
] ifFalse:[ |
ae4720e83b49
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
5592
diff
changeset
|
373 |
(now millisecondDeltaFrom:timeOverItem) >= (UserPreferences current timeToAutoExpandItemsWhenDraggingOver) ifTrue:[ |
ae4720e83b49
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
5592
diff
changeset
|
374 |
aDropContext saveDraw:[ item expand. packageListView repairDamage ]. |
ae4720e83b49
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
5592
diff
changeset
|
375 |
dropInfo removeKey:#timeOverItem. |
ae4720e83b49
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
5592
diff
changeset
|
376 |
dropInfo removeKey:#overItem. |
ae4720e83b49
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
5592
diff
changeset
|
377 |
] ifFalse:[ |
ae4720e83b49
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
5592
diff
changeset
|
378 |
aDropContext passiveAction:[ self packageAtTargetPointOf:aDropContext ]. |
ae4720e83b49
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
5592
diff
changeset
|
379 |
] |
ae4720e83b49
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
5592
diff
changeset
|
380 |
]. |
5591 | 381 |
]. |
382 |
||
383 |
package := item package. |
|
384 |
package = self class nameListEntryForALL ifTrue:[^ nil]. |
|
385 |
^ package. |
|
386 |
! ! |
|
387 |
||
388 |
!ProjectList methodsFor:'generators'! |
|
389 |
||
390 |
makeGenerator |
|
391 |
"return a generator which enumerates the classes from the selected project(s)." |
|
392 |
||
393 |
|selectedPackages thePackage hideUnloadedClasses| |
|
394 |
||
395 |
selectedPackages := self selectedProjects value. |
|
396 |
selectedPackages size == 0 ifTrue:[ |
|
397 |
^ #() |
|
398 |
]. |
|
399 |
||
400 |
hideUnloadedClasses := self hideUnloadedClasses value. |
|
401 |
||
402 |
(selectedPackages includes:(self class nameListEntryForALL)) ifTrue:[ |
|
403 |
hideUnloadedClasses ifTrue:[ |
|
404 |
^ Iterator on:[:whatToDo | |
|
405 |
Smalltalk allClassesDo:[:cls | |
|
406 |
cls isLoaded ifTrue:[ |
|
407 |
(cls isNameSpace not or:[cls == Smalltalk]) ifTrue:[ |
|
408 |
whatToDo value:cls |
|
409 |
] |
|
410 |
] |
|
411 |
] |
|
412 |
] |
|
413 |
]. |
|
414 |
^ Iterator on:[:whatToDo | |
|
415 |
Smalltalk allClassesDo:[:cls | |
|
416 |
(cls isNameSpace not or:[cls == Smalltalk]) ifTrue:[ |
|
417 |
whatToDo value:cls |
|
418 |
] |
|
419 |
] |
|
420 |
] |
|
421 |
]. |
|
422 |
||
423 |
selectedPackages size == 1 ifTrue:[ |
|
424 |
"/ faster common case |
|
425 |
thePackage := selectedPackages first. |
|
426 |
||
427 |
^ Iterator on:[:whatToDo | |doInclude| |
|
428 |
Smalltalk allClassesDo:[:cls | |
|
429 |
(hideUnloadedClasses not or:[cls isLoaded]) |
|
430 |
ifTrue:[ |
|
431 |
(cls isNameSpace not or:[cls == Smalltalk]) ifTrue:[ |
|
432 |
doInclude := (thePackage = cls package). |
|
433 |
doInclude ifFalse:[ |
|
434 |
cls isJavaClass ifFalse:[ |
|
435 |
doInclude := (cls methodDictionary contains:[:mthd | thePackage = mthd package]) |
|
436 |
or:[ cls class methodDictionary contains:[:mthd | thePackage = mthd package]]. |
|
437 |
] |
|
438 |
]. |
|
439 |
doInclude ifTrue:[ |
|
440 |
whatToDo value:cls |
|
441 |
] |
|
442 |
] |
|
443 |
] |
|
444 |
] |
|
445 |
] |
|
446 |
]. |
|
447 |
||
448 |
^ Iterator on:[:whatToDo | |doInclude| |
|
449 |
Smalltalk allClassesDo:[:cls | |
|
450 |
(hideUnloadedClasses not or:[cls isLoaded]) |
|
451 |
ifTrue:[ |
|
452 |
(cls isNameSpace not or:[cls == Smalltalk]) ifTrue:[ |
|
453 |
doInclude := (selectedPackages includes:cls package). |
|
454 |
doInclude ifFalse:[ |
|
455 |
cls isJavaClass ifFalse:[ |
|
456 |
doInclude := (cls methodDictionary contains:[:mthd | thePackage = mthd package]) |
|
457 |
or:[ cls class methodDictionary contains:[:mthd | thePackage = mthd package]]. |
|
458 |
] |
|
459 |
]. |
|
460 |
doInclude ifTrue:[ |
|
461 |
whatToDo value:cls |
|
462 |
] |
|
463 |
] |
|
464 |
] |
|
465 |
] |
|
466 |
] |
|
467 |
||
468 |
"Created: / 17.2.2000 / 23:49:37 / cg" |
|
469 |
"Modified: / 24.2.2000 / 22:53:46 / cg" |
|
470 |
! ! |
|
471 |
||
472 |
!ProjectList methodsFor:'private'! |
|
473 |
||
474 |
defaultSlaveModeValue |
|
475 |
|org| |
|
476 |
||
477 |
(org := self topApplication initialOrganizerMode) == #project ifTrue:[^ false]. |
|
478 |
org isNil ifTrue:[^ false]. |
|
479 |
^ true |
|
480 |
! |
|
481 |
||
482 |
initialOrganizerMode |
|
483 |
^ #project |
|
484 |
! |
|
485 |
||
486 |
listOfProjects |
|
487 |
|allProjects generator| |
|
488 |
||
489 |
allProjects := IdentitySet new. |
|
490 |
||
491 |
inGeneratorHolder isNil ifTrue:[ |
|
492 |
(self hideUnloadedClasses value) ifTrue:[ |
|
493 |
Smalltalk allClassesDo:[:eachClass | |
|
494 |
|cls pkg| |
|
495 |
||
496 |
eachClass isLoaded ifTrue:[ |
|
497 |
cls := eachClass theNonMetaclass. |
|
498 |
cls isPrivate ifTrue:[ |
|
499 |
cls := cls topOwningClass |
|
500 |
]. |
|
501 |
pkg := cls package. |
|
502 |
pkg withoutSeparators size > 0 ifTrue:[ |
|
503 |
allProjects add:pkg asSymbol. |
|
504 |
] ifFalse:[ |
|
505 |
"/ for now, nameSpaces are not in any package; |
|
506 |
"/ this might change. Then, 0-sized packages are |
|
507 |
"/ illegal, and the following should be enabled. |
|
508 |
"/ self halt |
|
509 |
]. |
|
510 |
cls isJavaClass ifFalse:[ |
|
511 |
cls instAndClassSelectorsAndMethodsDo:[:sel :mthd | |
|
512 |
allProjects add:mthd package asSymbol. |
|
513 |
]. |
|
514 |
]. |
|
515 |
]. |
|
516 |
]. |
|
517 |
allProjects := allProjects asOrderedCollection. |
|
518 |
] ifFalse:[ |
|
519 |
allProjects := NewSystemBrowser allProjectsIDs. |
|
520 |
]. |
|
521 |
||
522 |
"/ those are simulated - in ST/X, empty projects do not |
|
523 |
"/ really exist; however, during browsing, it makes sense. |
|
524 |
AdditionalEmptyProjects size > 0 ifTrue:[ |
|
525 |
"/ remove those that are present ... |
|
526 |
AdditionalEmptyProjects := AdditionalEmptyProjects select:[:pkg | (allProjects includes:pkg) not]. |
|
527 |
allProjects addAll:AdditionalEmptyProjects. |
|
528 |
]. |
|
529 |
] ifFalse:[ |
|
530 |
generator := inGeneratorHolder value. |
|
531 |
generator isNil ifTrue:[^ #() ]. |
|
532 |
generator do:[:prj | allProjects add:prj]. |
|
533 |
allProjects := allProjects asOrderedCollection. |
|
534 |
]. |
|
535 |
||
536 |
allProjects sort. |
|
537 |
allProjects size == 1 ifTrue:[ |
|
538 |
"/ self projectLabelHolder value:(allProjects first , ' [Project]'). |
|
539 |
self projectLabelHolder value:(LabelAndIcon icon:(self class packageIcon) string:allProjects first). |
|
540 |
]. |
|
541 |
allProjects size > 1 ifTrue:[ |
|
542 |
allProjects addFirst:(self class nameListEntryForALL). |
|
543 |
]. |
|
544 |
^ allProjects |
|
545 |
||
546 |
"Created: / 17.2.2000 / 23:43:05 / cg" |
|
547 |
"Modified: / 18.8.2000 / 20:26:04 / cg" |
|
548 |
! |
|
549 |
||
550 |
makeDependent |
|
551 |
Smalltalk addDependent:self |
|
552 |
||
553 |
"Created: / 17.2.2000 / 23:43:13 / cg" |
|
554 |
! |
|
555 |
||
556 |
makeIndependent |
|
557 |
Smalltalk removeDependent:self. |
|
558 |
! |
|
559 |
||
560 |
release |
|
561 |
super release. |
|
562 |
||
563 |
projectList removeDependent:self. |
|
564 |
! |
|
565 |
||
566 |
updateList |
|
567 |
|newList oldSelection newSelection selectedProjectsHolder| |
|
568 |
||
569 |
selectedProjectsHolder := self selectedProjects. |
|
570 |
oldSelection := selectedProjectsHolder value. |
|
571 |
newList := self listOfProjects. |
|
572 |
newList ~= projectList value ifTrue:[ |
|
573 |
"/ oldSelection size > 0 ifTrue:[ |
|
574 |
"/ selectedProjectsHolder removeDependent:self. |
|
575 |
"/ selectedProjectsHolder value:#(). |
|
576 |
"/ selectedProjectsHolder addDependent:self. |
|
577 |
"/ ]. |
|
578 |
||
579 |
self projectList value:newList. |
|
580 |
||
581 |
oldSelection size > 0 ifTrue:[ |
|
582 |
newSelection := oldSelection select:[:prj | newList includes:prj]. |
|
583 |
selectedProjectsHolder value:newSelection. |
|
584 |
] |
|
585 |
]. |
|
586 |
listValid := true. |
|
587 |
||
588 |
"Modified: / 25.2.2000 / 23:10:01 / cg" |
|
589 |
! ! |
|
590 |
||
591 |
!ProjectList methodsFor:'special'! |
|
592 |
||
593 |
addAdditionalProject:aProject |
|
594 |
"/ those are simulated - in ST/X, empty categories do not |
|
595 |
"/ really exist; however, during browsing, it makes sense. |
|
596 |
AdditionalEmptyProjects isNil ifTrue:[ |
|
597 |
AdditionalEmptyProjects := Set new. |
|
598 |
]. |
|
599 |
AdditionalEmptyProjects add:aProject. |
|
600 |
||
601 |
Smalltalk changed:#projectOrganization "/ not really ... to force update |
|
602 |
||
603 |
"Created: / 17.2.2000 / 23:44:27 / cg" |
|
604 |
! |
|
605 |
||
606 |
removeAdditionalProjects:aListOfProjects |
|
607 |
"/ those are simulated - in ST/X, empty categories do not |
|
608 |
"/ really exist; however, during browsing, it makes sense. |
|
609 |
AdditionalEmptyProjects notNil ifTrue:[ |
|
610 |
aListOfProjects do:[:eachProject | |
|
611 |
AdditionalEmptyProjects remove:eachProject ifAbsent:nil. |
|
612 |
]. |
|
613 |
]. |
|
614 |
Smalltalk changed:#projectOrganization "/ not really ... to force update |
|
615 |
||
616 |
"Created: / 17.2.2000 / 23:45:24 / cg" |
|
617 |
! ! |
|
618 |
||
619 |
!ProjectList class methodsFor:'documentation'! |
|
620 |
||
621 |
version |
|
5782
ae4720e83b49
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
5592
diff
changeset
|
622 |
^ '$Header: /cvs/stx/stx/libtool/Tools_ProjectList.st,v 1.3 2004-03-20 15:45:22 stefan Exp $' |
5591 | 623 |
! ! |