author | Claus Gittinger <cg@exept.de> |
Mon, 18 May 2009 16:12:49 +0200 | |
changeset 8632 | 3888dd1dc4db |
parent 8220 | 7ac29d123a95 |
child 8692 | 822f96803b57 |
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 |
||
8632 | 167 |
itemList |
168 |
^ self projectList value |
|
169 |
! |
|
170 |
||
5591 | 171 |
projectLabelHolder |
172 |
^ self pseudoListLabelHolder |
|
173 |
! |
|
174 |
||
175 |
projectList |
|
176 |
projectList isNil ifTrue:[ |
|
177 |
projectList := ValueHolder new. |
|
178 |
projectList addDependent:self. |
|
179 |
]. |
|
180 |
^ projectList |
|
181 |
||
182 |
"Created: / 17.2.2000 / 23:39:32 / cg" |
|
183 |
! |
|
184 |
||
6923 | 185 |
projectNameList |
186 |
projectNameList isNil ifTrue:[ |
|
187 |
projectNameList := ValueHolder new. |
|
188 |
"/ projectNameList addDependent:self. |
|
189 |
]. |
|
190 |
^ projectNameList |
|
191 |
||
192 |
"Created: / 17.2.2000 / 23:39:32 / cg" |
|
193 |
! |
|
194 |
||
5591 | 195 |
selectedProjects |
196 |
^ self selectionHolder |
|
197 |
||
198 |
"Created: / 17.2.2000 / 23:39:57 / cg" |
|
199 |
! |
|
200 |
||
201 |
selectedProjects:aValueHolder |
|
202 |
^ self selectionHolder:aValueHolder |
|
6923 | 203 |
! |
204 |
||
205 |
selectionIndexHolder |
|
206 |
selectionIndexHolder isNil ifTrue:[ |
|
207 |
selectionIndexHolder := 0 asValue. |
|
208 |
selectionIndexHolder addDependent:self. |
|
209 |
]. |
|
210 |
^ selectionIndexHolder |
|
211 |
||
212 |
"Created: / 17.2.2000 / 23:39:32 / cg" |
|
5591 | 213 |
! ! |
214 |
||
215 |
!ProjectList methodsFor:'change & update'! |
|
216 |
||
217 |
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
|
218 |
|cls sel pkg mthd newSel allIdx| |
5591 | 219 |
|
220 |
self inSlaveModeOrInvisible |
|
221 |
"/ (self slaveMode value == true) |
|
222 |
ifTrue:[ |
|
6923 | 223 |
(changedObject == Smalltalk |
224 |
or:[ something == #projectOrganization ]) ifTrue:[ |
|
225 |
listValid := false |
|
226 |
]. |
|
227 |
^ self |
|
228 |
]. |
|
229 |
||
230 |
changedObject == self selectionIndexHolder ifTrue:[ |
|
231 |
listValid ifFalse:[ |
|
232 |
self updateList. |
|
233 |
]. |
|
234 |
newSel := changedObject value collect:[:idx | projectList value at:idx]. |
|
235 |
newSel ~= self selectedProjects value ifTrue:[ |
|
236 |
self selectedProjects value:newSel. |
|
237 |
]. |
|
238 |
^ self. |
|
239 |
]. |
|
240 |
changedObject == self selectionHolder ifTrue:[ |
|
241 |
listValid == true ifFalse:[ |
|
242 |
self updateList. |
|
243 |
]. |
|
7423
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
244 |
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
|
245 |
newSel := changedObject value |
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
246 |
collect:[:val | |i| |
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
247 |
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
|
248 |
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
|
249 |
thenSelect:[:idx | idx ~~ 0]. |
6923 | 250 |
newSel ~= self selectionIndexHolder value ifTrue:[ |
251 |
self selectionIndexHolder value:newSel |
|
252 |
]. |
|
5591 | 253 |
]. |
254 |
||
255 |
changedObject == slaveMode ifTrue:[ |
|
6923 | 256 |
listValid ~~ true ifTrue:[ |
257 |
self enqueueDelayedUpdateList |
|
258 |
]. |
|
259 |
"/ self invalidateList. |
|
260 |
^ self |
|
5591 | 261 |
]. |
262 |
||
6923 | 263 |
changedObject == self projectList ifTrue:[ |
264 |
^ self |
|
265 |
]. |
|
5591 | 266 |
|
267 |
changedObject == Smalltalk ifTrue:[ |
|
6923 | 268 |
something == #projectOrganization ifTrue:[ |
269 |
self invalidateList. |
|
270 |
self enqueueDelayedUpdateOutputGenerator. |
|
271 |
^ self. |
|
272 |
]. |
|
273 |
something == #methodInClass ifTrue:[ |
|
274 |
listValid == true ifTrue:[ |
|
275 |
cls := aParameter at:1. |
|
276 |
sel := aParameter at:2. |
|
277 |
mthd := cls compiledMethodAt:sel. |
|
278 |
mthd notNil ifTrue:[ |
|
279 |
pkg := mthd package. |
|
280 |
(projectList value includes:pkg) ifFalse:[ |
|
281 |
self invalidateList. |
|
282 |
] |
|
283 |
]. |
|
284 |
]. |
|
285 |
^ self |
|
286 |
]. |
|
5591 | 287 |
|
6923 | 288 |
(something == #classDefinition |
289 |
or:[something == #newClass]) ifTrue:[ |
|
290 |
listValid == true ifTrue:[ |
|
291 |
cls := aParameter. |
|
292 |
pkg := cls package. |
|
293 |
(projectList value includes:pkg) ifFalse:[ |
|
294 |
self invalidateList. |
|
295 |
] ifTrue:[ |
|
296 |
self enqueueDelayedUpdateOutputGenerator |
|
297 |
]. |
|
298 |
] ifFalse:[ |
|
299 |
self invalidateList |
|
300 |
]. |
|
301 |
^ self |
|
302 |
]. |
|
303 |
(something == #classRemove) ifTrue:[ |
|
304 |
listValid == true ifTrue:[ |
|
305 |
cls := aParameter. |
|
306 |
pkg := cls package. |
|
307 |
]. |
|
308 |
]. |
|
309 |
^ self |
|
5591 | 310 |
]. |
311 |
||
312 |
"/ something == #projectOrganization ifTrue:[ |
|
313 |
"/ aParameter isSymbol ifTrue:[ |
|
314 |
"/ "/ a single method has changed |
|
315 |
"/"/ sel := aParameter. |
|
316 |
"/"/ mthd := changedObject compiledMethodAt:sel. |
|
317 |
"/ self enqueueDelayedUpdateOutputGenerator. |
|
318 |
"/ ]. |
|
319 |
"/ ^ self |
|
320 |
"/ ]. |
|
321 |
||
6966 | 322 |
changedObject == ChangeSet ifTrue:[ |
323 |
self invalidateList. |
|
324 |
^ self |
|
325 |
]. |
|
326 |
||
5591 | 327 |
(organizerMode notNil |
328 |
and:[organizerMode value ~~ #project]) ifTrue:[ |
|
6923 | 329 |
self invalidateList. |
330 |
^ self |
|
5591 | 331 |
]. |
332 |
super delayedUpdate:something with:aParameter from:changedObject |
|
333 |
||
7423
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
334 |
"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
|
335 |
"Modified: / 17-10-2006 / 18:43:40 / cg" |
5591 | 336 |
! |
337 |
||
338 |
selectionChangedByClick |
|
339 |
"we are not interested in that - get another notification |
|
340 |
via the changed valueHolder" |
|
341 |
||
342 |
"Created: / 17.2.2000 / 23:41:17 / cg" |
|
343 |
! |
|
344 |
||
345 |
update:something with:aParameter from:changedObject |
|
8220 | 346 |
self window topView realized ifFalse:[ |
347 |
self makeIndependent |
|
348 |
]. |
|
5591 | 349 |
changedObject == Smalltalk ifTrue:[ |
6923 | 350 |
something == #methodDictionary ifTrue:[ |
351 |
^ self |
|
352 |
]. |
|
353 |
something == #methodTrap ifTrue:[ |
|
354 |
^ self |
|
355 |
]. |
|
356 |
something == #methodInClass ifTrue:[ |
|
357 |
^ self |
|
358 |
]. |
|
359 |
something == #classVariables ifTrue:[ |
|
360 |
^ self |
|
361 |
]. |
|
362 |
something == #classComment ifTrue:[ |
|
363 |
^ self. |
|
364 |
]. |
|
365 |
something == #methodInClassRemoved ifTrue:[ |
|
366 |
^ self. |
|
367 |
]. |
|
5591 | 368 |
]. |
369 |
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
|
370 |
|
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
371 |
"Modified: / 17-10-2006 / 18:40:17 / cg" |
5591 | 372 |
! ! |
373 |
||
374 |
!ProjectList methodsFor:'drag & drop'! |
|
375 |
||
6468 | 376 |
canDropContext:aDropContext |
7423
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
377 |
|objects package| |
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
378 |
|
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
379 |
objects := aDropContext dropObjects collect:[:obj | obj theObject]. |
5591 | 380 |
|
7423
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
381 |
(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
|
382 |
|
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
383 |
(objects conform:[:aMethodOrClass | (aMethodOrClass isMethod or:[aMethodOrClass isClass]) ]) ifFalse:[^ false]. |
5591 | 384 |
|
385 |
package := self packageAtTargetPointOf:aDropContext. |
|
386 |
package isNil ifTrue:[^ false]. |
|
387 |
||
7423
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
388 |
(objects contains:[:aMethodOrClass | aMethodOrClass package ~= package]) ifFalse:[^ false]. |
5591 | 389 |
^ true |
7120 | 390 |
|
7423
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
391 |
"Modified: / 17-10-2006 / 18:30:32 / cg" |
5591 | 392 |
! |
393 |
||
6468 | 394 |
doDropContext:aDropContext |
7423
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
395 |
|package objects methods classes| |
5591 | 396 |
|
7423
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
397 |
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
|
398 |
(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
|
399 |
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
|
400 |
classes := objects select:[:something | something isClass]. |
5591 | 401 |
|
7423
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
402 |
package := self packageAtTargetPointOf:aDropContext. |
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
403 |
package notNil ifTrue:[ |
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
404 |
methods notEmpty ifTrue:[ |
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
405 |
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
|
406 |
]. |
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
407 |
classes notEmpty ifTrue:[ |
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
408 |
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
|
409 |
] |
6468 | 410 |
]. |
7423
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
411 |
^ self |
5591 | 412 |
]. |
7120 | 413 |
|
7423
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
414 |
(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
|
415 |
|p| |
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
416 |
|
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
417 |
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
|
418 |
|
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
419 |
Class packageQuerySignal answer:p |
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
420 |
do:[ |
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
421 |
self dropClassFiles:objects. |
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 |
^ self |
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
424 |
]. |
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
425 |
|
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
426 |
"Modified: / 17-10-2006 / 18:34:43 / cg" |
5591 | 427 |
! |
428 |
||
429 |
packageAtTargetPointOf:aDropContext |
|
430 |
|p packageListView lineNr item package dropInfo now |
|
431 |
overItem timeOverItem| |
|
432 |
||
433 |
p := aDropContext targetPoint. |
|
434 |
||
435 |
packageListView := aDropContext targetWidget. |
|
436 |
||
437 |
dropInfo := aDropContext dropInfo. |
|
438 |
||
439 |
lineNr := packageListView yVisibleToLineNr:p y. |
|
440 |
lineNr isNil ifTrue:[^ nil]. |
|
441 |
||
7525
a37f9b951ff6
package at drop-point fix (care for spaces and other decoration)
Claus Gittinger <cg@exept.de>
parents:
7497
diff
changeset
|
442 |
item := projectList value at:lineNr. |
5591 | 443 |
item isNil ifTrue:[^ nil]. |
7325
4e26cc5f9f21
oops - care for old (non-tree) project list handling
Claus Gittinger <cg@exept.de>
parents:
7131
diff
changeset
|
444 |
item isString ifTrue:[^ item asSymbol]. |
5591 | 445 |
|
446 |
item canExpand ifTrue:[ |
|
5782
ae4720e83b49
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
5592
diff
changeset
|
447 |
now := Timestamp now. |
8138 | 448 |
overItem := dropInfo at:#overItem ifAbsentPut:item. |
5782
ae4720e83b49
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
5592
diff
changeset
|
449 |
timeOverItem := dropInfo at:#timeOverItem ifAbsentPut:[now]. |
5591 | 450 |
|
5782
ae4720e83b49
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
5592
diff
changeset
|
451 |
overItem ~~ item ifTrue:[ |
ae4720e83b49
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
5592
diff
changeset
|
452 |
dropInfo at:#timeOverItem put:now. |
ae4720e83b49
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
5592
diff
changeset
|
453 |
dropInfo at:#overItem put:item. |
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 |
] ifFalse:[ |
ae4720e83b49
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
5592
diff
changeset
|
456 |
(now millisecondDeltaFrom:timeOverItem) >= (UserPreferences current timeToAutoExpandItemsWhenDraggingOver) ifTrue:[ |
ae4720e83b49
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
5592
diff
changeset
|
457 |
aDropContext saveDraw:[ item expand. packageListView repairDamage ]. |
ae4720e83b49
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
5592
diff
changeset
|
458 |
dropInfo removeKey:#timeOverItem. |
ae4720e83b49
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
5592
diff
changeset
|
459 |
dropInfo removeKey:#overItem. |
ae4720e83b49
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
5592
diff
changeset
|
460 |
] ifFalse:[ |
ae4720e83b49
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
5592
diff
changeset
|
461 |
aDropContext passiveAction:[ self packageAtTargetPointOf:aDropContext ]. |
ae4720e83b49
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
5592
diff
changeset
|
462 |
] |
ae4720e83b49
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
5592
diff
changeset
|
463 |
]. |
5591 | 464 |
]. |
465 |
||
466 |
package := item package. |
|
467 |
package = self class nameListEntryForALL ifTrue:[^ nil]. |
|
468 |
^ package. |
|
7325
4e26cc5f9f21
oops - care for old (non-tree) project list handling
Claus Gittinger <cg@exept.de>
parents:
7131
diff
changeset
|
469 |
|
7525
a37f9b951ff6
package at drop-point fix (care for spaces and other decoration)
Claus Gittinger <cg@exept.de>
parents:
7497
diff
changeset
|
470 |
"Modified: / 18-11-2006 / 16:13:47 / cg" |
5591 | 471 |
! ! |
472 |
||
473 |
!ProjectList methodsFor:'generators'! |
|
474 |
||
475 |
makeGenerator |
|
476 |
"return a generator which enumerates the classes from the selected project(s)." |
|
477 |
||
478 |
|selectedPackages thePackage hideUnloadedClasses| |
|
479 |
||
480 |
selectedPackages := self selectedProjects value. |
|
481 |
selectedPackages size == 0 ifTrue:[ |
|
6894 | 482 |
^ #() |
5591 | 483 |
]. |
6907 | 484 |
selectedPackages := selectedPackages collect:[:p | p string withoutSeparators]. |
5591 | 485 |
|
486 |
hideUnloadedClasses := self hideUnloadedClasses value. |
|
487 |
||
488 |
(selectedPackages includes:(self class nameListEntryForALL)) ifTrue:[ |
|
6894 | 489 |
hideUnloadedClasses ifTrue:[ |
490 |
^ Iterator on:[:whatToDo | |
|
491 |
Smalltalk allClassesDo:[:cls | |
|
492 |
cls isLoaded ifTrue:[ |
|
7497 | 493 |
(cls isRealNameSpace not) ifTrue:[ |
6894 | 494 |
whatToDo value:cls |
495 |
] |
|
496 |
] |
|
497 |
] |
|
498 |
] |
|
499 |
]. |
|
500 |
^ Iterator on:[:whatToDo | |
|
501 |
Smalltalk allClassesDo:[:cls | |
|
7497 | 502 |
(cls isRealNameSpace not) ifTrue:[ |
6894 | 503 |
whatToDo value:cls |
504 |
] |
|
505 |
] |
|
506 |
] |
|
5591 | 507 |
]. |
508 |
||
509 |
selectedPackages size == 1 ifTrue:[ |
|
6894 | 510 |
"/ faster common case |
511 |
thePackage := selectedPackages first. |
|
5591 | 512 |
|
6894 | 513 |
^ Iterator on:[:whatToDo | |doInclude| |
514 |
Smalltalk allClassesDo:[:cls | |
|
515 |
(hideUnloadedClasses not or:[cls isLoaded]) |
|
516 |
ifTrue:[ |
|
7497 | 517 |
(cls isRealNameSpace not) ifTrue:[ |
6894 | 518 |
doInclude := (thePackage = cls package). |
519 |
doInclude ifFalse:[ |
|
520 |
cls isJavaClass ifFalse:[ |
|
521 |
doInclude := (cls methodDictionary contains:[:mthd | thePackage = mthd package]) |
|
522 |
or:[ cls class methodDictionary contains:[:mthd | thePackage = mthd package]]. |
|
523 |
] |
|
524 |
]. |
|
525 |
doInclude ifTrue:[ |
|
526 |
whatToDo value:cls |
|
527 |
] |
|
528 |
] |
|
529 |
] |
|
530 |
] |
|
531 |
] |
|
5591 | 532 |
]. |
533 |
||
534 |
^ Iterator on:[:whatToDo | |doInclude| |
|
6894 | 535 |
Smalltalk allClassesDo:[:cls | |
536 |
(hideUnloadedClasses not or:[cls isLoaded]) |
|
537 |
ifTrue:[ |
|
7497 | 538 |
(cls isRealNameSpace not) ifTrue:[ |
6894 | 539 |
doInclude := (selectedPackages includes:cls package). |
540 |
doInclude ifFalse:[ |
|
541 |
cls isJavaClass ifFalse:[ |
|
542 |
doInclude := (cls methodDictionary contains:[:mthd | selectedPackages includes:mthd package]) |
|
543 |
or:[ cls class methodDictionary contains:[:mthd | selectedPackages includes:mthd package]]. |
|
544 |
] |
|
545 |
]. |
|
546 |
doInclude ifTrue:[ |
|
547 |
whatToDo value:cls |
|
548 |
] |
|
549 |
] |
|
550 |
] |
|
551 |
] |
|
552 |
] |
|
5591 | 553 |
|
6894 | 554 |
"Created: / 17-02-2000 / 23:49:37 / cg" |
7497 | 555 |
"Modified: / 10-11-2006 / 17:15:15 / cg" |
5591 | 556 |
! ! |
557 |
||
558 |
!ProjectList methodsFor:'private'! |
|
559 |
||
6923 | 560 |
allShownProjects |
7590 | 561 |
|hideUnloaded allProjects generator addWithAllParentPackages hideModules| |
562 |
||
563 |
hideModules := HideModules ? true. |
|
564 |
hideModules := HideModules ? false. |
|
5591 | 565 |
|
566 |
allProjects := IdentitySet new. |
|
567 |
||
568 |
inGeneratorHolder isNil ifTrue:[ |
|
6960 | 569 |
hideUnloaded := self hideUnloadedClasses value. |
570 |
||
571 |
addWithAllParentPackages := |
|
572 |
[:package | |
|
7590 | 573 |
|p parent module| |
5591 | 574 |
|
6960 | 575 |
(allProjects includes:package) ifFalse:[ |
576 |
allProjects add:package. |
|
7889 | 577 |
(package ~= Project noProjectID |
578 |
and:[package ~= #private]) ifTrue:[ |
|
7552 | 579 |
p := package asPackageId. |
580 |
[(parent := p parentPackage) notNil] whileTrue:[ |
|
581 |
allProjects add:parent asSymbol. |
|
582 |
p := parent. |
|
583 |
]. |
|
7590 | 584 |
hideModules ifFalse:[ |
585 |
(module := p module) notNil ifTrue:[ |
|
586 |
allProjects add:module asSymbol. |
|
587 |
]. |
|
588 |
]. |
|
6655 | 589 |
]. |
6960 | 590 |
]. |
591 |
]. |
|
592 |
||
593 |
Smalltalk allClassesDo:[:eachClass | |
|
594 |
|cls pkg p classPackage| |
|
595 |
||
7497 | 596 |
(eachClass isRealNameSpace not) ifTrue:[ |
6965 | 597 |
|
598 |
(hideUnloaded not or:[eachClass isLoaded]) ifTrue:[ |
|
599 |
cls := eachClass theNonMetaclass. |
|
600 |
cls isPrivate ifTrue:[ |
|
601 |
cls := cls topOwningClass |
|
602 |
]. |
|
6960 | 603 |
|
6970 | 604 |
classPackage := cls package ? (Project noProjectID). |
6965 | 605 |
classPackage size > 0 ifTrue:[ |
606 |
addWithAllParentPackages value:classPackage asSymbol. |
|
607 |
] ifFalse:[ |
|
608 |
"/ for now, nameSpaces are not in any package; |
|
609 |
"/ this might change. Then, 0-sized packages are |
|
610 |
"/ illegal, and the following should be enabled. |
|
611 |
"/ self halt |
|
612 |
]. |
|
613 |
cls isJavaClass ifFalse:[ |
|
614 |
cls instAndClassSelectorsAndMethodsDo:[:sel :mthd | |
|
615 |
|mpkg| |
|
616 |
||
617 |
mpkg := mthd package asSymbol. |
|
618 |
mpkg ~~ classPackage ifTrue:[ |
|
619 |
(allProjects includes:mpkg) ifFalse:[ |
|
620 |
addWithAllParentPackages value:mpkg. |
|
621 |
] |
|
622 |
]. |
|
6655 | 623 |
]. |
624 |
]. |
|
625 |
]. |
|
626 |
]. |
|
627 |
]. |
|
6960 | 628 |
allProjects := allProjects asOrderedCollection. |
5591 | 629 |
|
6655 | 630 |
"/ those are simulated - in ST/X, empty projects do not |
631 |
"/ really exist; however, during browsing, it makes sense. |
|
632 |
AdditionalEmptyProjects size > 0 ifTrue:[ |
|
633 |
"/ remove those that are present ... |
|
634 |
AdditionalEmptyProjects := AdditionalEmptyProjects select:[:pkg | (allProjects includes:pkg) not]. |
|
635 |
allProjects addAll:AdditionalEmptyProjects. |
|
636 |
]. |
|
5591 | 637 |
] ifFalse:[ |
6655 | 638 |
generator := inGeneratorHolder value. |
639 |
generator isNil ifTrue:[^ #() ]. |
|
640 |
generator do:[:prj | allProjects add:prj]. |
|
5591 | 641 |
]. |
6923 | 642 |
^ allProjects asOrderedCollection. |
7497 | 643 |
|
7590 | 644 |
"Modified: / 16-01-2007 / 15:56:16 / cg" |
6923 | 645 |
! |
646 |
||
647 |
defaultSlaveModeValue |
|
648 |
|mode| |
|
649 |
||
650 |
mode := self topApplication perform:#initialOrganizerMode ifNotUnderstood:nil. |
|
651 |
mode == OrganizerCanvas organizerModeProject ifTrue:[^ false]. |
|
652 |
mode isNil ifTrue:[^ false]. |
|
653 |
^ true |
|
654 |
! |
|
655 |
||
656 |
initialOrganizerMode |
|
657 |
^ OrganizerCanvas organizerModeProject |
|
658 |
! |
|
659 |
||
660 |
listOfProjects |
|
661 |
|allProjects| |
|
662 |
||
663 |
allProjects := self allShownProjects. |
|
5591 | 664 |
|
665 |
allProjects sort. |
|
666 |
allProjects size == 1 ifTrue:[ |
|
6655 | 667 |
"/ self projectLabelHolder value:(allProjects first , ' [Project]'). |
668 |
self projectLabelHolder value:(LabelAndIcon icon:(self class packageIcon) string:allProjects first). |
|
5591 | 669 |
]. |
670 |
allProjects size > 1 ifTrue:[ |
|
6655 | 671 |
allProjects addFirst:(self class nameListEntryForALL). |
5591 | 672 |
]. |
6907 | 673 |
|
5591 | 674 |
^ allProjects |
675 |
||
6907 | 676 |
"Created: / 17-02-2000 / 23:43:05 / cg" |
677 |
"Modified: / 17-08-2006 / 15:08:42 / cg" |
|
5591 | 678 |
! |
679 |
||
680 |
makeDependent |
|
6967 | 681 |
Smalltalk addDependent:self. |
682 |
ChangeSet addDependent:self. |
|
5591 | 683 |
! |
684 |
||
685 |
makeIndependent |
|
686 |
Smalltalk removeDependent:self. |
|
8220 | 687 |
ChangeSet removeDependent:self. |
5591 | 688 |
! |
689 |
||
6923 | 690 |
nameListFor:aProjectList |
691 |
" |
|
692 |
self basicNew |
|
6951 | 693 |
nameListFor:#( |
7060 | 694 |
'exept:expecco' |
695 |
'exept:expecco/application' |
|
696 |
'exept:procware' |
|
697 |
'exept:workflow' |
|
6923 | 698 |
) |
7590 | 699 |
|
700 |
self basicNew |
|
701 |
nameListFor:#( |
|
702 |
'exept' |
|
703 |
'exept:expecco' |
|
704 |
'exept:expecco/application' |
|
705 |
'exept:procware' |
|
706 |
'exept:workflow' |
|
707 |
) |
|
6923 | 708 |
" |
709 |
||
7338 | 710 |
|stack projectsWithExtensions projectsWithChangedCode packagesInChangeSet projectNameList| |
6923 | 711 |
|
712 |
stack := OrderedCollection new. |
|
713 |
||
6951 | 714 |
projectsWithExtensions := Set new. |
715 |
projectsWithChangedCode := Set new. |
|
716 |
||
7338 | 717 |
packagesInChangeSet := ChangeSet current changedPackages. |
6951 | 718 |
|
719 |
projectNameList := OrderedCollection new. |
|
720 |
aProjectList do:[:this | |
|
6923 | 721 |
|thisC entry rawEntry prefix indent| |
722 |
||
6965 | 723 |
this = self class nameListEntryForALL ifTrue:[ |
724 |
entry := this |
|
725 |
] ifFalse:[ |
|
726 |
thisC := this asCollectionOfSubstringsSeparatedByAny:':/'. |
|
727 |
thisC isEmpty ifTrue:[ |
|
6970 | 728 |
thisC := Array with:(Project noProjectID). |
6965 | 729 |
]. |
6923 | 730 |
|
6965 | 731 |
[ |
732 |
|stackTop| |
|
6923 | 733 |
|
6965 | 734 |
stack notEmpty |
735 |
and:[ |
|
736 |
stackTop := stack last. |
|
737 |
(thisC startsWith:stackTop) ifFalse:[ |
|
738 |
stack removeLast. |
|
739 |
true |
|
740 |
] ifTrue:[ |
|
741 |
false |
|
742 |
]] |
|
743 |
] whileTrue. |
|
744 |
prefix := stack notEmpty ifTrue:[ stack last ] ifFalse:[ #() ]. |
|
745 |
indent := stack size * 4. |
|
746 |
stack addLast:thisC. |
|
747 |
prefix isEmpty ifTrue:[ |
|
6970 | 748 |
rawEntry := thisC first. |
749 |
thisC size > 1 ifTrue:[ |
|
750 |
rawEntry := rawEntry , ':' , ((thisC copyFrom:2) asStringWith:$/). |
|
751 |
] |
|
6965 | 752 |
] ifFalse:[ |
753 |
rawEntry := (thisC copyFrom:prefix size+1) asStringWith:$/. |
|
754 |
]. |
|
755 |
||
7131 | 756 |
(packagesInChangeSet includes:this) ifTrue:[ |
7060 | 757 |
rawEntry := rawEntry , self class markForBeingInChangeList. |
6965 | 758 |
rawEntry := self colorizeForChangedCode:rawEntry. |
759 |
]. |
|
760 |
entry := (String new:indent) , rawEntry. |
|
6923 | 761 |
]. |
6951 | 762 |
projectNameList add:entry. |
6923 | 763 |
]. |
6951 | 764 |
^ projectNameList. |
6923 | 765 |
|
766 |
"Created: / 17-02-2000 / 23:43:05 / cg" |
|
7590 | 767 |
"Modified: / 16-01-2007 / 15:51:45 / cg" |
6923 | 768 |
! |
769 |
||
5591 | 770 |
release |
771 |
super release. |
|
772 |
||
773 |
projectList removeDependent:self. |
|
774 |
! |
|
775 |
||
776 |
updateList |
|
6923 | 777 |
|newList oldList newNameList oldNameList oldSelection newSelection selectedProjectsHolder| |
5591 | 778 |
|
779 |
selectedProjectsHolder := self selectedProjects. |
|
780 |
oldSelection := selectedProjectsHolder value. |
|
781 |
newList := self listOfProjects. |
|
6923 | 782 |
oldList := projectList value. |
783 |
newNameList := self nameListFor:newList. |
|
784 |
oldNameList := self projectNameList value. |
|
785 |
(newList ~= oldList |
|
786 |
or:[ newNameList ~= oldNameList]) ifTrue:[ |
|
5591 | 787 |
"/ oldSelection size > 0 ifTrue:[ |
788 |
"/ selectedProjectsHolder removeDependent:self. |
|
789 |
"/ selectedProjectsHolder value:#(). |
|
790 |
"/ selectedProjectsHolder addDependent:self. |
|
791 |
"/ ]. |
|
792 |
||
6923 | 793 |
self projectList value:newList. |
794 |
listValid := true. |
|
795 |
self projectNameList value:newNameList. |
|
5591 | 796 |
|
6923 | 797 |
oldSelection size > 0 ifTrue:[ |
798 |
newSelection := oldSelection select:[:prj | newList includes:prj]. |
|
799 |
selectedProjectsHolder value:newSelection. |
|
800 |
] |
|
5591 | 801 |
]. |
802 |
listValid := true. |
|
803 |
||
804 |
"Modified: / 25.2.2000 / 23:10:01 / cg" |
|
805 |
! ! |
|
806 |
||
807 |
!ProjectList methodsFor:'special'! |
|
808 |
||
809 |
addAdditionalProject:aProject |
|
6923 | 810 |
"/ those are simulated - in ST/X, empty projects do not |
5591 | 811 |
"/ really exist; however, during browsing, it makes sense. |
812 |
AdditionalEmptyProjects isNil ifTrue:[ |
|
6923 | 813 |
AdditionalEmptyProjects := Set new. |
5591 | 814 |
]. |
815 |
AdditionalEmptyProjects add:aProject. |
|
816 |
||
817 |
Smalltalk changed:#projectOrganization "/ not really ... to force update |
|
818 |
||
819 |
"Created: / 17.2.2000 / 23:44:27 / cg" |
|
820 |
! |
|
821 |
||
822 |
removeAdditionalProjects:aListOfProjects |
|
823 |
"/ those are simulated - in ST/X, empty categories do not |
|
824 |
"/ really exist; however, during browsing, it makes sense. |
|
825 |
AdditionalEmptyProjects notNil ifTrue:[ |
|
826 |
aListOfProjects do:[:eachProject | |
|
827 |
AdditionalEmptyProjects remove:eachProject ifAbsent:nil. |
|
828 |
]. |
|
829 |
]. |
|
830 |
Smalltalk changed:#projectOrganization "/ not really ... to force update |
|
831 |
||
832 |
"Created: / 17.2.2000 / 23:45:24 / cg" |
|
833 |
! ! |
|
834 |
||
835 |
!ProjectList class methodsFor:'documentation'! |
|
836 |
||
837 |
version |
|
8632 | 838 |
^ '$Header: /cvs/stx/stx/libtool/Tools_ProjectList.st,v 1.37 2009-05-18 14:12:49 cg Exp $' |
5591 | 839 |
! ! |