author | Claus Gittinger <cg@exept.de> |
Sat, 01 Nov 2008 22:10:08 +0100 | |
changeset 8396 | 1bda666dc0e9 |
parent 8220 | 7ac29d123a95 |
child 8632 | 3888dd1dc4db |
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 |
|
8220 | 342 |
self window topView realized ifFalse:[ |
343 |
self makeIndependent |
|
344 |
]. |
|
5591 | 345 |
changedObject == Smalltalk ifTrue:[ |
6923 | 346 |
something == #methodDictionary ifTrue:[ |
347 |
^ self |
|
348 |
]. |
|
349 |
something == #methodTrap ifTrue:[ |
|
350 |
^ self |
|
351 |
]. |
|
352 |
something == #methodInClass ifTrue:[ |
|
353 |
^ self |
|
354 |
]. |
|
355 |
something == #classVariables ifTrue:[ |
|
356 |
^ self |
|
357 |
]. |
|
358 |
something == #classComment ifTrue:[ |
|
359 |
^ self. |
|
360 |
]. |
|
361 |
something == #methodInClassRemoved ifTrue:[ |
|
362 |
^ self. |
|
363 |
]. |
|
5591 | 364 |
]. |
365 |
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
|
366 |
|
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
367 |
"Modified: / 17-10-2006 / 18:40:17 / cg" |
5591 | 368 |
! ! |
369 |
||
370 |
!ProjectList methodsFor:'drag & drop'! |
|
371 |
||
6468 | 372 |
canDropContext:aDropContext |
7423
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
373 |
|objects package| |
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
374 |
|
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
375 |
objects := aDropContext dropObjects collect:[:obj | obj theObject]. |
5591 | 376 |
|
7423
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
377 |
(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
|
378 |
|
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
379 |
(objects conform:[:aMethodOrClass | (aMethodOrClass isMethod or:[aMethodOrClass isClass]) ]) ifFalse:[^ false]. |
5591 | 380 |
|
381 |
package := self packageAtTargetPointOf:aDropContext. |
|
382 |
package isNil ifTrue:[^ false]. |
|
383 |
||
7423
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
384 |
(objects contains:[:aMethodOrClass | aMethodOrClass package ~= package]) ifFalse:[^ false]. |
5591 | 385 |
^ true |
7120 | 386 |
|
7423
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
387 |
"Modified: / 17-10-2006 / 18:30:32 / cg" |
5591 | 388 |
! |
389 |
||
6468 | 390 |
doDropContext:aDropContext |
7423
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
391 |
|package objects methods classes| |
5591 | 392 |
|
7423
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
393 |
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
|
394 |
(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
|
395 |
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
|
396 |
classes := objects select:[:something | something isClass]. |
5591 | 397 |
|
7423
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
398 |
package := self packageAtTargetPointOf:aDropContext. |
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
399 |
package notNil ifTrue:[ |
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
400 |
methods 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 moveMethods:methods toProject:package. |
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
402 |
]. |
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
403 |
classes notEmpty ifTrue:[ |
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
404 |
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
|
405 |
] |
6468 | 406 |
]. |
7423
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
407 |
^ self |
5591 | 408 |
]. |
7120 | 409 |
|
7423
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
410 |
(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
|
411 |
|p| |
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
412 |
|
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
413 |
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
|
414 |
|
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
415 |
Class packageQuerySignal answer:p |
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
416 |
do:[ |
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
417 |
self dropClassFiles:objects. |
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 |
^ self |
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
420 |
]. |
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
421 |
|
e92bcc3c8e0e
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7338
diff
changeset
|
422 |
"Modified: / 17-10-2006 / 18:34:43 / cg" |
5591 | 423 |
! |
424 |
||
425 |
packageAtTargetPointOf:aDropContext |
|
426 |
|p packageListView lineNr item package dropInfo now |
|
427 |
overItem timeOverItem| |
|
428 |
||
429 |
p := aDropContext targetPoint. |
|
430 |
||
431 |
packageListView := aDropContext targetWidget. |
|
432 |
||
433 |
dropInfo := aDropContext dropInfo. |
|
434 |
||
435 |
lineNr := packageListView yVisibleToLineNr:p y. |
|
436 |
lineNr isNil ifTrue:[^ nil]. |
|
437 |
||
7525
a37f9b951ff6
package at drop-point fix (care for spaces and other decoration)
Claus Gittinger <cg@exept.de>
parents:
7497
diff
changeset
|
438 |
item := projectList value at:lineNr. |
5591 | 439 |
item isNil ifTrue:[^ nil]. |
7325
4e26cc5f9f21
oops - care for old (non-tree) project list handling
Claus Gittinger <cg@exept.de>
parents:
7131
diff
changeset
|
440 |
item isString ifTrue:[^ item asSymbol]. |
5591 | 441 |
|
442 |
item canExpand ifTrue:[ |
|
5782
ae4720e83b49
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
5592
diff
changeset
|
443 |
now := Timestamp now. |
8138 | 444 |
overItem := dropInfo at:#overItem ifAbsentPut:item. |
5782
ae4720e83b49
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
5592
diff
changeset
|
445 |
timeOverItem := dropInfo at:#timeOverItem ifAbsentPut:[now]. |
5591 | 446 |
|
5782
ae4720e83b49
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
5592
diff
changeset
|
447 |
overItem ~~ item ifTrue:[ |
ae4720e83b49
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
5592
diff
changeset
|
448 |
dropInfo at:#timeOverItem put:now. |
ae4720e83b49
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
5592
diff
changeset
|
449 |
dropInfo at:#overItem put:item. |
ae4720e83b49
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
5592
diff
changeset
|
450 |
aDropContext passiveAction:[ self packageAtTargetPointOf:aDropContext ]. |
ae4720e83b49
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
5592
diff
changeset
|
451 |
] ifFalse:[ |
ae4720e83b49
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
5592
diff
changeset
|
452 |
(now millisecondDeltaFrom:timeOverItem) >= (UserPreferences current timeToAutoExpandItemsWhenDraggingOver) ifTrue:[ |
ae4720e83b49
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
5592
diff
changeset
|
453 |
aDropContext saveDraw:[ item expand. packageListView repairDamage ]. |
ae4720e83b49
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
5592
diff
changeset
|
454 |
dropInfo removeKey:#timeOverItem. |
ae4720e83b49
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
5592
diff
changeset
|
455 |
dropInfo removeKey:#overItem. |
ae4720e83b49
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
5592
diff
changeset
|
456 |
] ifFalse:[ |
ae4720e83b49
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
5592
diff
changeset
|
457 |
aDropContext passiveAction:[ self packageAtTargetPointOf:aDropContext ]. |
ae4720e83b49
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
5592
diff
changeset
|
458 |
] |
ae4720e83b49
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
5592
diff
changeset
|
459 |
]. |
5591 | 460 |
]. |
461 |
||
462 |
package := item package. |
|
463 |
package = self class nameListEntryForALL ifTrue:[^ nil]. |
|
464 |
^ package. |
|
7325
4e26cc5f9f21
oops - care for old (non-tree) project list handling
Claus Gittinger <cg@exept.de>
parents:
7131
diff
changeset
|
465 |
|
7525
a37f9b951ff6
package at drop-point fix (care for spaces and other decoration)
Claus Gittinger <cg@exept.de>
parents:
7497
diff
changeset
|
466 |
"Modified: / 18-11-2006 / 16:13:47 / cg" |
5591 | 467 |
! ! |
468 |
||
469 |
!ProjectList methodsFor:'generators'! |
|
470 |
||
471 |
makeGenerator |
|
472 |
"return a generator which enumerates the classes from the selected project(s)." |
|
473 |
||
474 |
|selectedPackages thePackage hideUnloadedClasses| |
|
475 |
||
476 |
selectedPackages := self selectedProjects value. |
|
477 |
selectedPackages size == 0 ifTrue:[ |
|
6894 | 478 |
^ #() |
5591 | 479 |
]. |
6907 | 480 |
selectedPackages := selectedPackages collect:[:p | p string withoutSeparators]. |
5591 | 481 |
|
482 |
hideUnloadedClasses := self hideUnloadedClasses value. |
|
483 |
||
484 |
(selectedPackages includes:(self class nameListEntryForALL)) ifTrue:[ |
|
6894 | 485 |
hideUnloadedClasses ifTrue:[ |
486 |
^ Iterator on:[:whatToDo | |
|
487 |
Smalltalk allClassesDo:[:cls | |
|
488 |
cls isLoaded ifTrue:[ |
|
7497 | 489 |
(cls isRealNameSpace not) ifTrue:[ |
6894 | 490 |
whatToDo value:cls |
491 |
] |
|
492 |
] |
|
493 |
] |
|
494 |
] |
|
495 |
]. |
|
496 |
^ Iterator on:[:whatToDo | |
|
497 |
Smalltalk allClassesDo:[:cls | |
|
7497 | 498 |
(cls isRealNameSpace not) ifTrue:[ |
6894 | 499 |
whatToDo value:cls |
500 |
] |
|
501 |
] |
|
502 |
] |
|
5591 | 503 |
]. |
504 |
||
505 |
selectedPackages size == 1 ifTrue:[ |
|
6894 | 506 |
"/ faster common case |
507 |
thePackage := selectedPackages first. |
|
5591 | 508 |
|
6894 | 509 |
^ Iterator on:[:whatToDo | |doInclude| |
510 |
Smalltalk allClassesDo:[:cls | |
|
511 |
(hideUnloadedClasses not or:[cls isLoaded]) |
|
512 |
ifTrue:[ |
|
7497 | 513 |
(cls isRealNameSpace not) ifTrue:[ |
6894 | 514 |
doInclude := (thePackage = cls package). |
515 |
doInclude ifFalse:[ |
|
516 |
cls isJavaClass ifFalse:[ |
|
517 |
doInclude := (cls methodDictionary contains:[:mthd | thePackage = mthd package]) |
|
518 |
or:[ cls class methodDictionary contains:[:mthd | thePackage = mthd package]]. |
|
519 |
] |
|
520 |
]. |
|
521 |
doInclude ifTrue:[ |
|
522 |
whatToDo value:cls |
|
523 |
] |
|
524 |
] |
|
525 |
] |
|
526 |
] |
|
527 |
] |
|
5591 | 528 |
]. |
529 |
||
530 |
^ Iterator on:[:whatToDo | |doInclude| |
|
6894 | 531 |
Smalltalk allClassesDo:[:cls | |
532 |
(hideUnloadedClasses not or:[cls isLoaded]) |
|
533 |
ifTrue:[ |
|
7497 | 534 |
(cls isRealNameSpace not) ifTrue:[ |
6894 | 535 |
doInclude := (selectedPackages includes:cls package). |
536 |
doInclude ifFalse:[ |
|
537 |
cls isJavaClass ifFalse:[ |
|
538 |
doInclude := (cls methodDictionary contains:[:mthd | selectedPackages includes:mthd package]) |
|
539 |
or:[ cls class methodDictionary contains:[:mthd | selectedPackages includes:mthd package]]. |
|
540 |
] |
|
541 |
]. |
|
542 |
doInclude ifTrue:[ |
|
543 |
whatToDo value:cls |
|
544 |
] |
|
545 |
] |
|
546 |
] |
|
547 |
] |
|
548 |
] |
|
5591 | 549 |
|
6894 | 550 |
"Created: / 17-02-2000 / 23:49:37 / cg" |
7497 | 551 |
"Modified: / 10-11-2006 / 17:15:15 / cg" |
5591 | 552 |
! ! |
553 |
||
554 |
!ProjectList methodsFor:'private'! |
|
555 |
||
6923 | 556 |
allShownProjects |
7590 | 557 |
|hideUnloaded allProjects generator addWithAllParentPackages hideModules| |
558 |
||
559 |
hideModules := HideModules ? true. |
|
560 |
hideModules := HideModules ? false. |
|
5591 | 561 |
|
562 |
allProjects := IdentitySet new. |
|
563 |
||
564 |
inGeneratorHolder isNil ifTrue:[ |
|
6960 | 565 |
hideUnloaded := self hideUnloadedClasses value. |
566 |
||
567 |
addWithAllParentPackages := |
|
568 |
[:package | |
|
7590 | 569 |
|p parent module| |
5591 | 570 |
|
6960 | 571 |
(allProjects includes:package) ifFalse:[ |
572 |
allProjects add:package. |
|
7889 | 573 |
(package ~= Project noProjectID |
574 |
and:[package ~= #private]) ifTrue:[ |
|
7552 | 575 |
p := package asPackageId. |
576 |
[(parent := p parentPackage) notNil] whileTrue:[ |
|
577 |
allProjects add:parent asSymbol. |
|
578 |
p := parent. |
|
579 |
]. |
|
7590 | 580 |
hideModules ifFalse:[ |
581 |
(module := p module) notNil ifTrue:[ |
|
582 |
allProjects add:module asSymbol. |
|
583 |
]. |
|
584 |
]. |
|
6655 | 585 |
]. |
6960 | 586 |
]. |
587 |
]. |
|
588 |
||
589 |
Smalltalk allClassesDo:[:eachClass | |
|
590 |
|cls pkg p classPackage| |
|
591 |
||
7497 | 592 |
(eachClass isRealNameSpace not) ifTrue:[ |
6965 | 593 |
|
594 |
(hideUnloaded not or:[eachClass isLoaded]) ifTrue:[ |
|
595 |
cls := eachClass theNonMetaclass. |
|
596 |
cls isPrivate ifTrue:[ |
|
597 |
cls := cls topOwningClass |
|
598 |
]. |
|
6960 | 599 |
|
6970 | 600 |
classPackage := cls package ? (Project noProjectID). |
6965 | 601 |
classPackage size > 0 ifTrue:[ |
602 |
addWithAllParentPackages value:classPackage asSymbol. |
|
603 |
] ifFalse:[ |
|
604 |
"/ for now, nameSpaces are not in any package; |
|
605 |
"/ this might change. Then, 0-sized packages are |
|
606 |
"/ illegal, and the following should be enabled. |
|
607 |
"/ self halt |
|
608 |
]. |
|
609 |
cls isJavaClass ifFalse:[ |
|
610 |
cls instAndClassSelectorsAndMethodsDo:[:sel :mthd | |
|
611 |
|mpkg| |
|
612 |
||
613 |
mpkg := mthd package asSymbol. |
|
614 |
mpkg ~~ classPackage ifTrue:[ |
|
615 |
(allProjects includes:mpkg) ifFalse:[ |
|
616 |
addWithAllParentPackages value:mpkg. |
|
617 |
] |
|
618 |
]. |
|
6655 | 619 |
]. |
620 |
]. |
|
621 |
]. |
|
622 |
]. |
|
623 |
]. |
|
6960 | 624 |
allProjects := allProjects asOrderedCollection. |
5591 | 625 |
|
6655 | 626 |
"/ those are simulated - in ST/X, empty projects do not |
627 |
"/ really exist; however, during browsing, it makes sense. |
|
628 |
AdditionalEmptyProjects size > 0 ifTrue:[ |
|
629 |
"/ remove those that are present ... |
|
630 |
AdditionalEmptyProjects := AdditionalEmptyProjects select:[:pkg | (allProjects includes:pkg) not]. |
|
631 |
allProjects addAll:AdditionalEmptyProjects. |
|
632 |
]. |
|
5591 | 633 |
] ifFalse:[ |
6655 | 634 |
generator := inGeneratorHolder value. |
635 |
generator isNil ifTrue:[^ #() ]. |
|
636 |
generator do:[:prj | allProjects add:prj]. |
|
5591 | 637 |
]. |
6923 | 638 |
^ allProjects asOrderedCollection. |
7497 | 639 |
|
7590 | 640 |
"Modified: / 16-01-2007 / 15:56:16 / cg" |
6923 | 641 |
! |
642 |
||
643 |
defaultSlaveModeValue |
|
644 |
|mode| |
|
645 |
||
646 |
mode := self topApplication perform:#initialOrganizerMode ifNotUnderstood:nil. |
|
647 |
mode == OrganizerCanvas organizerModeProject ifTrue:[^ false]. |
|
648 |
mode isNil ifTrue:[^ false]. |
|
649 |
^ true |
|
650 |
! |
|
651 |
||
652 |
initialOrganizerMode |
|
653 |
^ OrganizerCanvas organizerModeProject |
|
654 |
! |
|
655 |
||
656 |
listOfProjects |
|
657 |
|allProjects| |
|
658 |
||
659 |
allProjects := self allShownProjects. |
|
5591 | 660 |
|
661 |
allProjects sort. |
|
662 |
allProjects size == 1 ifTrue:[ |
|
6655 | 663 |
"/ self projectLabelHolder value:(allProjects first , ' [Project]'). |
664 |
self projectLabelHolder value:(LabelAndIcon icon:(self class packageIcon) string:allProjects first). |
|
5591 | 665 |
]. |
666 |
allProjects size > 1 ifTrue:[ |
|
6655 | 667 |
allProjects addFirst:(self class nameListEntryForALL). |
5591 | 668 |
]. |
6907 | 669 |
|
5591 | 670 |
^ allProjects |
671 |
||
6907 | 672 |
"Created: / 17-02-2000 / 23:43:05 / cg" |
673 |
"Modified: / 17-08-2006 / 15:08:42 / cg" |
|
5591 | 674 |
! |
675 |
||
676 |
makeDependent |
|
6967 | 677 |
Smalltalk addDependent:self. |
678 |
ChangeSet addDependent:self. |
|
5591 | 679 |
! |
680 |
||
681 |
makeIndependent |
|
682 |
Smalltalk removeDependent:self. |
|
8220 | 683 |
ChangeSet removeDependent:self. |
5591 | 684 |
! |
685 |
||
6923 | 686 |
nameListFor:aProjectList |
687 |
" |
|
688 |
self basicNew |
|
6951 | 689 |
nameListFor:#( |
7060 | 690 |
'exept:expecco' |
691 |
'exept:expecco/application' |
|
692 |
'exept:procware' |
|
693 |
'exept:workflow' |
|
6923 | 694 |
) |
7590 | 695 |
|
696 |
self basicNew |
|
697 |
nameListFor:#( |
|
698 |
'exept' |
|
699 |
'exept:expecco' |
|
700 |
'exept:expecco/application' |
|
701 |
'exept:procware' |
|
702 |
'exept:workflow' |
|
703 |
) |
|
6923 | 704 |
" |
705 |
||
7338 | 706 |
|stack projectsWithExtensions projectsWithChangedCode packagesInChangeSet projectNameList| |
6923 | 707 |
|
708 |
stack := OrderedCollection new. |
|
709 |
||
6951 | 710 |
projectsWithExtensions := Set new. |
711 |
projectsWithChangedCode := Set new. |
|
712 |
||
7338 | 713 |
packagesInChangeSet := ChangeSet current changedPackages. |
6951 | 714 |
|
715 |
projectNameList := OrderedCollection new. |
|
716 |
aProjectList do:[:this | |
|
6923 | 717 |
|thisC entry rawEntry prefix indent| |
718 |
||
6965 | 719 |
this = self class nameListEntryForALL ifTrue:[ |
720 |
entry := this |
|
721 |
] ifFalse:[ |
|
722 |
thisC := this asCollectionOfSubstringsSeparatedByAny:':/'. |
|
723 |
thisC isEmpty ifTrue:[ |
|
6970 | 724 |
thisC := Array with:(Project noProjectID). |
6965 | 725 |
]. |
6923 | 726 |
|
6965 | 727 |
[ |
728 |
|stackTop| |
|
6923 | 729 |
|
6965 | 730 |
stack notEmpty |
731 |
and:[ |
|
732 |
stackTop := stack last. |
|
733 |
(thisC startsWith:stackTop) ifFalse:[ |
|
734 |
stack removeLast. |
|
735 |
true |
|
736 |
] ifTrue:[ |
|
737 |
false |
|
738 |
]] |
|
739 |
] whileTrue. |
|
740 |
prefix := stack notEmpty ifTrue:[ stack last ] ifFalse:[ #() ]. |
|
741 |
indent := stack size * 4. |
|
742 |
stack addLast:thisC. |
|
743 |
prefix isEmpty ifTrue:[ |
|
6970 | 744 |
rawEntry := thisC first. |
745 |
thisC size > 1 ifTrue:[ |
|
746 |
rawEntry := rawEntry , ':' , ((thisC copyFrom:2) asStringWith:$/). |
|
747 |
] |
|
6965 | 748 |
] ifFalse:[ |
749 |
rawEntry := (thisC copyFrom:prefix size+1) asStringWith:$/. |
|
750 |
]. |
|
751 |
||
7131 | 752 |
(packagesInChangeSet includes:this) ifTrue:[ |
7060 | 753 |
rawEntry := rawEntry , self class markForBeingInChangeList. |
6965 | 754 |
rawEntry := self colorizeForChangedCode:rawEntry. |
755 |
]. |
|
756 |
entry := (String new:indent) , rawEntry. |
|
6923 | 757 |
]. |
6951 | 758 |
projectNameList add:entry. |
6923 | 759 |
]. |
6951 | 760 |
^ projectNameList. |
6923 | 761 |
|
762 |
"Created: / 17-02-2000 / 23:43:05 / cg" |
|
7590 | 763 |
"Modified: / 16-01-2007 / 15:51:45 / cg" |
6923 | 764 |
! |
765 |
||
5591 | 766 |
release |
767 |
super release. |
|
768 |
||
769 |
projectList removeDependent:self. |
|
770 |
! |
|
771 |
||
772 |
updateList |
|
6923 | 773 |
|newList oldList newNameList oldNameList oldSelection newSelection selectedProjectsHolder| |
5591 | 774 |
|
775 |
selectedProjectsHolder := self selectedProjects. |
|
776 |
oldSelection := selectedProjectsHolder value. |
|
777 |
newList := self listOfProjects. |
|
6923 | 778 |
oldList := projectList value. |
779 |
newNameList := self nameListFor:newList. |
|
780 |
oldNameList := self projectNameList value. |
|
781 |
(newList ~= oldList |
|
782 |
or:[ newNameList ~= oldNameList]) ifTrue:[ |
|
5591 | 783 |
"/ oldSelection size > 0 ifTrue:[ |
784 |
"/ selectedProjectsHolder removeDependent:self. |
|
785 |
"/ selectedProjectsHolder value:#(). |
|
786 |
"/ selectedProjectsHolder addDependent:self. |
|
787 |
"/ ]. |
|
788 |
||
6923 | 789 |
self projectList value:newList. |
790 |
listValid := true. |
|
791 |
self projectNameList value:newNameList. |
|
5591 | 792 |
|
6923 | 793 |
oldSelection size > 0 ifTrue:[ |
794 |
newSelection := oldSelection select:[:prj | newList includes:prj]. |
|
795 |
selectedProjectsHolder value:newSelection. |
|
796 |
] |
|
5591 | 797 |
]. |
798 |
listValid := true. |
|
799 |
||
800 |
"Modified: / 25.2.2000 / 23:10:01 / cg" |
|
801 |
! ! |
|
802 |
||
803 |
!ProjectList methodsFor:'special'! |
|
804 |
||
805 |
addAdditionalProject:aProject |
|
6923 | 806 |
"/ those are simulated - in ST/X, empty projects do not |
5591 | 807 |
"/ really exist; however, during browsing, it makes sense. |
808 |
AdditionalEmptyProjects isNil ifTrue:[ |
|
6923 | 809 |
AdditionalEmptyProjects := Set new. |
5591 | 810 |
]. |
811 |
AdditionalEmptyProjects add:aProject. |
|
812 |
||
813 |
Smalltalk changed:#projectOrganization "/ not really ... to force update |
|
814 |
||
815 |
"Created: / 17.2.2000 / 23:44:27 / cg" |
|
816 |
! |
|
817 |
||
818 |
removeAdditionalProjects:aListOfProjects |
|
819 |
"/ those are simulated - in ST/X, empty categories do not |
|
820 |
"/ really exist; however, during browsing, it makes sense. |
|
821 |
AdditionalEmptyProjects notNil ifTrue:[ |
|
822 |
aListOfProjects do:[:eachProject | |
|
823 |
AdditionalEmptyProjects remove:eachProject ifAbsent:nil. |
|
824 |
]. |
|
825 |
]. |
|
826 |
Smalltalk changed:#projectOrganization "/ not really ... to force update |
|
827 |
||
828 |
"Created: / 17.2.2000 / 23:45:24 / cg" |
|
829 |
! ! |
|
830 |
||
831 |
!ProjectList class methodsFor:'documentation'! |
|
832 |
||
833 |
version |
|
8220 | 834 |
^ '$Header: /cvs/stx/stx/libtool/Tools_ProjectList.st,v 1.36 2008-07-18 11:12:04 fm Exp $' |
5591 | 835 |
! ! |