commentary;
authorClaus Gittinger <cg@exept.de>
Tue, 14 Jan 1997 13:46:32 +0100
changeset 955 31a5221235f1
parent 954 664cb25ee914
child 956 afea28c682be
commentary; merged projectModule & projectRepository into one dialog.
ProjectV.st
ProjectView.st
--- a/ProjectV.st	Tue Jan 14 12:56:40 1997 +0100
+++ b/ProjectV.st	Tue Jan 14 13:46:32 1997 +0100
@@ -66,27 +66,45 @@
          which were done while this project was active)
 
       - allow removal of all classes/methods which have the current projects packageIdentifier
+
+    [author:]
+        Claus Gittinger
+
+    [see also:]
+        Project
+        Namespace
+        CVSSourceCodemanager
 "
+
 ! !
 
 !ProjectView class methodsFor:'instance creation'!
 
 for:aProject
+    "create & open a new projectView on some project"
+
     |newView|
 
     newView := super new.
     newView setProject:aProject.
     ^ newView
 
-    "ProjectView for:(Project new)"
+    "
+     ProjectView for:(Project new)
+    "
+
+    "Modified: 14.2.1997 / 13:46:07 / cg"
 ! !
 
 !ProjectView methodsFor:'initialization'!
 
 addToCurrentProject
-    "ignored here"
+    "add this view to the current projects set of views.
+     Ignored here - ProjectViews are global."
 
     ^ self
+
+    "Modified: 14.2.1997 / 13:35:58 / cg"
 !
 
 initialize
@@ -124,8 +142,7 @@
                     'fileOut classes'
                     '-'
                     'fileOut directory ...'
-                    'repository module ...'
-                    'repository directory ...'
+                    'repository defaults ...'
                     'package name ...'
                     'default nameSpace ...'
 "/                        '-'
@@ -149,8 +166,7 @@
                     fileOutClasses
                     nil
                     projectDirectory
-                    projectModule
-                    projectRepository
+                    projectRepositoryAndModule
                     projectPackage
                     projectNameSpace
 "/                        nil
@@ -175,16 +191,27 @@
     toggle middleButtonMenu:m
 
     "Created: 25.11.1995 / 18:06:32 / cg"
-    "Modified: 11.4.1996 / 19:36:26 / cg"
+    "Modified: 14.2.1997 / 13:42:22 / cg"
 ! !
 
 !ProjectView methodsFor:'menu actions'!
 
 browseChanges
-    |b|
+    "open a changeBrowser showing all changes made in this project
+     (i.e. while this project was the active project)"
+
+    |changes b|
+
+    changes := myProject changeSet.
+    changes size == 0 ifTrue:[
+        self warn:(resources string:'no changes made in this project (yet)').
+        ^ self
+    ].
 
     b := ChangeSetBrowser openOn:(myProject changeSet).
     b label:(resources string:'Changes in %1' with:myProject name)
+
+    "Modified: 14.2.1997 / 13:36:40 / cg"
 !
 
 browsePackage
@@ -222,23 +249,37 @@
 !
 
 browseProps
-    "will look better, once property inspector runs ..."
+    "show the projects properties.
+     This is not yet finished ...
+     ... and will look better, once property inspector runs ..."
 
     myProject properties inspect
+
+    "Modified: 14.2.1997 / 13:37:15 / cg"
 !
 
 buildProject
+    "build the project; this is not yet finished ...
+     ... and will eventually create all sources, makefile and
+     build what is to be built: either a classLibrary or an application"
+
     self topView withWaitCursorDo:[
-	|dir|
+        |dir|
 
-	self saveProjectFiles.
-	(self confirm:'make object files in: ' ,  dir , ' ?') ifTrue:[
-	    myProject buildProject.
-	]
+        self saveProjectFiles.
+        (self confirm:'make object files in: ' ,  dir , ' ?') ifTrue:[
+            myProject buildProject.
+        ]
     ].
+
+    "Modified: 14.2.1997 / 13:38:06 / cg"
 !
 
 destroy
