author | Claus Gittinger <cg@exept.de> |
Thu, 22 Oct 2009 14:39:38 +0200 | |
changeset 9029 | 66a3d6c4030e |
parent 8975 | ca2e80f67b74 |
child 9385 | a9f2356fae85 |
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 |
" |
|
5592 | 12 |
"{ Package: 'stx:libtool' }" |
5591 | 13 |
|
14 |
"{ NameSpace: Tools }" |
|
15 |
||
16 |
BrowserList subclass:#ProjectList |
|
6923 | 17 |
instanceVariableNames:'projectList projectNameList selectionIndexHolder' |
7590 | 18 |
classVariableNames:'AdditionalEmptyProjects HideModules' |
5591 | 19 |
poolDictionaries:'' |
20 |
category:'Interface-Browsers-New' |
|
21 |
! |
|
22 |
||
23 |
!ProjectList class methodsFor:'documentation'! |
|
24 |
||
25 |
copyright |
|
26 |
" |
|
27 |
COPYRIGHT (c) 2000 by eXept Software AG |
|
28 |
All Rights Reserved |
|
29 |
||
30 |
This software is furnished under a license and may be used |
|
31 |
only in accordance with the terms of that license and with the |
|
32 |
inclusion of the above copyright notice. This software may not |
|
33 |
be provided or otherwise made available to, or used by, any |
|
34 |
other person. No title to or ownership of the software is |
|
35 |
hereby transferred. |
|
36 |
" |
|
37 |
! ! |
|
38 |
||
39 |
!ProjectList class methodsFor:'interface specs'! |
|
40 |
||
41 |
singleProjectWindowSpec |
|
42 |
"This resource specification was automatically generated |
|
43 |
by the UIPainter of ST/X." |
|
44 |
||
45 |
"Do not manually edit this!! If it is corrupted, |
|
46 |
the UIPainter may not be able to read the specification." |
|
47 |
||
48 |
" |
|
49 |
UIPainter new openOnClass:ClassCategoryList andSelector:#singleCategoryWindowSpec |
|
50 |
ClassCategoryList new openInterface:#singleCategoryWindowSpec |
|
51 |
" |
|
52 |
||
53 |
<resource: #canvas> |
|
54 |
||
55 |
^ |
|
56 |
#(#FullSpec |
|
5592 | 57 |
#name: #singleProjectWindowSpec |
58 |
#window: |
|
5591 | 59 |
#(#WindowSpec |
5592 | 60 |
#label: 'ProjectList' |
61 |
#name: 'ProjectList' |
|
62 |
#min: #(#Point 0 0) |
|
63 |
#max: #(#Point 1024 721) |
|
64 |
#bounds: #(#Rectangle 218 175 518 475) |
|
65 |
) |
|
66 |
#component: |
|
5591 | 67 |
#(#SpecCollection |
5592 | 68 |
#collection: #( |
69 |
#(#LabelSpec |
|
70 |
#label: 'ProjectName' |
|
71 |
#name: 'ProjectLabel' |
|
72 |
#layout: #(#LayoutFrame 0 0.0 0 0 0 1.0 25 0) |
|
73 |
#translateLabel: true |
|
74 |
#labelChannel: #projectLabelHolder |
|
75 |
#menu: #menuHolder |
|
76 |
) |
|
77 |
) |
|
5591 | 78 |
|
5592 | 79 |
) |
5591 | 80 |
) |
81 |
! |
|
82 |
||
83 |
windowSpec |
|
84 |
"This resource specification was automatically generated |
|
85 |
by the UIPainter of ST/X." |
|
86 |
||
87 |
"Do not manually edit this!! If it is corrupted, |
|
88 |
the UIPainter may not be able to read the specification." |
|
89 |
||
90 |
" |
|
91 |
UIPainter new openOnClass:ProjectList andSelector:#windowSpec |
|
92 |
ProjectList new openInterface:#windowSpec |
|
93 |
ProjectList open |
|
94 |
" |
|
95 |
||
96 |
<resource: #canvas> |
|
97 |
||
98 |
^ |
|
99 |
#(#FullSpec |
|
6468 | 100 |
#name: #windowSpec |
101 |
#window: |
|
5591 | 102 |
#(#WindowSpec |
6468 | 103 |
#label: 'ProjectList' |
104 |
#name: 'ProjectList' |
|
105 |
#min: #(#Point 0 0) |
|
106 |
#max: #(#Point 1024 721) |
|
107 |
#bounds: #(#Rectangle 13 23 313 323) |
|
108 |
) |
|
109 |
#component: |
|
5591 | 110 |
#(#SpecCollection |
6468 | 111 |
#collection: #( |
112 |
#(#SequenceViewSpec |
|
113 |
#name: 'List' |
|
114 |
#layout: #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0) |
|
115 |
#tabable: true |
|
6923 | 116 |
#model: #selectionIndexHolder |
6468 | 117 |
#menu: #menuHolder |
118 |
#hasHorizontalScrollBar: true |
|
119 |
#hasVerticalScrollBar: true |
|
120 |
#miniScrollerHorizontal: true |
|
121 |
#isMultiSelect: true |
|
122 |
#valueChangeSelector: #selectionChangedByClick |
|
6923 | 123 |
#useIndex: true |
124 |
#sequenceList: #projectNameList |
|
6468 | 125 |
#doubleClickChannel: #doubleClickChannel |
126 |
#properties: |
|
127 |
#(#PropertyListDictionary |
|
128 |
#dragArgument: nil |
|
129 |
#dropArgument: nil |
|
130 |
#canDropSelector: #canDropContext: |
|
131 |
#dropSelector: #doDropContext: |
|
132 |
) |
|
133 |
) |
|
134 |
) |
|
5591 | 135 |
|
6468 | 136 |
) |
5591 | 137 |
) |
138 |
||
139 |
"Created: / 17.2.2000 / 23:45:47 / cg" |
|
140 |
"Modified: / 17.2.2000 / 23:47:53 / cg" |
|
141 |
! ! |
|
142 |
||
143 |
!ProjectList class methodsFor:'queries-plugin'! |
|
144 |
||
145 |
aspectSelectors |
|
146 |
^ #( |
|
147 |
#(#doubleClickChannel #action ) |
|
148 |
immediateUpdate |
|
149 |
selectedProjects |
|
150 |
menuHolder |
|
151 |
outGeneratorHolder |
|
152 |
inGeneratorHolder |
|
153 |
selectionChangeCondition |
|
154 |
updateTrigger |
|
155 |
forceGeneratorTrigger |
|
156 |
hideUnloadedClasses |
|
157 |
organizerMode |
|
158 |
slaveMode |
|
159 |
) |
|
160 |
||
161 |
"Created: / 17.2.2000 / 23:46:18 / cg" |
|
162 |
"Modified: / 25.2.2000 / 22:32:10 / cg" |
|
163 |
! ! |
|
164 |
||
165 |
!ProjectList methodsFor:'aspects'! |
|
166 |
||
8632 | 167 |
itemList |
168 |
^ self projectList value |
|
169 |
! |
|
170 |
||
5591 | 171 |
projectLabelHolder |
172 |
^ self pseudoListLabelHolder |
|
173 |
! |
|
174 |
||
175 |
projectList |
|
176 |
projectList isNil ifTrue:[ |
|
177 |
projectList := ValueHolder new. |
|
178 |
projectList addDependent:self. |
|
179 |
]. |
|
180 |
^ projectList |
|
181 |
||
182 |
"Created: / 17.2.2000 / 23:39:32 / cg" |
|
183 |
! |
|
184 |
||
6923 | 185 |
projectNameList |
186 |
projectNameList isNil ifTrue:[ |
|
187 |
projectNameList := ValueHolder new. |
|
188 |
"/ projectNameList addDependent:self. |
|
189 |
]. |
|
190 |
^ projectNameList |
|
191 |
||
192 |
"Created: / 17.2.2000 / 23:39:32 / cg" |
|
193 |
! |
|
194 |
||
5591 | 195 |
selectedProjects |
196 |
^ self selectionHolder |
|
197 |
||
198 |
"Created: / 17.2.2000 / 23:39:57 / cg" |
|
199 |
! |
|
200 |
||
201 |
selectedProjects:aValueHolder |
|
202 |
^ self selectionHolder:aValueHolder |
|
6923 | 203 |
! |
204 |
||
205 |
selectionIndexHolder |
|
206 |
selectionIndexHolder isNil ifTrue:[ |
|
207 |
selectionIndexHolder := 0 asValue. |
|
208 |
selectionIndexHolder addDependent:self. |
|
209 |
]. |
|
210 |
^ selectionIndexHolder |
|
211 |
||
212 |
"Created: / 17.2.2000 / 23:39:32 / cg" |
|
5591 | 213 |
! ! |
214 |
||
215 |
!ProjectList methodsFor:'change & update'! |
|
216 |
||
217 |
delayedUpdate:something with:aParameter from:changedObject |
|
7423
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
218 |
|cls sel pkg mthd newSel allIdx| |
5591 | 219 |
|
220 |
self inSlaveModeOrInvisible |
|
221 |
"/ (self slaveMode value == true) |
|
222 |
ifTrue:[ |
|
6923 | 223 |
(changedObject == Smalltalk |
224 |
or:[ something == #projectOrganization ]) ifTrue:[ |
|
225 |
listValid := false |
|
226 |
]. |
|
227 |
^ self |
|
228 |
]. |
|
229 |
||
230 |
changedObject == self selectionIndexHolder ifTrue:[ |
|
231 |
listValid ifFalse:[ |
|
232 |
self updateList. |
|
233 |
]. |
|
234 |
newSel := changedObject value collect:[:idx | projectList value at:idx]. |
|
235 |
newSel ~= self selectedProjects value ifTrue:[ |
|
236 |
self selectedProjects value:newSel. |
|
237 |
]. |
|
238 |
^ self. |
|
239 |
]. |
|
240 |
changedObject == self selectionHolder ifTrue:[ |
|
241 |
listValid == true ifFalse:[ |
|
242 |
self updateList. |
|
243 |
]. |
|
7423
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
244 |
allIdx := projectList value indexOf:(self class nameListEntryForALL). |
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
245 |
newSel := changedObject value |
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
246 |
collect:[:val | |i| |
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
247 |
i := projectList value indexOf:val. |
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
248 |
i == 0 ifTrue:[allIdx] ifFalse:[i]] |
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
249 |
thenSelect:[:idx | idx ~~ 0]. |
6923 | 250 |
newSel ~= self selectionIndexHolder value ifTrue:[ |
251 |
self selectionIndexHolder value:newSel |
|
252 |
]. |
|
5591 | 253 |
]. |
254 |
||
255 |
changedObject == slaveMode ifTrue:[ |
|
6923 | 256 |
listValid ~~ true ifTrue:[ |
257 |
self enqueueDelayedUpdateList |
|
258 |
]. |
|
259 |
"/ self invalidateList. |
|
260 |
^ self |
|
5591 | 261 |
]. |
262 |
||
6923 | 263 |
changedObject == self projectList ifTrue:[ |
264 |
^ self |
|
265 |
]. |
|
5591 | 266 |
|
267 |
changedObject == Smalltalk ifTrue:[ |
|
6923 | 268 |
something == #projectOrganization ifTrue:[ |
269 |
self invalidateList. |
|
270 |
self enqueueDelayedUpdateOutputGenerator. |
|
271 |
^ self. |
|
272 |
]. |
|
273 |
something == #methodInClass ifTrue:[ |
|
274 |
listValid == true ifTrue:[ |
|
275 |
cls := aParameter at:1. |
|
276 |
sel := aParameter at:2. |
|
277 |
mthd := cls compiledMethodAt:sel. |
|
278 |
mthd notNil ifTrue:[ |
|
279 |
pkg := mthd package. |
|
280 |
(projectList value includes:pkg) ifFalse:[ |
|
281 |
self invalidateList. |
|
282 |
] |
|
283 |
]. |
|
284 |
]. |
|
285 |
^ self |
|
286 |
]. |
|
5591 | 287 |
|
6923 | 288 |
(something == #classDefinition |
289 |
or:[something == #newClass]) ifTrue:[ |
|
290 |
listValid == true ifTrue:[ |
|
291 |
cls := aParameter. |
|
292 |
pkg := cls package. |
|
293 |
(projectList value includes:pkg) ifFalse:[ |
|
294 |
self invalidateList. |
|
295 |
] ifTrue:[ |
|
296 |
self enqueueDelayedUpdateOutputGenerator |
|
297 |
]. |
|
298 |
] ifFalse:[ |
|
299 |
self invalidateList |
|
300 |
]. |
|
301 |
^ self |
|
302 |
]. |
|
303 |
(something == #classRemove) ifTrue:[ |
|
304 |
listValid == true ifTrue:[ |
|
305 |
cls := aParameter. |
|
306 |
pkg := cls package. |
|
307 |
]. |
|
308 |
]. |
|
309 |
^ self |
|
5591 | 310 |
]. |
311 |
||
312 |
"/ something == #projectOrganization ifTrue:[ |
|
313 |
"/ aParameter isSymbol ifTrue:[ |
|
314 |
"/ "/ a single method has changed |
|
315 |
"/"/ sel := aParameter. |
|
316 |
"/"/ mthd := changedObject compiledMethodAt:sel. |
|
317 |
"/ self enqueueDelayedUpdateOutputGenerator. |
|
318 |
"/ ]. |
|
319 |
"/ ^ self |
|
320 |
"/ ]. |
|
321 |
||
6966 | 322 |
changedObject == ChangeSet ifTrue:[ |
323 |
self invalidateList. |
|
324 |
^ self |
|
325 |
]. |
|
326 |
||
5591 | 327 |
(organizerMode notNil |
328 |
and:[organizerMode value ~~ #project]) ifTrue:[ |
|
6923 | 329 |
self invalidateList. |
330 |
^ self |
|
5591 | 331 |
]. |
332 |
super delayedUpdate:something with:aParameter from:changedObject |
|
333 |
||
7423
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
334 |
"Created: / 17-02-2000 / 23:41:02 / cg" |
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
335 |
"Modified: / 17-10-2006 / 18:43:40 / cg" |
5591 | 336 |
! |
337 |
||
338 |
selectionChangedByClick |
|
339 |
"we are not interested in that - get another notification |
|
340 |
via the changed valueHolder" |
|
341 |
||
342 |
"Created: / 17.2.2000 / 23:41:17 / cg" |
|
343 |
! |
|
344 |
||
345 |
update:something with:aParameter from:changedObject |
|
8730 | 346 |
|
347 |
(self builder isNil or:[self window topView realized not]) ifTrue:[ |
|
348 |
self makeIndependent |
|
349 |
]. |
|
350 |
||
5591 | 351 |
changedObject == Smalltalk ifTrue:[ |
6923 | 352 |
something == #methodDictionary ifTrue:[ |
353 |
^ self |
|
354 |
]. |
|
355 |
something == #methodTrap ifTrue:[ |
|
356 |
^ self |
|
357 |
]. |
|
358 |
something == #methodInClass ifTrue:[ |
|
359 |
^ self |
|
360 |
]. |
|
361 |
something == #classVariables ifTrue:[ |
|
362 |
^ self |
|
363 |
]. |
|
364 |
something == #classComment ifTrue:[ |
|
365 |
^ self. |
|
366 |
]. |
|
367 |
something == #methodInClassRemoved ifTrue:[ |
|
368 |
^ self. |
|
369 |
]. |
|
5591 | 370 |
]. |
371 |
super update:something with:aParameter from:changedObject |
|
7423
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
372 |
|
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
373 |
"Modified: / 17-10-2006 / 18:40:17 / cg" |
5591 | 374 |
! ! |
375 |
||
376 |
!ProjectList methodsFor:'drag & drop'! |
|
377 |
||
6468 | 378 |
canDropContext:aDropContext |
7423
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
379 |
|objects package| |
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
380 |
|
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
381 |
objects := aDropContext dropObjects collect:[:obj | obj theObject]. |
5591 | 382 |
|
7423
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
383 |
(self objectsAreClassFiles:objects) ifTrue:[^ true]. |
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
384 |
|
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
385 |
(objects conform:[:aMethodOrClass | (aMethodOrClass isMethod or:[aMethodOrClass isClass]) ]) ifFalse:[^ false]. |
5591 | 386 |
|
387 |
package := self packageAtTargetPointOf:aDropContext. |
|
388 |
package isNil ifTrue:[^ false]. |
|
389 |
||
7423
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
390 |
(objects contains:[:aMethodOrClass | aMethodOrClass package ~= package]) ifFalse:[^ false]. |
5591 | 391 |
^ true |
7120 | 392 |
|
7423
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
393 |
"Modified: / 17-10-2006 / 18:30:32 / cg" |
5591 | 394 |
! |
395 |
||
6468 | 396 |
doDropContext:aDropContext |
7423
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
397 |
|package objects methods classes| |
5591 | 398 |
|
7423
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
399 |
objects := aDropContext dropObjects collect:[:aDropObject | aDropObject theObject]. |
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
400 |
(objects conform:[:something | (something isMethod or:[something isClass])]) ifTrue:[ |
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
401 |
methods := objects select:[:something | something isMethod]. |
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
402 |
classes := objects select:[:something | something isClass]. |
5591 | 403 |
|
7423
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
404 |
package := self packageAtTargetPointOf:aDropContext. |
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
405 |
package notNil ifTrue:[ |
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
406 |
methods notEmpty ifTrue:[ |
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
407 |
self masterApplication moveMethods:methods toProject:package. |
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
408 |
]. |
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
409 |
classes notEmpty ifTrue:[ |
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
410 |
self masterApplication moveClasses:classes toProject:package. |
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
411 |
] |
6468 | 412 |
]. |
7423
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
413 |
^ self |
5591 | 414 |
]. |
7120 | 415 |
|
7423
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
416 |
(objects conform:[:something | something isFilename]) ifTrue:[ |
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
417 |
|p| |
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
418 |
|
8966
8387f26335a9
Project noPackageId -> PackageId noPackageId
Claus Gittinger <cg@exept.de>
parents:
8749
diff
changeset
|
419 |
p := (self selectedProjects value ? #()) firstIfEmpty:PackageId noProjectID. |
7423
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
420 |
|
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
421 |
Class packageQuerySignal answer:p |
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
422 |
do:[ |
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
423 |
self dropClassFiles:objects. |
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
424 |
]. |
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
425 |
^ self |
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
426 |
]. |
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
427 |
|
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
428 |
"Modified: / 17-10-2006 / 18:34:43 / cg" |
5591 | 429 |
! |
430 |
||
431 |
packageAtTargetPointOf:aDropContext |
|
432 |
|p packageListView lineNr item package dropInfo now |
|
433 |
overItem timeOverItem| |
|
434 |
||
435 |
p := aDropContext targetPoint. |
|
436 |
||
437 |
packageListView := aDropContext targetWidget. |
|
438 |
||
439 |
dropInfo := aDropContext dropInfo. |
|
440 |
||
441 |
lineNr := packageListView yVisibleToLineNr:p y. |
|
442 |
lineNr isNil ifTrue:[^ nil]. |
|
443 |
||
7525
a37f9b951ff6
package at drop-point fix (care for spaces and other decoration)
Claus Gittinger <cg@exept.de>
parents:
7497
diff
changeset
|
444 |
item := projectList value at:lineNr. |
5591 | 445 |
item isNil ifTrue:[^ nil]. |
7325
4e26cc5f9f21
oops - care for old (non-tree) project list handling
Claus Gittinger <cg@exept.de>
parents:
7131
diff
changeset
|
446 |
item isString ifTrue:[^ item asSymbol]. |
5591 | 447 |
|
448 |
item canExpand ifTrue:[ |
|
5782
ae4720e83b49
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
5592
diff
changeset
|
449 |
now := Timestamp now. |
8138 | 450 |
overItem := dropInfo at:#overItem ifAbsentPut:item. |
5782
ae4720e83b49
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
5592
diff
changeset
|
451 |
timeOverItem := dropInfo at:#timeOverItem ifAbsentPut:[now]. |
5591 | 452 |
|
5782
ae4720e83b49
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
5592
diff
changeset
|
453 |
overItem ~~ item ifTrue:[ |
ae4720e83b49
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
5592
diff
changeset
|
454 |
dropInfo at:#timeOverItem put:now. |
ae4720e83b49
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
5592
diff
changeset
|
455 |
dropInfo at:#overItem put:item. |
ae4720e83b49
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
5592
diff
changeset
|
456 |
aDropContext passiveAction:[ self packageAtTargetPointOf:aDropContext ]. |
ae4720e83b49
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
5592
diff
changeset
|
457 |
] ifFalse:[ |
ae4720e83b49
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
5592
diff
changeset
|
458 |
(now millisecondDeltaFrom:timeOverItem) >= (UserPreferences current timeToAutoExpandItemsWhenDraggingOver) ifTrue:[ |
ae4720e83b49
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
5592
diff
changeset
|
459 |
aDropContext saveDraw:[ item expand. packageListView repairDamage ]. |
ae4720e83b49
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
5592
diff
changeset
|
460 |
dropInfo removeKey:#timeOverItem. |
ae4720e83b49
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
5592
diff
changeset
|
461 |
dropInfo removeKey:#overItem. |
ae4720e83b49
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
5592
diff
changeset
|
462 |
] ifFalse:[ |
ae4720e83b49
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
5592
diff
changeset
|
463 |
aDropContext passiveAction:[ self packageAtTargetPointOf:aDropContext ]. |
ae4720e83b49
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
5592
diff
changeset
|
464 |
] |
ae4720e83b49
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
5592
diff
changeset
|
465 |
]. |
5591 | 466 |
]. |
467 |
||
468 |
package := item package. |
|
469 |
package = self class nameListEntryForALL ifTrue:[^ nil]. |
|
470 |
^ package. |
|
7325
4e26cc5f9f21
oops - care for old (non-tree) project list handling
Claus Gittinger <cg@exept.de>
parents:
7131
diff
changeset
|
471 |
|
7525
a37f9b951ff6
package at drop-point fix (care for spaces and other decoration)
Claus Gittinger <cg@exept.de>
parents:
7497
diff
changeset
|
472 |
"Modified: / 18-11-2006 / 16:13:47 / cg" |
5591 | 473 |
! ! |
474 |
||
475 |
!ProjectList methodsFor:'generators'! |
|
476 |
||
477 |
makeGenerator |
|
478 |
"return a generator which enumerates the classes from the selected project(s)." |
|
479 |
||
8749
23db847d3259
added changed to projectList
Claus Gittinger <cg@exept.de>
parents:
8730
diff
changeset
|
480 |
|selectedPackages thePackage hideUnloadedClasses showChangedClasses| |
5591 | 481 |
|
482 |
selectedPackages := self selectedProjects value. |
|
483 |
selectedPackages size == 0 ifTrue:[ |
|
6894 | 484 |
^ #() |
5591 | 485 |
]. |
6907 | 486 |
selectedPackages := selectedPackages collect:[:p | p string withoutSeparators]. |
5591 | 487 |
|
8749
23db847d3259
added changed to projectList
Claus Gittinger <cg@exept.de>
parents:
8730
diff
changeset
|
488 |
showChangedClasses := selectedPackages includes:(self class nameListEntryForChanged). |
5591 | 489 |
hideUnloadedClasses := self hideUnloadedClasses value. |
490 |
||
491 |
(selectedPackages includes:(self class nameListEntryForALL)) ifTrue:[ |
|
6894 | 492 |
hideUnloadedClasses ifTrue:[ |
493 |
^ Iterator on:[:whatToDo | |
|
494 |
Smalltalk allClassesDo:[:cls | |
|
495 |
cls isLoaded ifTrue:[ |
|
7497 | 496 |
(cls isRealNameSpace not) ifTrue:[ |
6894 | 497 |
whatToDo value:cls |
498 |
] |
|
499 |
] |
|
500 |
] |
|
501 |
] |
|
502 |
]. |
|
503 |
^ Iterator on:[:whatToDo | |
|
504 |
Smalltalk allClassesDo:[:cls | |
|
7497 | 505 |
(cls isRealNameSpace not) ifTrue:[ |
6894 | 506 |
whatToDo value:cls |
507 |
] |
|
508 |
] |
|
509 |
] |
|
5591 | 510 |
]. |
511 |
||
512 |
selectedPackages size == 1 ifTrue:[ |
|
6894 | 513 |
"/ faster common case |
514 |
thePackage := selectedPackages first. |
|
5591 | 515 |
|
8749
23db847d3259
added changed to projectList
Claus Gittinger <cg@exept.de>
parents:
8730
diff
changeset
|
516 |
^ Iterator on:[:whatToDo | |
23db847d3259
added changed to projectList
Claus Gittinger <cg@exept.de>
parents:
8730
diff
changeset
|
517 |
|changedClasses| |
23db847d3259
added changed to projectList
Claus Gittinger <cg@exept.de>
parents:
8730
diff
changeset
|
518 |
|
23db847d3259
added changed to projectList
Claus Gittinger <cg@exept.de>
parents:
8730
diff
changeset
|
519 |
showChangedClasses ifTrue:[ changedClasses := ChangeSet current changedClasses ]. |
23db847d3259
added changed to projectList
Claus Gittinger <cg@exept.de>
parents:
8730
diff
changeset
|
520 |
|
6894 | 521 |
Smalltalk allClassesDo:[:cls | |
8749
23db847d3259
added changed to projectList
Claus Gittinger <cg@exept.de>
parents:
8730
diff
changeset
|
522 |
|doInclude| |
23db847d3259
added changed to projectList
Claus Gittinger <cg@exept.de>
parents:
8730
diff
changeset
|
523 |
|
6894 | 524 |
(hideUnloadedClasses not or:[cls isLoaded]) |
525 |
ifTrue:[ |
|
7497 | 526 |
(cls isRealNameSpace not) ifTrue:[ |
6894 | 527 |
doInclude := (thePackage = cls package). |
528 |
doInclude ifFalse:[ |
|
529 |
cls isJavaClass ifFalse:[ |
|
530 |
doInclude := (cls methodDictionary contains:[:mthd | thePackage = mthd package]) |
|
531 |
or:[ cls class methodDictionary contains:[:mthd | thePackage = mthd package]]. |
|
8749
23db847d3259
added changed to projectList
Claus Gittinger <cg@exept.de>
parents:
8730
diff
changeset
|
532 |
]. |
23db847d3259
added changed to projectList
Claus Gittinger <cg@exept.de>
parents:
8730
diff
changeset
|
533 |
doInclude ifFalse:[ |
23db847d3259
added changed to projectList
Claus Gittinger <cg@exept.de>
parents:
8730
diff
changeset
|
534 |
(showChangedClasses and:[ (changedClasses includes:cls theNonMetaclass) |
23db847d3259
added changed to projectList
Claus Gittinger <cg@exept.de>
parents:
8730
diff
changeset
|
535 |
or:[(changedClasses includes:cls theMetaclass)] ]) ifTrue:[ |
23db847d3259
added changed to projectList
Claus Gittinger <cg@exept.de>
parents:
8730
diff
changeset
|
536 |
doInclude := true |
23db847d3259
added changed to projectList
Claus Gittinger <cg@exept.de>
parents:
8730
diff
changeset
|
537 |
]. |
23db847d3259
added changed to projectList
Claus Gittinger <cg@exept.de>
parents:
8730
diff
changeset
|
538 |
]. |
6894 | 539 |
]. |
540 |
doInclude ifTrue:[ |
|
541 |
whatToDo value:cls |
|
542 |
] |
|
543 |
] |
|
544 |
] |
|
545 |
] |
|
546 |
] |
|
5591 | 547 |
]. |
548 |
||
8749
23db847d3259
added changed to projectList
Claus Gittinger <cg@exept.de>
parents:
8730
diff
changeset
|
549 |
^ Iterator on:[:whatToDo | |
23db847d3259
added changed to projectList
Claus Gittinger <cg@exept.de>
parents:
8730
diff
changeset
|
550 |
|changedClasses| |
23db847d3259
added changed to projectList
Claus Gittinger <cg@exept.de>
parents:
8730
diff
changeset
|
551 |
|
23db847d3259
added changed to projectList
Claus Gittinger <cg@exept.de>
parents:
8730
diff
changeset
|
552 |
showChangedClasses ifTrue:[ changedClasses := ChangeSet current changedClasses ]. |
23db847d3259
added changed to projectList
Claus Gittinger <cg@exept.de>
parents:
8730
diff
changeset
|
553 |
|
6894 | 554 |
Smalltalk allClassesDo:[:cls | |
8749
23db847d3259
added changed to projectList
Claus Gittinger <cg@exept.de>
parents:
8730
diff
changeset
|
555 |
|doInclude| |
23db847d3259
added changed to projectList
Claus Gittinger <cg@exept.de>
parents:
8730
diff
changeset
|
556 |
|
6894 | 557 |
(hideUnloadedClasses not or:[cls isLoaded]) |
558 |
ifTrue:[ |
|
7497 | 559 |
(cls isRealNameSpace not) ifTrue:[ |
6894 | 560 |
doInclude := (selectedPackages includes:cls package). |
561 |
doInclude ifFalse:[ |
|
562 |
cls isJavaClass ifFalse:[ |
|
563 |
doInclude := (cls methodDictionary contains:[:mthd | selectedPackages includes:mthd package]) |
|
564 |
or:[ cls class methodDictionary contains:[:mthd | selectedPackages includes:mthd package]]. |
|
8749
23db847d3259
added changed to projectList
Claus Gittinger <cg@exept.de>
parents:
8730
diff
changeset
|
565 |
doInclude ifFalse:[ |
23db847d3259
added changed to projectList
Claus Gittinger <cg@exept.de>
parents:
8730
diff
changeset
|
566 |
(showChangedClasses and:[ (changedClasses includes:cls theNonMetaclass) |
23db847d3259
added changed to projectList
Claus Gittinger <cg@exept.de>
parents:
8730
diff
changeset
|
567 |
or:[(changedClasses includes:cls theMetaclass)] ]) ifTrue:[ |
23db847d3259
added changed to projectList
Claus Gittinger <cg@exept.de>
parents:
8730
diff
changeset
|
568 |
doInclude := true |
23db847d3259
added changed to projectList
Claus Gittinger <cg@exept.de>
parents:
8730
diff
changeset
|
569 |
]. |
23db847d3259
added changed to projectList
Claus Gittinger <cg@exept.de>
parents:
8730
diff
changeset
|
570 |
]. |
23db847d3259
added changed to projectList
Claus Gittinger <cg@exept.de>
parents:
8730
diff
changeset
|
571 |
|
6894 | 572 |
] |
573 |
]. |
|
574 |
doInclude ifTrue:[ |
|
575 |
whatToDo value:cls |
|
576 |
] |
|
577 |
] |
|
578 |
] |
|
579 |
] |
|
580 |
] |
|
5591 | 581 |
|
6894 | 582 |
"Created: / 17-02-2000 / 23:49:37 / cg" |
7497 | 583 |
"Modified: / 10-11-2006 / 17:15:15 / cg" |
5591 | 584 |
! ! |
585 |
||
586 |
!ProjectList methodsFor:'private'! |
|
587 |
||
6923 | 588 |
allShownProjects |
7590 | 589 |
|hideUnloaded allProjects generator addWithAllParentPackages hideModules| |
590 |
||
591 |
hideModules := HideModules ? true. |
|
592 |
hideModules := HideModules ? false. |
|
5591 | 593 |
|
594 |
allProjects := IdentitySet new. |
|
595 |
||
596 |
inGeneratorHolder isNil ifTrue:[ |
|
6960 | 597 |
hideUnloaded := self hideUnloadedClasses value. |
598 |
||
599 |
addWithAllParentPackages := |
|
600 |
[:package | |
|
7590 | 601 |
|p parent module| |
5591 | 602 |
|
6960 | 603 |
(allProjects includes:package) ifFalse:[ |
604 |
allProjects add:package. |
|
8966
8387f26335a9
Project noPackageId -> PackageId noPackageId
Claus Gittinger <cg@exept.de>
parents:
8749
diff
changeset
|
605 |
(package ~= PackageId noProjectID |
7889 | 606 |
and:[package ~= #private]) ifTrue:[ |
7552 | 607 |
p := package asPackageId. |
608 |
[(parent := p parentPackage) notNil] whileTrue:[ |
|
609 |
allProjects add:parent asSymbol. |
|
610 |
p := parent. |
|
611 |
]. |
|
7590 | 612 |
hideModules ifFalse:[ |
613 |
(module := p module) notNil ifTrue:[ |
|
614 |
allProjects add:module asSymbol. |
|
615 |
]. |
|
616 |
]. |
|
6655 | 617 |
]. |
6960 | 618 |
]. |
619 |
]. |
|
620 |
||
621 |
Smalltalk allClassesDo:[:eachClass | |
|
622 |
|cls pkg p classPackage| |
|
623 |
||
7497 | 624 |
(eachClass isRealNameSpace not) ifTrue:[ |
6965 | 625 |
|
626 |
(hideUnloaded not or:[eachClass isLoaded]) ifTrue:[ |
|
627 |
cls := eachClass theNonMetaclass. |
|
628 |
cls isPrivate ifTrue:[ |
|
629 |
cls := cls topOwningClass |
|
630 |
]. |
|
6960 | 631 |
|
8966
8387f26335a9
Project noPackageId -> PackageId noPackageId
Claus Gittinger <cg@exept.de>
parents:
8749
diff
changeset
|
632 |
classPackage := cls package ? (PackageId noProjectID). |
6965 | 633 |
classPackage size > 0 ifTrue:[ |
634 |
addWithAllParentPackages value:classPackage asSymbol. |
|
635 |
] ifFalse:[ |
|
636 |
"/ for now, nameSpaces are not in any package; |
|
637 |
"/ this might change. Then, 0-sized packages are |
|
638 |
"/ illegal, and the following should be enabled. |
|
639 |
"/ self halt |
|
640 |
]. |
|
641 |
cls isJavaClass ifFalse:[ |
|
642 |
cls instAndClassSelectorsAndMethodsDo:[:sel :mthd | |
|
643 |
|mpkg| |
|
644 |
||
645 |
mpkg := mthd package asSymbol. |
|
646 |
mpkg ~~ classPackage ifTrue:[ |
|
647 |
(allProjects includes:mpkg) ifFalse:[ |
|
648 |
addWithAllParentPackages value:mpkg. |
|
649 |
] |
|
650 |
]. |
|
6655 | 651 |
]. |
652 |
]. |
|
653 |
]. |
|
654 |
]. |
|
655 |
]. |
|
6960 | 656 |
allProjects := allProjects asOrderedCollection. |
5591 | 657 |
|
6655 | 658 |
"/ those are simulated - in ST/X, empty projects do not |
659 |
"/ really exist; however, during browsing, it makes sense. |
|
660 |
AdditionalEmptyProjects size > 0 ifTrue:[ |
|
661 |
"/ remove those that are present ... |
|
662 |
AdditionalEmptyProjects := AdditionalEmptyProjects select:[:pkg | (allProjects includes:pkg) not]. |
|
663 |
allProjects addAll:AdditionalEmptyProjects. |
|
664 |
]. |
|
5591 | 665 |
] ifFalse:[ |
6655 | 666 |
generator := inGeneratorHolder value. |
667 |
generator isNil ifTrue:[^ #() ]. |
|
668 |
generator do:[:prj | allProjects add:prj]. |
|
5591 | 669 |
]. |
6923 | 670 |
^ allProjects asOrderedCollection. |
7497 | 671 |
|
7590 | 672 |
"Modified: / 16-01-2007 / 15:56:16 / cg" |
6923 | 673 |
! |
674 |
||
675 |
defaultSlaveModeValue |
|
676 |
|mode| |
|
677 |
||
678 |
mode := self topApplication perform:#initialOrganizerMode ifNotUnderstood:nil. |
|
679 |
mode == OrganizerCanvas organizerModeProject ifTrue:[^ false]. |
|
680 |
mode isNil ifTrue:[^ false]. |
|
681 |
^ true |
|
682 |
! |
|
683 |
||
684 |
initialOrganizerMode |
|
685 |
^ OrganizerCanvas organizerModeProject |
|
686 |
! |
|
687 |
||
688 |
listOfProjects |
|
8749
23db847d3259
added changed to projectList
Claus Gittinger <cg@exept.de>
parents:
8730
diff
changeset
|
689 |
|allProjects numClassesInChangeSet| |
6923 | 690 |
|
8975
ca2e80f67b74
copy asOrderedCollection -> copyAsOrderedCollection
Claus Gittinger <cg@exept.de>
parents:
8966
diff
changeset
|
691 |
allProjects := self allShownProjects copyAsOrderedCollection. |
5591 | 692 |
|
693 |
allProjects sort. |
|
694 |
allProjects size == 1 ifTrue:[ |
|
6655 | 695 |
"/ self projectLabelHolder value:(allProjects first , ' [Project]'). |
696 |
self projectLabelHolder value:(LabelAndIcon icon:(self class packageIcon) string:allProjects first). |
|
5591 | 697 |
]. |
8749
23db847d3259
added changed to projectList
Claus Gittinger <cg@exept.de>
parents:
8730
diff
changeset
|
698 |
|
23db847d3259
added changed to projectList
Claus Gittinger <cg@exept.de>
parents:
8730
diff
changeset
|
699 |
numClassesInChangeSet := ChangeSet current changedClasses size. |
23db847d3259
added changed to projectList
Claus Gittinger <cg@exept.de>
parents:
8730
diff
changeset
|
700 |
numClassesInChangeSet > 0 ifTrue:[ |
23db847d3259
added changed to projectList
Claus Gittinger <cg@exept.de>
parents:
8730
diff
changeset
|
701 |
"/ dont include count - makeGenerator compares against the un-expanded nameListEntry (sigh - need two lists) |
23db847d3259
added changed to projectList
Claus Gittinger <cg@exept.de>
parents:
8730
diff
changeset
|
702 |
allProjects addFirst:((self class nameListEntryForChanged "bindWith:numClassesInChangeSet") allItalic). |
23db847d3259
added changed to projectList
Claus Gittinger <cg@exept.de>
parents:
8730
diff
changeset
|
703 |
]. |
23db847d3259
added changed to projectList
Claus Gittinger <cg@exept.de>
parents:
8730
diff
changeset
|
704 |
|
5591 | 705 |
allProjects size > 1 ifTrue:[ |
9029
66a3d6c4030e
no need for #asText to emphasize a string
Claus Gittinger <cg@exept.de>
parents:
8975
diff
changeset
|
706 |
allProjects addFirst:(self class nameListEntryForALL allItalic). |
5591 | 707 |
]. |
6907 | 708 |
|
5591 | 709 |
^ allProjects |
710 |
||
6907 | 711 |
"Created: / 17-02-2000 / 23:43:05 / cg" |
712 |
"Modified: / 17-08-2006 / 15:08:42 / cg" |
|
5591 | 713 |
! |
714 |
||
715 |
makeDependent |
|
6967 | 716 |
Smalltalk addDependent:self. |
717 |
ChangeSet addDependent:self. |
|
5591 | 718 |
! |
719 |
||
720 |
makeIndependent |
|
721 |
Smalltalk removeDependent:self. |
|
8220 | 722 |
ChangeSet removeDependent:self. |
5591 | 723 |
! |
724 |
||
6923 | 725 |
nameListFor:aProjectList |
726 |
" |
|
727 |
self basicNew |
|
6951 | 728 |
nameListFor:#( |
7060 | 729 |
'exept:expecco' |
730 |
'exept:expecco/application' |
|
731 |
'exept:procware' |
|
732 |
'exept:workflow' |
|
6923 | 733 |
) |
7590 | 734 |
|
735 |
self basicNew |
|
736 |
nameListFor:#( |
|
737 |
'exept' |
|
738 |
'exept:expecco' |
|
739 |
'exept:expecco/application' |
|
740 |
'exept:procware' |
|
741 |
'exept:workflow' |
|
742 |
) |
|
6923 | 743 |
" |
744 |
||
7338 | 745 |
|stack projectsWithExtensions projectsWithChangedCode packagesInChangeSet projectNameList| |
6923 | 746 |
|
747 |
stack := OrderedCollection new. |
|
748 |
||
6951 | 749 |
projectsWithExtensions := Set new. |
750 |
projectsWithChangedCode := Set new. |
|
751 |
||
7338 | 752 |
packagesInChangeSet := ChangeSet current changedPackages. |
6951 | 753 |
|
754 |
projectNameList := OrderedCollection new. |
|
755 |
aProjectList do:[:this | |
|
6923 | 756 |
|thisC entry rawEntry prefix indent| |
757 |
||
6965 | 758 |
this = self class nameListEntryForALL ifTrue:[ |
759 |
entry := this |
|
760 |
] ifFalse:[ |
|
761 |
thisC := this asCollectionOfSubstringsSeparatedByAny:':/'. |
|
762 |
thisC isEmpty ifTrue:[ |
|
8966
8387f26335a9
Project noPackageId -> PackageId noPackageId
Claus Gittinger <cg@exept.de>
parents:
8749
diff
changeset
|
763 |
thisC := Array with:(PackageId noProjectID). |
6965 | 764 |
]. |
6923 | 765 |
|
6965 | 766 |
[ |
767 |
|stackTop| |
|
6923 | 768 |
|
6965 | 769 |
stack notEmpty |
770 |
and:[ |
|
771 |
stackTop := stack last. |
|
772 |
(thisC startsWith:stackTop) ifFalse:[ |
|
773 |
stack removeLast. |
|
774 |
true |
|
775 |
] ifTrue:[ |
|
776 |
false |
|
777 |
]] |
|
778 |
] whileTrue. |
|
779 |
prefix := stack notEmpty ifTrue:[ stack last ] ifFalse:[ #() ]. |
|
780 |
indent := stack size * 4. |
|
781 |
stack addLast:thisC. |
|
782 |
prefix isEmpty ifTrue:[ |
|
6970 | 783 |
rawEntry := thisC first. |
784 |
thisC size > 1 ifTrue:[ |
|
785 |
rawEntry := rawEntry , ':' , ((thisC copyFrom:2) asStringWith:$/). |
|
786 |
] |
|
6965 | 787 |
] ifFalse:[ |
788 |
rawEntry := (thisC copyFrom:prefix size+1) asStringWith:$/. |
|
789 |
]. |
|
790 |
||
7131 | 791 |
(packagesInChangeSet includes:this) ifTrue:[ |
7060 | 792 |
rawEntry := rawEntry , self class markForBeingInChangeList. |
6965 | 793 |
rawEntry := self colorizeForChangedCode:rawEntry. |
794 |
]. |
|
795 |
entry := (String new:indent) , rawEntry. |
|
6923 | 796 |
]. |
6951 | 797 |
projectNameList add:entry. |
6923 | 798 |
]. |
6951 | 799 |
^ projectNameList. |
6923 | 800 |
|
801 |
"Created: / 17-02-2000 / 23:43:05 / cg" |
|
7590 | 802 |
"Modified: / 16-01-2007 / 15:51:45 / cg" |
6923 | 803 |
! |
804 |
||
5591 | 805 |
release |
806 |
super release. |
|
807 |
||
808 |
projectList removeDependent:self. |
|
809 |
! |
|
810 |
||
811 |
updateList |
|
6923 | 812 |
|newList oldList newNameList oldNameList oldSelection newSelection selectedProjectsHolder| |
5591 | 813 |
|
814 |
selectedProjectsHolder := self selectedProjects. |
|
815 |
oldSelection := selectedProjectsHolder value. |
|
816 |
newList := self listOfProjects. |
|
6923 | 817 |
oldList := projectList value. |
818 |
newNameList := self nameListFor:newList. |
|
819 |
oldNameList := self projectNameList value. |
|
820 |
(newList ~= oldList |
|
821 |
or:[ newNameList ~= oldNameList]) ifTrue:[ |
|
5591 | 822 |
"/ oldSelection size > 0 ifTrue:[ |
823 |
"/ selectedProjectsHolder removeDependent:self. |
|
824 |
"/ selectedProjectsHolder value:#(). |
|
825 |
"/ selectedProjectsHolder addDependent:self. |
|
826 |
"/ ]. |
|
827 |
||
6923 | 828 |
self projectList value:newList. |
829 |
listValid := true. |
|
830 |
self projectNameList value:newNameList. |
|
5591 | 831 |
|
6923 | 832 |
oldSelection size > 0 ifTrue:[ |
833 |
newSelection := oldSelection select:[:prj | newList includes:prj]. |
|
834 |
selectedProjectsHolder value:newSelection. |
|
835 |
] |
|
5591 | 836 |
]. |
837 |
listValid := true. |
|
838 |
||
839 |
"Modified: / 25.2.2000 / 23:10:01 / cg" |
|
840 |
! ! |
|
841 |
||
842 |
!ProjectList methodsFor:'special'! |
|
843 |
||
844 |
addAdditionalProject:aProject |
|
6923 | 845 |
"/ those are simulated - in ST/X, empty projects do not |
5591 | 846 |
"/ really exist; however, during browsing, it makes sense. |
847 |
AdditionalEmptyProjects isNil ifTrue:[ |
|
6923 | 848 |
AdditionalEmptyProjects := Set new. |
5591 | 849 |
]. |
850 |
AdditionalEmptyProjects add:aProject. |
|
851 |
||
852 |
Smalltalk changed:#projectOrganization "/ not really ... to force update |
|
853 |
||
854 |
"Created: / 17.2.2000 / 23:44:27 / cg" |
|
855 |
! |
|
856 |
||
857 |
removeAdditionalProjects:aListOfProjects |
|
858 |
"/ those are simulated - in ST/X, empty categories do not |
|
859 |
"/ really exist; however, during browsing, it makes sense. |
|
860 |
AdditionalEmptyProjects notNil ifTrue:[ |
|
861 |
aListOfProjects do:[:eachProject | |
|
862 |
AdditionalEmptyProjects remove:eachProject ifAbsent:nil. |
|
863 |
]. |
|
864 |
]. |
|
865 |
Smalltalk changed:#projectOrganization "/ not really ... to force update |
|
866 |
||
867 |
"Created: / 17.2.2000 / 23:45:24 / cg" |
|
868 |
! ! |
|
869 |
||
870 |
!ProjectList class methodsFor:'documentation'! |
|
871 |
||
872 |
version |
|
9029
66a3d6c4030e
no need for #asText to emphasize a string
Claus Gittinger <cg@exept.de>
parents:
8975
diff
changeset
|
873 |
^ '$Header: /cvs/stx/stx/libtool/Tools_ProjectList.st,v 1.43 2009-10-22 12:39:38 cg Exp $' |
8966
8387f26335a9
Project noPackageId -> PackageId noPackageId
Claus Gittinger <cg@exept.de>
parents:
8749
diff
changeset
|
874 |
! |
8387f26335a9
Project noPackageId -> PackageId noPackageId
Claus Gittinger <cg@exept.de>
parents:
8749
diff
changeset
|
875 |
|
8387f26335a9
Project noPackageId -> PackageId noPackageId
Claus Gittinger <cg@exept.de>
parents:
8749
diff
changeset
|
876 |
version_CVS |
9029
66a3d6c4030e
no need for #asText to emphasize a string
Claus Gittinger <cg@exept.de>
parents:
8975
diff
changeset
|
877 |
^ '$Header: /cvs/stx/stx/libtool/Tools_ProjectList.st,v 1.43 2009-10-22 12:39:38 cg Exp $' |
5591 | 878 |
! ! |