author | Claus Gittinger <cg@exept.de> |
Sun, 10 Mar 2013 15:22:06 +0100 | |
changeset 12451 | 3ba4a65fc521 |
parent 12442 | 65d7ced7bcca |
child 12519 | fb7f3dca3f2c |
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 |
12394
a4f9d45bb707
fixed selection update from changed class selection,
Claus Gittinger <cg@exept.de>
parents:
12087
diff
changeset
|
18 |
workerQueue includedPseudoEntryForChanged selectionIndexValid' |
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 |
|
12394
a4f9d45bb707
fixed selection update from changed class selection,
Claus Gittinger <cg@exept.de>
parents:
12087
diff
changeset
|
230 |
|cls sel pkg mthd newSel| |
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 |
]. |
|
12394
a4f9d45bb707
fixed selection update from changed class selection,
Claus Gittinger <cg@exept.de>
parents:
12087
diff
changeset
|
239 |
changedObject == self selectionHolder ifTrue:[ |
a4f9d45bb707
fixed selection update from changed class selection,
Claus Gittinger <cg@exept.de>
parents:
12087
diff
changeset
|
240 |
selectionIndexValid := false. |
a4f9d45bb707
fixed selection update from changed class selection,
Claus Gittinger <cg@exept.de>
parents:
12087
diff
changeset
|
241 |
]. |
12451 | 242 |
changedObject == inGeneratorHolder ifTrue:[ |
243 |
self invalidateList. |
|
244 |
self updateList. |
|
245 |
]. |
|
246 |
"/ |
|
247 |
"/ self window shown ifFalse:[ ^ self ]. |
|
6923 | 248 |
]. |
249 |
||
12394
a4f9d45bb707
fixed selection update from changed class selection,
Claus Gittinger <cg@exept.de>
parents:
12087
diff
changeset
|
250 |
(changedObject == self selectionHolder) ifTrue:[ |
a4f9d45bb707
fixed selection update from changed class selection,
Claus Gittinger <cg@exept.de>
parents:
12087
diff
changeset
|
251 |
self updateSelectionIndexFromSelection. |
12397 | 252 |
self enqueueDelayedUpdateOutputGenerator. |
12394
a4f9d45bb707
fixed selection update from changed class selection,
Claus Gittinger <cg@exept.de>
parents:
12087
diff
changeset
|
253 |
^ self. |
a4f9d45bb707
fixed selection update from changed class selection,
Claus Gittinger <cg@exept.de>
parents:
12087
diff
changeset
|
254 |
]. |
a4f9d45bb707
fixed selection update from changed class selection,
Claus Gittinger <cg@exept.de>
parents:
12087
diff
changeset
|
255 |
|
a4f9d45bb707
fixed selection update from changed class selection,
Claus Gittinger <cg@exept.de>
parents:
12087
diff
changeset
|
256 |
selectionIndexValid ifFalse:[ |
a4f9d45bb707
fixed selection update from changed class selection,
Claus Gittinger <cg@exept.de>
parents:
12087
diff
changeset
|
257 |
self updateSelectionIndexFromSelection. |
a4f9d45bb707
fixed selection update from changed class selection,
Claus Gittinger <cg@exept.de>
parents:
12087
diff
changeset
|
258 |
]. |
a4f9d45bb707
fixed selection update from changed class selection,
Claus Gittinger <cg@exept.de>
parents:
12087
diff
changeset
|
259 |
|
6923 | 260 |
changedObject == self selectionIndexHolder ifTrue:[ |
261 |
listValid ifFalse:[ |
|
262 |
self updateList. |
|
263 |
]. |
|
12451 | 264 |
changedObject value == 0 ifTrue:[ |
265 |
self selectionIndexHolder value:#() |
|
266 |
]. |
|
6923 | 267 |
newSel := changedObject value collect:[:idx | projectList value at:idx]. |
268 |
newSel ~= self selectedProjects value ifTrue:[ |
|
269 |
self selectedProjects value:newSel. |
|
270 |
]. |
|
271 |
^ self. |
|
272 |
]. |
|
5591 | 273 |
|
274 |
changedObject == slaveMode ifTrue:[ |
|
6923 | 275 |
listValid ~~ true ifTrue:[ |
276 |
self enqueueDelayedUpdateList |
|
277 |
]. |
|
278 |
"/ self invalidateList. |
|
279 |
^ self |
|
5591 | 280 |
]. |
281 |
||
6923 | 282 |
changedObject == self projectList ifTrue:[ |
283 |
^ self |
|
284 |
]. |
|
5591 | 285 |
|
286 |
changedObject == Smalltalk ifTrue:[ |
|
6923 | 287 |
something == #projectOrganization ifTrue:[ |
288 |
self invalidateList. |
|
289 |
self enqueueDelayedUpdateOutputGenerator. |
|
290 |
^ self. |
|
291 |
]. |
|
292 |
something == #methodInClass ifTrue:[ |
|
293 |
listValid == true ifTrue:[ |
|
294 |
cls := aParameter at:1. |
|
295 |
sel := aParameter at:2. |
|
296 |
mthd := cls compiledMethodAt:sel. |
|
297 |
mthd notNil ifTrue:[ |
|
298 |
pkg := mthd package. |
|
299 |
(projectList value includes:pkg) ifFalse:[ |
|
300 |
self invalidateList. |
|
301 |
] |
|
302 |
]. |
|
303 |
]. |
|
304 |
^ self |
|
305 |
]. |
|
5591 | 306 |
|
6923 | 307 |
(something == #classDefinition |
308 |
or:[something == #newClass]) ifTrue:[ |
|
309 |
listValid == true ifTrue:[ |
|
310 |
cls := aParameter. |
|
311 |
pkg := cls package. |
|
312 |
(projectList value includes:pkg) ifFalse:[ |
|
313 |
self invalidateList. |
|
314 |
] ifTrue:[ |
|
315 |
self enqueueDelayedUpdateOutputGenerator |
|
316 |
]. |
|
317 |
] ifFalse:[ |
|
318 |
self invalidateList |
|
319 |
]. |
|
320 |
^ self |
|
321 |
]. |
|
322 |
(something == #classRemove) ifTrue:[ |
|
323 |
listValid == true ifTrue:[ |
|
324 |
cls := aParameter. |
|
325 |
pkg := cls package. |
|
326 |
]. |
|
327 |
]. |
|
328 |
^ self |
|
5591 | 329 |
]. |
330 |
||
331 |
"/ something == #projectOrganization ifTrue:[ |
|
332 |
"/ aParameter isSymbol ifTrue:[ |
|
333 |
"/ "/ a single method has changed |
|
334 |
"/"/ sel := aParameter. |
|
335 |
"/"/ mthd := changedObject compiledMethodAt:sel. |
|
336 |
"/ self enqueueDelayedUpdateOutputGenerator. |
|
337 |
"/ ]. |
|
338 |
"/ ^ self |
|
339 |
"/ ]. |
|
340 |
||
6966 | 341 |
changedObject == ChangeSet ifTrue:[ |
342 |
self invalidateList. |
|
343 |
^ self |
|
344 |
]. |
|
345 |
||
5591 | 346 |
(organizerMode notNil |
347 |
and:[organizerMode value ~~ #project]) ifTrue:[ |
|
6923 | 348 |
self invalidateList. |
349 |
^ self |
|
5591 | 350 |
]. |
351 |
super delayedUpdate:something with:aParameter from:changedObject |
|
352 |
||
7423
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
353 |
"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
|
354 |
"Modified: / 17-10-2006 / 18:43:40 / cg" |
5591 | 355 |
! |
356 |
||
357 |
selectionChangedByClick |
|
358 |
"we are not interested in that - get another notification |
|
359 |
via the changed valueHolder" |
|
360 |
||
361 |
"Created: / 17.2.2000 / 23:41:17 / cg" |
|
362 |
! |
|
363 |
||
364 |
update:something with:aParameter from:changedObject |
|
8730 | 365 |
(self builder isNil or:[self window topView realized not]) ifTrue:[ |
12394
a4f9d45bb707
fixed selection update from changed class selection,
Claus Gittinger <cg@exept.de>
parents:
12087
diff
changeset
|
366 |
"/ self makeIndependent. |
a4f9d45bb707
fixed selection update from changed class selection,
Claus Gittinger <cg@exept.de>
parents:
12087
diff
changeset
|
367 |
listValid := false. |
a4f9d45bb707
fixed selection update from changed class selection,
Claus Gittinger <cg@exept.de>
parents:
12087
diff
changeset
|
368 |
selectionIndexValid := false. |
a4f9d45bb707
fixed selection update from changed class selection,
Claus Gittinger <cg@exept.de>
parents:
12087
diff
changeset
|
369 |
^ self |
8730 | 370 |
]. |
371 |
||
5591 | 372 |
changedObject == Smalltalk ifTrue:[ |
6923 | 373 |
something == #methodDictionary ifTrue:[ |
374 |
^ self |
|
375 |
]. |
|
376 |
something == #methodTrap ifTrue:[ |
|
377 |
^ self |
|
378 |
]. |
|
10364 | 379 |
something == #methodCoverageInfo ifTrue:[ |
380 |
^ self |
|
381 |
]. |
|
6923 | 382 |
something == #methodInClass ifTrue:[ |
383 |
^ self |
|
384 |
]. |
|
385 |
something == #classVariables ifTrue:[ |
|
386 |
^ self |
|
387 |
]. |
|
388 |
something == #classComment ifTrue:[ |
|
389 |
^ self. |
|
390 |
]. |
|
391 |
something == #methodInClassRemoved ifTrue:[ |
|
392 |
^ self. |
|
393 |
]. |
|
5591 | 394 |
]. |
395 |
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
|
396 |
|
10364 | 397 |
"Modified: / 20-07-2011 / 18:54:39 / cg" |
12394
a4f9d45bb707
fixed selection update from changed class selection,
Claus Gittinger <cg@exept.de>
parents:
12087
diff
changeset
|
398 |
! |
a4f9d45bb707
fixed selection update from changed class selection,
Claus Gittinger <cg@exept.de>
parents:
12087
diff
changeset
|
399 |
|
a4f9d45bb707
fixed selection update from changed class selection,
Claus Gittinger <cg@exept.de>
parents:
12087
diff
changeset
|
400 |
updateSelectionIndexFromSelection |
a4f9d45bb707
fixed selection update from changed class selection,
Claus Gittinger <cg@exept.de>
parents:
12087
diff
changeset
|
401 |
|newSel allIdx| |
a4f9d45bb707
fixed selection update from changed class selection,
Claus Gittinger <cg@exept.de>
parents:
12087
diff
changeset
|
402 |
|
12439 | 403 |
self selectionHolder value isNil ifTrue:[ |
404 |
self selectionIndexHolder value:0. |
|
405 |
^ self. |
|
406 |
]. |
|
407 |
||
12394
a4f9d45bb707
fixed selection update from changed class selection,
Claus Gittinger <cg@exept.de>
parents:
12087
diff
changeset
|
408 |
listValid ifFalse:[ |
a4f9d45bb707
fixed selection update from changed class selection,
Claus Gittinger <cg@exept.de>
parents:
12087
diff
changeset
|
409 |
self updateList. |
a4f9d45bb707
fixed selection update from changed class selection,
Claus Gittinger <cg@exept.de>
parents:
12087
diff
changeset
|
410 |
]. |
a4f9d45bb707
fixed selection update from changed class selection,
Claus Gittinger <cg@exept.de>
parents:
12087
diff
changeset
|
411 |
allIdx := projectList value indexOf:(self class nameListEntryForALL). |
a4f9d45bb707
fixed selection update from changed class selection,
Claus Gittinger <cg@exept.de>
parents:
12087
diff
changeset
|
412 |
|
a4f9d45bb707
fixed selection update from changed class selection,
Claus Gittinger <cg@exept.de>
parents:
12087
diff
changeset
|
413 |
newSel := self selectionHolder value |
a4f9d45bb707
fixed selection update from changed class selection,
Claus Gittinger <cg@exept.de>
parents:
12087
diff
changeset
|
414 |
collect:[:val | |i| |
a4f9d45bb707
fixed selection update from changed class selection,
Claus Gittinger <cg@exept.de>
parents:
12087
diff
changeset
|
415 |
i := projectList value indexOf:val. |
a4f9d45bb707
fixed selection update from changed class selection,
Claus Gittinger <cg@exept.de>
parents:
12087
diff
changeset
|
416 |
i == 0 ifTrue:[allIdx] ifFalse:[i]] |
a4f9d45bb707
fixed selection update from changed class selection,
Claus Gittinger <cg@exept.de>
parents:
12087
diff
changeset
|
417 |
thenSelect:[:idx | idx ~~ 0]. |
a4f9d45bb707
fixed selection update from changed class selection,
Claus Gittinger <cg@exept.de>
parents:
12087
diff
changeset
|
418 |
(newSel ~= self selectionIndexHolder value |
a4f9d45bb707
fixed selection update from changed class selection,
Claus Gittinger <cg@exept.de>
parents:
12087
diff
changeset
|
419 |
or:[ self selectionIndexHolder value == 0]) ifTrue:[ |
a4f9d45bb707
fixed selection update from changed class selection,
Claus Gittinger <cg@exept.de>
parents:
12087
diff
changeset
|
420 |
self selectionIndexHolder value:newSel |
a4f9d45bb707
fixed selection update from changed class selection,
Claus Gittinger <cg@exept.de>
parents:
12087
diff
changeset
|
421 |
]. |
a4f9d45bb707
fixed selection update from changed class selection,
Claus Gittinger <cg@exept.de>
parents:
12087
diff
changeset
|
422 |
|
a4f9d45bb707
fixed selection update from changed class selection,
Claus Gittinger <cg@exept.de>
parents:
12087
diff
changeset
|
423 |
selectionIndexValid := true. |
5591 | 424 |
! ! |
425 |
||
426 |
!ProjectList methodsFor:'drag & drop'! |
|
427 |
||
6468 | 428 |
canDropContext:aDropContext |
7423
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
429 |
|objects package| |
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 |
objects := aDropContext dropObjects collect:[:obj | obj theObject]. |
5591 | 432 |
|
7423
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
433 |
(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
|
434 |
|
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
435 |
(objects conform:[:aMethodOrClass | (aMethodOrClass isMethod or:[aMethodOrClass isClass]) ]) ifFalse:[^ false]. |
5591 | 436 |
|
437 |
package := self packageAtTargetPointOf:aDropContext. |
|
438 |
package isNil ifTrue:[^ false]. |
|
439 |
||
7423
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
440 |
(objects contains:[:aMethodOrClass | aMethodOrClass package ~= package]) ifFalse:[^ false]. |
5591 | 441 |
^ true |
7120 | 442 |
|
7423
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:30:32 / cg" |
5591 | 444 |
! |
445 |
||
6468 | 446 |
doDropContext:aDropContext |
7423
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
447 |
|package objects methods classes| |
5591 | 448 |
|
7423
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
449 |
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
|
450 |
(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
|
451 |
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
|
452 |
classes := objects select:[:something | something isClass]. |
5591 | 453 |
|
7423
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
454 |
package := self packageAtTargetPointOf:aDropContext. |
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
455 |
package notNil ifTrue:[ |
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
456 |
methods notEmpty ifTrue:[ |
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
457 |
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
|
458 |
]. |
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
459 |
classes notEmpty ifTrue:[ |
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
460 |
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
|
461 |
] |
6468 | 462 |
]. |
7423
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
463 |
^ self |
5591 | 464 |
]. |
7120 | 465 |
|
7423
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
466 |
(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
|
467 |
|p| |
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
468 |
|
8966
8387f26335a9
Project noPackageId -> PackageId noPackageId
Claus Gittinger <cg@exept.de>
parents:
8749
diff
changeset
|
469 |
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
|
470 |
|
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
471 |
Class packageQuerySignal answer:p |
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
472 |
do:[ |
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
473 |
self dropClassFiles:objects. |
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
474 |
]. |
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
475 |
^ self |
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
476 |
]. |
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
477 |
|
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
478 |
"Modified: / 17-10-2006 / 18:34:43 / cg" |
5591 | 479 |
! |
480 |
||
481 |
packageAtTargetPointOf:aDropContext |
|
482 |
|p packageListView lineNr item package dropInfo now |
|
483 |
overItem timeOverItem| |
|
484 |
||
485 |
p := aDropContext targetPoint. |
|
486 |
||
487 |
packageListView := aDropContext targetWidget. |
|
488 |
||
489 |
dropInfo := aDropContext dropInfo. |
|
490 |
||
491 |
lineNr := packageListView yVisibleToLineNr:p y. |
|
492 |
lineNr isNil ifTrue:[^ nil]. |
|
493 |
||
7525
a37f9b951ff6
package at drop-point fix (care for spaces and other decoration)
Claus Gittinger <cg@exept.de>
parents:
7497
diff
changeset
|
494 |
item := projectList value at:lineNr. |
5591 | 495 |
item isNil ifTrue:[^ nil]. |
7325
4e26cc5f9f21
oops - care for old (non-tree) project list handling
Claus Gittinger <cg@exept.de>
parents:
7131
diff
changeset
|
496 |
item isString ifTrue:[^ item asSymbol]. |
5591 | 497 |
|
498 |
item canExpand ifTrue:[ |
|
5782
ae4720e83b49
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
5592
diff
changeset
|
499 |
now := Timestamp now. |
8138 | 500 |
overItem := dropInfo at:#overItem ifAbsentPut:item. |
5782
ae4720e83b49
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
5592
diff
changeset
|
501 |
timeOverItem := dropInfo at:#timeOverItem ifAbsentPut:[now]. |
5591 | 502 |
|
5782
ae4720e83b49
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
5592
diff
changeset
|
503 |
overItem ~~ item ifTrue:[ |
ae4720e83b49
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
5592
diff
changeset
|
504 |
dropInfo at:#timeOverItem put:now. |
ae4720e83b49
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
5592
diff
changeset
|
505 |
dropInfo at:#overItem put:item. |
ae4720e83b49
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
5592
diff
changeset
|
506 |
aDropContext passiveAction:[ self packageAtTargetPointOf:aDropContext ]. |
ae4720e83b49
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
5592
diff
changeset
|
507 |
] ifFalse:[ |
ae4720e83b49
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
5592
diff
changeset
|
508 |
(now millisecondDeltaFrom:timeOverItem) >= (UserPreferences current timeToAutoExpandItemsWhenDraggingOver) ifTrue:[ |
ae4720e83b49
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
5592
diff
changeset
|
509 |
aDropContext saveDraw:[ item expand. packageListView repairDamage ]. |
ae4720e83b49
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
5592
diff
changeset
|
510 |
dropInfo removeKey:#timeOverItem. |
ae4720e83b49
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
5592
diff
changeset
|
511 |
dropInfo removeKey:#overItem. |
ae4720e83b49
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
5592
diff
changeset
|
512 |
] ifFalse:[ |
ae4720e83b49
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
5592
diff
changeset
|
513 |
aDropContext passiveAction:[ self packageAtTargetPointOf:aDropContext ]. |
ae4720e83b49
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
5592
diff
changeset
|
514 |
] |
ae4720e83b49
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
5592
diff
changeset
|
515 |
]. |
5591 | 516 |
]. |
517 |
||
518 |
package := item package. |
|
519 |
package = self class nameListEntryForALL ifTrue:[^ nil]. |
|
520 |
^ package. |
|
7325
4e26cc5f9f21
oops - care for old (non-tree) project list handling
Claus Gittinger <cg@exept.de>
parents:
7131
diff
changeset
|
521 |
|
7525
a37f9b951ff6
package at drop-point fix (care for spaces and other decoration)
Claus Gittinger <cg@exept.de>
parents:
7497
diff
changeset
|
522 |
"Modified: / 18-11-2006 / 16:13:47 / cg" |
5591 | 523 |
! ! |
524 |
||
525 |
!ProjectList methodsFor:'generators'! |
|
526 |
||
527 |
makeGenerator |
|
528 |
"return a generator which enumerates the classes from the selected project(s)." |
|
529 |
||
8749
23db847d3259
added changed to projectList
Claus Gittinger <cg@exept.de>
parents:
8730
diff
changeset
|
530 |
|selectedPackages thePackage hideUnloadedClasses showChangedClasses| |
5591 | 531 |
|
532 |
selectedPackages := self selectedProjects value. |
|
533 |
selectedPackages size == 0 ifTrue:[ |
|
6894 | 534 |
^ #() |
5591 | 535 |
]. |
6907 | 536 |
selectedPackages := selectedPackages collect:[:p | p string withoutSeparators]. |
5591 | 537 |
|
8749
23db847d3259
added changed to projectList
Claus Gittinger <cg@exept.de>
parents:
8730
diff
changeset
|
538 |
showChangedClasses := selectedPackages includes:(self class nameListEntryForChanged). |
5591 | 539 |
hideUnloadedClasses := self hideUnloadedClasses value. |
540 |
||
541 |
(selectedPackages includes:(self class nameListEntryForALL)) ifTrue:[ |
|
6894 | 542 |
hideUnloadedClasses ifTrue:[ |
543 |
^ Iterator on:[:whatToDo | |
|
544 |
Smalltalk allClassesDo:[:cls | |
|
545 |
cls isLoaded ifTrue:[ |
|
9385 | 546 |
cls isRealNameSpace ifFalse:[ |
6894 | 547 |
whatToDo value:cls |
548 |
] |
|
549 |
] |
|
550 |
] |
|
551 |
] |
|
552 |
]. |
|
553 |
^ Iterator on:[:whatToDo | |
|
554 |
Smalltalk allClassesDo:[:cls | |
|
9385 | 555 |
cls isRealNameSpace ifFalse:[ |
6894 | 556 |
whatToDo value:cls |
557 |
] |
|
558 |
] |
|
559 |
] |
|
5591 | 560 |
]. |
561 |
||
562 |
selectedPackages size == 1 ifTrue:[ |
|
6894 | 563 |
"/ faster common case |
564 |
thePackage := selectedPackages first. |
|
5591 | 565 |
|
8749
23db847d3259
added changed to projectList
Claus Gittinger <cg@exept.de>
parents:
8730
diff
changeset
|
566 |
^ Iterator on:[:whatToDo | |
23db847d3259
added changed to projectList
Claus Gittinger <cg@exept.de>
parents:
8730
diff
changeset
|
567 |
|changedClasses| |
23db847d3259
added changed to projectList
Claus Gittinger <cg@exept.de>
parents:
8730
diff
changeset
|
568 |
|
23db847d3259
added changed to projectList
Claus Gittinger <cg@exept.de>
parents:
8730
diff
changeset
|
569 |
showChangedClasses ifTrue:[ changedClasses := ChangeSet current changedClasses ]. |
23db847d3259
added changed to projectList
Claus Gittinger <cg@exept.de>
parents:
8730
diff
changeset
|
570 |
|
6894 | 571 |
Smalltalk allClassesDo:[:cls | |
8749
23db847d3259
added changed to projectList
Claus Gittinger <cg@exept.de>
parents:
8730
diff
changeset
|
572 |
|doInclude| |
23db847d3259
added changed to projectList
Claus Gittinger <cg@exept.de>
parents:
8730
diff
changeset
|
573 |
|
6894 | 574 |
(hideUnloadedClasses not or:[cls isLoaded]) |
575 |
ifTrue:[ |
|
9385 | 576 |
cls isRealNameSpace ifFalse:[ |
6894 | 577 |
doInclude := (thePackage = cls package). |
578 |
doInclude ifFalse:[ |
|
579 |
cls isJavaClass ifFalse:[ |
|
580 |
doInclude := (cls methodDictionary contains:[:mthd | thePackage = mthd package]) |
|
581 |
or:[ cls class methodDictionary contains:[:mthd | thePackage = mthd package]]. |
|
8749
23db847d3259
added changed to projectList
Claus Gittinger <cg@exept.de>
parents:
8730
diff
changeset
|
582 |
]. |
23db847d3259
added changed to projectList
Claus Gittinger <cg@exept.de>
parents:
8730
diff
changeset
|
583 |
doInclude ifFalse:[ |
23db847d3259
added changed to projectList
Claus Gittinger <cg@exept.de>
parents:
8730
diff
changeset
|
584 |
(showChangedClasses and:[ (changedClasses includes:cls theNonMetaclass) |
23db847d3259
added changed to projectList
Claus Gittinger <cg@exept.de>
parents:
8730
diff
changeset
|
585 |
or:[(changedClasses includes:cls theMetaclass)] ]) ifTrue:[ |
23db847d3259
added changed to projectList
Claus Gittinger <cg@exept.de>
parents:
8730
diff
changeset
|
586 |
doInclude := true |
23db847d3259
added changed to projectList
Claus Gittinger <cg@exept.de>
parents:
8730
diff
changeset
|
587 |
]. |
23db847d3259
added changed to projectList
Claus Gittinger <cg@exept.de>
parents:
8730
diff
changeset
|
588 |
]. |
6894 | 589 |
]. |
590 |
doInclude ifTrue:[ |
|
591 |
whatToDo value:cls |
|
592 |
] |
|
593 |
] |
|
594 |
] |
|
595 |
] |
|
596 |
] |
|
5591 | 597 |
]. |
598 |
||
8749
23db847d3259
added changed to projectList
Claus Gittinger <cg@exept.de>
parents:
8730
diff
changeset
|
599 |
^ Iterator on:[:whatToDo | |
23db847d3259
added changed to projectList
Claus Gittinger <cg@exept.de>
parents:
8730
diff
changeset
|
600 |
|changedClasses| |
23db847d3259
added changed to projectList
Claus Gittinger <cg@exept.de>
parents:
8730
diff
changeset
|
601 |
|
23db847d3259
added changed to projectList
Claus Gittinger <cg@exept.de>
parents:
8730
diff
changeset
|
602 |
showChangedClasses ifTrue:[ changedClasses := ChangeSet current changedClasses ]. |
23db847d3259
added changed to projectList
Claus Gittinger <cg@exept.de>
parents:
8730
diff
changeset
|
603 |
|
6894 | 604 |
Smalltalk allClassesDo:[:cls | |
8749
23db847d3259
added changed to projectList
Claus Gittinger <cg@exept.de>
parents:
8730
diff
changeset
|
605 |
|doInclude| |
23db847d3259
added changed to projectList
Claus Gittinger <cg@exept.de>
parents:
8730
diff
changeset
|
606 |
|
6894 | 607 |
(hideUnloadedClasses not or:[cls isLoaded]) |
608 |
ifTrue:[ |
|
9385 | 609 |
cls isRealNameSpace ifFalse:[ |
6894 | 610 |
doInclude := (selectedPackages includes:cls package). |
611 |
doInclude ifFalse:[ |
|
612 |
cls isJavaClass ifFalse:[ |
|
613 |
doInclude := (cls methodDictionary contains:[:mthd | selectedPackages includes:mthd package]) |
|
614 |
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
|
615 |
doInclude ifFalse:[ |
23db847d3259
added changed to projectList
Claus Gittinger <cg@exept.de>
parents:
8730
diff
changeset
|
616 |
(showChangedClasses and:[ (changedClasses includes:cls theNonMetaclass) |
23db847d3259
added changed to projectList
Claus Gittinger <cg@exept.de>
parents:
8730
diff
changeset
|
617 |
or:[(changedClasses includes:cls theMetaclass)] ]) ifTrue:[ |
23db847d3259
added changed to projectList
Claus Gittinger <cg@exept.de>
parents:
8730
diff
changeset
|
618 |
doInclude := true |
23db847d3259
added changed to projectList
Claus Gittinger <cg@exept.de>
parents:
8730
diff
changeset
|
619 |
]. |
23db847d3259
added changed to projectList
Claus Gittinger <cg@exept.de>
parents:
8730
diff
changeset
|
620 |
]. |
23db847d3259
added changed to projectList
Claus Gittinger <cg@exept.de>
parents:
8730
diff
changeset
|
621 |
|
6894 | 622 |
] |
623 |
]. |
|
624 |
doInclude ifTrue:[ |
|
625 |
whatToDo value:cls |
|
626 |
] |
|
627 |
] |
|
628 |
] |
|
629 |
] |
|
630 |
] |
|
5591 | 631 |
|
6894 | 632 |
"Created: / 17-02-2000 / 23:49:37 / cg" |
7497 | 633 |
"Modified: / 10-11-2006 / 17:15:15 / cg" |
5591 | 634 |
! ! |
635 |
||
11258 | 636 |
!ProjectList methodsFor:'initialize-release'! |
10249 | 637 |
|
12087 | 638 |
commonPostBuild |
639 |
super commonPostBuild. |
|
640 |
listValid ifFalse:[ |
|
641 |
self enqueueDelayedUpdateList. |
|
642 |
]. |
|
643 |
! |
|
644 |
||
645 |
commonPostOpen |
|
646 |
super commonPostOpen. |
|
647 |
listValid ifFalse:[ |
|
648 |
self enqueueDelayedUpdateList. |
|
649 |
]. |
|
650 |
! |
|
651 |
||
10249 | 652 |
initialize |
653 |
||
654 |
super initialize. |
|
11915
b070218efdaa
fixes to allow viewing all vs extensions in a
Claus Gittinger <cg@exept.de>
parents:
11877
diff
changeset
|
655 |
workerQueue := SharedQueue new. |
b070218efdaa
fixes to allow viewing all vs extensions in a
Claus Gittinger <cg@exept.de>
parents:
11877
diff
changeset
|
656 |
includedPseudoEntryForChanged := true. |
12394
a4f9d45bb707
fixed selection update from changed class selection,
Claus Gittinger <cg@exept.de>
parents:
12087
diff
changeset
|
657 |
selectionIndexValid := false. |
10249 | 658 |
|
659 |
"Created: / 14-12-2010 / 15:41:23 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
11258 | 660 |
! |
661 |
||
662 |
release |
|
663 |
super release. |
|
664 |
||
665 |
projectList removeDependent:self. |
|
10249 | 666 |
! ! |
667 |
||
5591 | 668 |
!ProjectList methodsFor:'private'! |
669 |
||
6923 | 670 |
allShownProjects |
11951 | 671 |
|hideUnloaded allProjects projectBag generator addWithAllParentPackages hideModules| |
7590 | 672 |
|
673 |
hideModules := HideModules ? true. |
|
674 |
hideModules := HideModules ? false. |
|
5591 | 675 |
|
676 |
allProjects := IdentitySet new. |
|
11951 | 677 |
projectBag := Bag new. |
5591 | 678 |
|
679 |
inGeneratorHolder isNil ifTrue:[ |
|
6960 | 680 |
hideUnloaded := self hideUnloadedClasses value. |
681 |
||
682 |
addWithAllParentPackages := |
|
683 |
[:package | |
|
7590 | 684 |
|p parent module| |
5591 | 685 |
|
6960 | 686 |
(allProjects includes:package) ifFalse:[ |
687 |
allProjects add:package. |
|
8966
8387f26335a9
Project noPackageId -> PackageId noPackageId
Claus Gittinger <cg@exept.de>
parents:
8749
diff
changeset
|
688 |
(package ~= PackageId noProjectID |
7889 | 689 |
and:[package ~= #private]) ifTrue:[ |
7552 | 690 |
p := package asPackageId. |
691 |
[(parent := p parentPackage) notNil] whileTrue:[ |
|
692 |
allProjects add:parent asSymbol. |
|
693 |
p := parent. |
|
694 |
]. |
|
7590 | 695 |
hideModules ifFalse:[ |
696 |
(module := p module) notNil ifTrue:[ |
|
697 |
allProjects add:module asSymbol. |
|
698 |
]. |
|
699 |
]. |
|
6655 | 700 |
]. |
6960 | 701 |
]. |
702 |
]. |
|
703 |
||
704 |
Smalltalk allClassesDo:[:eachClass | |
|
705 |
|cls pkg p classPackage| |
|
706 |
||
9385 | 707 |
eachClass isRealNameSpace ifFalse:[ |
6965 | 708 |
|
709 |
(hideUnloaded not or:[eachClass isLoaded]) ifTrue:[ |
|
710 |
cls := eachClass theNonMetaclass. |
|
711 |
cls isPrivate ifTrue:[ |
|
712 |
cls := cls topOwningClass |
|
713 |
]. |
|
6960 | 714 |
|
8966
8387f26335a9
Project noPackageId -> PackageId noPackageId
Claus Gittinger <cg@exept.de>
parents:
8749
diff
changeset
|
715 |
classPackage := cls package ? (PackageId noProjectID). |
6965 | 716 |
classPackage size > 0 ifTrue:[ |
11951 | 717 |
classPackage := classPackage asSymbol. |
718 |
addWithAllParentPackages value:classPackage. |
|
719 |
projectBag add:classPackage. |
|
6965 | 720 |
] ifFalse:[ |
721 |
"/ for now, nameSpaces are not in any package; |
|
722 |
"/ this might change. Then, 0-sized packages are |
|
723 |
"/ illegal, and the following should be enabled. |
|
724 |
"/ self halt |
|
725 |
]. |
|
11951 | 726 |
|
6965 | 727 |
cls isJavaClass ifFalse:[ |
728 |
cls instAndClassSelectorsAndMethodsDo:[:sel :mthd | |
|
729 |
|mpkg| |
|
730 |
||
731 |
mpkg := mthd package asSymbol. |
|
732 |
mpkg ~~ classPackage ifTrue:[ |
|
733 |
(allProjects includes:mpkg) ifFalse:[ |
|
734 |
addWithAllParentPackages value:mpkg. |
|
735 |
] |
|
736 |
]. |
|
6655 | 737 |
]. |
738 |
]. |
|
739 |
]. |
|
740 |
]. |
|
741 |
]. |
|
6960 | 742 |
allProjects := allProjects asOrderedCollection. |
5591 | 743 |
|
6655 | 744 |
"/ those are simulated - in ST/X, empty projects do not |
745 |
"/ really exist; however, during browsing, it makes sense. |
|
746 |
AdditionalEmptyProjects size > 0 ifTrue:[ |
|
747 |
"/ remove those that are present ... |
|
748 |
AdditionalEmptyProjects := AdditionalEmptyProjects select:[:pkg | (allProjects includes:pkg) not]. |
|
749 |
allProjects addAll:AdditionalEmptyProjects. |
|
750 |
]. |
|
5591 | 751 |
] ifFalse:[ |
6655 | 752 |
generator := inGeneratorHolder value. |
753 |
generator isNil ifTrue:[^ #() ]. |
|
754 |
generator do:[:prj | allProjects add:prj]. |
|
5591 | 755 |
]. |
6923 | 756 |
^ allProjects asOrderedCollection. |
7497 | 757 |
|
7590 | 758 |
"Modified: / 16-01-2007 / 15:56:16 / cg" |
6923 | 759 |
! |
760 |
||
761 |
defaultSlaveModeValue |
|
762 |
|mode| |
|
763 |
||
764 |
mode := self topApplication perform:#initialOrganizerMode ifNotUnderstood:nil. |
|
765 |
mode == OrganizerCanvas organizerModeProject ifTrue:[^ false]. |
|
766 |
mode isNil ifTrue:[^ false]. |
|
767 |
^ true |
|
768 |
! |
|
769 |
||
770 |
initialOrganizerMode |
|
771 |
^ OrganizerCanvas organizerModeProject |
|
772 |
! |
|
773 |
||
774 |
listOfProjects |
|
8749
23db847d3259
added changed to projectList
Claus Gittinger <cg@exept.de>
parents:
8730
diff
changeset
|
775 |
|allProjects numClassesInChangeSet| |
6923 | 776 |
|
8975
ca2e80f67b74
copy asOrderedCollection -> copyAsOrderedCollection
Claus Gittinger <cg@exept.de>
parents:
8966
diff
changeset
|
777 |
allProjects := self allShownProjects copyAsOrderedCollection. |
11915
b070218efdaa
fixes to allow viewing all vs extensions in a
Claus Gittinger <cg@exept.de>
parents:
11877
diff
changeset
|
778 |
allProjects sort. |
5591 | 779 |
|
780 |
allProjects size == 1 ifTrue:[ |
|
6655 | 781 |
"/ self projectLabelHolder value:(allProjects first , ' [Project]'). |
782 |
self projectLabelHolder value:(LabelAndIcon icon:(self class packageIcon) string:allProjects first). |
|
5591 | 783 |
]. |
8749
23db847d3259
added changed to projectList
Claus Gittinger <cg@exept.de>
parents:
8730
diff
changeset
|
784 |
|
11915
b070218efdaa
fixes to allow viewing all vs extensions in a
Claus Gittinger <cg@exept.de>
parents:
11877
diff
changeset
|
785 |
includedPseudoEntryForChanged ifTrue:[ |
b070218efdaa
fixes to allow viewing all vs extensions in a
Claus Gittinger <cg@exept.de>
parents:
11877
diff
changeset
|
786 |
numClassesInChangeSet := ChangeSet current changedClasses size. |
b070218efdaa
fixes to allow viewing all vs extensions in a
Claus Gittinger <cg@exept.de>
parents:
11877
diff
changeset
|
787 |
numClassesInChangeSet > 0 ifTrue:[ |
b070218efdaa
fixes to allow viewing all vs extensions in a
Claus Gittinger <cg@exept.de>
parents:
11877
diff
changeset
|
788 |
"/ 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
|
789 |
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
|
790 |
]. |
8749
23db847d3259
added changed to projectList
Claus Gittinger <cg@exept.de>
parents:
8730
diff
changeset
|
791 |
]. |
23db847d3259
added changed to projectList
Claus Gittinger <cg@exept.de>
parents:
8730
diff
changeset
|
792 |
|
5591 | 793 |
allProjects size > 1 ifTrue:[ |
9029
66a3d6c4030e
no need for #asText to emphasize a string
Claus Gittinger <cg@exept.de>
parents:
8975
diff
changeset
|
794 |
allProjects addFirst:(self class nameListEntryForALL allItalic). |
5591 | 795 |
]. |
6907 | 796 |
|
5591 | 797 |
^ allProjects |
798 |
||
6907 | 799 |
"Created: / 17-02-2000 / 23:43:05 / cg" |
800 |
"Modified: / 17-08-2006 / 15:08:42 / cg" |
|
5591 | 801 |
! |
802 |
||
803 |
makeDependent |
|
6967 | 804 |
Smalltalk addDependent:self. |
805 |
ChangeSet addDependent:self. |
|
5591 | 806 |
! |
807 |
||
808 |
makeIndependent |
|
809 |
Smalltalk removeDependent:self. |
|
8220 | 810 |
ChangeSet removeDependent:self. |
5591 | 811 |
! |
812 |
||
10249 | 813 |
markEntry: rawEntry at: index forBeingManagedBySVN: package |
11138
c37649db3b52
changed: #markEntry:at:forBeingManagedBySVN:
Claus Gittinger <cg@exept.de>
parents:
10675
diff
changeset
|
814 |
^ rawEntry. |
c37649db3b52
changed: #markEntry:at:forBeingManagedBySVN:
Claus Gittinger <cg@exept.de>
parents:
10675
diff
changeset
|
815 |
|
11157
7277655aee35
Use Configurable includesFeature:#Feature instead of direct send of #hasFeature
vrany
parents:
11138
diff
changeset
|
816 |
(ConfigurableFeatures includesFeature: #SubversionSupportEnabled) ifFalse:[^rawEntry]. |
10249 | 817 |
package = PackageId noProjectID ifTrue:[^rawEntry]. |
818 |
||
10675
1a6a5e0b012f
ask comon feature list if svn is avail
Claus Gittinger <cg@exept.de>
parents:
10364
diff
changeset
|
819 |
"/ workerQueue |
1a6a5e0b012f
ask comon feature list if svn is avail
Claus Gittinger <cg@exept.de>
parents:
10364
diff
changeset
|
820 |
"/ nextPut:[ |
1a6a5e0b012f
ask comon feature list if svn is avail
Claus Gittinger <cg@exept.de>
parents:
10364
diff
changeset
|
821 |
"/ | repo newEntry branch mark| |
1a6a5e0b012f
ask comon feature list if svn is avail
Claus Gittinger <cg@exept.de>
parents:
10364
diff
changeset
|
822 |
"/ "/ 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
|
823 |
"/ repo := (Smalltalk at:#SVN::RepositoryManager) current |
1a6a5e0b012f
ask comon feature list if svn is avail
Claus Gittinger <cg@exept.de>
parents:
10364
diff
changeset
|
824 |
"/ repositoryForPackage: package onlyFromCache: false. |
1a6a5e0b012f
ask comon feature list if svn is avail
Claus Gittinger <cg@exept.de>
parents:
10364
diff
changeset
|
825 |
"/ repo ifNotNil:[ |
1a6a5e0b012f
ask comon feature list if svn is avail
Claus Gittinger <cg@exept.de>
parents:
10364
diff
changeset
|
826 |
"/ mark := ' [SVN]'. |
1a6a5e0b012f
ask comon feature list if svn is avail
Claus Gittinger <cg@exept.de>
parents:
10364
diff
changeset
|
827 |
"/ branch := repo workingCopy branchOrNil. |
1a6a5e0b012f
ask comon feature list if svn is avail
Claus Gittinger <cg@exept.de>
parents:
10364
diff
changeset
|
828 |
"/ branch ifNotNil:[mark := ' [SVN: ', branch path,']']. |
1a6a5e0b012f
ask comon feature list if svn is avail
Claus Gittinger <cg@exept.de>
parents:
10364
diff
changeset
|
829 |
"/ 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
|
830 |
"/ 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
|
831 |
"/ self projectNameList changed. |
1a6a5e0b012f
ask comon feature list if svn is avail
Claus Gittinger <cg@exept.de>
parents:
10364
diff
changeset
|
832 |
"/ ]]. |
10249 | 833 |
^rawEntry |
834 |
||
835 |
"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
|
836 |
"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
|
837 |
"Modified: / 19-01-2012 / 10:46:32 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
10249 | 838 |
! |
839 |
||
6923 | 840 |
nameListFor:aProjectList |
841 |
" |
|
842 |
self basicNew |
|
6951 | 843 |
nameListFor:#( |
7060 | 844 |
'exept:expecco' |
845 |
'exept:expecco/application' |
|
846 |
'exept:procware' |
|
847 |
'exept:workflow' |
|
6923 | 848 |
) |
7590 | 849 |
|
850 |
self basicNew |
|
851 |
nameListFor:#( |
|
852 |
'exept' |
|
853 |
'exept:expecco' |
|
854 |
'exept:expecco/application' |
|
855 |
'exept:procware' |
|
856 |
'exept:workflow' |
|
857 |
) |
|
6923 | 858 |
" |
859 |
||
7338 | 860 |
|stack projectsWithExtensions projectsWithChangedCode packagesInChangeSet projectNameList| |
6923 | 861 |
|
862 |
stack := OrderedCollection new. |
|
863 |
||
6951 | 864 |
projectsWithExtensions := Set new. |
865 |
projectsWithChangedCode := Set new. |
|
866 |
||
7338 | 867 |
packagesInChangeSet := ChangeSet current changedPackages. |
6951 | 868 |
|
869 |
projectNameList := OrderedCollection new. |
|
870 |
aProjectList do:[:this | |
|
6923 | 871 |
|thisC entry rawEntry prefix indent| |
872 |
||
6965 | 873 |
this = self class nameListEntryForALL ifTrue:[ |
874 |
entry := this |
|
875 |
] ifFalse:[ |
|
876 |
thisC := this asCollectionOfSubstringsSeparatedByAny:':/'. |
|
877 |
thisC isEmpty ifTrue:[ |
|
8966
8387f26335a9
Project noPackageId -> PackageId noPackageId
Claus Gittinger <cg@exept.de>
parents:
8749
diff
changeset
|
878 |
thisC := Array with:(PackageId noProjectID). |
6965 | 879 |
]. |
6923 | 880 |
|
6965 | 881 |
[ |
882 |
|stackTop| |
|
6923 | 883 |
|
6965 | 884 |
stack notEmpty |
885 |
and:[ |
|
886 |
stackTop := stack last. |
|
887 |
(thisC startsWith:stackTop) ifFalse:[ |
|
888 |
stack removeLast. |
|
889 |
true |
|
890 |
] ifTrue:[ |
|
891 |
false |
|
892 |
]] |
|
893 |
] whileTrue. |
|
894 |
prefix := stack notEmpty ifTrue:[ stack last ] ifFalse:[ #() ]. |
|
895 |
indent := stack size * 4. |
|
896 |
stack addLast:thisC. |
|
897 |
prefix isEmpty ifTrue:[ |
|
6970 | 898 |
rawEntry := thisC first. |
899 |
thisC size > 1 ifTrue:[ |
|
900 |
rawEntry := rawEntry , ':' , ((thisC copyFrom:2) asStringWith:$/). |
|
901 |
] |
|
6965 | 902 |
] ifFalse:[ |
903 |
rawEntry := (thisC copyFrom:prefix size+1) asStringWith:$/. |
|
904 |
]. |
|
905 |
||
7131 | 906 |
(packagesInChangeSet includes:this) ifTrue:[ |
7060 | 907 |
rawEntry := rawEntry , self class markForBeingInChangeList. |
6965 | 908 |
rawEntry := self colorizeForChangedCode:rawEntry. |
909 |
]. |
|
11873
40ed77dbf31e
comment/format in: #nameListFor:
Claus Gittinger <cg@exept.de>
parents:
11258
diff
changeset
|
910 |
|
6965 | 911 |
entry := (String new:indent) , rawEntry. |
11157
7277655aee35
Use Configurable includesFeature:#Feature instead of direct send of #hasFeature
vrany
parents:
11138
diff
changeset
|
912 |
((ConfigurableFeatures includesFeature: #SubversionSupportEnabled) and:[this first ~= $*]) ifTrue:[ |
11873
40ed77dbf31e
comment/format in: #nameListFor:
Claus Gittinger <cg@exept.de>
parents:
11258
diff
changeset
|
913 |
entry := self markEntry: entry at: projectNameList size + 1 forBeingManagedBySVN: this. |
10249 | 914 |
]. |
6923 | 915 |
]. |
6951 | 916 |
projectNameList add:entry. |
6923 | 917 |
]. |
10249 | 918 |
self startWorker. |
6951 | 919 |
^ projectNameList. |
6923 | 920 |
|
921 |
"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
|
922 |
"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
|
923 |
"Modified: / 19-01-2012 / 10:46:53 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
6923 | 924 |
! |
925 |
||
10249 | 926 |
startWorker |
12394
a4f9d45bb707
fixed selection update from changed class selection,
Claus Gittinger <cg@exept.de>
parents:
12087
diff
changeset
|
927 |
worker |
a4f9d45bb707
fixed selection update from changed class selection,
Claus Gittinger <cg@exept.de>
parents:
12087
diff
changeset
|
928 |
ifNil:[ |
a4f9d45bb707
fixed selection update from changed class selection,
Claus Gittinger <cg@exept.de>
parents:
12087
diff
changeset
|
929 |
worker := [ |
a4f9d45bb707
fixed selection update from changed class selection,
Claus Gittinger <cg@exept.de>
parents:
12087
diff
changeset
|
930 |
[ workerQueue notEmpty ] whileTrue:[ |
a4f9d45bb707
fixed selection update from changed class selection,
Claus Gittinger <cg@exept.de>
parents:
12087
diff
changeset
|
931 |
|job| |
10249 | 932 |
|
12394
a4f9d45bb707
fixed selection update from changed class selection,
Claus Gittinger <cg@exept.de>
parents:
12087
diff
changeset
|
933 |
job := workerQueue next. |
a4f9d45bb707
fixed selection update from changed class selection,
Claus Gittinger <cg@exept.de>
parents:
12087
diff
changeset
|
934 |
job value |
a4f9d45bb707
fixed selection update from changed class selection,
Claus Gittinger <cg@exept.de>
parents:
12087
diff
changeset
|
935 |
]. |
a4f9d45bb707
fixed selection update from changed class selection,
Claus Gittinger <cg@exept.de>
parents:
12087
diff
changeset
|
936 |
worker := nil. |
a4f9d45bb707
fixed selection update from changed class selection,
Claus Gittinger <cg@exept.de>
parents:
12087
diff
changeset
|
937 |
] newProcess. |
a4f9d45bb707
fixed selection update from changed class selection,
Claus Gittinger <cg@exept.de>
parents:
12087
diff
changeset
|
938 |
worker resume |
a4f9d45bb707
fixed selection update from changed class selection,
Claus Gittinger <cg@exept.de>
parents:
12087
diff
changeset
|
939 |
]. |
10249 | 940 |
|
941 |
"Created: / 14-12-2010 / 15:49:57 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
942 |
"Modified: / 16-12-2010 / 17:35:37 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
943 |
! |
|
944 |
||
5591 | 945 |
updateList |
6923 | 946 |
|newList oldList newNameList oldNameList oldSelection newSelection selectedProjectsHolder| |
5591 | 947 |
|
948 |
selectedProjectsHolder := self selectedProjects. |
|
949 |
oldSelection := selectedProjectsHolder value. |
|
950 |
newList := self listOfProjects. |
|
6923 | 951 |
oldList := projectList value. |
952 |
newNameList := self nameListFor:newList. |
|
953 |
oldNameList := self projectNameList value. |
|
954 |
(newList ~= oldList |
|
955 |
or:[ newNameList ~= oldNameList]) ifTrue:[ |
|
5591 | 956 |
"/ oldSelection size > 0 ifTrue:[ |
957 |
"/ selectedProjectsHolder removeDependent:self. |
|
958 |
"/ selectedProjectsHolder value:#(). |
|
959 |
"/ selectedProjectsHolder addDependent:self. |
|
960 |
"/ ]. |
|
961 |
||
12442 | 962 |
self projectList value ~= newList ifTrue:[ |
963 |
"Hack to avoid recursion" |
|
964 |
self projectList value:newList. |
|
965 |
]. |
|
6923 | 966 |
listValid := true. |
967 |
self projectNameList value:newNameList. |
|
5591 | 968 |
|
6923 | 969 |
oldSelection size > 0 ifTrue:[ |
970 |
newSelection := oldSelection select:[:prj | newList includes:prj]. |
|
971 |
selectedProjectsHolder value:newSelection. |
|
972 |
] |
|
5591 | 973 |
]. |
974 |
listValid := true. |
|
975 |
||
976 |
"Modified: / 25.2.2000 / 23:10:01 / cg" |
|
977 |
! ! |
|
978 |
||
979 |
!ProjectList methodsFor:'special'! |
|
980 |
||
981 |
addAdditionalProject:aProject |
|
6923 | 982 |
"/ those are simulated - in ST/X, empty projects do not |
5591 | 983 |
"/ really exist; however, during browsing, it makes sense. |
984 |
AdditionalEmptyProjects isNil ifTrue:[ |
|
6923 | 985 |
AdditionalEmptyProjects := Set new. |
5591 | 986 |
]. |
987 |
AdditionalEmptyProjects add:aProject. |
|
988 |
||
989 |
Smalltalk changed:#projectOrganization "/ not really ... to force update |
|
990 |
||
991 |
"Created: / 17.2.2000 / 23:44:27 / cg" |
|
992 |
! |
|
993 |
||
994 |
removeAdditionalProjects:aListOfProjects |
|
995 |
"/ those are simulated - in ST/X, empty categories do not |
|
996 |
"/ really exist; however, during browsing, it makes sense. |
|
997 |
AdditionalEmptyProjects notNil ifTrue:[ |
|
998 |
aListOfProjects do:[:eachProject | |
|
999 |
AdditionalEmptyProjects remove:eachProject ifAbsent:nil. |
|
1000 |
]. |
|
1001 |
]. |
|
1002 |
Smalltalk changed:#projectOrganization "/ not really ... to force update |
|
1003 |
||
1004 |
"Created: / 17.2.2000 / 23:45:24 / cg" |
|
1005 |
! ! |
|
1006 |
||
1007 |
!ProjectList class methodsFor:'documentation'! |
|
1008 |
||
11877 | 1009 |
version |
12451 | 1010 |
^ '$Header: /cvs/stx/stx/libtool/Tools_ProjectList.st,v 1.61 2013-03-10 14:22:06 cg Exp $' |
11877 | 1011 |
! |
1012 |
||
8966
8387f26335a9
Project noPackageId -> PackageId noPackageId
Claus Gittinger <cg@exept.de>
parents:
8749
diff
changeset
|
1013 |
version_CVS |
12451 | 1014 |
^ '$Header: /cvs/stx/stx/libtool/Tools_ProjectList.st,v 1.61 2013-03-10 14:22:06 cg Exp $' |
5591 | 1015 |
! ! |
12394
a4f9d45bb707
fixed selection update from changed class selection,
Claus Gittinger <cg@exept.de>
parents:
12087
diff
changeset
|
1016 |