+    "Let user confirm, then close all of my views, and get rid of the changeList.
+     However, methods and classes are not restored to their
+     previous state."
+
     (myProject views notNil
     and:[myProject views notEmpty]) ifTrue:[
         |box|
@@ -251,13 +292,20 @@
 
     self doDestroy
 
-    "Modified: 12.12.1995 / 16:44:54 / cg"
+    "Modified: 14.2.1997 / 13:39:03 / cg"
 !
 
 doDestroy
+    "close all of my views, and get rid of the changeList.
+     However, methods and classes are not restored to their
+     previous state.
+     No confiramtion here."
+
     self hideProject.
     myProject := nil.
     super destroy
+
+    "Modified: 14.2.1997 / 13:39:18 / cg"
 !
 
 fileOutClasses
@@ -295,13 +343,22 @@
 !
 
 hideProject
+    "hide all views belonging to that project and switch
+     to the default project"
+
     myProject hideViews.
     ActiveProjectView := nil.
     toggle turnOff.
     Project setDefaultProject.
+
+    "Modified: 14.2.1997 / 13:39:43 / cg"
 !
 
 projectDirectory
+    "ask for the default directory, where fileOut will write
+     its files. Will eventually also be the place, where makefiles
+     and additional stuff is saved, for project building."
+
     |box d|
 
     box := FilenameEnterBox new.
@@ -328,27 +385,16 @@
         ].
     ].
     box showAtPointer
-!
 
-projectModule
-    |box d|
-
-    box := FilenameEnterBox new.
-    box directoriesOnly.
-    box title:(resources string:'PROJECT_MODULEDIR') withCRs.
-    (d := myProject repositoryModule) notNil ifTrue:[
-        box initialText:d
-    ].
-    box action:[:dirName |
-        myProject repositoryModule:dirName
-    ].
-    box showAtPointer
-
-    "Created: 25.11.1995 / 18:07:51 / cg"
-    "Modified: 10.12.1995 / 00:01:25 / cg"
+    "Modified: 14.2.1997 / 13:44:59 / cg"
 !
 
 projectNameSpace
+    "ask for the default nameSpace, into which new classes
+     are loaded while this project is active.
+     Useful before filing in alien code, to make certain that loaded
+     classes do not conflict with existing ones ..."
+
     self topView withWaitCursorDo:[
         |box allNameSpaces|
 
@@ -366,10 +412,14 @@
     ]
 
     "Created: 9.12.1995 / 16:50:45 / cg"
-    "Modified: 16.8.1996 / 14:56:42 / cg"
+    "Modified: 14.2.1997 / 13:43:52 / cg"
 !
 
 projectPackage
+    "ask for the package identifier of this project.
+     New classes and methods get this identifier, to find them
+     quickly later."
+
     self topView withWaitCursorDo:[
         |box p existingPackages allClasses|
 
@@ -430,25 +480,47 @@
     ]
 
     "Created: 9.12.1995 / 16:50:45 / cg"
-    "Modified: 16.8.1996 / 14:56:42 / cg"
+    "Modified: 14.2.1997 / 13:43:02 / cg"
 !
 
-projectRepository
-    |box d|
+projectRepositoryAndModule
+    "ask for a default module and package directory.
+     This is offered as default, when new containers are
+     created. However, when creating, these can still be changed"
+
+    |box d moduleHolder dirHolder|
+
+    box := DialogBox new.
+    (box addTextLabel:(resources string:'PROJECT_MODULEANDDIR') withCRs)
+        adjust:#left.
+    box addHorizontalLine.
+
+    moduleHolder := myProject repositoryModule asValue.
+    dirHolder := myProject repositoryDirectory asValue.
+
+    (box addTextLabel:(resources string:'PROJECT_MODULEDIR') withCRs)
+        adjust:#left.
+    box addFilenameInputFieldOn:moduleHolder in:nil tabable:true.
 
