BrowserView.st
changeset 2178 ce3b8658fed4
parent 2174 5e599b7bd5ff
child 2179 934c84ce1b8d
--- a/BrowserView.st	Mon Jun 07 17:19:23 1999 +0200
+++ b/BrowserView.st	Mon Jun 07 17:28:04 1999 +0200
@@ -4195,8 +4195,8 @@
      y component info project nm mgr creatingNew msg|
 
     aClass isLoaded ifFalse:[
-	self warn:'please load the class first'.
-	^ false.
+        self warn:'please load the class first'.
+        ^ false.
     ].
 
     className := aClass name.
@@ -4205,27 +4205,27 @@
     "/ defaults, if nothing at all is known
     "/
     (module := lastModule) isNil ifTrue:[
-	module := (OperatingSystem getLoginName).
+        module := (OperatingSystem getLoginName).
     ].
     (package := lastPackage) isNil ifTrue:[
-	package := 'private'.
+        package := 'private'.
     ].
 
     "/
     "/ try to extract some useful defaults from the current project
     "/
     (Project notNil and:[(project := Project current) notNil]) ifTrue:[
-	package isNil ifTrue:[
-	    (nm := project repositoryDirectory) isNil ifTrue:[
-		nm := project name
-	    ].
-	    package := nm.
-	].
-	module isNil ifTrue:[
-	    (nm := project repositoryModule) notNil ifTrue:[
-		module := nm
-	    ]
-	].
+        package isNil ifTrue:[
+            (nm := project repositoryDirectory) isNil ifTrue:[
+                nm := project name
+            ].
+            package := nm.
+        ].
+        module isNil ifTrue:[
+            (nm := project repositoryModule) notNil ifTrue:[
+                module := nm
+            ]
+        ].
     ].
 
     "/
