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