-    box := FilenameEnterBox new.
-    box directoriesOnly.
-    box title:(resources string:'PROJECT_PACKAGEDIR') withCRs.
-    (d := myProject repositoryDirectory) notNil ifTrue:[
-        box initialText:d
+    box addVerticalSpace.
+    box addHorizontalLine.
+    box addVerticalSpace.
+
+    (box addTextLabel:(resources string:'PROJECT_PACKAGEDIR') withCRs)
+        adjust:#left.
+    box addFilenameInputFieldOn:dirHolder in:nil tabable:true.
+
+    box addAbortButton; addOkButton.
+    box showAtPointer.
+
+    box accepted ifTrue:[
+        myProject repositoryModule:moduleHolder value.
+        myProject repositoryDirectory:dirHolder value.
     ].
-    box action:[:dirName |
-        myProject repositoryDirectory:dirName
-    ].
-    box showAtPointer
 
-    "Created: 25.11.1995 / 18:07:51 / cg"
-    "Modified: 11.12.1995 / 13:46:53 / cg"
+    box destroy.
+
+    "Modified: 14.2.1997 / 13:42:05 / cg"
 !
 
 removePackage
@@ -529,6 +601,9 @@
 !
 
 renameProject
+    "give that project another name - has no semantic meaning,
+     and does not affect any class/method"
+
     |box|
 
     box := EnterBox new.
@@ -542,18 +617,23 @@
     ].
     box showAtPointer
 
-    "Modified: 12.12.1995 / 16:22:48 / cg"
+    "Modified: 14.2.1997 / 13:41:15 / cg"
 !
 
 saveProjectFiles
+    "create the projects files.
+     This is not yet finished."
+
     self topView withWaitCursorDo:[
-	|dir|
+        |dir|
 
-	dir := myProject directory.
-	(self confirm:'create source files in: ' ,  dir , ' ?') ifTrue:[
-	    myProject createProjectFiles.
-	]
+        dir := myProject directory.
+        (self confirm:'create source files in: ' ,  dir , ' ?') ifTrue:[
+            myProject createProjectFiles.
+        ]
     ].
+
+    "Modified: 14.2.1997 / 13:40:40 / cg"
 !
 
 showClassDocumentation
@@ -596,14 +676,19 @@
 !
 
 showProject
+    "show all views belonging to that project and hide
+     the active projects views (except for those opened before)"
+
     ActiveProjectView notNil ifTrue:[
-	ActiveProjectView hideProject
+        ActiveProjectView hideProject
     ].
     ActiveProjectView := self.
 
     myProject showViews.
     Project current:myProject.
     toggle turnOn
+
+    "Modified: 14.2.1997 / 13:40:10 / cg"
 ! !
 
 !ProjectView methodsFor:'private accessing'!
@@ -634,5 +719,5 @@
 !ProjectView class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libtool/Attic/ProjectV.st,v 1.34 1997-01-04 15:40:42 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libtool/Attic/ProjectV.st,v 1.35 1997-01-14 12:46:32 cg Exp $'
 ! !
--- a/ProjectView.st	Tue Jan 14 12:56:40 1997 +0100
+++ b/ProjectView.st	Tue Jan 14 13:46:32 1997 +0100
@@ -66,27 +66,45 @@
          which were done while this project was active)
 
       - allow removal of all classes/methods which have the current projects packageIdentifier
+
+    [author:]
+        Claus Gittinger
+
+    [see also:]
+        Project
+        Namespace
+        CVSSourceCodemanager
 "
+
 ! !
 
 !ProjectView class methodsFor:'instance creation'!
 
 for:aProject
+    "create & open a new projectView on some project"
+
     |newView|
 
     newView := super new.
     newView setProject:aProject.
     ^ newView
 
-    "ProjectView for:(Project new)"
+    "
+     ProjectView for:(Project new)
+    "
+
+    "Modified: 14.2.1997 / 13:46:07 / cg"
 ! !
 
 !ProjectView methodsFor:'initialization'!
 
 addToCurrentProject
-    "ignored here"
+    "add this view to the current projects set of views.
+     Ignored here - ProjectViews are global."
 
     ^ self
+
+    "Modified: 14.2.1997 / 13:35:58 / cg"
 !
 
 initialize
@@ -124,8 +142,7 @@
                     'fileOut classes'
                     '-'
                     'fileOut directory ...'
-                    'repository module ...'
-                    'repository directory ...'
+                    'repository defaults ...'
                     'package name ...'
                     'default nameSpace ...'
 "/                        '-'
@@ -149,8 +166,7 @@
                     fileOutClasses
                     nil
                     projectDirectory
-                    projectModule
-                    projectRepository
+                    projectRepositoryAndModule
                     projectPackage
                     projectNameSpace
 "/                        nil
@@ -175,16 +191,27 @@
     toggle middleButtonMenu:m
 
     "Created: 25.11.1995 / 18:06:32 / cg"
