author | Stefan Vogel <sv@exept.de> |
Wed, 30 Apr 2014 12:09:15 +0200 | |
changeset 14297 | 3f2d9aac889d |
parent 7603 | b4ae9e305bb7 |
child 12123 | 4bde08cebd48 |
child 16266 | 7729a941a1cf |
permissions | -rw-r--r-- |
88 | 1 |
" |
2 |
COPYRIGHT (c) 1994 by Claus Gittinger |
|
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 |
" |
|
7089 | 12 |
"{ Package: 'stx:libtool' }" |
13 |
||
0 | 14 |
StandardSystemView subclass:#ProjectView |
278
9d33deca396c
better message (nationalized)
Claus Gittinger <cg@exept.de>
parents:
272
diff
changeset
|
15 |
instanceVariableNames:'myProject toggle' |
9d33deca396c
better message (nationalized)
Claus Gittinger <cg@exept.de>
parents:
272
diff
changeset
|
16 |
classVariableNames:'ActiveProjectView' |
9d33deca396c
better message (nationalized)
Claus Gittinger <cg@exept.de>
parents:
272
diff
changeset
|
17 |
poolDictionaries:'' |
7089 | 18 |
category:'Interface-Tools' |
0 | 19 |
! |
20 |
||
796
b8edcbceaa18
XtHTML is no longer there ...
Claus Gittinger <cg@exept.de>
parents:
692
diff
changeset
|
21 |
!ProjectView class methodsFor:'documentation'! |
88 | 22 |
|
23 |
copyright |
|
24 |
" |
|
25 |
COPYRIGHT (c) 1994 by Claus Gittinger |
|
26 |
All Rights Reserved |
|
27 |
||
28 |
This software is furnished under a license and may be used |
|
29 |
only in accordance with the terms of that license and with the |
|
30 |
inclusion of the above copyright notice. This software may not |
|
31 |
be provided or otherwise made available to, or used by, any |
|
32 |
other person. No title to or ownership of the software is |
|
33 |
hereby transferred. |
|
34 |
" |
|
272 | 35 |
! |
36 |
||
37 |
documentation |
|
38 |
" |
|
39 |
ProjectViews basically offer two functionalities: |
|
40 |
||
41 |
- keep a group of windows in order to organize the desktop |
|
1348 | 42 |
(I am not sure, if this is really a useful feature, now that we |
43 |
have modern windowManagers which have multiple desktops as well). |
|
272 | 44 |
|
1348 | 45 |
All views as created while a project is active are remembered |
46 |
and can be hidden/shown altogether. |
|
47 |
(this has nothing to do with windowGroups) |
|
272 | 48 |
|
1348 | 49 |
Also, it is possible to close down all those windows (by destroying the project). |
272 | 50 |
|
51 |
- keep defaults for various system activities: |
|
1348 | 52 |
- the fileOut directory (i.e. where the SystemBrowser creates fileOut sources) |
272 | 53 |
|
1348 | 54 |
- keep the source module/package |
55 |
thats the default offered when classes are checkedIn the very first time |
|
278
9d33deca396c
better message (nationalized)
Claus Gittinger <cg@exept.de>
parents:
272
diff
changeset
|
56 |
|
1348 | 57 |
- keep a default package-identifier assigned when classes/methods are created/modified. |
58 |
thats mostly useful to browse all classes/methods that have been touched |
|
59 |
in a projects context |
|
272 | 60 |
|
1348 | 61 |
- keep a per-project changeList |
278
9d33deca396c
better message (nationalized)
Claus Gittinger <cg@exept.de>
parents:
272
diff
changeset
|
62 |
|
9d33deca396c
better message (nationalized)
Claus Gittinger <cg@exept.de>
parents:
272
diff
changeset
|
63 |
- allow opening a browser on all classes/methods which were created or modified |
1348 | 64 |
while a project was active. |
272 | 65 |
|
278
9d33deca396c
better message (nationalized)
Claus Gittinger <cg@exept.de>
parents:
272
diff
changeset
|
66 |
- allow opening a browser on this projects changeList (which contains the subset of changes |
1348 | 67 |
which were done while this project was active) |
278
9d33deca396c
better message (nationalized)
Claus Gittinger <cg@exept.de>
parents:
272
diff
changeset
|
68 |
|
9d33deca396c
better message (nationalized)
Claus Gittinger <cg@exept.de>
parents:
272
diff
changeset
|
69 |
- allow removal of all classes/methods which have the current projects packageIdentifier |
955 | 70 |
|
71 |
[author:] |
|
1348 | 72 |
Claus Gittinger |
955 | 73 |
|
74 |
[see also:] |
|
1348 | 75 |
Project |
2653 | 76 |
NameSpace |
1348 | 77 |
CVSSourceCodemanager |
272 | 78 |
" |
955 | 79 |
|
88 | 80 |
! ! |
81 |
||
796
b8edcbceaa18
XtHTML is no longer there ...
Claus Gittinger <cg@exept.de>
parents:
692
diff
changeset
|
82 |
!ProjectView class methodsFor:'instance creation'! |
0 | 83 |
|
84 |
for:aProject |
|
955 | 85 |
"create & open a new projectView on some project" |
86 |
||
0 | 87 |
|newView| |
88 |
||
89 |
newView := super new. |
|
90 |
newView setProject:aProject. |
|
91 |
^ newView |
|
92 |
||
955 | 93 |
" |
94 |
ProjectView for:(Project new) |
|
95 |
" |
|
96 |
||
97 |
"Modified: 14.2.1997 / 13:46:07 / cg" |
|
0 | 98 |
! ! |
99 |
||
2118 | 100 |
!ProjectView methodsFor:'initialize / release'! |
217 | 101 |
|
102 |
addToCurrentProject |
|
955 | 103 |
"add this view to the current projects set of views. |
104 |
Ignored here - ProjectViews are global." |
|
217 | 105 |
|
106 |
^ self |
|
955 | 107 |
|
108 |
"Modified: 14.2.1997 / 13:35:58 / cg" |
|
217 | 109 |
! |
110 |
||
2118 | 111 |
destroy |
112 |
"Let user confirm, then close all of my views, and get rid of the changeList. |
|
113 |
However, methods and classes are not restored to their |
|
114 |
previous state." |
|
115 |
||
116 |
|views| |
|
117 |
||
118 |
myProject notNil ifTrue:[ |
|
119 |
views := myProject views. |
|
120 |
(views size > 0) ifTrue:[ |
|
121 |
|box| |
|
122 |
||
123 |
box := YesNoBox new. |
|
124 |
box title:(resources string:'PROJECT_DESTROY') withCRs. |
|
125 |
box okText:(resources string:'yes'). |
|
126 |
(box confirm) ifFalse:[^ self] |
|
127 |
]. |
|
128 |
]. |
|
129 |
self doDestroy |
|
130 |
||
131 |
"Modified: 14.2.1997 / 13:39:03 / cg" |
|
132 |
! |
|
133 |
||
217 | 134 |
initialize |
135 |
super initialize. |
|
136 |
||
137 |
"/ |
|
138 |
"/ create the toggle ... |
|
139 |
"/ |
|
140 |
toggle := Toggle in:self. |
|
141 |
toggle borderWidth:0. |
|
142 |
toggle pressAction:[self showProject]. |
|
143 |
toggle releaseAction:[self hideProject]. |
|
144 |
||
145 |
"/ |
|
146 |
"/ and give it a menu |
|
147 |
"/ |
|
148 |
||
1001 | 149 |
toggle menuHolder:self; menuMessage:#projectMenu. |
217 | 150 |
|
151 |
"Created: 25.11.1995 / 18:06:32 / cg" |
|
1001 | 152 |
"Modified: 27.1.1997 / 11:53:18 / cg" |
217 | 153 |
! |
154 |
||
1001 | 155 |
projectMenu |
156 |
"return a popUpMenu" |
|
157 |
||
468
66637cf315a5
added fileOutClasses menu entry
Claus Gittinger <cg@exept.de>
parents:
278
diff
changeset
|
158 |
|labels selectors m| |
217 | 159 |
|
468
66637cf315a5
added fileOutClasses menu entry
Claus Gittinger <cg@exept.de>
parents:
278
diff
changeset
|
160 |
labels := #( |
1468 | 161 |
'class documentation' |
162 |
'-' |
|
163 |
'show' |
|
164 |
'hide' |
|
165 |
'-' |
|
166 |
'changes' |
|
167 |
'browse' |
|
168 |
'browse redefined' |
|
169 |
'fileOut classes' |
|
170 |
'-' |
|
171 |
'fileOut directory ...' |
|
172 |
'repository defaults ...' |
|
173 |
'package name ...' |
|
174 |
'default nameSpace for fileIn ...' |
|
217 | 175 |
"/ '-' |
176 |
"/ 'save project code' |
|
177 |
"/ 'build' |
|
1468 | 178 |
'-' |
179 |
'remove package code' |
|
180 |
'remove project' |
|
181 |
'-' |
|
182 |
'rename ...' |
|
183 |
). |
|
217 | 184 |
|
468
66637cf315a5
added fileOutClasses menu entry
Claus Gittinger <cg@exept.de>
parents:
278
diff
changeset
|
185 |
selectors := #( |
1468 | 186 |
showClassDocumentation |
187 |
nil |
|
188 |
showProject |
|
189 |
hideProject |
|
190 |
nil |
|
191 |
browseChanges |
|
192 |
browsePackage |
|
193 |
browseRedefined |
|
194 |
fileOutClasses |
|
195 |
nil |
|
196 |
projectDirectory |
|
197 |
projectRepositoryAndModule |
|
198 |
projectPackage |
|
199 |
projectNameSpace |
|
217 | 200 |
"/ nil |
201 |
"/ saveProjectFiles |
|
202 |
"/ buildProject |
|
1468 | 203 |
nil |
204 |
removePackage |
|
205 |
destroy |
|
206 |
nil |
|
207 |
renameProject |
|
208 |
). |
|
468
66637cf315a5
added fileOutClasses menu entry
Claus Gittinger <cg@exept.de>
parents:
278
diff
changeset
|
209 |
|
66637cf315a5
added fileOutClasses menu entry
Claus Gittinger <cg@exept.de>
parents:
278
diff
changeset
|
210 |
m := PopUpMenu |
1468 | 211 |
labels:(resources array:labels) |
212 |
selectors:selectors |
|
213 |
receiver:self. |
|
468
66637cf315a5
added fileOutClasses menu entry
Claus Gittinger <cg@exept.de>
parents:
278
diff
changeset
|
214 |
|
66637cf315a5
added fileOutClasses menu entry
Claus Gittinger <cg@exept.de>
parents:
278
diff
changeset
|
215 |
SourceCodeManager isNil ifTrue:[ |
1468 | 216 |
m disableAll:#(#projectRepository #projectRepositoryAndModule). |
217 | 217 |
]. |
218 |
||
1001 | 219 |
^ m |
217 | 220 |
|
1468 | 221 |
"Created: / 27.1.1997 / 11:53:30 / cg" |
222 |
"Modified: / 6.2.1998 / 12:57:21 / cg" |
|
217 | 223 |
! ! |
224 |
||
57 | 225 |
!ProjectView methodsFor:'menu actions'! |
226 |
||
227 |
browseChanges |
|
955 | 228 |
"open a changeBrowser showing all changes made in this project |
229 |
(i.e. while this project was the active project)" |
|
230 |
||
231 |
|changes b| |
|
232 |
||
233 |
changes := myProject changeSet. |
|
234 |
changes size == 0 ifTrue:[ |
|
1348 | 235 |
self warn:(resources string:'no changes made in this project (yet)'). |
236 |
^ self |
|
955 | 237 |
]. |
57 | 238 |
|
239 |
b := ChangeSetBrowser openOn:(myProject changeSet). |
|
278
9d33deca396c
better message (nationalized)
Claus Gittinger <cg@exept.de>
parents:
272
diff
changeset
|
240 |
b label:(resources string:'Changes in %1' with:myProject name) |
955 | 241 |
|
242 |
"Modified: 14.2.1997 / 13:36:40 / cg" |
|
57 | 243 |
! |
244 |
||
245 |
browsePackage |
|
278
9d33deca396c
better message (nationalized)
Claus Gittinger <cg@exept.de>
parents:
272
diff
changeset
|
246 |
"launch browsers for all classes/methods which are defined in this package |
9d33deca396c
better message (nationalized)
Claus Gittinger <cg@exept.de>
parents:
272
diff
changeset
|
247 |
(i.e. whose packageIdentifier is the same as my Projects packageIdentifier)" |
57 | 248 |
|
249 |
self topView withWaitCursorDo:[ |
|
2575 | 250 |
|classes packageName methods methodList anyClasses anyMethods ignoredClasses| |
278
9d33deca396c
better message (nationalized)
Claus Gittinger <cg@exept.de>
parents:
272
diff
changeset
|
251 |
|
2575 | 252 |
anyMethods := anyClasses := false. |
57 | 253 |
|
2575 | 254 |
packageName := myProject package. |
255 |
classes := myProject classes. |
|
256 |
(classes notNil and:[classes notEmpty]) ifTrue:[ |
|
257 |
anyClasses := true. |
|
258 |
]. |
|
57 | 259 |
|
2575 | 260 |
methods := myProject individualMethods. |
261 |
methods notEmpty ifTrue:[ |
|
262 |
anyMethods := true. |
|
263 |
SystemBrowser browseMethods:methods |
|
264 |
title:(resources string:'individual methods in package %1' with:packageName). |
|
265 |
]. |
|
266 |
anyClasses ifTrue:[ |
|
267 |
SystemBrowser browseClasses:classes |
|
268 |
title:(resources string:'classes in package %1' with:packageName). |
|
269 |
]. |
|
270 |
(anyClasses or:[anyMethods]) ifFalse:[ |
|
271 |
self information:(resources string:'no classes or methods in this project (yet)') |
|
272 |
] |
|
57 | 273 |
] |
265 | 274 |
|
275 |
"Created: 10.12.1995 / 00:08:58 / cg" |
|
278
9d33deca396c
better message (nationalized)
Claus Gittinger <cg@exept.de>
parents:
272
diff
changeset
|
276 |
"Modified: 12.12.1995 / 16:35:07 / cg" |
57 | 277 |
! |
278 |
||
217 | 279 |
browseProps |
955 | 280 |
"show the projects properties. |
281 |
This is not yet finished ... |
|
282 |
... and will look better, once property inspector runs ..." |
|
217 | 283 |
|
284 |
myProject properties inspect |
|
955 | 285 |
|
286 |
"Modified: 14.2.1997 / 13:37:15 / cg" |
|
217 | 287 |
! |
288 |
||
1001 | 289 |
browseRedefined |
290 |
"launch browsers for all redefined methods. |
|
291 |
Thats methods which existed before and were redefined by package methods" |
|
292 |
||
293 |
self topView withWaitCursorDo:[ |
|
1348 | 294 |
|redefined methods| |
1001 | 295 |
|
1348 | 296 |
redefined := myProject overwrittenMethods. |
297 |
redefined notNil ifTrue:[ |
|
298 |
methods := redefined values. |
|
299 |
]. |
|
300 |
methods size > 0 ifTrue:[ |
|
301 |
SystemBrowser browseMethods:methods |
|
302 |
title:(resources string:'redefined methods in package %1' with:myProject packageName). |
|
303 |
] ifFalse:[ |
|
304 |
self information:(resources string:'no redefined methods in this project (yet)') |
|
305 |
] |
|
1001 | 306 |
] |
307 |
||
308 |
"Created: 27.1.1997 / 11:57:03 / cg" |
|
309 |
"Modified: 27.1.1997 / 11:58:06 / cg" |
|
310 |
! |
|
311 |
||
217 | 312 |
buildProject |
955 | 313 |
"build the project; this is not yet finished ... |
314 |
... and will eventually create all sources, makefile and |
|
315 |
build what is to be built: either a classLibrary or an application" |
|
316 |
||
217 | 317 |
self topView withWaitCursorDo:[ |
1348 | 318 |
|dir| |
217 | 319 |
|
1348 | 320 |
self saveProjectFiles. |
321 |
(self confirm:'make object files in: ' , dir , ' ?') ifTrue:[ |
|
322 |
myProject buildProject. |
|
323 |
] |
|
217 | 324 |
]. |
955 | 325 |
|
326 |
"Modified: 14.2.1997 / 13:38:06 / cg" |
|
217 | 327 |
! |
328 |
||
329 |
doDestroy |
|
955 | 330 |
"close all of my views, and get rid of the changeList. |
331 |
However, methods and classes are not restored to their |
|
332 |
previous state. |
|
333 |
No confiramtion here." |
|
334 |
||
217 | 335 |
self hideProject. |
336 |
myProject := nil. |
|
337 |
super destroy |
|
955 | 338 |
|
339 |
"Modified: 14.2.1997 / 13:39:18 / cg" |
|
217 | 340 |
! |
341 |
||
468
66637cf315a5
added fileOutClasses menu entry
Claus Gittinger <cg@exept.de>
parents:
278
diff
changeset
|
342 |
fileOutClasses |
66637cf315a5
added fileOutClasses menu entry
Claus Gittinger <cg@exept.de>
parents:
278
diff
changeset
|
343 |
"fileout all classes belonging to that package. |
66637cf315a5
added fileOutClasses menu entry
Claus Gittinger <cg@exept.de>
parents:
278
diff
changeset
|
344 |
CAVEAT: individual methods are not yet supported." |
66637cf315a5
added fileOutClasses menu entry
Claus Gittinger <cg@exept.de>
parents:
278
diff
changeset
|
345 |
|
66637cf315a5
added fileOutClasses menu entry
Claus Gittinger <cg@exept.de>
parents:
278
diff
changeset
|
346 |
self topView withWaitCursorDo:[ |
1348 | 347 |
|classes packageName methods methodList anyClasses anyMethods ignoredClasses| |
468
66637cf315a5
added fileOutClasses menu entry
Claus Gittinger <cg@exept.de>
parents:
278
diff
changeset
|
348 |
|
1348 | 349 |
anyMethods := anyClasses := false. |
468
66637cf315a5
added fileOutClasses menu entry
Claus Gittinger <cg@exept.de>
parents:
278
diff
changeset
|
350 |
|
1348 | 351 |
packageName := myProject packageName. |
352 |
classes := myProject classes. |
|
353 |
(classes notNil and:[classes notEmpty]) ifTrue:[ |
|
354 |
anyClasses := true. |
|
355 |
]. |
|
468
66637cf315a5
added fileOutClasses menu entry
Claus Gittinger <cg@exept.de>
parents:
278
diff
changeset
|
356 |
|
1348 | 357 |
methods := myProject individualMethods. |
358 |
methods notEmpty ifTrue:[ |
|
359 |
anyMethods := true. |
|
360 |
self warn:'individual methods are currently not handled' |
|
361 |
]. |
|
362 |
anyClasses ifTrue:[ |
|
363 |
classes do:[:aClass | |
|
364 |
Transcript showCR:'fileOut: ' , aClass name , ' ...'. |
|
365 |
aClass fileOut |
|
366 |
]. |
|
367 |
]. |
|
368 |
(anyClasses or:[anyMethods]) ifFalse:[ |
|
369 |
self information:(resources string:'no classes or methods in this project (yet)') |
|
370 |
] |
|
468
66637cf315a5
added fileOutClasses menu entry
Claus Gittinger <cg@exept.de>
parents:
278
diff
changeset
|
371 |
] |
66637cf315a5
added fileOutClasses menu entry
Claus Gittinger <cg@exept.de>
parents:
278
diff
changeset
|
372 |
|
66637cf315a5
added fileOutClasses menu entry
Claus Gittinger <cg@exept.de>
parents:
278
diff
changeset
|
373 |
"Created: 11.4.1996 / 19:29:50 / cg" |
66637cf315a5
added fileOutClasses menu entry
Claus Gittinger <cg@exept.de>
parents:
278
diff
changeset
|
374 |
! |
66637cf315a5
added fileOutClasses menu entry
Claus Gittinger <cg@exept.de>
parents:
278
diff
changeset
|
375 |
|
217 | 376 |
hideProject |
955 | 377 |
"hide all views belonging to that project and switch |
378 |
to the default project" |
|
379 |
||
1980 | 380 |
myProject notNil ifTrue:[ |
381 |
myProject hideViews. |
|
382 |
]. |
|
217 | 383 |
ActiveProjectView := nil. |
384 |
toggle turnOff. |
|
385 |
Project setDefaultProject. |
|
955 | 386 |
|
387 |
"Modified: 14.2.1997 / 13:39:43 / cg" |
|
217 | 388 |
! |
389 |
||
57 | 390 |
projectDirectory |
955 | 391 |
"ask for the default directory, where fileOut will write |
392 |
its files. Will eventually also be the place, where makefiles |
|
393 |
and additional stuff is saved, for project building." |
|
394 |
||
57 | 395 |
|box d| |
396 |
||
397 |
box := FilenameEnterBox new. |
|
85 | 398 |
box directoriesOnly. |
278
9d33deca396c
better message (nationalized)
Claus Gittinger <cg@exept.de>
parents:
272
diff
changeset
|
399 |
box title:(resources string:'PROJECT_DIRECTPORY') withCRs. |
57 | 400 |
(d := myProject directory) notNil ifTrue:[ |
1348 | 401 |
box initialText:d |
57 | 402 |
]. |
403 |
box action:[:dirName | |
|
1348 | 404 |
(OperatingSystem isDirectory:dirName) ifFalse:[ |
405 |
(OperatingSystem isValidPath:dirName) ifTrue:[ |
|
406 |
self warn:(resources string:'%1 is not a valid directory' with:dirName). |
|
407 |
^ self |
|
408 |
]. |
|
409 |
(self confirm:(resources string:'%1 does not exist\\create ?' with:dirName) withCRs) ifTrue:[ |
|
410 |
(OperatingSystem recursiveCreateDirectory:dirName) ifFalse:[ |
|
411 |
self warn:(resources string:'cannot create %1' with:dirName) |
|
412 |
] |
|
413 |
]. |
|
414 |
]. |
|
415 |
"did it work ?" |
|
416 |
(OperatingSystem isDirectory:dirName) ifTrue:[ |
|
417 |
myProject directory:dirName |
|
418 |
]. |
|
57 | 419 |
]. |
420 |
box showAtPointer |
|
421 |
||
955 | 422 |
"Modified: 14.2.1997 / 13:44:59 / cg" |
265 | 423 |
! |
424 |
||
893 | 425 |
projectNameSpace |
955 | 426 |
"ask for the default nameSpace, into which new classes |
427 |
are loaded while this project is active. |
|
428 |
Useful before filing in alien code, to make certain that loaded |
|
429 |
classes do not conflict with existing ones ..." |
|
430 |
||
893 | 431 |
self topView withWaitCursorDo:[ |
2302 | 432 |
|box allNameSpaces| |
893 | 433 |
|
2653 | 434 |
allNameSpaces := (NameSpace allNamespaces |
2302 | 435 |
select:[:ns | ns isTopLevelNamespace]) |
436 |
collect:[:ns | ns name]. |
|
437 |
||
438 |
box := ListSelectionBox title:(resources string:'default nameSpace:') withCRs. |
|
439 |
box list:(allNameSpaces asOrderedCollection sort). |
|
440 |
box action:[:nsName | |
|
441 |
|ns| |
|
893 | 442 |
|
2302 | 443 |
"/ only create topLevel nameSpaces here |
963
3d9083fde09f
provide Smalltalk as homeNameSpace, when defining the projects
Claus Gittinger <cg@exept.de>
parents:
955
diff
changeset
|
444 |
|
2302 | 445 |
Class nameSpaceQuerySignal |
446 |
answer:Smalltalk |
|
447 |
do:[ |
|
2653 | 448 |
ns := NameSpace name:nsName. |
2302 | 449 |
]. |
450 |
myProject defaultNameSpace:ns |
|
451 |
]. |
|
452 |
box showAtPointer |
|
893 | 453 |
] |
454 |
||
455 |
"Created: 9.12.1995 / 16:50:45 / cg" |
|
963
3d9083fde09f
provide Smalltalk as homeNameSpace, when defining the projects
Claus Gittinger <cg@exept.de>
parents:
955
diff
changeset
|
456 |
"Modified: 16.1.1997 / 01:00:06 / cg" |
893 | 457 |
! |
458 |
||
57 | 459 |
projectPackage |
955 | 460 |
"ask for the package identifier of this project. |
461 |
New classes and methods get this identifier, to find them |
|
462 |
quickly later." |
|
463 |
||
57 | 464 |
self topView withWaitCursorDo:[ |
2108 | 465 |
|box p existingPackages allClasses| |
466 |
||
467 |
existingPackages := Set new. |
|
468 |
(allClasses := Smalltalk allClasses) do:[:aClass | |
|
469 |
|p| |
|
259
c651fecef457
better defaults when creating a container
Claus Gittinger <cg@exept.de>
parents:
217
diff
changeset
|
470 |
|
2653 | 471 |
(aClass isNameSpace |
2109 | 472 |
"/ or:[aClass isLoaded not] |
473 |
) ifFalse:[ |
|
2108 | 474 |
p := aClass package. |
475 |
p size == 0 ifTrue:[ |
|
476 |
p := 'no package'. |
|
477 |
]. |
|
478 |
existingPackages add:(p asString). |
|
57 | 479 |
|
2108 | 480 |
aClass methodDictionary do:[:aMethod | |
481 |
p := aMethod package. |
|
482 |
p size == 0 ifTrue:[ |
|
483 |
p := 'no package'. |
|
484 |
]. |
|
485 |
existingPackages add:(p asString). |
|
486 |
]. |
|
487 |
aClass class methodDictionary do:[:aMethod | |
|
488 |
p := aMethod package. |
|
489 |
p size == 0 ifTrue:[ |
|
490 |
p := 'no package'. |
|
491 |
]. |
|
492 |
existingPackages add:(p asString). |
|
493 |
]. |
|
2109 | 494 |
]. |
2108 | 495 |
]. |
259
c651fecef457
better defaults when creating a container
Claus Gittinger <cg@exept.de>
parents:
217
diff
changeset
|
496 |
|
2108 | 497 |
box := ListSelectionBox title:(resources string:'PROJECT_PACKAGENAME') withCRs. |
498 |
box list:(existingPackages asOrderedCollection sort). |
|
2533 | 499 |
(p := myProject package) notNil ifTrue:[ |
2108 | 500 |
box initialText:p |
501 |
]. |
|
502 |
box action:[:packageName | |
|
503 |
|someClass module directory| |
|
57 | 504 |
|
2108 | 505 |
"/ (try) to extract the module & repository directory from someClass which |
506 |
"/ is already contained in that package |
|
259
c651fecef457
better defaults when creating a container
Claus Gittinger <cg@exept.de>
parents:
217
diff
changeset
|
507 |
|
2108 | 508 |
Smalltalk allClasses |
509 |
detect:[:cls | |
|
510 |
|info| |
|
57 | 511 |
|
2108 | 512 |
(cls package = packageName) ifTrue:[ |
513 |
(info := cls packageSourceCodeInfo) notNil ifTrue:[ |
|
514 |
module := info at:#module ifAbsent:nil. |
|
515 |
directory := info at:#directory ifAbsent:nil. |
|
516 |
] |
|
517 |
]. |
|
518 |
module notNil and:[directory notNil]. |
|
519 |
] |
|
520 |
ifNone:nil. |
|
259
c651fecef457
better defaults when creating a container
Claus Gittinger <cg@exept.de>
parents:
217
diff
changeset
|
521 |
|
2108 | 522 |
module notNil ifTrue:[ |
523 |
myProject repositoryModule:module |
|
524 |
]. |
|
525 |
directory notNil ifTrue:[ |
|
526 |
myProject repositoryDirectory:directory |
|
527 |
]. |
|
528 |
myProject packageName:packageName. |
|
259
c651fecef457
better defaults when creating a container
Claus Gittinger <cg@exept.de>
parents:
217
diff
changeset
|
529 |
|
2108 | 530 |
]. |
531 |
box showAtPointer |
|
57 | 532 |
] |
259
c651fecef457
better defaults when creating a container
Claus Gittinger <cg@exept.de>
parents:
217
diff
changeset
|
533 |
|
c651fecef457
better defaults when creating a container
Claus Gittinger <cg@exept.de>
parents:
217
diff
changeset
|
534 |
"Created: 9.12.1995 / 16:50:45 / cg" |
1326 | 535 |
"Modified: 19.9.1997 / 10:55:19 / cg" |
110 | 536 |
! |
57 | 537 |
|
955 | 538 |
projectRepositoryAndModule |
539 |
"ask for a default module and package directory. |
|
540 |
This is offered as default, when new containers are |
|
541 |
created. However, when creating, these can still be changed" |
|
542 |
||
1490 | 543 |
|box moduleHolder dirHolder| |
955 | 544 |
|
545 |
box := DialogBox new. |
|
546 |
(box addTextLabel:(resources string:'PROJECT_MODULEANDDIR') withCRs) |
|
1348 | 547 |
adjust:#left. |
955 | 548 |
box addHorizontalLine. |
549 |
||
550 |
moduleHolder := myProject repositoryModule asValue. |
|
551 |
dirHolder := myProject repositoryDirectory asValue. |
|
552 |
||
553 |
(box addTextLabel:(resources string:'PROJECT_MODULEDIR') withCRs) |
|
1348 | 554 |
adjust:#left. |
955 | 555 |
box addFilenameInputFieldOn:moduleHolder in:nil tabable:true. |
217 | 556 |
|
1490 | 557 |
box addVerticalSpace; addHorizontalLine; addVerticalSpace. |
955 | 558 |
|
559 |
(box addTextLabel:(resources string:'PROJECT_PACKAGEDIR') withCRs) |
|
1348 | 560 |
adjust:#left. |
955 | 561 |
box addFilenameInputFieldOn:dirHolder in:nil tabable:true. |
562 |
||
563 |
box addAbortButton; addOkButton. |
|
564 |
box showAtPointer. |
|
565 |
||
566 |
box accepted ifTrue:[ |
|
1348 | 567 |
myProject repositoryModule:moduleHolder value. |
568 |
myProject repositoryDirectory:dirHolder value. |
|
217 | 569 |
]. |
570 |
||
955 | 571 |
box destroy. |
572 |
||
573 |
"Modified: 14.2.1997 / 13:42:05 / cg" |
|
217 | 574 |
! |
575 |
||
110 | 576 |
removePackage |
577 |
"remove all classes and individual methods from the system. |
|
578 |
Currently, this cannot fully restore the state to before |
|
579 |
the time the package was loaded (redefined methods are lost). |
|
580 |
In the future, we may keep a backref of overwritten methods |
|
581 |
and restore them from their source ..." |
|
57 | 582 |
|
110 | 583 |
|classesToRemove methodsToRemove theProject| |
584 |
||
585 |
(myProject isNil |
|
586 |
or:[(theProject := myProject packageName) isNil]) ifTrue:[ |
|
1348 | 587 |
self warn:(resources string:'No current package.'). |
588 |
^ self |
|
110 | 589 |
]. |
590 |
||
591 |
classesToRemove := IdentitySet new. |
|
592 |
methodsToRemove := IdentitySet new. |
|
593 |
||
594 |
Smalltalk allClassesDo:[:aClass | |
|
1348 | 595 |
|p| |
110 | 596 |
|
1348 | 597 |
(p := aClass package) notNil ifTrue:[ |
598 |
p = theProject ifTrue:[ |
|
599 |
classesToRemove add:aClass |
|
600 |
] |
|
601 |
]. |
|
110 | 602 |
]. |
603 |
Smalltalk allClassesDo:[:aClass | |
|
1348 | 604 |
|p| |
110 | 605 |
|
1348 | 606 |
(classesToRemove includes:aClass) ifFalse:[ |
607 |
aClass methodDictionary keysAndValuesDo:[:sel :aMethod | |
|
608 |
(p := aMethod package) notNil ifTrue:[ |
|
609 |
p = theProject ifTrue:[ |
|
610 |
methodsToRemove add:aMethod |
|
611 |
] |
|
612 |
] |
|
613 |
]. |
|
614 |
aClass class methodDictionary keysAndValuesDo:[:sel :aMethod | |
|
615 |
(p := aMethod package) notNil ifTrue:[ |
|
616 |
p = theProject ifTrue:[ |
|
617 |
methodsToRemove add:aMethod |
|
618 |
] |
|
619 |
] |
|
620 |
]. |
|
621 |
]. |
|
110 | 622 |
]. |
623 |
||
624 |
(classesToRemove isEmpty |
|
625 |
and:[methodsToRemove isEmpty]) ifTrue:[ |
|
1348 | 626 |
self warn:(resources string:'No classes or methods found in %1' with:theProject). |
627 |
^ self |
|
110 | 628 |
]. |
629 |
||
278
9d33deca396c
better message (nationalized)
Claus Gittinger <cg@exept.de>
parents:
272
diff
changeset
|
630 |
(self confirm:(resources |
1348 | 631 |
string:'About to remove %1 classes and %2 additional methods.\\Are you certain you want this ?' |
632 |
with:classesToRemove size |
|
633 |
with:methodsToRemove size) withCRs) |
|
634 |
ifTrue:[ |
|
635 |
classesToRemove do:[:aClass | |
|
636 |
('PROJECT: removing ' , aClass name) infoPrintNL. |
|
637 |
Smalltalk removeClass:aClass. |
|
638 |
]. |
|
639 |
methodsToRemove do:[:aMethod | |
|
640 |
|where| |
|
110 | 641 |
|
1348 | 642 |
('PROJECT: removing ' , aMethod displayString) infoPrintNL. |
643 |
where := aMethod who. |
|
644 |
where isNil ifTrue:[ |
|
645 |
'PROJECT: oops, some method is gone' infoPrintNL. |
|
646 |
] ifFalse:[ |
|
647 |
(where at:1) removeSelector:(where at:2) |
|
648 |
] |
|
649 |
] |
|
110 | 650 |
]. |
57 | 651 |
! |
652 |
||
653 |
renameProject |
|
955 | 654 |
"give that project another name - has no semantic meaning, |
655 |
and does not affect any class/method" |
|
656 |
||
57 | 657 |
|box| |
658 |
||
659 |
box := EnterBox new. |
|
278
9d33deca396c
better message (nationalized)
Claus Gittinger <cg@exept.de>
parents:
272
diff
changeset
|
660 |
box title:(resources string:'new name of project:'). |
9d33deca396c
better message (nationalized)
Claus Gittinger <cg@exept.de>
parents:
272
diff
changeset
|
661 |
box okText:(resources string:'rename'). |
57 | 662 |
box initialText:(myProject name). |
663 |
box action:[:newName | |
|
1348 | 664 |
myProject name:newName. |
665 |
self setProject:myProject. |
|
666 |
self windowGroup process name:'Project: ' , newName. |
|
57 | 667 |
]. |
668 |
box showAtPointer |
|
278
9d33deca396c
better message (nationalized)
Claus Gittinger <cg@exept.de>
parents:
272
diff
changeset
|
669 |
|
955 | 670 |
"Modified: 14.2.1997 / 13:41:15 / cg" |
57 | 671 |
! |
672 |
||
217 | 673 |
saveProjectFiles |
955 | 674 |
"create the projects files. |
675 |
This is not yet finished." |
|
676 |
||
57 | 677 |
self topView withWaitCursorDo:[ |
1348 | 678 |
|dir| |
57 | 679 |
|
1348 | 680 |
dir := myProject directory. |
681 |
(self confirm:'create source files in: ' , dir , ' ?') ifTrue:[ |
|
682 |
myProject createProjectFiles. |
|
683 |
] |
|
57 | 684 |
]. |
955 | 685 |
|
686 |
"Modified: 14.2.1997 / 13:40:40 / cg" |
|
57 | 687 |
! |
688 |
||
513 | 689 |
showClassDocumentation |
690 |
"open a documentViewer on the projects classes documentation only" |
|
691 |
||
692 |
self topView withWaitCursorDo:[ |
|
7603
b4ae9e305bb7
Bug 85 - bad selectors when generating HTML docs
Stefan Vogel <sv@exept.de>
parents:
7089
diff
changeset
|
693 |
|classes packageName methods methodList anyClasses anyMethods |
b4ae9e305bb7
Bug 85 - bad selectors when generating HTML docs
Stefan Vogel <sv@exept.de>
parents:
7089
diff
changeset
|
694 |
html| |
513 | 695 |
|
7603
b4ae9e305bb7
Bug 85 - bad selectors when generating HTML docs
Stefan Vogel <sv@exept.de>
parents:
7089
diff
changeset
|
696 |
anyMethods := anyClasses := false. |
513 | 697 |
|
7603
b4ae9e305bb7
Bug 85 - bad selectors when generating HTML docs
Stefan Vogel <sv@exept.de>
parents:
7089
diff
changeset
|
698 |
packageName := myProject package. |
b4ae9e305bb7
Bug 85 - bad selectors when generating HTML docs
Stefan Vogel <sv@exept.de>
parents:
7089
diff
changeset
|
699 |
classes := myProject classes. |
b4ae9e305bb7
Bug 85 - bad selectors when generating HTML docs
Stefan Vogel <sv@exept.de>
parents:
7089
diff
changeset
|
700 |
(classes notNil and:[classes notEmpty]) ifTrue:[ |
b4ae9e305bb7
Bug 85 - bad selectors when generating HTML docs
Stefan Vogel <sv@exept.de>
parents:
7089
diff
changeset
|
701 |
anyClasses := true. |
b4ae9e305bb7
Bug 85 - bad selectors when generating HTML docs
Stefan Vogel <sv@exept.de>
parents:
7089
diff
changeset
|
702 |
]. |
b4ae9e305bb7
Bug 85 - bad selectors when generating HTML docs
Stefan Vogel <sv@exept.de>
parents:
7089
diff
changeset
|
703 |
(anyClasses or:[anyMethods]) ifFalse:[ |
b4ae9e305bb7
Bug 85 - bad selectors when generating HTML docs
Stefan Vogel <sv@exept.de>
parents:
7089
diff
changeset
|
704 |
self information:(resources string:'no classes or methods in this project (yet)'). |
b4ae9e305bb7
Bug 85 - bad selectors when generating HTML docs
Stefan Vogel <sv@exept.de>
parents:
7089
diff
changeset
|
705 |
^ self. |
b4ae9e305bb7
Bug 85 - bad selectors when generating HTML docs
Stefan Vogel <sv@exept.de>
parents:
7089
diff
changeset
|
706 |
]. |
513 | 707 |
|
7603
b4ae9e305bb7
Bug 85 - bad selectors when generating HTML docs
Stefan Vogel <sv@exept.de>
parents:
7089
diff
changeset
|
708 |
methods := myProject individualMethods. |
b4ae9e305bb7
Bug 85 - bad selectors when generating HTML docs
Stefan Vogel <sv@exept.de>
parents:
7089
diff
changeset
|
709 |
methods notEmpty ifTrue:[ |
b4ae9e305bb7
Bug 85 - bad selectors when generating HTML docs
Stefan Vogel <sv@exept.de>
parents:
7089
diff
changeset
|
710 |
anyMethods := true. |
b4ae9e305bb7
Bug 85 - bad selectors when generating HTML docs
Stefan Vogel <sv@exept.de>
parents:
7089
diff
changeset
|
711 |
"/ not yet shown ... |
b4ae9e305bb7
Bug 85 - bad selectors when generating HTML docs
Stefan Vogel <sv@exept.de>
parents:
7089
diff
changeset
|
712 |
]. |
513 | 713 |
|
7603
b4ae9e305bb7
Bug 85 - bad selectors when generating HTML docs
Stefan Vogel <sv@exept.de>
parents:
7089
diff
changeset
|
714 |
anyClasses ifFalse:[ ^ self]. |
513 | 715 |
|
7603
b4ae9e305bb7
Bug 85 - bad selectors when generating HTML docs
Stefan Vogel <sv@exept.de>
parents:
7089
diff
changeset
|
716 |
html := HTMLDocGenerator |
b4ae9e305bb7
Bug 85 - bad selectors when generating HTML docs
Stefan Vogel <sv@exept.de>
parents:
7089
diff
changeset
|
717 |
htmlClasses:classes |
b4ae9e305bb7
Bug 85 - bad selectors when generating HTML docs
Stefan Vogel <sv@exept.de>
parents:
7089
diff
changeset
|
718 |
title:'project classes' |
b4ae9e305bb7
Bug 85 - bad selectors when generating HTML docs
Stefan Vogel <sv@exept.de>
parents:
7089
diff
changeset
|
719 |
backTo:#none. |
513 | 720 |
|
7603
b4ae9e305bb7
Bug 85 - bad selectors when generating HTML docs
Stefan Vogel <sv@exept.de>
parents:
7089
diff
changeset
|
721 |
HTMLDocumentView openFullOnText:html |
513 | 722 |
] |
723 |
||
724 |
"Created: 11.4.1996 / 19:29:50 / cg" |
|
515 | 725 |
"Modified: 26.4.1996 / 17:48:33 / cg" |
513 | 726 |
! |
727 |
||
217 | 728 |
showProject |
955 | 729 |
"show all views belonging to that project and hide |
730 |
the active projects views (except for those opened before)" |
|
731 |
||
217 | 732 |
ActiveProjectView notNil ifTrue:[ |
1348 | 733 |
ActiveProjectView hideProject |
57 | 734 |
]. |
217 | 735 |
ActiveProjectView := self. |
110 | 736 |
|
217 | 737 |
myProject showViews. |
738 |
Project current:myProject. |
|
739 |
toggle turnOn |
|
955 | 740 |
|
741 |
"Modified: 14.2.1997 / 13:40:10 / cg" |
|
57 | 742 |
! ! |
743 |
||
0 | 744 |
!ProjectView methodsFor:'private accessing'! |
745 |
||
746 |
setProject:aProject |
|
747 |
|name e| |
|
748 |
||
749 |
name := aProject name. |
|
750 |
self label:name. |
|
17 | 751 |
self iconLabel:name. |
0 | 752 |
toggle label:'Project: ' , name. |
753 |
toggle resize. |
|
754 |
myProject := aProject. |
|
755 |
e := (toggle width @ toggle height). |
|
29 | 756 |
drawableId isNil ifTrue:[ |
1348 | 757 |
self minExtent:e. |
758 |
self maxExtent:e. |
|
759 |
self open |
|
29 | 760 |
] ifFalse:[ |
1348 | 761 |
self unmap. |
762 |
self minExtent:e. |
|
763 |
self maxExtent:e. |
|
764 |
self extent:e. |
|
765 |
self remap |
|
29 | 766 |
] |
0 | 767 |
! ! |
217 | 768 |
|
796
b8edcbceaa18
XtHTML is no longer there ...
Claus Gittinger <cg@exept.de>
parents:
692
diff
changeset
|
769 |
!ProjectView class methodsFor:'documentation'! |
217 | 770 |
|
771 |
version |
|
7603
b4ae9e305bb7
Bug 85 - bad selectors when generating HTML docs
Stefan Vogel <sv@exept.de>
parents:
7089
diff
changeset
|
772 |
^ '$Header: /cvs/stx/stx/libtool/ProjectView.st,v 1.52 2007-01-23 18:19:38 stefan Exp $' |
515 | 773 |
! ! |