author | Claus Gittinger <cg@exept.de> |
Wed, 20 Jul 2011 20:18:53 +0200 | |
changeset 10364 | 934e0840d81e |
parent 10249 | 219f8553b31b |
child 10675 | 1a6a5e0b012f |
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 |
|
10249 | 17 |
instanceVariableNames:'projectList projectNameList selectionIndexHolder worker |
18 |
workerQueue' |
|
7590 | 19 |
classVariableNames:'AdditionalEmptyProjects HideModules' |
5591 | 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 |
|
6468 | 101 |
#name: #windowSpec |
102 |
#window: |
|
5591 | 103 |
#(#WindowSpec |
6468 | 104 |
#label: 'ProjectList' |
105 |
#name: 'ProjectList' |
|
106 |
#min: #(#Point 0 0) |
|
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 |
]. |
|
10364 | 358 |
something == #methodCoverageInfo ifTrue:[ |
359 |
^ self |
|
360 |
]. |
|
6923 | 361 |
something == #methodInClass ifTrue:[ |
362 |
^ self |
|
363 |
]. |
|
364 |
something == #classVariables ifTrue:[ |
|
365 |
^ self |
|
366 |
]. |
|
367 |
something == #classComment ifTrue:[ |
|
368 |
^ self. |
|
369 |
]. |
|
370 |
something == #methodInClassRemoved ifTrue:[ |
|
371 |
^ self. |
|
372 |
]. |
|
5591 | 373 |
]. |
374 |
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
|
375 |
|
10364 | 376 |
"Modified: / 20-07-2011 / 18:54:39 / cg" |
5591 | 377 |
! ! |
378 |
||
379 |
!ProjectList methodsFor:'drag & drop'! |
|
380 |
||
6468 | 381 |
canDropContext:aDropContext |
7423
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
382 |
|objects package| |
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
383 |
|
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
384 |
objects := aDropContext dropObjects collect:[:obj | obj theObject]. |
5591 | 385 |
|
7423
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
386 |
(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
|
387 |
|
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
388 |
(objects conform:[:aMethodOrClass | (aMethodOrClass isMethod or:[aMethodOrClass isClass]) ]) ifFalse:[^ false]. |
5591 | 389 |
|
390 |
package := self packageAtTargetPointOf:aDropContext. |
|
391 |
package isNil ifTrue:[^ false]. |
|
392 |
||
7423
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
393 |
(objects contains:[:aMethodOrClass | aMethodOrClass package ~= package]) ifFalse:[^ false]. |
5591 | 394 |
^ true |
7120 | 395 |
|
7423
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
396 |
"Modified: / 17-10-2006 / 18:30:32 / cg" |
5591 | 397 |
! |
398 |
||
6468 | 399 |
doDropContext:aDropContext |
7423
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
400 |
|package objects methods classes| |
5591 | 401 |
|
7423
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
402 |
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
|
403 |
(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
|
404 |
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
|
405 |
classes := objects select:[:something | something isClass]. |
5591 | 406 |
|
7423
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
407 |
package := self packageAtTargetPointOf:aDropContext. |
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
408 |
package notNil ifTrue:[ |
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
409 |
methods 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 moveMethods:methods toProject:package. |
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
411 |
]. |
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
412 |
classes notEmpty ifTrue:[ |
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
413 |
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
|
414 |
] |
6468 | 415 |
]. |
7423
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
416 |
^ self |
5591 | 417 |
]. |
7120 | 418 |
|
7423
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
419 |
(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
|
420 |
|p| |
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
421 |
|
8966
8387f26335a9
Project noPackageId -> PackageId noPackageId
Claus Gittinger <cg@exept.de>
parents:
8749
diff
changeset
|
422 |
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
|
423 |
|
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
424 |
Class packageQuerySignal answer:p |
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
425 |
do:[ |
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
426 |
self dropClassFiles:objects. |
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 |
^ self |
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
429 |
]. |
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
430 |
|
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
431 |
"Modified: / 17-10-2006 / 18:34:43 / cg" |
5591 | 432 |
! |
433 |
||
434 |
packageAtTargetPointOf:aDropContext |
|
435 |
|p packageListView lineNr item package dropInfo now |
|
436 |
overItem timeOverItem| |
|
437 |
||
438 |
p := aDropContext targetPoint. |
|
439 |
||
440 |
packageListView := aDropContext targetWidget. |
|
441 |
||
442 |
dropInfo := aDropContext dropInfo. |
|
443 |
||
444 |
lineNr := packageListView yVisibleToLineNr:p y. |
|
445 |
lineNr isNil ifTrue:[^ nil]. |
|
446 |
||
7525
a37f9b951ff6
package at drop-point fix (care for spaces and other decoration)
Claus Gittinger <cg@exept.de>
parents:
7497
diff
changeset
|
447 |
item := projectList value at:lineNr. |
5591 | 448 |
item isNil ifTrue:[^ nil]. |
7325
4e26cc5f9f21
oops - care for old (non-tree) project list handling
Claus Gittinger <cg@exept.de>
parents:
7131
diff
changeset
|
449 |
item isString ifTrue:[^ item asSymbol]. |
5591 | 450 |
|
451 |
item canExpand ifTrue:[ |
|
5782
ae4720e83b49
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
5592
diff
changeset
|
452 |
now := Timestamp now. |
8138 | 453 |
overItem := dropInfo at:#overItem ifAbsentPut:item. |
5782
ae4720e83b49
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
5592
diff
changeset
|
454 |
timeOverItem := dropInfo at:#timeOverItem ifAbsentPut:[now]. |
5591 | 455 |
|
5782
ae4720e83b49
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
5592
diff
changeset
|
456 |
overItem ~~ item ifTrue:[ |
ae4720e83b49
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
5592
diff
changeset
|
457 |
dropInfo at:#timeOverItem put:now. |
ae4720e83b49
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
5592
diff
changeset
|
458 |
dropInfo at:#overItem put:item. |
ae4720e83b49
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
5592
diff
changeset
|
459 |
aDropContext passiveAction:[ self packageAtTargetPointOf:aDropContext ]. |
ae4720e83b49
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
5592
diff
changeset
|
460 |
] ifFalse:[ |
ae4720e83b49
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
5592
diff
changeset
|
461 |
(now millisecondDeltaFrom:timeOverItem) >= (UserPreferences current timeToAutoExpandItemsWhenDraggingOver) ifTrue:[ |
ae4720e83b49
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
5592
diff
changeset
|
462 |
aDropContext saveDraw:[ item expand. packageListView repairDamage ]. |
ae4720e83b49
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
5592
diff
changeset
|
463 |
dropInfo removeKey:#timeOverItem. |
ae4720e83b49
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
5592
diff
changeset
|
464 |
dropInfo removeKey:#overItem. |
ae4720e83b49
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
5592
diff
changeset
|
465 |
] ifFalse:[ |
ae4720e83b49
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
5592
diff
changeset
|
466 |
aDropContext passiveAction:[ self packageAtTargetPointOf:aDropContext ]. |
ae4720e83b49
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
5592
diff
changeset
|
467 |
] |
ae4720e83b49
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
5592
diff
changeset
|
468 |
]. |
5591 | 469 |
]. |
470 |
||
471 |
package := item package. |
|
472 |
package = self class nameListEntryForALL ifTrue:[^ nil]. |
|
473 |
^ package. |
|
7325
4e26cc5f9f21
oops - care for old (non-tree) project list handling
Claus Gittinger <cg@exept.de>
parents:
7131
diff
changeset
|
474 |
|
7525
a37f9b951ff6
package at drop-point fix (care for spaces and other decoration)
Claus Gittinger <cg@exept.de>
parents:
7497
diff
changeset
|
475 |
"Modified: / 18-11-2006 / 16:13:47 / cg" |
5591 | 476 |
! ! |
477 |
||
478 |
!ProjectList methodsFor:'generators'! |
|
479 |
||
480 |
makeGenerator |
|
481 |
"return a generator which enumerates the classes from the selected project(s)." |
|
482 |
||
8749
23db847d3259
added changed to projectList
Claus Gittinger <cg@exept.de>
parents:
8730
diff
changeset
|
483 |
|selectedPackages thePackage hideUnloadedClasses showChangedClasses| |
5591 | 484 |
|
485 |
selectedPackages := self selectedProjects value. |
|
486 |
selectedPackages size == 0 ifTrue:[ |
|
6894 | 487 |
^ #() |
5591 | 488 |
]. |
6907 | 489 |
selectedPackages := selectedPackages collect:[:p | p string withoutSeparators]. |
5591 | 490 |
|
8749
23db847d3259
added changed to projectList
Claus Gittinger <cg@exept.de>
parents:
8730
diff
changeset
|
491 |
showChangedClasses := selectedPackages includes:(self class nameListEntryForChanged). |
5591 | 492 |
hideUnloadedClasses := self hideUnloadedClasses value. |
493 |
||
494 |
(selectedPackages includes:(self class nameListEntryForALL)) ifTrue:[ |
|
6894 | 495 |
hideUnloadedClasses ifTrue:[ |
496 |
^ Iterator on:[:whatToDo | |
|
497 |
Smalltalk allClassesDo:[:cls | |
|
498 |
cls isLoaded ifTrue:[ |
|
9385 | 499 |
cls isRealNameSpace ifFalse:[ |
6894 | 500 |
whatToDo value:cls |
501 |
] |
|
502 |
] |
|
503 |
] |
|
504 |
] |
|
505 |
]. |
|
506 |
^ Iterator on:[:whatToDo | |
|
507 |
Smalltalk allClassesDo:[:cls | |
|
9385 | 508 |
cls isRealNameSpace ifFalse:[ |
6894 | 509 |
whatToDo value:cls |
510 |
] |
|
511 |
] |
|
512 |
] |
|
5591 | 513 |
]. |
514 |
||
515 |
selectedPackages size == 1 ifTrue:[ |
|
6894 | 516 |
"/ faster common case |
517 |
thePackage := selectedPackages first. |
|
5591 | 518 |
|
8749
23db847d3259
added changed to projectList
Claus Gittinger <cg@exept.de>
parents:
8730
diff
changeset
|
519 |
^ Iterator on:[:whatToDo | |
23db847d3259
added changed to projectList
Claus Gittinger <cg@exept.de>
parents:
8730
diff
changeset
|
520 |
|changedClasses| |
23db847d3259
added changed to projectList
Claus Gittinger <cg@exept.de>
parents:
8730
diff
changeset
|
521 |
|
23db847d3259
added changed to projectList
Claus Gittinger <cg@exept.de>
parents:
8730
diff
changeset
|
522 |
showChangedClasses ifTrue:[ changedClasses := ChangeSet current changedClasses ]. |
23db847d3259
added changed to projectList
Claus Gittinger <cg@exept.de>
parents:
8730
diff
changeset
|
523 |
|
6894 | 524 |
Smalltalk allClassesDo:[:cls | |
8749
23db847d3259
added changed to projectList
Claus Gittinger <cg@exept.de>
parents:
8730
diff
changeset
|
525 |
|doInclude| |
23db847d3259
added changed to projectList
Claus Gittinger <cg@exept.de>
parents:
8730
diff
changeset
|
526 |
|
6894 | 527 |
(hideUnloadedClasses not or:[cls isLoaded]) |
528 |
ifTrue:[ |
|
9385 | 529 |
cls isRealNameSpace ifFalse:[ |
6894 | 530 |
doInclude := (thePackage = cls package). |
531 |
doInclude ifFalse:[ |
|
532 |
cls isJavaClass ifFalse:[ |
|
533 |
doInclude := (cls methodDictionary contains:[:mthd | thePackage = mthd package]) |
|
534 |
or:[ cls class methodDictionary contains:[:mthd | thePackage = mthd package]]. |
|
8749
23db847d3259
added changed to projectList
Claus Gittinger <cg@exept.de>
parents:
8730
diff
changeset
|
535 |
]. |
23db847d3259
added changed to projectList
Claus Gittinger <cg@exept.de>
parents:
8730
diff
changeset
|
536 |
doInclude ifFalse:[ |
23db847d3259
added changed to projectList
Claus Gittinger <cg@exept.de>
parents:
8730
diff
changeset
|
537 |
(showChangedClasses and:[ (changedClasses includes:cls theNonMetaclass) |
23db847d3259
added changed to projectList
Claus Gittinger <cg@exept.de>
parents:
8730
diff
changeset
|
538 |
or:[(changedClasses includes:cls theMetaclass)] ]) ifTrue:[ |
23db847d3259
added changed to projectList
Claus Gittinger <cg@exept.de>
parents:
8730
diff
changeset
|
539 |
doInclude := true |
23db847d3259
added changed to projectList
Claus Gittinger <cg@exept.de>
parents:
8730
diff
changeset
|
540 |
]. |
23db847d3259
added changed to projectList
Claus Gittinger <cg@exept.de>
parents:
8730
diff
changeset
|
541 |
]. |
6894 | 542 |
]. |
543 |
doInclude ifTrue:[ |
|
544 |
whatToDo value:cls |
|
545 |
] |
|
546 |
] |
|
547 |
] |
|
548 |
] |
|
549 |
] |
|
5591 | 550 |
]. |
551 |
||
8749
23db847d3259
added changed to projectList
Claus Gittinger <cg@exept.de>
parents:
8730
diff
changeset
|
552 |
^ Iterator on:[:whatToDo | |
23db847d3259
added changed to projectList
Claus Gittinger <cg@exept.de>
parents:
8730
diff
changeset
|
553 |
|changedClasses| |
23db847d3259
added changed to projectList
Claus Gittinger <cg@exept.de>
parents:
8730
diff
changeset
|
554 |
|
23db847d3259
added changed to projectList
Claus Gittinger <cg@exept.de>
parents:
8730
diff
changeset
|
555 |
showChangedClasses ifTrue:[ changedClasses := ChangeSet current changedClasses ]. |
23db847d3259
added changed to projectList
Claus Gittinger <cg@exept.de>
parents:
8730
diff
changeset
|
556 |
|
6894 | 557 |
Smalltalk allClassesDo:[:cls | |
8749
23db847d3259
added changed to projectList
Claus Gittinger <cg@exept.de>
parents:
8730
diff
changeset
|
558 |
|doInclude| |
23db847d3259
added changed to projectList
Claus Gittinger <cg@exept.de>
parents:
8730
diff
changeset
|
559 |
|
6894 | 560 |
(hideUnloadedClasses not or:[cls isLoaded]) |
561 |
ifTrue:[ |
|
9385 | 562 |
cls isRealNameSpace ifFalse:[ |
6894 | 563 |
doInclude := (selectedPackages includes:cls package). |
564 |
doInclude ifFalse:[ |
|
565 |
cls isJavaClass ifFalse:[ |
|
566 |
doInclude := (cls methodDictionary contains:[:mthd | selectedPackages includes:mthd package]) |
|
567 |
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
|
568 |
doInclude ifFalse:[ |
23db847d3259
added changed to projectList
Claus Gittinger <cg@exept.de>
parents:
8730
diff
changeset
|
569 |
(showChangedClasses and:[ (changedClasses includes:cls theNonMetaclass) |
23db847d3259
added changed to projectList
Claus Gittinger <cg@exept.de>
parents:
8730
diff
changeset
|
570 |
or:[(changedClasses includes:cls theMetaclass)] ]) ifTrue:[ |
23db847d3259
added changed to projectList
Claus Gittinger <cg@exept.de>
parents:
8730
diff
changeset
|
571 |
doInclude := true |
23db847d3259
added changed to projectList
Claus Gittinger <cg@exept.de>
parents:
8730
diff
changeset
|
572 |
]. |
23db847d3259
added changed to projectList
Claus Gittinger <cg@exept.de>
parents:
8730
diff
changeset
|
573 |
]. |
23db847d3259
added changed to projectList
Claus Gittinger <cg@exept.de>
parents:
8730
diff
changeset
|
574 |
|
6894 | 575 |
] |
576 |
]. |
|
577 |
doInclude ifTrue:[ |
|
578 |
whatToDo value:cls |
|
579 |
] |
|
580 |
] |
|
581 |
] |
|
582 |
] |
|
583 |
] |
|
5591 | 584 |
|
6894 | 585 |
"Created: / 17-02-2000 / 23:49:37 / cg" |
7497 | 586 |
"Modified: / 10-11-2006 / 17:15:15 / cg" |
5591 | 587 |
! ! |
588 |
||
10249 | 589 |
!ProjectList methodsFor:'initialization'! |
590 |
||
591 |
initialize |
|
592 |
||
593 |
super initialize. |
|
594 |
workerQueue := SharedQueue new |
|
595 |
||
596 |
"Created: / 14-12-2010 / 15:41:23 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
597 |
! ! |
|
598 |
||
5591 | 599 |
!ProjectList methodsFor:'private'! |
600 |
||
6923 | 601 |
allShownProjects |
7590 | 602 |
|hideUnloaded allProjects generator addWithAllParentPackages hideModules| |
603 |
||
604 |
hideModules := HideModules ? true. |
|
605 |
hideModules := HideModules ? false. |
|
5591 | 606 |
|
607 |
allProjects := IdentitySet new. |
|
608 |
||
609 |
inGeneratorHolder isNil ifTrue:[ |
|
6960 | 610 |
hideUnloaded := self hideUnloadedClasses value. |
611 |
||
612 |
addWithAllParentPackages := |
|
613 |
[:package | |
|
7590 | 614 |
|p parent module| |
5591 | 615 |
|
6960 | 616 |
(allProjects includes:package) ifFalse:[ |
617 |
allProjects add:package. |
|
8966
8387f26335a9
Project noPackageId -> PackageId noPackageId
Claus Gittinger <cg@exept.de>
parents:
8749
diff
changeset
|
618 |
(package ~= PackageId noProjectID |
7889 | 619 |
and:[package ~= #private]) ifTrue:[ |
7552 | 620 |
p := package asPackageId. |
621 |
[(parent := p parentPackage) notNil] whileTrue:[ |
|
622 |
allProjects add:parent asSymbol. |
|
623 |
p := parent. |
|
624 |
]. |
|
7590 | 625 |
hideModules ifFalse:[ |
626 |
(module := p module) notNil ifTrue:[ |
|
627 |
allProjects add:module asSymbol. |
|
628 |
]. |
|
629 |
]. |
|
6655 | 630 |
]. |
6960 | 631 |
]. |
632 |
]. |
|
633 |
||
634 |
Smalltalk allClassesDo:[:eachClass | |
|
635 |
|cls pkg p classPackage| |
|
636 |
||
9385 | 637 |
eachClass isRealNameSpace ifFalse:[ |
6965 | 638 |
|
639 |
(hideUnloaded not or:[eachClass isLoaded]) ifTrue:[ |
|
640 |
cls := eachClass theNonMetaclass. |
|
641 |
cls isPrivate ifTrue:[ |
|
642 |
cls := cls topOwningClass |
|
643 |
]. |
|
6960 | 644 |
|
8966
8387f26335a9
Project noPackageId -> PackageId noPackageId
Claus Gittinger <cg@exept.de>
parents:
8749
diff
changeset
|
645 |
classPackage := cls package ? (PackageId noProjectID). |
6965 | 646 |
classPackage size > 0 ifTrue:[ |
647 |
addWithAllParentPackages value:classPackage asSymbol. |
|
648 |
] ifFalse:[ |
|
649 |
"/ for now, nameSpaces are not in any package; |
|
650 |
"/ this might change. Then, 0-sized packages are |
|
651 |
"/ illegal, and the following should be enabled. |
|
652 |
"/ self halt |
|
653 |
]. |
|
654 |
cls isJavaClass ifFalse:[ |
|
655 |
cls instAndClassSelectorsAndMethodsDo:[:sel :mthd | |
|
656 |
|mpkg| |
|
657 |
||
658 |
mpkg := mthd package asSymbol. |
|
659 |
mpkg ~~ classPackage ifTrue:[ |
|
660 |
(allProjects includes:mpkg) ifFalse:[ |
|
661 |
addWithAllParentPackages value:mpkg. |
|
662 |
] |
|
663 |
]. |
|
6655 | 664 |
]. |
665 |
]. |
|
666 |
]. |
|
667 |
]. |
|
668 |
]. |
|
6960 | 669 |
allProjects := allProjects asOrderedCollection. |
5591 | 670 |
|
6655 | 671 |
"/ those are simulated - in ST/X, empty projects do not |
672 |
"/ really exist; however, during browsing, it makes sense. |
|
673 |
AdditionalEmptyProjects size > 0 ifTrue:[ |
|
674 |
"/ remove those that are present ... |
|
675 |
AdditionalEmptyProjects := AdditionalEmptyProjects select:[:pkg | (allProjects includes:pkg) not]. |
|
676 |
allProjects addAll:AdditionalEmptyProjects. |
|
677 |
]. |
|
5591 | 678 |
] ifFalse:[ |
6655 | 679 |
generator := inGeneratorHolder value. |
680 |
generator isNil ifTrue:[^ #() ]. |
|
681 |
generator do:[:prj | allProjects add:prj]. |
|
5591 | 682 |
]. |
6923 | 683 |
^ allProjects asOrderedCollection. |
7497 | 684 |
|
7590 | 685 |
"Modified: / 16-01-2007 / 15:56:16 / cg" |
6923 | 686 |
! |
687 |
||
688 |
defaultSlaveModeValue |
|
689 |
|mode| |
|
690 |
||
691 |
mode := self topApplication perform:#initialOrganizerMode ifNotUnderstood:nil. |
|
692 |
mode == OrganizerCanvas organizerModeProject ifTrue:[^ false]. |
|
693 |
mode isNil ifTrue:[^ false]. |
|
694 |
^ true |
|
695 |
! |
|
696 |
||
697 |
initialOrganizerMode |
|
698 |
^ OrganizerCanvas organizerModeProject |
|
699 |
! |
|
700 |
||
701 |
listOfProjects |
|
8749
23db847d3259
added changed to projectList
Claus Gittinger <cg@exept.de>
parents:
8730
diff
changeset
|
702 |
|allProjects numClassesInChangeSet| |
6923 | 703 |
|
8975
ca2e80f67b74
copy asOrderedCollection -> copyAsOrderedCollection
Claus Gittinger <cg@exept.de>
parents:
8966
diff
changeset
|
704 |
allProjects := self allShownProjects copyAsOrderedCollection. |
5591 | 705 |
|
706 |
allProjects sort. |
|
707 |
allProjects size == 1 ifTrue:[ |
|
6655 | 708 |
"/ self projectLabelHolder value:(allProjects first , ' [Project]'). |
709 |
self projectLabelHolder value:(LabelAndIcon icon:(self class packageIcon) string:allProjects first). |
|
5591 | 710 |
]. |
8749
23db847d3259
added changed to projectList
Claus Gittinger <cg@exept.de>
parents:
8730
diff
changeset
|
711 |
|
23db847d3259
added changed to projectList
Claus Gittinger <cg@exept.de>
parents:
8730
diff
changeset
|
712 |
numClassesInChangeSet := ChangeSet current changedClasses size. |
23db847d3259
added changed to projectList
Claus Gittinger <cg@exept.de>
parents:
8730
diff
changeset
|
713 |
numClassesInChangeSet > 0 ifTrue:[ |
23db847d3259
added changed to projectList
Claus Gittinger <cg@exept.de>
parents:
8730
diff
changeset
|
714 |
"/ 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
|
715 |
allProjects addFirst:((self class nameListEntryForChanged "bindWith:numClassesInChangeSet") allItalic). |
23db847d3259
added changed to projectList
Claus Gittinger <cg@exept.de>
parents:
8730
diff
changeset
|
716 |
]. |
23db847d3259
added changed to projectList
Claus Gittinger <cg@exept.de>
parents:
8730
diff
changeset
|
717 |
|
5591 | 718 |
allProjects size > 1 ifTrue:[ |
9029
66a3d6c4030e
no need for #asText to emphasize a string
Claus Gittinger <cg@exept.de>
parents:
8975
diff
changeset
|
719 |
allProjects addFirst:(self class nameListEntryForALL allItalic). |
5591 | 720 |
]. |
6907 | 721 |
|
5591 | 722 |
^ allProjects |
723 |
||
6907 | 724 |
"Created: / 17-02-2000 / 23:43:05 / cg" |
725 |
"Modified: / 17-08-2006 / 15:08:42 / cg" |
|
5591 | 726 |
! |
727 |
||
728 |
makeDependent |
|
6967 | 729 |
Smalltalk addDependent:self. |
730 |
ChangeSet addDependent:self. |
|
5591 | 731 |
! |
732 |
||
733 |
makeIndependent |
|
734 |
Smalltalk removeDependent:self. |
|
8220 | 735 |
ChangeSet removeDependent:self. |
5591 | 736 |
! |
737 |
||
10249 | 738 |
markEntry: rawEntry at: index forBeingManagedBySVN: package |
739 |
||
740 |
| branch mark | |
|
741 |
self hasSubversionSupport ifFalse:[^rawEntry]. |
|
742 |
package = PackageId noProjectID ifTrue:[^rawEntry]. |
|
743 |
||
744 |
^rawEntry. |
|
745 |
||
746 |
workerQueue nextPut: |
|
747 |
[ |
|
748 |
| repo newEntry | |
|
749 |
repo := (Smalltalk at:#SVN::RepositoryManager) current |
|
750 |
repositoryForPackage: package onlyFromCache: false. |
|
751 |
repo ifNotNil:[ |
|
752 |
mark := ' [SVN]'. |
|
753 |
branch := repo workingCopy branchOrNil. |
|
754 |
branch ifNotNil:[mark := ' [SVN: ', branch path,']']. |
|
755 |
newEntry := rawEntry , (mark asText colorizeAllWith: Color gray). |
|
756 |
self projectNameList value at: index put: newEntry. |
|
757 |
self projectNameList changed. |
|
758 |
]]. |
|
759 |
^rawEntry |
|
760 |
||
761 |
"Created: / 14-12-2010 / 15:59:33 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
762 |
"Modified: / 17-12-2010 / 11:52:08 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
763 |
! |
|
764 |
||
6923 | 765 |
nameListFor:aProjectList |
766 |
" |
|
767 |
self basicNew |
|
6951 | 768 |
nameListFor:#( |
7060 | 769 |
'exept:expecco' |
770 |
'exept:expecco/application' |
|
771 |
'exept:procware' |
|
772 |
'exept:workflow' |
|
6923 | 773 |
) |
7590 | 774 |
|
775 |
self basicNew |
|
776 |
nameListFor:#( |
|
777 |
'exept' |
|
778 |
'exept:expecco' |
|
779 |
'exept:expecco/application' |
|
780 |
'exept:procware' |
|
781 |
'exept:workflow' |
|
782 |
) |
|
6923 | 783 |
" |
784 |
||
7338 | 785 |
|stack projectsWithExtensions projectsWithChangedCode packagesInChangeSet projectNameList| |
6923 | 786 |
|
787 |
stack := OrderedCollection new. |
|
788 |
||
6951 | 789 |
projectsWithExtensions := Set new. |
790 |
projectsWithChangedCode := Set new. |
|
791 |
||
7338 | 792 |
packagesInChangeSet := ChangeSet current changedPackages. |
6951 | 793 |
|
794 |
projectNameList := OrderedCollection new. |
|
795 |
aProjectList do:[:this | |
|
6923 | 796 |
|thisC entry rawEntry prefix indent| |
797 |
||
6965 | 798 |
this = self class nameListEntryForALL ifTrue:[ |
799 |
entry := this |
|
800 |
] ifFalse:[ |
|
801 |
thisC := this asCollectionOfSubstringsSeparatedByAny:':/'. |
|
802 |
thisC isEmpty ifTrue:[ |
|
8966
8387f26335a9
Project noPackageId -> PackageId noPackageId
Claus Gittinger <cg@exept.de>
parents:
8749
diff
changeset
|
803 |
thisC := Array with:(PackageId noProjectID). |
6965 | 804 |
]. |
6923 | 805 |
|
6965 | 806 |
[ |
807 |
|stackTop| |
|
6923 | 808 |
|
6965 | 809 |
stack notEmpty |
810 |
and:[ |
|
811 |
stackTop := stack last. |
|
812 |
(thisC startsWith:stackTop) ifFalse:[ |
|
813 |
stack removeLast. |
|
814 |
true |
|
815 |
] ifTrue:[ |
|
816 |
false |
|
817 |
]] |
|
818 |
] whileTrue. |
|
819 |
prefix := stack notEmpty ifTrue:[ stack last ] ifFalse:[ #() ]. |
|
820 |
indent := stack size * 4. |
|
821 |
stack addLast:thisC. |
|
822 |
prefix isEmpty ifTrue:[ |
|
6970 | 823 |
rawEntry := thisC first. |
824 |
thisC size > 1 ifTrue:[ |
|
825 |
rawEntry := rawEntry , ':' , ((thisC copyFrom:2) asStringWith:$/). |
|
826 |
] |
|
6965 | 827 |
] ifFalse:[ |
828 |
rawEntry := (thisC copyFrom:prefix size+1) asStringWith:$/. |
|
829 |
]. |
|
830 |
||
10249 | 831 |
|
7131 | 832 |
(packagesInChangeSet includes:this) ifTrue:[ |
7060 | 833 |
rawEntry := rawEntry , self class markForBeingInChangeList. |
6965 | 834 |
rawEntry := self colorizeForChangedCode:rawEntry. |
835 |
]. |
|
836 |
entry := (String new:indent) , rawEntry. |
|
10249 | 837 |
(self hasSubversionSupport and:[this first ~= $*]) ifTrue:[ |
838 |
entry := self markEntry: entry at: projectNameList size + 1 |
|
839 |
forBeingManagedBySVN: this. |
|
840 |
]. |
|
6923 | 841 |
]. |
6951 | 842 |
projectNameList add:entry. |
6923 | 843 |
]. |
10249 | 844 |
self startWorker. |
6951 | 845 |
^ projectNameList. |
6923 | 846 |
|
847 |
"Created: / 17-02-2000 / 23:43:05 / cg" |
|
7590 | 848 |
"Modified: / 16-01-2007 / 15:51:45 / cg" |
10249 | 849 |
"Modified: / 16-12-2010 / 17:29:01 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
6923 | 850 |
! |
851 |
||
5591 | 852 |
release |
853 |
super release. |
|
854 |
||
855 |
projectList removeDependent:self. |
|
856 |
! |
|
857 |
||
10249 | 858 |
startWorker |
859 |
||
860 |
worker ifNil: |
|
861 |
[worker := |
|
862 |
[[workerQueue notEmpty ] whileTrue: |
|
863 |
[| job | |
|
864 |
job := workerQueue next. |
|
865 |
job value]. |
|
866 |
worker := nil. |
|
867 |
] newProcess. |
|
868 |
worker resume]. |
|
869 |
||
870 |
"Created: / 14-12-2010 / 15:49:57 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
871 |
"Modified: / 16-12-2010 / 17:35:37 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
872 |
! |
|
873 |
||
5591 | 874 |
updateList |
6923 | 875 |
|newList oldList newNameList oldNameList oldSelection newSelection selectedProjectsHolder| |
5591 | 876 |
|
877 |
selectedProjectsHolder := self selectedProjects. |
|
878 |
oldSelection := selectedProjectsHolder value. |
|
879 |
newList := self listOfProjects. |
|
6923 | 880 |
oldList := projectList value. |
881 |
newNameList := self nameListFor:newList. |
|
882 |
oldNameList := self projectNameList value. |
|
883 |
(newList ~= oldList |
|
884 |
or:[ newNameList ~= oldNameList]) ifTrue:[ |
|
5591 | 885 |
"/ oldSelection size > 0 ifTrue:[ |
886 |
"/ selectedProjectsHolder removeDependent:self. |
|
887 |
"/ selectedProjectsHolder value:#(). |
|
888 |
"/ selectedProjectsHolder addDependent:self. |
|
889 |
"/ ]. |
|
890 |
||
6923 | 891 |
self projectList value:newList. |
892 |
listValid := true. |
|
893 |
self projectNameList value:newNameList. |
|
5591 | 894 |
|
6923 | 895 |
oldSelection size > 0 ifTrue:[ |
896 |
newSelection := oldSelection select:[:prj | newList includes:prj]. |
|
897 |
selectedProjectsHolder value:newSelection. |
|
898 |
] |
|
5591 | 899 |
]. |
900 |
listValid := true. |
|
901 |
||
902 |
"Modified: / 25.2.2000 / 23:10:01 / cg" |
|
903 |
! ! |
|
904 |
||
905 |
!ProjectList methodsFor:'special'! |
|
906 |
||
907 |
addAdditionalProject:aProject |
|
6923 | 908 |
"/ those are simulated - in ST/X, empty projects do not |
5591 | 909 |
"/ really exist; however, during browsing, it makes sense. |
910 |
AdditionalEmptyProjects isNil ifTrue:[ |
|
6923 | 911 |
AdditionalEmptyProjects := Set new. |
5591 | 912 |
]. |
913 |
AdditionalEmptyProjects add:aProject. |
|
914 |
||
915 |
Smalltalk changed:#projectOrganization "/ not really ... to force update |
|
916 |
||
917 |
"Created: / 17.2.2000 / 23:44:27 / cg" |
|
918 |
! |
|
919 |
||
920 |
removeAdditionalProjects:aListOfProjects |
|
921 |
"/ those are simulated - in ST/X, empty categories do not |
|
922 |
"/ really exist; however, during browsing, it makes sense. |
|
923 |
AdditionalEmptyProjects notNil ifTrue:[ |
|
924 |
aListOfProjects do:[:eachProject | |
|
925 |
AdditionalEmptyProjects remove:eachProject ifAbsent:nil. |
|
926 |
]. |
|
927 |
]. |
|
928 |
Smalltalk changed:#projectOrganization "/ not really ... to force update |
|
929 |
||
930 |
"Created: / 17.2.2000 / 23:45:24 / cg" |
|
931 |
! ! |
|
932 |
||
933 |
!ProjectList class methodsFor:'documentation'! |
|
934 |
||
8966
8387f26335a9
Project noPackageId -> PackageId noPackageId
Claus Gittinger <cg@exept.de>
parents:
8749
diff
changeset
|
935 |
version_CVS |
10364 | 936 |
^ '$Header: /cvs/stx/stx/libtool/Tools_ProjectList.st,v 1.47 2011-07-20 18:18:53 cg Exp $' |
5591 | 937 |
! ! |