-    "Modified: 11.4.1996 / 19:36:26 / cg"
+    "Modified: 14.2.1997 / 13:42:22 / cg"
 ! !
 
 !ProjectView methodsFor:'menu actions'!
 
 browseChanges
-    |b|
+    "open a changeBrowser showing all changes made in this project
+     (i.e. while this project was the active project)"
+
+    |changes b|
+
+    changes := myProject changeSet.
+    changes size == 0 ifTrue:[
+        self warn:(resources string:'no changes made in this project (yet)').
+        ^ self
+    ].
 
     b := ChangeSetBrowser openOn:(myProject changeSet).
     b label:(resources string:'Changes in %1' with:myProject name)
+
+    "Modified: 14.2.1997 / 13:36:40 / cg"
 !
 
 browsePackage
@@ -222,23 +249,37 @@
 !
 
 browseProps
-    "will look better, once property inspector runs ..."
+    "show the projects properties.
+     This is not yet finished ...
+     ... and will look better, once property inspector runs ..."
 
     myProject properties inspect
+
+    "Modified: 14.2.1997 / 13:37:15 / cg"
 !
 
 buildProject
+    "build the project; this is not yet finished ...
+     ... and will eventually create all sources, makefile and
+     build what is to be built: either a classLibrary or an application"
+
     self topView withWaitCursorDo:[
-	|dir|
+        |dir|
 
-	self saveProjectFiles.
-	(self confirm:'make object files in: ' ,  dir , ' ?') ifTrue:[
-	    myProject buildProject.
-	]
+        self saveProjectFiles.
+        (self confirm:'make object files in: ' ,  dir , ' ?') ifTrue:[
+            myProject buildProject.
+        ]
     ].
+
+    "Modified: 14.2.1997 / 13:38:06 / cg"
 !
 
 destroy
+    "Let user confirm, then close all of my views, and get rid of the changeList.
+     However, methods and classes are not restored to their
+     previous state."
+
     (myProject views notNil
     and:[myProject views notEmpty]) ifTrue:[
         |box|
@@ -251,13 +292,20 @@
 
     self doDestroy
 
-    "Modified: 12.12.1995 / 16:44:54 / cg"
+    "Modified: 14.2.1997 / 13:39:03 / cg"
 !
 
 doDestroy
+    "close all of my views, and get rid of the changeList.
+     However, methods and classes are not restored to their
+     previous state.
+     No confiramtion here."
+
     self hideProject.
     myProject := nil.
     super destroy
+
+    "Modified: 14.2.1997 / 13:39:18 / cg"
 !
 
 fileOutClasses
@@ -295,13 +343,22 @@
 !
 
 hideProject
+    "hide all views belonging to that project and switch
+     to the default project"
+
     myProject hideViews.
     ActiveProjectView := nil.
     toggle turnOff.
     Project setDefaultProject.
+
+    "Modified: 14.2.1997 / 13:39:43 / cg"
 !
 
 projectDirectory
+    "ask for the default directory, where fileOut will write
+     its files. Will eventually also be the place, where makefiles
+     and additional stuff is saved, for project building."
+
     |box d|
 
     box := FilenameEnterBox new.
@@ -328,27 +385,16 @@
         ].
     ].
     box showAtPointer
-!
 
-projectModule
-    |box d|
-
-    box := FilenameEnterBox new.
-    box directoriesOnly.
-    box title:(resources string:'PROJECT_MODULEDIR') withCRs.
-    (d := myProject repositoryModule) notNil ifTrue:[
-        box initialText:d
-    ].
-    box action:[:dirName |
-        myProject repositoryModule:dirName
-    ].
-    box showAtPointer
-
-    "Created: 25.11.1995 / 18:07:51 / cg"
-    "Modified: 10.12.1995 / 00:01:25 / cg"
+    "Modified: 14.2.1997 / 13:44:59 / cg"
 !
 
 projectNameSpace
+    "ask for the default nameSpace, into which new classes
+     are loaded while this project is active.
+     Useful before filing in alien code, to make certain that loaded
+     classes do not conflict with existing ones ..."
+
     self topView withWaitCursorDo:[
         |box allNameSpaces|
 
@@ -366,10 +412,14 @@
     ]
 
     "Created: 9.12.1995 / 16:50:45 / cg"
-    "Modified: 16.8.1996 / 14:56:42 / cg"
+    "Modified: 14.2.1997 / 13:43:52 / cg"
 !
 
 projectPackage