@@ -4234,23 +4234,23 @@
     "/
     info := (mgr := aClass sourceCodeManager) sourceInfoOfClass:aClass.
     info notNil ifTrue:[
-	module ~= lastModule ifTrue:[
-	    (info includesKey:#module) ifTrue:[
-		module := (info at:#module).
-	    ].
-	].
-	package ~= lastPackage ifTrue:[
-	    (info includesKey:#directory) ifTrue:[
-		package := (info at:#directory).
-	    ].
-	].
-	fileName := mgr containerFromSourceInfo:info.
-	(nameSpace := aClass nameSpace) ~~ Smalltalk ifTrue:[
-	    nameSpacePrefix := nameSpace name , '::'.
-	    (fileName startsWith:nameSpacePrefix) ifTrue:[
-		fileName := fileName copyFrom:(nameSpacePrefix size + 1).
-	    ]
-	].
+        module ~= lastModule ifTrue:[
+            (info includesKey:#module) ifTrue:[
+                module := (info at:#module).
+            ].
+        ].
+        package ~= lastPackage ifTrue:[
+            (info includesKey:#directory) ifTrue:[
+                package := (info at:#directory).
+            ].
+        ].
+        fileName := mgr containerFromSourceInfo:info.
+        (nameSpace := aClass nameSpace) ~~ Smalltalk ifTrue:[
+            nameSpacePrefix := nameSpace name , '::'.
+            (fileName startsWith:nameSpacePrefix) ifTrue:[
+                fileName := fileName copyFrom:(nameSpacePrefix size + 1).
+            ]
+        ].
 "/        (info includesKey:#fileName) ifTrue:[
 "/            fileName := (info at:#fileName).
 "/        ] ifFalse:[
@@ -4265,24 +4265,30 @@
     ].
 
     fileName isNil ifTrue:[
-	aClass nameSpace ~~ Smalltalk ifTrue:[
-	     fileName := aClass nameWithoutPrefix , '.st'.
-	] ifFalse:[
-	     fileName := (Smalltalk fileNameForClass:aClass) , '.st'.
-	]
+        aClass nameSpace ~~ Smalltalk ifTrue:[
+             fileName := aClass nameWithoutPrefix , '.st'.
+        ] ifFalse:[
+             fileName := (Smalltalk fileNameForClass:aClass) , '.st'.
+        ]
     ].
 
     fileNameHolder := fileName asValue.
+    OperatingSystem isMSDOSlike ifTrue:[
+        module replaceAll:$\ with:$/.
+    ].
     moduleHolder := module asValue.
+    OperatingSystem isMSDOSlike ifTrue:[
+        package replaceAll:$\ with:$/.
+    ].
     packageHolder := package asValue.
 
     "/
     "/ should check for conflicts (i.e. if such a container already exists) ...
     "/
     (mgr checkForExistingContainerInModule:module 
-				   package:package 
-				 container:fileName) ifTrue:[
-	"/ for now - this needs more work.
+                                   package:package 
+                                 container:fileName) ifTrue:[
+        "/ for now - this needs more work.
 
 "/        self information:(resources 
 "/                            string:'%1 is already contained in the container:
@@ -4294,24 +4300,24 @@
 "/                            with:fileName).
 "/        ^ false.
 "/
-	(Dialog confirm:(resources 
-			    string:'Notice: there already is a container for %1 in:
+        (Dialog confirm:(resources 
+                            string:'Notice: there already is a container for %1 in:
 
     %2 / %3 / %4
 
 To change it, press continue.'
-			    with:className
-			    with:module
-			    with:package
-			    with:fileName)
-		yesLabel:(resources string:'continue')
-		noLabel:(resources string:'cancel'))
-	ifFalse:[
-	    ^ false
-	].
-	oldModule := module.
-	oldPackage := package.
-	oldFileName := fileName
+                            with:className
+                            with:module
+                            with:package
+                            with:fileName)
+                yesLabel:(resources string:'continue')
+                noLabel:(resources string:'cancel'))
+        ifFalse:[
+            ^ false
+        ].
+        oldModule := module.
+        oldPackage := package.
+        oldFileName := fileName
     ].
 
     "/
@@ -4351,13 +4357,13 @@
     box addVerticalSpace.
 
     (mgr checkForExistingContainerInModule:module 
-				   package:package 
-				 container:fileName) ifFalse:[
-	component := box addTextLabel:'Notice: class seems to have no container yet.'.
-	component adjust:#left; borderWidth:0.
-	creatingNew := true.
+                                   package:package 
+                                 container:fileName) ifFalse:[
+        component := box addTextLabel:'Notice: class seems to have no container yet.'.
+        component adjust:#left; borderWidth:0.
+        creatingNew := true.
     ] ifTrue:[
-	creatingNew := false.
+        creatingNew := false.
     ].
 
     box addVerticalSpace.
@@ -4367,87 +4373,87 @@
     box showAtPointer.
 
     box accepted ifTrue:[
-	module := moduleHolder value withoutSpaces.
-	package := packageHolder value withoutSpaces.
-
-	fileName := fileNameHolder value withoutSpaces.
-
-	(fileName endsWith:',v') ifTrue:[
-	    fileName := fileName copyWithoutLast:2
-	].
-	(fileName endsWith:'.st') ifFalse:[
-	    fileName := fileName , '.st'
-	].
-
-	info := aClass revisionInfo.
-	info notNil ifTrue:[
-	    (info includesKey:#repositoryPathName) ifFalse:[
-		info := nil
-	    ]
-	].
-	info isNil ifTrue:[
-	    creatingNew ifFalse:[
-		(self confirm:(resources string:'The repository already contains a container named "%3" in "%1/%2" !!\\Checkin %4 anyway ? (DANGER - be careful)'
-			 withArgs:(Array with:module with:package with:fileName with:className)) withCRs)
-		    ifFalse:[
-			^ false
-		    ].
-	    ].
-
-	    (self confirm:(resources string:'%1 does not have any (usable) revision info (#version method)\\Shall I create one ?' with:className) withCRs)
-		ifFalse:[
-		    ^ false
-		].
-	    aClass updateVersionMethodFor:(mgr initialRevisionStringFor:aClass 
-					       inModule:module 
-					       package:package 
-					       container:fileName).
-	].
-
-	"/
-	"/ check for the module
-	"/
-	(mgr checkForExistingModule:module) ifFalse:[
-	    (createDirs or:[creatingNew]) ifFalse:[
-		self warn:(resources string:'a module named %1 does not exist in the source code management' with:module).
-		^ false
-	    ].
-	    (self confirm:(resources string:'%1 is a new module.\\create it ?' with:module) withCRs) ifFalse:[
-		^ false.
-	    ].
-	    (mgr createModule:module) ifFalse:[
-		self warn:(resources string:'cannot create new module: %1' with:module).
-		^ false.
-	    ]
-	].
-	lastModule := module.
-
-
-	"/
-	"/ check for the package
-	"/
-	(mgr checkForExistingModule:module package:package) ifFalse:[
-	    (createDirs or:[creatingNew]) ifFalse:[
-		self warn:(resources string:'a package named %1 does not exist module %2' with:module with:package).
-		^ false
-	    ].
-	    (self confirm:(resources string:'%1 is a new package (in module %2).\\create it ?' with:package with:module) withCRs) ifFalse:[
-		^ false.
-	    ].
-	    (mgr createModule:module package:package) ifFalse:[
-		self warn:(resources string:'cannot create new package: %1 (in module %2)' with:package with:module).
-		^ false.
-	    ]
-	].
-	lastPackage := package.
-
-	"/
-	"/ check for the container itself
-	"/
-	(mgr checkForExistingContainerInModule:module package:package container:fileName) ifTrue:[
-	    creatingNew ifTrue:[
-		self warn:(resources string:'container for %1 already exists in %2/%3.' with:fileName with:module with:package) withCRs.
-	    ].
+        module := moduleHolder value withoutSpaces.
+        package := packageHolder value withoutSpaces.
+
+        fileName := fileNameHolder value withoutSpaces.
+
+        (fileName endsWith:',v') ifTrue:[
+            fileName := fileName copyWithoutLast:2
+        ].
+        (fileName endsWith:'.st') ifFalse:[
+            fileName := fileName , '.st'
+        ].
+
+        info := aClass revisionInfo.
+        info notNil ifTrue:[
+            (info includesKey:#repositoryPathName) ifFalse:[
+                info := nil
+            ]
+        ].
+        info isNil ifTrue:[
+            creatingNew ifFalse:[
+                (self confirm:(resources string:'The repository already contains a container named "%3" in "%1/%2" !!\\Checkin %4 anyway ? (DANGER - be careful)'
+                         withArgs:(Array with:module with:package with:fileName with:className)) withCRs)
+                    ifFalse:[
+                        ^ false
+                    ].
+            ].
+
+            (self confirm:(resources string:'%1 does not have any (usable) revision info (#version method)\\Shall I create one ?' with:className) withCRs)
+                ifFalse:[
+                    ^ false
+                ].
+            aClass updateVersionMethodFor:(mgr initialRevisionStringFor:aClass 
+                                               inModule:module 
+                                               package:package 
+                                               container:fileName).
+        ].
+
+        "/
+        "/ check for the module
+        "/
+        (mgr checkForExistingModule:module) ifFalse:[
+            (createDirs or:[creatingNew]) ifFalse:[
+                self warn:(resources string:'a module named %1 does not exist in the source code management' with:module).
+                ^ false
+            ].
+            (self confirm:(resources string:'%1 is a new module.\\create it ?' with:module) withCRs) ifFalse:[
+                ^ false.
+            ].
+            (mgr createModule:module) ifFalse:[
+                self warn:(resources string:'cannot create new module: %1' with:module).
+                ^ false.
+            ]
+        ].
+        lastModule := module.
+
+
+        "/
+        "/ check for the package
+        "/
+        (mgr checkForExistingModule:module package:package) ifFalse:[
+            (createDirs or:[creatingNew]) ifFalse:[
+                self warn:(resources string:'a package named %1 does not exist module %2' with:module with:package).
+                ^ false
+            ].
+            (self confirm:(resources string:'%1 is a new package (in module %2).\\create it ?' with:package with:module) withCRs) ifFalse:[
+                ^ false.
+            ].
+            (mgr createModule:module package:package) ifFalse:[
+                self warn:(resources string:'cannot create new package: %1 (in module %2)' with:package with:module).
+                ^ false.
+            ]
+        ].
+        lastPackage := package.
+
+        "/
+        "/ check for the container itself
+        "/
+        (mgr checkForExistingContainerInModule:module package:package container:fileName) ifTrue:[
+            creatingNew ifTrue:[
+                self warn:(resources string:'container for %1 already exists in %2/%3.' with:fileName with:module with:package) withCRs.
+            ].
 
 "/            (oldModule notNil
 "/            and:[(oldModule ~= module)
@@ -4458,72 +4464,72 @@
 "/                ^ false.
 "/            ].
 
-	    (self confirm:(resources string:'check %1 into the existing container
+            (self confirm:(resources string:'check %1 into the existing container
 
     %2 / %3 / %4  ?'
-				with:className
-				with:module 
-				with:package 
-				with:fileName) withCRs) 
-	    ifFalse:[
-		^ false.
-	    ].  
-
-	    aClass updateVersionMethodFor:'$' , 'Header' , '$'. "/ concatenated to avoid RCS-expansion
-
-	    oldFileName notNil ifTrue:[
-		msg := ('forced checkin / source container change from ' , oldFileName).
-	    ] ifFalse:[
-		msg := 'defined source container'
-	    ].
-
-	    (mgr
-		checkinClass:aClass 
-		fileName:fileName 
-		directory:package 
-		module:module 
-		logMessage:msg)
-	    ifFalse:[
-		(self confirm:'no easy merge seems possible; force checkin (no merge) ?') ifFalse:[
-		    self normalLabel.
-		    ^ false.
-		].
-		(mgr
-		    checkinClass:aClass 
-		    fileName:fileName 
-		    directory:package 
-		    module:module 
-		    logMessage:msg
-		    force:true)
-		ifFalse:[
-		    self warn:(resources string:'failed to check into existing container.').
-		    self normalLabel.
-		    ^ false.
-		].
-	    ].
-
-	    self normalLabel.
-	    ^ true
-	] ifFalse:[
-	    (createContainer or:[creatingNew]) ifFalse:[
-		(self confirm:(resources string:'no container exists for %1 in %2/%3\\create ?' 
-					  with:fileName with:module with:package) withCRs) ifFalse:[
-		    ^ false
-		]
-	    ]
-	].
-
-	(mgr
-		createContainerFor:aClass
-		inModule:module
-		package:package
-		container:fileName) ifFalse:[
-	    self warn:(resources string:'failed to create container.').
-	    self normalLabel.
-	    ^ false.
-	].
-	self normalLabel.
-	^ true
+                                with:className
+                                with:module 
+                                with:package 
+                                with:fileName) withCRs) 
+            ifFalse:[
+                ^ false.
+            ].  
+
+            aClass updateVersionMethodFor:'$' , 'Header' , '$'. "/ concatenated to avoid RCS-expansion
+
+            oldFileName notNil ifTrue:[
+                msg := ('forced checkin / source container change from ' , oldFileName).
+            ] ifFalse:[
+                msg := 'defined source container'
+            ].
+
+            (mgr
+                checkinClass:aClass 
+                fileName:fileName 
+                directory:package 
+                module:module 
+                logMessage:msg)
+            ifFalse:[
+                (self confirm:'no easy merge seems possible; force checkin (no merge) ?') ifFalse:[
+                    self normalLabel.
+                    ^ false.
+                ].
+                (mgr
+                    checkinClass:aClass 
+                    fileName:fileName 
+                    directory:package 
+                    module:module 
+                    logMessage:msg
+                    force:true)
+                ifFalse:[
+                    self warn:(resources string:'failed to check into existing container.').
+                    self normalLabel.
+                    ^ false.
+                ].
+            ].
+
+            self normalLabel.
+            ^ true
+        ] ifFalse:[
+            (createContainer or:[creatingNew]) ifFalse:[
+                (self confirm:(resources string:'no container exists for %1 in %2/%3\\create ?' 
+                                          with:fileName with:module with:package) withCRs) ifFalse:[
+                    ^ false
+                ]
+            ]
+        ].
+
+        (mgr
+                createContainerFor:aClass
+                inModule:module
+                package:package
+                container:fileName) ifFalse:[
+            self warn:(resources string:'failed to create container.').
+            self normalLabel.
+            ^ false.
+        ].
+        self normalLabel.
+        ^ true
     ].
     box destroy.
     ^ false
@@ -4836,8 +4842,8 @@
     |module package fileName info mgr|
 
     aClass isLoaded ifFalse:[
-	self warn:'please load the class first'.
-	^ false.
+        self warn:'please load the class first'.
+        ^ false.
     ].
 
     "/
@@ -4846,67 +4852,73 @@
     "/
     mgr := aClass sourceCodeManager.
     mgr isNil ifTrue:[
-	self warn:'No sourceCodeManagement.'.
-	^ false
+        self warn:'No sourceCodeManagement.'.
+        ^ false
     ].
 
     info := mgr sourceInfoOfClass:aClass.
     info notNil ifTrue:[
-	(info includesKey:#module) ifTrue:[
-	    module := (info at:#module).
-	].
-	(info includesKey:#directory) ifTrue:[
-	    package := (info at:#directory).
-	].
-	fileName := mgr containerFromSourceInfo:info.
+        (info includesKey:#module) ifTrue:[
+            module := (info at:#module).
+        ].
+        (info includesKey:#directory) ifTrue:[
+            package := (info at:#directory).
+        ].
+        fileName := mgr containerFromSourceInfo:info.
     ].
 
     module isNil ifTrue:[
-	self warn:'classes module is unknown.\\It seems to not have a container.' withCRs.
-	^ false.
+        self warn:'classes module is unknown.\\It seems to not have a container.' withCRs.
+        ^ false.
     ].
     package isNil ifTrue:[
-	self warn:'classes package is unknown.\\It seems to not have a container.' withCRs.
-	^ false.
+        self warn:'classes package is unknown.\\It seems to not have a container.' withCRs.
+        ^ false.
     ].
     fileName isNil ifTrue:[
-	self warn:'classes container fileName is unknown.\\It seems to not have a container.' withCRs.
-	^ false.
+        self warn:'classes container fileName is unknown.\\It seems to not have a container.' withCRs.
+        ^ false.
     ].
         
+    OperatingSystem isMSDOSlike ifTrue:[
+        module replaceAll:$\ with:$/.
+    ].
+    OperatingSystem isMSDOSlike ifTrue:[
+        package replaceAll:$\ with:$/.
+    ].
     (mgr checkForExistingContainerInModule:module 
-				   package:package 
-				 container:fileName) ifFalse:[
-	self warn:'Class has no source container.' withCRs.
-	^ false.
+                                   package:package 
+                                 container:fileName) ifFalse:[
+        self warn:'Class has no source container.' withCRs.
+        ^ false.
     ].
 
     (Dialog
-	choose:(resources 
-		    string:'Please confirm removal of the container for %1:
+        choose:(resources 
+                    string:'Please confirm removal of the container for %1:
 
 container:    %2 / %3 / %4
 
 Really remove ?' 
-		    with:aClass name 
-		    with:module 
-		    with:package 
-		    with:fileName) 
-	labels:(Array 
-		    with:(resources string:'no') 
-		    with:(resources string:'remove'))
-	values:#(false true)
-	default:false) ifFalse:[
-	^ self.
+                    with:aClass name 
+                    with:module 
+                    with:package 
+                    with:fileName) 
+        labels:(Array 
+                    with:(resources string:'no') 
+                    with:(resources string:'remove'))
+        values:#(false true)
+        default:false) ifFalse:[
+        ^ self.
     ].
 
     (mgr removeContainerFor:aClass
-		   inModule:module
-		    package:package
-		  container:fileName) ifFalse:[
-	self warn:(resources string:'failed to remove container.').
-	self normalLabel.
-	^ true.
+                   inModule:module
+                    package:package
+                  container:fileName) ifFalse:[
+        self warn:(resources string:'failed to remove container.').
+        self normalLabel.
+        ^ true.
     ].
     ^ false
 
@@ -13539,6 +13551,6 @@
 !BrowserView class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libtool/BrowserView.st,v 1.507 1999-05-28 10:29:00 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libtool/BrowserView.st,v 1.508 1999-06-07 15:28:04 cg Exp $'
 ! !
 BrowserView initialize!