author | Michael Beyl <mb@exept.de> |
Wed, 07 Nov 2007 18:20:03 +0100 | |
changeset 7889 | b5c2546a0cd9 |
parent 7814 | 54321c9b4238 |
child 8138 | 7ec9d35e1357 |
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 |
|
6923 | 17 |
instanceVariableNames:'projectList projectNameList selectionIndexHolder' |
7590 | 18 |
classVariableNames:'AdditionalEmptyProjects HideModules' |
5591 | 19 |
poolDictionaries:'' |
20 |
category:'Interface-Browsers-New' |
|
21 |
! |
|
22 |
||
23 |
!ProjectList class methodsFor:'documentation'! |
|
24 |
||
25 |
copyright |
|
26 |
" |
|
27 |
COPYRIGHT (c) 2000 by eXept Software AG |
|
28 |
All Rights Reserved |
|
29 |
||
30 |
This software is furnished under a license and may be used |
|
31 |
only in accordance with the terms of that license and with the |
|
32 |
inclusion of the above copyright notice. This software may not |
|
33 |
be provided or otherwise made available to, or used by, any |
|
34 |
other person. No title to or ownership of the software is |
|
35 |
hereby transferred. |
|
36 |
" |
|
37 |
! ! |
|
38 |
||
39 |
!ProjectList class methodsFor:'interface specs'! |
|
40 |
||
41 |
singleProjectWindowSpec |
|
42 |
"This resource specification was automatically generated |
|
43 |
by the UIPainter of ST/X." |
|
44 |
||
45 |
"Do not manually edit this!! If it is corrupted, |
|
46 |
the UIPainter may not be able to read the specification." |
|
47 |
||
48 |
" |
|
49 |
UIPainter new openOnClass:ClassCategoryList andSelector:#singleCategoryWindowSpec |
|
50 |
ClassCategoryList new openInterface:#singleCategoryWindowSpec |
|
51 |
" |
|
52 |
||
53 |
<resource: #canvas> |
|
54 |
||
55 |
^ |
|
56 |
#(#FullSpec |
|
5592 | 57 |
#name: #singleProjectWindowSpec |
58 |
#window: |
|
5591 | 59 |
#(#WindowSpec |
5592 | 60 |
#label: 'ProjectList' |
61 |
#name: 'ProjectList' |
|
62 |
#min: #(#Point 0 0) |
|
63 |
#max: #(#Point 1024 721) |
|
64 |
#bounds: #(#Rectangle 218 175 518 475) |
|
65 |
) |
|
66 |
#component: |
|
5591 | 67 |
#(#SpecCollection |
5592 | 68 |
#collection: #( |
69 |
#(#LabelSpec |
|
70 |
#label: 'ProjectName' |
|
71 |
#name: 'ProjectLabel' |
|
72 |
#layout: #(#LayoutFrame 0 0.0 0 0 0 1.0 25 0) |
|
73 |
#translateLabel: true |
|
74 |
#labelChannel: #projectLabelHolder |
|
75 |
#menu: #menuHolder |
|
76 |
) |
|
77 |
) |
|
5591 | 78 |
|
5592 | 79 |
) |
5591 | 80 |
) |
81 |
! |
|
82 |
||
83 |
windowSpec |
|
84 |
"This resource specification was automatically generated |
|
85 |
by the UIPainter of ST/X." |
|
86 |
||
87 |
"Do not manually edit this!! If it is corrupted, |
|
88 |
the UIPainter may not be able to read the specification." |
|
89 |
||
90 |
" |
|
91 |
UIPainter new openOnClass:ProjectList andSelector:#windowSpec |
|
92 |
ProjectList new openInterface:#windowSpec |
|
93 |
ProjectList open |
|
94 |
" |
|
95 |
||
96 |
<resource: #canvas> |
|
97 |
||
98 |
^ |
|
99 |
#(#FullSpec |
|
6468 | 100 |
#name: #windowSpec |
101 |
#window: |
|
5591 | 102 |
#(#WindowSpec |
6468 | 103 |
#label: 'ProjectList' |
104 |
#name: 'ProjectList' |
|
105 |
#min: #(#Point 0 0) |
|
106 |
#max: #(#Point 1024 721) |
|
107 |
#bounds: #(#Rectangle 13 23 313 323) |
|
108 |
) |
|
109 |
#component: |
|
5591 | 110 |
#(#SpecCollection |
6468 | 111 |
#collection: #( |
112 |
#(#SequenceViewSpec |
|
113 |
#name: 'List' |
|
114 |
#layout: #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0) |
|
115 |
#tabable: true |
|
6923 | 116 |
#model: #selectionIndexHolder |
6468 | 117 |
#menu: #menuHolder |
118 |
#hasHorizontalScrollBar: true |
|
119 |
#hasVerticalScrollBar: true |
|
120 |
#miniScrollerHorizontal: true |
|
121 |
#isMultiSelect: true |
|
122 |
#valueChangeSelector: #selectionChangedByClick |
|
6923 | 123 |
#useIndex: true |
124 |
#sequenceList: #projectNameList |
|
6468 | 125 |
#doubleClickChannel: #doubleClickChannel |
126 |
#properties: |
|
127 |
#(#PropertyListDictionary |
|
128 |
#dragArgument: nil |
|
129 |
#dropArgument: nil |
|
130 |
#canDropSelector: #canDropContext: |
|
131 |
#dropSelector: #doDropContext: |
|
132 |
) |
|
133 |
) |
|
134 |
) |
|
5591 | 135 |
|
6468 | 136 |
) |
5591 | 137 |
) |
138 |
||
139 |
"Created: / 17.2.2000 / 23:45:47 / cg" |
|
140 |
"Modified: / 17.2.2000 / 23:47:53 / cg" |
|
141 |
! ! |
|
142 |
||
143 |
!ProjectList class methodsFor:'queries-plugin'! |
|
144 |
||
145 |
aspectSelectors |
|
146 |
^ #( |
|
147 |
#(#doubleClickChannel #action ) |
|
148 |
immediateUpdate |
|
149 |
selectedProjects |
|
150 |
menuHolder |
|
151 |
outGeneratorHolder |
|
152 |
inGeneratorHolder |
|
153 |
selectionChangeCondition |
|
154 |
updateTrigger |
|
155 |
forceGeneratorTrigger |
|
156 |
hideUnloadedClasses |
|
157 |
organizerMode |
|
158 |
slaveMode |
|
159 |
) |
|
160 |
||
161 |
"Created: / 17.2.2000 / 23:46:18 / cg" |
|
162 |
"Modified: / 25.2.2000 / 22:32:10 / cg" |
|
163 |
! ! |
|
164 |
||
165 |
!ProjectList methodsFor:'aspects'! |
|
166 |
||
167 |
projectLabelHolder |
|
168 |
^ self pseudoListLabelHolder |
|
169 |
! |
|
170 |
||
171 |
projectList |
|
172 |
projectList isNil ifTrue:[ |
|
173 |
projectList := ValueHolder new. |
|
174 |
projectList addDependent:self. |
|
175 |
]. |
|
176 |
^ projectList |
|
177 |
||
178 |
"Created: / 17.2.2000 / 23:39:32 / cg" |
|
179 |
! |
|
180 |
||
6923 | 181 |
projectNameList |
182 |
projectNameList isNil ifTrue:[ |
|
183 |
projectNameList := ValueHolder new. |
|
184 |
"/ projectNameList addDependent:self. |
|
185 |
]. |
|
186 |
^ projectNameList |
|
187 |
||
188 |
"Created: / 17.2.2000 / 23:39:32 / cg" |
|
189 |
! |
|
190 |
||
5591 | 191 |
selectedProjects |
192 |
^ self selectionHolder |
|
193 |
||
194 |
"Created: / 17.2.2000 / 23:39:57 / cg" |
|
195 |
! |
|
196 |
||
197 |
selectedProjects:aValueHolder |
|
198 |
^ self selectionHolder:aValueHolder |
|
6923 | 199 |
! |
200 |
||
201 |
selectionIndexHolder |
|
202 |
selectionIndexHolder isNil ifTrue:[ |
|
203 |
selectionIndexHolder := 0 asValue. |
|
204 |
selectionIndexHolder addDependent:self. |
|
205 |
]. |
|
206 |
^ selectionIndexHolder |
|
207 |
||
208 |
"Created: / 17.2.2000 / 23:39:32 / cg" |
|
5591 | 209 |
! ! |
210 |
||
211 |
!ProjectList methodsFor:'change & update'! |
|
212 |
||
213 |
delayedUpdate:something with:aParameter from:changedObject |
|
7423
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
214 |
|cls sel pkg mthd newSel allIdx| |
5591 | 215 |
|
216 |
self inSlaveModeOrInvisible |
|
217 |
"/ (self slaveMode value == true) |
|
218 |
ifTrue:[ |
|
6923 | 219 |
(changedObject == Smalltalk |
220 |
or:[ something == #projectOrganization ]) ifTrue:[ |
|
221 |
listValid := false |
|
222 |
]. |
|
223 |
^ self |
|
224 |
]. |
|
225 |
||
226 |
changedObject == self selectionIndexHolder ifTrue:[ |
|
227 |
listValid ifFalse:[ |
|
228 |
self updateList. |
|
229 |
]. |
|
230 |
newSel := changedObject value collect:[:idx | projectList value at:idx]. |
|
231 |
newSel ~= self selectedProjects value ifTrue:[ |
|
232 |
self selectedProjects value:newSel. |
|
233 |
]. |
|
234 |
^ self. |
|
235 |
]. |
|
236 |
changedObject == self selectionHolder ifTrue:[ |
|
237 |
listValid == true ifFalse:[ |
|
238 |
self updateList. |
|
239 |
]. |
|
7423
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
240 |
allIdx := projectList value indexOf:(self class nameListEntryForALL). |
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
241 |
newSel := changedObject value |
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
242 |
collect:[:val | |i| |
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
243 |
i := projectList value indexOf:val. |
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
244 |
i == 0 ifTrue:[allIdx] ifFalse:[i]] |
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
245 |
thenSelect:[:idx | idx ~~ 0]. |
6923 | 246 |
newSel ~= self selectionIndexHolder value ifTrue:[ |
247 |
self selectionIndexHolder value:newSel |
|
248 |
]. |
|
5591 | 249 |
]. |
250 |
||
251 |
changedObject == slaveMode ifTrue:[ |
|
6923 | 252 |
listValid ~~ true ifTrue:[ |
253 |
self enqueueDelayedUpdateList |
|
254 |
]. |
|
255 |
"/ self invalidateList. |
|
256 |
^ self |
|
5591 | 257 |
]. |
258 |
||
6923 | 259 |
changedObject == self projectList ifTrue:[ |
260 |
^ self |
|
261 |
]. |
|
5591 | 262 |
|
263 |
changedObject == Smalltalk ifTrue:[ |
|
6923 | 264 |
something == #projectOrganization ifTrue:[ |
265 |
self invalidateList. |
|
266 |
self enqueueDelayedUpdateOutputGenerator. |
|
267 |
^ self. |
|
268 |
]. |
|
269 |
something == #methodInClass ifTrue:[ |
|
270 |
listValid == true ifTrue:[ |
|
271 |
cls := aParameter at:1. |
|
272 |
sel := aParameter at:2. |
|
273 |
mthd := cls compiledMethodAt:sel. |
|
274 |
mthd notNil ifTrue:[ |
|
275 |
pkg := mthd package. |
|
276 |
(projectList value includes:pkg) ifFalse:[ |
|
277 |
self invalidateList. |
|
278 |
] |
|
279 |
]. |
|
280 |
]. |
|
281 |
^ self |
|
282 |
]. |
|
5591 | 283 |
|
6923 | 284 |
(something == #classDefinition |
285 |
or:[something == #newClass]) ifTrue:[ |
|
286 |
listValid == true ifTrue:[ |
|
287 |
cls := aParameter. |
|
288 |
pkg := cls package. |
|
289 |
(projectList value includes:pkg) ifFalse:[ |
|
290 |
self invalidateList. |
|
291 |
] ifTrue:[ |
|
292 |
self enqueueDelayedUpdateOutputGenerator |
|
293 |
]. |
|
294 |
] ifFalse:[ |
|
295 |
self invalidateList |
|
296 |
]. |
|
297 |
^ self |
|
298 |
]. |
|
299 |
(something == #classRemove) ifTrue:[ |
|
300 |
listValid == true ifTrue:[ |
|
301 |
cls := aParameter. |
|
302 |
pkg := cls package. |
|
303 |
]. |
|
304 |
]. |
|
305 |
^ self |
|
5591 | 306 |
]. |
307 |
||
308 |
"/ something == #projectOrganization ifTrue:[ |
|
309 |
"/ aParameter isSymbol ifTrue:[ |
|
310 |
"/ "/ a single method has changed |
|
311 |
"/"/ sel := aParameter. |
|
312 |
"/"/ mthd := changedObject compiledMethodAt:sel. |
|
313 |
"/ self enqueueDelayedUpdateOutputGenerator. |
|
314 |
"/ ]. |
|
315 |
"/ ^ self |
|
316 |
"/ ]. |
|
317 |
||
6966 | 318 |
changedObject == ChangeSet ifTrue:[ |
319 |
self invalidateList. |
|
320 |
^ self |
|
321 |
]. |
|
322 |
||
5591 | 323 |
(organizerMode notNil |
324 |
and:[organizerMode value ~~ #project]) ifTrue:[ |
|
6923 | 325 |
self invalidateList. |
326 |
^ self |
|
5591 | 327 |
]. |
328 |
super delayedUpdate:something with:aParameter from:changedObject |
|
329 |
||
7423
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
330 |
"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
|
331 |
"Modified: / 17-10-2006 / 18:43:40 / cg" |
5591 | 332 |
! |
333 |
||
334 |
selectionChangedByClick |
|
335 |
"we are not interested in that - get another notification |
|
336 |
via the changed valueHolder" |
|
337 |
||
338 |
"Created: / 17.2.2000 / 23:41:17 / cg" |
|
339 |
! |
|
340 |
||
341 |
update:something with:aParameter from:changedObject |
|
342 |
changedObject == Smalltalk ifTrue:[ |
|
6923 | 343 |
something == #methodDictionary ifTrue:[ |
344 |
^ self |
|
345 |
]. |
|
346 |
something == #methodTrap ifTrue:[ |
|
347 |
^ self |
|
348 |
]. |
|
349 |
something == #methodInClass ifTrue:[ |
|
350 |
^ self |
|
351 |
]. |
|
352 |
something == #classVariables ifTrue:[ |
|
353 |
^ self |
|
354 |
]. |
|
355 |
something == #classComment ifTrue:[ |
|
356 |
^ self. |
|
357 |
]. |
|
358 |
something == #methodInClassRemoved ifTrue:[ |
|
359 |
^ self. |
|
360 |
]. |
|
5591 | 361 |
]. |
362 |
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
|
363 |
|
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
364 |
"Modified: / 17-10-2006 / 18:40:17 / cg" |
5591 | 365 |
! ! |
366 |
||
367 |
!ProjectList methodsFor:'drag & drop'! |
|
368 |
||
6468 | 369 |
canDropContext:aDropContext |
7423
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
370 |
|objects package| |
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
371 |
|
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
372 |
objects := aDropContext dropObjects collect:[:obj | obj theObject]. |
5591 | 373 |
|
7423
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
374 |
(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
|
375 |
|
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
376 |
(objects conform:[:aMethodOrClass | (aMethodOrClass isMethod or:[aMethodOrClass isClass]) ]) ifFalse:[^ false]. |
5591 | 377 |
|
378 |
package := self packageAtTargetPointOf:aDropContext. |
|
379 |
package isNil ifTrue:[^ false]. |
|
380 |
||
7423
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
381 |
(objects contains:[:aMethodOrClass | aMethodOrClass package ~= package]) ifFalse:[^ false]. |
5591 | 382 |
^ true |
7120 | 383 |
|
7423
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
384 |
"Modified: / 17-10-2006 / 18:30:32 / cg" |
5591 | 385 |
! |
386 |
||
6468 | 387 |
doDropContext:aDropContext |
7423
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
388 |
|package objects methods classes| |
5591 | 389 |
|
7423
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
390 |
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
|
391 |
(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
|
392 |
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
|
393 |
classes := objects select:[:something | something isClass]. |
5591 | 394 |
|
7423
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
395 |
package := self packageAtTargetPointOf:aDropContext. |
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
396 |
package notNil ifTrue:[ |
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
397 |
methods notEmpty ifTrue:[ |
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
398 |
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
|
399 |
]. |
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
400 |
classes notEmpty ifTrue:[ |
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
401 |
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
|
402 |
] |
6468 | 403 |
]. |
7423
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
404 |
^ self |
5591 | 405 |
]. |
7120 | 406 |
|
7423
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
407 |
(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
|
408 |
|p| |
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
409 |
|
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
410 |
p := (self selectedProjects value ? #()) firstIfEmpty:Project noProjectID. |
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
411 |
|
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
412 |
Class packageQuerySignal answer:p |
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
413 |
do:[ |
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
414 |
self dropClassFiles:objects. |
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
415 |
]. |
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
416 |
^ self |
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
417 |
]. |
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 |
"Modified: / 17-10-2006 / 18:34:43 / cg" |
5591 | 420 |
! |
421 |
||
422 |
packageAtTargetPointOf:aDropContext |
|
423 |
|p packageListView lineNr item package dropInfo now |
|
424 |
overItem timeOverItem| |
|
425 |
||
426 |
p := aDropContext targetPoint. |
|
427 |
||
428 |
packageListView := aDropContext targetWidget. |
|
429 |
||
430 |
dropInfo := aDropContext dropInfo. |
|
431 |
||
432 |
lineNr := packageListView yVisibleToLineNr:p y. |
|
433 |
lineNr isNil ifTrue:[^ nil]. |
|
434 |
||
7525
a37f9b951ff6
package at drop-point fix (care for spaces and other decoration)
Claus Gittinger <cg@exept.de>
parents:
7497
diff
changeset
|
435 |
item := projectList value at:lineNr. |
5591 | 436 |
item isNil ifTrue:[^ nil]. |
7325
4e26cc5f9f21
oops - care for old (non-tree) project list handling
Claus Gittinger <cg@exept.de>
parents:
7131
diff
changeset
|
437 |
item isString ifTrue:[^ item asSymbol]. |
5591 | 438 |
|
439 |
item canExpand ifTrue:[ |
|
5782
ae4720e83b49
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
5592
diff
changeset
|
440 |
now := Timestamp now. |
ae4720e83b49
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
5592
diff
changeset
|
441 |
overItem := dropInfo at:#overItem ifAbsentPut:[item]. |
ae4720e83b49
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
5592
diff
changeset
|
442 |
timeOverItem := dropInfo at:#timeOverItem ifAbsentPut:[now]. |
5591 | 443 |
|
5782
ae4720e83b49
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
5592
diff
changeset
|
444 |
overItem ~~ item ifTrue:[ |
ae4720e83b49
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
5592
diff
changeset
|
445 |
dropInfo at:#timeOverItem put:now. |
ae4720e83b49
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
5592
diff
changeset
|
446 |
dropInfo at:#overItem put:item. |
ae4720e83b49
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
5592
diff
changeset
|
447 |
aDropContext passiveAction:[ self packageAtTargetPointOf:aDropContext ]. |
ae4720e83b49
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
5592
diff
changeset
|
448 |
] ifFalse:[ |
ae4720e83b49
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
5592
diff
changeset
|
449 |
(now millisecondDeltaFrom:timeOverItem) >= (UserPreferences current timeToAutoExpandItemsWhenDraggingOver) ifTrue:[ |
ae4720e83b49
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
5592
diff
changeset
|
450 |
aDropContext saveDraw:[ item expand. packageListView repairDamage ]. |
ae4720e83b49
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
5592
diff
changeset
|
451 |
dropInfo removeKey:#timeOverItem. |
ae4720e83b49
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
5592
diff
changeset
|
452 |
dropInfo removeKey:#overItem. |
ae4720e83b49
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
5592
diff
changeset
|
453 |
] ifFalse:[ |
ae4720e83b49
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
5592
diff
changeset
|
454 |
aDropContext passiveAction:[ self packageAtTargetPointOf:aDropContext ]. |
ae4720e83b49
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
5592
diff
changeset
|
455 |
] |
ae4720e83b49
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
5592
diff
changeset
|
456 |
]. |
5591 | 457 |
]. |
458 |
||
459 |
package := item package. |
|
460 |
package = self class nameListEntryForALL ifTrue:[^ nil]. |
|
461 |
^ package. |
|
7325
4e26cc5f9f21
oops - care for old (non-tree) project list handling
Claus Gittinger <cg@exept.de>
parents:
7131
diff
changeset
|
462 |
|
7525
a37f9b951ff6
package at drop-point fix (care for spaces and other decoration)
Claus Gittinger <cg@exept.de>
parents:
7497
diff
changeset
|
463 |
"Modified: / 18-11-2006 / 16:13:47 / cg" |
5591 | 464 |
! ! |
465 |
||
466 |
!ProjectList methodsFor:'generators'! |
|
467 |
||
468 |
makeGenerator |
|
469 |
"return a generator which enumerates the classes from the selected project(s)." |
|
470 |
||
471 |
|selectedPackages thePackage hideUnloadedClasses| |
|
472 |
||
473 |
selectedPackages := self selectedProjects value. |
|
474 |
selectedPackages size == 0 ifTrue:[ |
|
6894 | 475 |
^ #() |
5591 | 476 |
]. |
6907 | 477 |
selectedPackages := selectedPackages collect:[:p | p string withoutSeparators]. |
5591 | 478 |
|
479 |
hideUnloadedClasses := self hideUnloadedClasses value. |
|
480 |
||
481 |
(selectedPackages includes:(self class nameListEntryForALL)) ifTrue:[ |
|
6894 | 482 |
hideUnloadedClasses ifTrue:[ |
483 |
^ Iterator on:[:whatToDo | |
|
484 |
Smalltalk allClassesDo:[:cls | |
|
485 |
cls isLoaded ifTrue:[ |
|
7497 | 486 |
(cls isRealNameSpace not) ifTrue:[ |
6894 | 487 |
whatToDo value:cls |
488 |
] |
|
489 |
] |
|
490 |
] |
|
491 |
] |
|
492 |
]. |
|
493 |
^ Iterator on:[:whatToDo | |
|
494 |
Smalltalk allClassesDo:[:cls | |
|
7497 | 495 |
(cls isRealNameSpace not) ifTrue:[ |
6894 | 496 |
whatToDo value:cls |
497 |
] |
|
498 |
] |
|
499 |
] |
|
5591 | 500 |
]. |
501 |
||
502 |
selectedPackages size == 1 ifTrue:[ |
|
6894 | 503 |
"/ faster common case |
504 |
thePackage := selectedPackages first. |
|
5591 | 505 |
|
6894 | 506 |
^ Iterator on:[:whatToDo | |doInclude| |
507 |
Smalltalk allClassesDo:[:cls | |
|
508 |
(hideUnloadedClasses not or:[cls isLoaded]) |
|
509 |
ifTrue:[ |
|
7497 | 510 |
(cls isRealNameSpace not) ifTrue:[ |
6894 | 511 |
doInclude := (thePackage = cls package). |
512 |
doInclude ifFalse:[ |
|
513 |
cls isJavaClass ifFalse:[ |
|
514 |
doInclude := (cls methodDictionary contains:[:mthd | thePackage = mthd package]) |
|
515 |
or:[ cls class methodDictionary contains:[:mthd | thePackage = mthd package]]. |
|
516 |
] |
|
517 |
]. |
|
518 |
doInclude ifTrue:[ |
|
519 |
whatToDo value:cls |
|
520 |
] |
|
521 |
] |
|
522 |
] |
|
523 |
] |
|
524 |
] |
|
5591 | 525 |
]. |
526 |
||
527 |
^ Iterator on:[:whatToDo | |doInclude| |
|
6894 | 528 |
Smalltalk allClassesDo:[:cls | |
529 |
(hideUnloadedClasses not or:[cls isLoaded]) |
|
530 |
ifTrue:[ |
|
7497 | 531 |
(cls isRealNameSpace not) ifTrue:[ |
6894 | 532 |
doInclude := (selectedPackages includes:cls package). |
533 |
doInclude ifFalse:[ |
|
534 |
cls isJavaClass ifFalse:[ |
|
535 |
doInclude := (cls methodDictionary contains:[:mthd | selectedPackages includes:mthd package]) |
|
536 |
or:[ cls class methodDictionary contains:[:mthd | selectedPackages includes:mthd package]]. |
|
537 |
] |
|
538 |
]. |
|
539 |
doInclude ifTrue:[ |
|
540 |
whatToDo value:cls |
|
541 |
] |
|
542 |
] |
|
543 |
] |
|
544 |
] |
|
545 |
] |
|
5591 | 546 |
|
6894 | 547 |
"Created: / 17-02-2000 / 23:49:37 / cg" |
7497 | 548 |
"Modified: / 10-11-2006 / 17:15:15 / cg" |
5591 | 549 |
! ! |
550 |
||
551 |
!ProjectList methodsFor:'private'! |
|
552 |
||
6923 | 553 |
allShownProjects |
7590 | 554 |
|hideUnloaded allProjects generator addWithAllParentPackages hideModules| |
555 |
||
556 |
hideModules := HideModules ? true. |
|
557 |
hideModules := HideModules ? false. |
|
5591 | 558 |
|
559 |
allProjects := IdentitySet new. |
|
560 |
||
561 |
inGeneratorHolder isNil ifTrue:[ |
|
6960 | 562 |
hideUnloaded := self hideUnloadedClasses value. |
563 |
||
564 |
addWithAllParentPackages := |
|
565 |
[:package | |
|
7590 | 566 |
|p parent module| |
5591 | 567 |
|
6960 | 568 |
(allProjects includes:package) ifFalse:[ |
569 |
allProjects add:package. |
|
7889 | 570 |
(package ~= Project noProjectID |
571 |
and:[package ~= #private]) ifTrue:[ |
|
7552 | 572 |
p := package asPackageId. |
573 |
[(parent := p parentPackage) notNil] whileTrue:[ |
|
574 |
allProjects add:parent asSymbol. |
|
575 |
p := parent. |
|
576 |
]. |
|
7590 | 577 |
hideModules ifFalse:[ |
578 |
(module := p module) notNil ifTrue:[ |
|
579 |
allProjects add:module asSymbol. |
|
580 |
]. |
|
581 |
]. |
|
6655 | 582 |
]. |
6960 | 583 |
]. |
584 |
]. |
|
585 |
||
586 |
Smalltalk allClassesDo:[:eachClass | |
|
587 |
|cls pkg p classPackage| |
|
588 |
||
7497 | 589 |
(eachClass isRealNameSpace not) ifTrue:[ |
6965 | 590 |
|
591 |
(hideUnloaded not or:[eachClass isLoaded]) ifTrue:[ |
|
592 |
cls := eachClass theNonMetaclass. |
|
593 |
cls isPrivate ifTrue:[ |
|
594 |
cls := cls topOwningClass |
|
595 |
]. |
|
6960 | 596 |
|
6970 | 597 |
classPackage := cls package ? (Project noProjectID). |
6965 | 598 |
classPackage size > 0 ifTrue:[ |
599 |
addWithAllParentPackages value:classPackage asSymbol. |
|
600 |
] ifFalse:[ |
|
601 |
"/ for now, nameSpaces are not in any package; |
|
602 |
"/ this might change. Then, 0-sized packages are |
|
603 |
"/ illegal, and the following should be enabled. |
|
604 |
"/ self halt |
|
605 |
]. |
|
606 |
cls isJavaClass ifFalse:[ |
|
607 |
cls instAndClassSelectorsAndMethodsDo:[:sel :mthd | |
|
608 |
|mpkg| |
|
609 |
||
610 |
mpkg := mthd package asSymbol. |
|
611 |
mpkg ~~ classPackage ifTrue:[ |
|
612 |
(allProjects includes:mpkg) ifFalse:[ |
|
613 |
addWithAllParentPackages value:mpkg. |
|
614 |
] |
|
615 |
]. |
|
6655 | 616 |
]. |
617 |
]. |
|
618 |
]. |
|
619 |
]. |
|
620 |
]. |
|
6960 | 621 |
allProjects := allProjects asOrderedCollection. |
5591 | 622 |
|
6655 | 623 |
"/ those are simulated - in ST/X, empty projects do not |
624 |
"/ really exist; however, during browsing, it makes sense. |
|
625 |
AdditionalEmptyProjects size > 0 ifTrue:[ |
|
626 |
"/ remove those that are present ... |
|
627 |
AdditionalEmptyProjects := AdditionalEmptyProjects select:[:pkg | (allProjects includes:pkg) not]. |
|
628 |
allProjects addAll:AdditionalEmptyProjects. |
|
629 |
]. |
|
5591 | 630 |
] ifFalse:[ |
6655 | 631 |
generator := inGeneratorHolder value. |
632 |
generator isNil ifTrue:[^ #() ]. |
|
633 |
generator do:[:prj | allProjects add:prj]. |
|
5591 | 634 |
]. |
6923 | 635 |
^ allProjects asOrderedCollection. |
7497 | 636 |
|
7590 | 637 |
"Modified: / 16-01-2007 / 15:56:16 / cg" |
6923 | 638 |
! |
639 |
||
640 |
defaultSlaveModeValue |
|
641 |
|mode| |
|
642 |
||
643 |
mode := self topApplication perform:#initialOrganizerMode ifNotUnderstood:nil. |
|
644 |
mode == OrganizerCanvas organizerModeProject ifTrue:[^ false]. |
|
645 |
mode isNil ifTrue:[^ false]. |
|
646 |
^ true |
|
647 |
! |
|
648 |
||
649 |
initialOrganizerMode |
|
650 |
^ OrganizerCanvas organizerModeProject |
|
651 |
! |
|
652 |
||
653 |
listOfProjects |
|
654 |
|allProjects| |
|
655 |
||
656 |
allProjects := self allShownProjects. |
|
5591 | 657 |
|
658 |
allProjects sort. |
|
659 |
allProjects size == 1 ifTrue:[ |
|
6655 | 660 |
"/ self projectLabelHolder value:(allProjects first , ' [Project]'). |
661 |
self projectLabelHolder value:(LabelAndIcon icon:(self class packageIcon) string:allProjects first). |
|
5591 | 662 |
]. |
663 |
allProjects size > 1 ifTrue:[ |
|
6655 | 664 |
allProjects addFirst:(self class nameListEntryForALL). |
5591 | 665 |
]. |
6907 | 666 |
|
5591 | 667 |
^ allProjects |
668 |
||
6907 | 669 |
"Created: / 17-02-2000 / 23:43:05 / cg" |
670 |
"Modified: / 17-08-2006 / 15:08:42 / cg" |
|
5591 | 671 |
! |
672 |
||
673 |
makeDependent |
|
6967 | 674 |
Smalltalk addDependent:self. |
675 |
ChangeSet addDependent:self. |
|
5591 | 676 |
! |
677 |
||
678 |
makeIndependent |
|
679 |
Smalltalk removeDependent:self. |
|
680 |
! |
|
681 |
||
6923 | 682 |
nameListFor:aProjectList |
683 |
" |
|
684 |
self basicNew |
|
6951 | 685 |
nameListFor:#( |
7060 | 686 |
'exept:expecco' |
687 |
'exept:expecco/application' |
|
688 |
'exept:procware' |
|
689 |
'exept:workflow' |
|
6923 | 690 |
) |
7590 | 691 |
|
692 |
self basicNew |
|
693 |
nameListFor:#( |
|
694 |
'exept' |
|
695 |
'exept:expecco' |
|
696 |
'exept:expecco/application' |
|
697 |
'exept:procware' |
|
698 |
'exept:workflow' |
|
699 |
) |
|
6923 | 700 |
" |
701 |
||
7338 | 702 |
|stack projectsWithExtensions projectsWithChangedCode packagesInChangeSet projectNameList| |
6923 | 703 |
|
704 |
stack := OrderedCollection new. |
|
705 |
||
6951 | 706 |
projectsWithExtensions := Set new. |
707 |
projectsWithChangedCode := Set new. |
|
708 |
||
7338 | 709 |
packagesInChangeSet := ChangeSet current changedPackages. |
6951 | 710 |
|
711 |
projectNameList := OrderedCollection new. |
|
712 |
aProjectList do:[:this | |
|
6923 | 713 |
|thisC entry rawEntry prefix indent| |
714 |
||
6965 | 715 |
this = self class nameListEntryForALL ifTrue:[ |
716 |
entry := this |
|
717 |
] ifFalse:[ |
|
718 |
thisC := this asCollectionOfSubstringsSeparatedByAny:':/'. |
|
719 |
thisC isEmpty ifTrue:[ |
|
6970 | 720 |
thisC := Array with:(Project noProjectID). |
6965 | 721 |
]. |
6923 | 722 |
|
6965 | 723 |
[ |
724 |
|stackTop| |
|
6923 | 725 |
|
6965 | 726 |
stack notEmpty |
727 |
and:[ |
|
728 |
stackTop := stack last. |
|
729 |
(thisC startsWith:stackTop) ifFalse:[ |
|
730 |
stack removeLast. |
|
731 |
true |
|
732 |
] ifTrue:[ |
|
733 |
false |
|
734 |
]] |
|
735 |
] whileTrue. |
|
736 |
prefix := stack notEmpty ifTrue:[ stack last ] ifFalse:[ #() ]. |
|
737 |
indent := stack size * 4. |
|
738 |
stack addLast:thisC. |
|
739 |
prefix isEmpty ifTrue:[ |
|
6970 | 740 |
rawEntry := thisC first. |
741 |
thisC size > 1 ifTrue:[ |
|
742 |
rawEntry := rawEntry , ':' , ((thisC copyFrom:2) asStringWith:$/). |
|
743 |
] |
|
6965 | 744 |
] ifFalse:[ |
745 |
rawEntry := (thisC copyFrom:prefix size+1) asStringWith:$/. |
|
746 |
]. |
|
747 |
||
7131 | 748 |
(packagesInChangeSet includes:this) ifTrue:[ |
7060 | 749 |
rawEntry := rawEntry , self class markForBeingInChangeList. |
6965 | 750 |
rawEntry := self colorizeForChangedCode:rawEntry. |
751 |
]. |
|
752 |
entry := (String new:indent) , rawEntry. |
|
6923 | 753 |
]. |
6951 | 754 |
projectNameList add:entry. |
6923 | 755 |
]. |
6951 | 756 |
^ projectNameList. |
6923 | 757 |
|
758 |
"Created: / 17-02-2000 / 23:43:05 / cg" |
|
7590 | 759 |
"Modified: / 16-01-2007 / 15:51:45 / cg" |
6923 | 760 |
! |
761 |
||
5591 | 762 |
release |
763 |
super release. |
|
764 |
||
765 |
projectList removeDependent:self. |
|
766 |
! |
|
767 |
||
768 |
updateList |
|
6923 | 769 |
|newList oldList newNameList oldNameList oldSelection newSelection selectedProjectsHolder| |
5591 | 770 |
|
771 |
selectedProjectsHolder := self selectedProjects. |
|
772 |
oldSelection := selectedProjectsHolder value. |
|
773 |
newList := self listOfProjects. |
|
6923 | 774 |
oldList := projectList value. |
775 |
newNameList := self nameListFor:newList. |
|
776 |
oldNameList := self projectNameList value. |
|
777 |
(newList ~= oldList |
|
778 |
or:[ newNameList ~= oldNameList]) ifTrue:[ |
|
5591 | 779 |
"/ oldSelection size > 0 ifTrue:[ |
780 |
"/ selectedProjectsHolder removeDependent:self. |
|
781 |
"/ selectedProjectsHolder value:#(). |
|
782 |
"/ selectedProjectsHolder addDependent:self. |
|
783 |
"/ ]. |
|
784 |
||
6923 | 785 |
self projectList value:newList. |
786 |
listValid := true. |
|
787 |
self projectNameList value:newNameList. |
|
5591 | 788 |
|
6923 | 789 |
oldSelection size > 0 ifTrue:[ |
790 |
newSelection := oldSelection select:[:prj | newList includes:prj]. |
|
791 |
selectedProjectsHolder value:newSelection. |
|
792 |
] |
|
5591 | 793 |
]. |
794 |
listValid := true. |
|
795 |
||
796 |
"Modified: / 25.2.2000 / 23:10:01 / cg" |
|
797 |
! ! |
|
798 |
||
799 |
!ProjectList methodsFor:'special'! |
|
800 |
||
801 |
addAdditionalProject:aProject |
|
6923 | 802 |
"/ those are simulated - in ST/X, empty projects do not |
5591 | 803 |
"/ really exist; however, during browsing, it makes sense. |
804 |
AdditionalEmptyProjects isNil ifTrue:[ |
|
6923 | 805 |
AdditionalEmptyProjects := Set new. |
5591 | 806 |
]. |
807 |
AdditionalEmptyProjects add:aProject. |
|
808 |
||
809 |
Smalltalk changed:#projectOrganization "/ not really ... to force update |
|
810 |
||
811 |
"Created: / 17.2.2000 / 23:44:27 / cg" |
|
812 |
! |
|
813 |
||
814 |
removeAdditionalProjects:aListOfProjects |
|
815 |
"/ those are simulated - in ST/X, empty categories do not |
|
816 |
"/ really exist; however, during browsing, it makes sense. |
|
817 |
AdditionalEmptyProjects notNil ifTrue:[ |
|
818 |
aListOfProjects do:[:eachProject | |
|
819 |
AdditionalEmptyProjects remove:eachProject ifAbsent:nil. |
|
820 |
]. |
|
821 |
]. |
|
822 |
Smalltalk changed:#projectOrganization "/ not really ... to force update |
|
823 |
||
824 |
"Created: / 17.2.2000 / 23:45:24 / cg" |
|
825 |
! ! |
|
826 |
||
827 |
!ProjectList class methodsFor:'documentation'! |
|
828 |
||
829 |
version |
|
7889 | 830 |
^ '$Header: /cvs/stx/stx/libtool/Tools_ProjectList.st,v 1.34 2007-11-07 17:20:03 mb Exp $' |
5591 | 831 |
! ! |