+    "ask for the package identifier of this project.
+     New classes and methods get this identifier, to find them
+     quickly later."
+
     self topView withWaitCursorDo:[
         |box p existingPackages allClasses|
 
@@ -430,25 +480,47 @@
     ]
 
     "Created: 9.12.1995 / 16:50:45 / cg"
-    "Modified: 16.8.1996 / 14:56:42 / cg"
+    "Modified: 14.2.1997 / 13:43:02 / cg"
 !
 
-projectRepository
-    |box d|
+projectRepositoryAndModule
+    "ask for a default module and package directory.
+     This is offered as default, when new containers are
+     created. However, when creating, these can still be changed"
+
+    |box d moduleHolder dirHolder|
+
+    box := DialogBox new.
+    (box addTextLabel:(resources string:'PROJECT_MODULEANDDIR') withCRs)
+        adjust:#left.
+    box addHorizontalLine.
+
+    moduleHolder := myProject repositoryModule asValue.
+    dirHolder := myProject repositoryDirectory asValue.
+
+    (box addTextLabel:(resources string:'PROJECT_MODULEDIR') withCRs)
+        adjust:#left.
+    box addFilenameInputFieldOn:moduleHolder in:nil tabable:true.
 
-    box := FilenameEnterBox new.
-    box directoriesOnly.
-    box title:(resources string:'PROJECT_PACKAGEDIR') withCRs.
-    (d := myProject repositoryDirectory) notNil ifTrue:[
-        box initialText:d
+    box addVerticalSpace.
+    box addHorizontalLine.
+    box addVerticalSpace.
+
+    (box addTextLabel:(resources string:'PROJECT_PACKAGEDIR') withCRs)
+        adjust:#left.
+    box addFilenameInputFieldOn:dirHolder in:nil tabable:true.
+
+    box addAbortButton; addOkButton.
+    box showAtPointer.
+
+    box accepted ifTrue:[
+        myProject repositoryModule:moduleHolder value.
+        myProject repositoryDirectory:dirHolder value.
     ].
-    box action:[:dirName |
-        myProject repositoryDirectory:dirName
-    ].
-    box showAtPointer
 
-    "Created: 25.11.1995 / 18:07:51 / cg"
-    "Modified: 11.12.1995 / 13:46:53 / cg"
+    box destroy.
+
+    "Modified: 14.2.1997 / 13:42:05 / cg"
 !
 
 removePackage
@@ -529,6 +601,9 @@
 !
 
 renameProject
+    "give that project another name - has no semantic meaning,
+     and does not affect any class/method"
+
     |box|
 
     box := EnterBox new.
@@ -542,18 +617,23 @@
     ].
     box showAtPointer
 
-    "Modified: 12.12.1995 / 16:22:48 / cg"
+    "Modified: 14.2.1997 / 13:41:15 / cg"
 !
 
 saveProjectFiles
+    "create the projects files.
+     This is not yet finished."
+
     self topView withWaitCursorDo:[
-	|dir|
+        |dir|
 
-	dir := myProject directory.
-	(self confirm:'create source files in: ' ,  dir , ' ?') ifTrue:[
-	    myProject createProjectFiles.
-	]
+        dir := myProject directory.
+        (self confirm:'create source files in: ' ,  dir , ' ?') ifTrue:[
+            myProject createProjectFiles.
+        ]
     ].
+
+    "Modified: 14.2.1997 / 13:40:40 / cg"
 !
 
 showClassDocumentation
@@ -596,14 +676,19 @@
 !
 
 showProject
+    "show all views belonging to that project and hide
+     the active projects views (except for those opened before)"
+
     ActiveProjectView notNil ifTrue:[
-	ActiveProjectView hideProject
+        ActiveProjectView hideProject
     ].
     ActiveProjectView := self.
 
     myProject showViews.
     Project current:myProject.
     toggle turnOn
+
+    "Modified: 14.2.1997 / 13:40:10 / cg"
 ! !
 
 !ProjectView methodsFor:'private accessing'!
@@ -634,5 +719,5 @@
 !ProjectView class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libtool/ProjectView.st,v 1.34 1997-01-04 15:40:42 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libtool/ProjectView.st,v 1.35 1997-01-14 12:46:32 cg Exp $'
 ! !