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