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