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