BrowserView.st
changeset 339 43d8b6158ec6
parent 338 1d4a76bf6e8f
child 340 8b9971312f6a
--- a/BrowserView.st	Thu Jan 25 17:47:25 1996 +0100
+++ b/BrowserView.st	Fri Jan 26 16:28:54 1996 +0100
@@ -1241,188 +1241,188 @@
     |specialMenu labels selectors m|
 
     labels :=  #(
-		   'fileOut binary'
-		   '-'
-		   'inspect class'
-		   '-'
-		   'primitive definitions'
-		   'primitive variables'
-		   'primitive functions'
-		   '-'
-		   'container ...'
-		   '-'
-		   'revision info' 
-		   'compare with repository ...' 
-		   '-'
-		   'check into source repository'
-		   'fileIn from repository ...' 
-		).
+                   'fileOut binary'
+                   '-'
+                   'inspect class'
+                   '-'
+                   'primitive definitions'
+                   'primitive variables'
+                   'primitive functions'
+                   '-'
+                   'source container ...'
+                   '-'
+                   'revision info' 
+                   'compare with repository ...' 
+                   '-'
+                   'check into source repository'
+                   'fileIn from repository ...' 
+                ).
     selectors := #(
-		   classFileOutBinary
-		   nil
-		   classInspect
-		   nil
-		   classPrimitiveDefinitions
-		   classPrimitiveVariables
-		   classPrimitiveFunctions
-		   nil
-		   classModifyContainer
-		   nil
-		   classRevisionInfo
-		   classCompareWithNewestInRepository
-		   nil
-		   classCheckin
-		   classLoadRevision
-		  ).
+                   classFileOutBinary
+                   nil
+                   classInspect
+                   nil
+                   classPrimitiveDefinitions
+                   classPrimitiveVariables
+                   classPrimitiveFunctions
+                   nil
+                   classModifyContainer
+                   nil
+                   classRevisionInfo
+                   classCompareWithNewestInRepository
+                   nil
+                   classCheckin
+                   classLoadRevision
+                  ).
 
     specialMenu := PopUpMenu
-			labels:(resources array:labels)
-			selectors:selectors
-			receiver:self.
+                        labels:(resources array:labels)
+                        selectors:selectors
+                        receiver:self.
 
     currentClass isNil ifTrue:[
-	specialMenu disableAll.
+        specialMenu disableAll.
     ] ifFalse:[
-	currentClass sourceCodeManager isNil ifTrue:[
-	    specialMenu disableAll:#(classModifyContainer classRevisionInfo 
-			   classLoadRevision classCheckin classCompareWithNewestInRepository).
-	]
+        currentClass sourceCodeManager isNil ifTrue:[
+            specialMenu disableAll:#(classModifyContainer classRevisionInfo 
+                           classLoadRevision classCheckin classCompareWithNewestInRepository).
+        ]
     ].
 
     device ctrlDown ifTrue:[
-	^ specialMenu
+        ^ specialMenu
     ].
 
     currentClass isNil ifTrue:[
-	labels :=    #(
-		       'new class'
-		     ).
-	selectors := #(
-		       classNewClass
-		     ).
+        labels :=    #(
+                       'new class'
+                     ).
+        selectors := #(
+                       classNewClass
+                     ).
     ] ifFalse:[
-	currentClass isLoaded ifFalse:[
-	    labels :=    #(
-			   'definition'
-			   '-'
-			   'new class'
-			   '-'
-			   'load '
-			 ).
-	    selectors := #(
-			   classDefinition
-			   nil
-			   classNewClass
-			   nil
-			   classLoad
-			 ).
-	] ifTrue:[
-	    fullProtocol ifTrue:[
-		labels :=    #(
-			       'hierarchy' 
-			       'definition' 
-			       'comment' 
-			       'class instvars' 
-			     ).
-		selectors := #(
-			       classHierarchy
-			       classDefinition
-			       classComment
-			       classClassInstVars
-			      ).
-	    ] ifFalse:[
-		labels :=    #(
-			       'fileOut'
-			       'printOut'
-			       'printOut protocol'
-			     " 'printOut full protocol' "
-			       '-'
-			       'SPAWN_CLASS' 
-			       'spawn full protocol' 
-			       'spawn hierarchy' 
-			       'spawn subclasses' 
-			       '-'
-			      ).
-		selectors := #(
-			       classFileOut
-			       classPrintOut
-			       classPrintOutProtocol
-			    "  classPrintOutFullProtocol "
-			       nil
-			       classSpawn
-			       classSpawnFullProtocol
-			       classSpawnHierarchy
-			       classSpawnSubclasses
-			       nil
-			      ).
-
-		fullClass ifFalse:[
-		    labels := labels , #(
-			       'hierarchy' 
-			       'definition' 
-			       'comment' 
-			       'class instvars' 
-	       "/              'protocols' 
-			       '-'
-			      ).
-		    selectors := selectors , #(
-			       classHierarchy
-			       classDefinition
-			       classComment
-			       classClassInstVars
-	       "/              classProtocols 
-			       nil
-			      ).
-		].
-
-		labels := labels , #(
-	       "/              'variable search'
-			       'class refs'
-			       '-'
-			       'new class'
-			       'new subclass'
-			       'rename ...'
-			       'remove'
-			      ).
-		selectors := selectors , #(
-	       "/              variables
-			       classRefs
-			       nil
-			       classNewClass
-			       classNewSubclass
-			       classRename
-			       classRemove
-			      ).
-		currentClass wasAutoloaded ifTrue:[
-		    labels := labels , #(
-			       'unload'
-			      ).
-		    selectors := selectors , #(
-			       classUnload
-			      ).
-		]
-	    ]
-	].
+        currentClass isLoaded ifFalse:[
+            labels :=    #(
+                           'definition'
+                           '-'
+                           'new class'
+                           '-'
+                           'load '
+                         ).
+            selectors := #(
+                           classDefinition
+                           nil
+                           classNewClass
+                           nil
+                           classLoad
+                         ).
+        ] ifTrue:[
+            fullProtocol ifTrue:[
+                labels :=    #(
+                               'hierarchy' 
+                               'definition' 
+                               'comment' 
+                               'class instvars' 
+                             ).
+                selectors := #(
+                               classHierarchy
+                               classDefinition
+                               classComment
+                               classClassInstVars
+                              ).
+            ] ifFalse:[
+                labels :=    #(
+                               'fileOut'
+                               'printOut'
+                               'printOut protocol'
+                             " 'printOut full protocol' "
+                               '-'
+                               'SPAWN_CLASS' 
+                               'spawn full protocol' 
+                               'spawn hierarchy' 
+                               'spawn subclasses' 
+                               '-'
+                              ).
+                selectors := #(
+                               classFileOut
+                               classPrintOut
+                               classPrintOutProtocol
+                            "  classPrintOutFullProtocol "
+                               nil
+                               classSpawn
+                               classSpawnFullProtocol
+                               classSpawnHierarchy
+                               classSpawnSubclasses
+                               nil
+                              ).
+
+                fullClass ifFalse:[
+                    labels := labels , #(
+                               'hierarchy' 
+                               'definition' 
+                               'comment' 
+                               'class instvars' 
+               "/              'protocols' 
+                               '-'
+                              ).
+                    selectors := selectors , #(
+                               classHierarchy
+                               classDefinition
+                               classComment
+                               classClassInstVars
+               "/              classProtocols 
+                               nil
+                              ).
+                ].
+
+                labels := labels , #(
+               "/              'variable search'
+                               'class refs'
+                               '-'
+                               'new class'
+                               'new subclass'
+                               'rename ...'
+                               'remove'
+                              ).
+                selectors := selectors , #(
+               "/              variables
+                               classRefs
+                               nil
+                               classNewClass
+                               classNewSubclass
+                               classRename
+                               classRemove
+                              ).
+                currentClass wasAutoloaded ifTrue:[
+                    labels := labels , #(
+                               'unload'
+                              ).
+                    selectors := selectors , #(
+                               classUnload
+                              ).
+                ]
+            ]
+        ].
     ].
 
     labels := labels , #(
-			  '-'
-			  'others ...'
-			).
+                          '-'
+                          'others ...'
+                        ).
     selectors := selectors , #(
-			  nil
-			  otherMenu
-			).
+                          nil
+                          otherMenu
+                        ).
 
     m := PopUpMenu 
-	    labels:(resources array:labels)
-	    selectors:selectors.
+            labels:(resources array:labels)
+            selectors:selectors.
 
     m subMenuAt:#otherMenu put:specialMenu.
 
     ^ m
 
-    "Modified: 23.12.1995 / 18:19:25 / cg"
+    "Modified: 26.1.1996 / 16:24:42 / cg"
 !
 
 classNewClass
@@ -1926,31 +1926,31 @@
      moduleHolder packageHolder fileNameHolder 
      module package fileName 
      specialFlags
-     check y component info fn project nm mgr|
+     check y component info project nm mgr|
 
     aClass isLoaded ifFalse:[
-	self warn:'please load the class first'.
-	^ self.
+        self warn:'please load the class first'.
+        ^ self.
     ].
 
     "/
     "/ defaults, if nothing at all is known
     "/
-    moduleHolder := (OperatingSystem getLoginName) asValue.
-    packageHolder := 'private' asValue.
+    module := (OperatingSystem getLoginName).
+    package := 'private'.
 
     "/
     "/ try to extract some useful defaults from the current project
     "/
     (Project notNil and:[(project := Project current) notNil]) ifTrue:[
-	(nm := project repositoryDirectory) isNil ifTrue:[
-	    nm := project name
-	].
-	packageHolder value:nm.
-
-	(nm := project repositoryModule) notNil ifTrue:[
-	    moduleHolder value:nm
-	].
+        (nm := project repositoryDirectory) isNil ifTrue:[
+            nm := project name
+        ].
+        package := nm.
+
+        (nm := project repositoryModule) notNil ifTrue:[
+            module := nm
+        ].
     ].
 
     "/
@@ -1959,30 +1959,32 @@
     "/
     info := (mgr := aClass sourceCodeManager) sourceInfoOfClass:aClass.
     info notNil ifTrue:[
-	(info includesKey:#module) ifTrue:[
-	    moduleHolder value:(info at:#module).
-	].
-	(info includesKey:#directory) ifTrue:[
-	    packageHolder value:(info at:#directory).
-	].
-	(info includesKey:#expectedFileName) ifTrue:[
-	    fn := (info at:#expectedFileName).
-	] ifFalse:[
-	    (info includesKey:#fileName) ifTrue:[
-		fn := (info at:#fileName).
-	    ] ifFalse:[
-		(info includesKey:#classFileName) ifTrue:[
-		    fn := (info at:#classFileName) , '.st'.
-		]
-	    ]
-	]
-    ].
-
-    fn isNil ifTrue:[
-	fn := (Smalltalk fileNameForClass:aClass) , '.st'.
-    ].
-
-    fileNameHolder := fn asValue.
+        (info includesKey:#module) ifTrue:[
+            module := (info at:#module).
+        ].
+        (info includesKey:#directory) ifTrue:[
+            package := (info at:#directory).
+        ].
+        (info includesKey:#expectedFileName) ifTrue:[
+            fileName := (info at:#expectedFileName).
+        ] ifFalse:[
+            (info includesKey:#fileName) ifTrue:[
+                fileName := (info at:#fileName).
+            ] ifFalse:[
+                (info includesKey:#classFileName) ifTrue:[
+                    fileName := (info at:#classFileName) , '.st'.
+                ]
+            ]
+        ]
+    ].
+
+    fileName isNil ifTrue:[
+        fileName := (Smalltalk fileNameForClass:aClass) , '.st'.
+    ].
+
+    fileNameHolder := fileName asValue.
+    moduleHolder := module asValue.
+    packageHolder := package asValue.
 
     "/
     "/ should check for conflicts (i.e. if such a container already exists) ...
@@ -2001,28 +2003,36 @@
 
     y := box yPosition.
     component := box addTextLabel:(resources string:'Module:').
-    component width:0.5; adjust:#right.
+    component width:0.4; adjust:#right.
     box yPosition:y.
     component := box addInputFieldOn:moduleHolder tabable:true.
-    component width:0.5; left:0.5; immediateAccept:true; acceptOnLeave:false; cursorMovementWhenUpdating:#beginOfLine.
+    component width:0.6; left:0.4; immediateAccept:true; acceptOnLeave:false; cursorMovementWhenUpdating:#beginOfLine.
 
     box addVerticalSpace.
     y := box yPosition.
     component := box addTextLabel:'Package:'.
-    component width:0.5; adjust:#right.
+    component width:0.4; adjust:#right.
     box yPosition:y.
     component := box addInputFieldOn:packageHolder tabable:true.
-    component width:0.5; left:0.5; immediateAccept:true; acceptOnLeave:false; cursorMovementWhenUpdating:#beginOfLine.
+    component width:0.6; left:0.4; immediateAccept:true; acceptOnLeave:false; cursorMovementWhenUpdating:#beginOfLine.
 
     box addVerticalSpace.
     y := box yPosition.
     component := box addTextLabel:'Filename:'.
-    component width:0.5; adjust:#right.
+    component width:0.4; adjust:#right.
     box yPosition:y.
     component := box addInputFieldOn:fileNameHolder tabable:true.
-    component width:0.5; left:0.5; immediateAccept:true; acceptOnLeave:false; cursorMovementWhenUpdating:#beginOfLine.
+    component width:0.6; left:0.4; immediateAccept:true; acceptOnLeave:false; cursorMovementWhenUpdating:#beginOfLine.
 
     box addVerticalSpace.
+
+    (mgr checkForExistingContainerInModule:module 
+                                   package:package 
+                                 container:fileName) ifFalse:[
+        component := box addTextLabel:'Notice: no such container exists currently.'.
+        component adjust:#left; borderWidth:0.
+    ].
+
     box addVerticalSpace.
 
     box addAbortButton; addOkButton.
@@ -2030,86 +2040,86 @@
     box showAtPointer.
 
     box accepted ifTrue:[
-	module := moduleHolder value withoutSpaces.
-	package := packageHolder value withoutSpaces.
-	fileName := fileNameHolder value withoutSpaces.
-
-	info := aClass revisionInfo.
-	info notNil ifTrue:[
-	    (info includesKey:#repositoryPathName) ifFalse:[
-		info := nil
-	    ]
-	].
-	info isNil ifTrue:[
-	    (self confirm:(resources string:'%1 does not have any (usable) revision info (#version method)\\Shall I create one ?' with:aClass name) withCRs)
-		ifFalse:[
-		    ^ self
-		].
-	    aClass updateVersionMethodFor:(mgr initialRevisionStringFor:aClass 
-					       inModule:module 
-					       package:package 
-					       container:fileName).
-	].
-
-	"/
-	"/ check for the module
-	"/
-	(mgr checkForExistingModule:module) ifFalse:[
-	    createDirs ifFalse:[
-		self warn:(resources string:'a module named %1 does not exist in the source code management' with:module).
-		^ self
-	    ].
-	    (self confirm:(resources string:'%1 is a new module.\\create it ?' with:module) withCRs) ifFalse:[
-		^ self.
-	    ].
-	    (mgr createModule:module) ifFalse:[
-		self warn:(resources string:'cannot create new module: %1' with:module).
-		^ self.
-	    ]
-	].
-
-	"/
-	"/ check for the package
-	"/
-	(mgr checkForExistingModule:module package:package) ifFalse:[
-	    createDirs ifFalse:[
-		self warn:(resources string:'a package named %1 does not exist module %2' with:module with:package).
-		^ self
-	    ].
-	    (self confirm:(resources string:'%1 is a new package (in module %2).\\create it ?' with:package with:module) withCRs) ifFalse:[
-		^ self.
-	    ].
-	    (mgr createModule:module package:package) ifFalse:[
-		self warn:(resources string:'cannot create new package: %1 (in module %2)' with:package with:module).
-		^ self.
-	    ]
-	].
-
-	"/
-	"/ check for the container itself
-	"/
-	(mgr checkForExistingContainerInModule:module package:package container:fileName) ifTrue:[
-	    self warn:(resources string:'container for %1 already exists in %2/%3.' with:fileName with:module with:package) withCRs.
-	    ^ self
-	] ifFalse:[
-	    createContainer ifFalse:[
-		self warn:(resources string:'no container exists for %1 in %2/%3' with:fileName with:module with:package).
-		^ self
-	    ]
-	].
-
-	(mgr
-		createContainerFor:aClass
-		inModule:module
-		package:package
-		container:fileName) ifFalse:[
-	    self warn:(resources string:'failed to create container.').
-	    ^ self.
-	].
+        module := moduleHolder value withoutSpaces.
+        package := packageHolder value withoutSpaces.
+        fileName := fileNameHolder value withoutSpaces.
+
+        info := aClass revisionInfo.
+        info notNil ifTrue:[
+            (info includesKey:#repositoryPathName) ifFalse:[
+                info := nil
+            ]
+        ].
+        info isNil ifTrue:[
+            (self confirm:(resources string:'%1 does not have any (usable) revision info (#version method)\\Shall I create one ?' with:aClass name) withCRs)
+                ifFalse:[
+                    ^ self
+                ].
+            aClass updateVersionMethodFor:(mgr initialRevisionStringFor:aClass 
+                                               inModule:module 
+                                               package:package 
+                                               container:fileName).
+        ].
+
+        "/
+        "/ check for the module
+        "/
+        (mgr checkForExistingModule:module) ifFalse:[
+            createDirs ifFalse:[
+                self warn:(resources string:'a module named %1 does not exist in the source code management' with:module).
+                ^ self
+            ].
+            (self confirm:(resources string:'%1 is a new module.\\create it ?' with:module) withCRs) ifFalse:[
+                ^ self.
+            ].
+            (mgr createModule:module) ifFalse:[
+                self warn:(resources string:'cannot create new module: %1' with:module).
+                ^ self.
+            ]
+        ].
+
+        "/
+        "/ check for the package
+        "/
+        (mgr checkForExistingModule:module package:package) ifFalse:[
+            createDirs ifFalse:[
+                self warn:(resources string:'a package named %1 does not exist module %2' with:module with:package).
+                ^ self
+            ].
+            (self confirm:(resources string:'%1 is a new package (in module %2).\\create it ?' with:package with:module) withCRs) ifFalse:[
+                ^ self.
+            ].
+            (mgr createModule:module package:package) ifFalse:[
+                self warn:(resources string:'cannot create new package: %1 (in module %2)' with:package with:module).
+                ^ self.
+            ]
+        ].
+
+        "/
+        "/ check for the container itself
+        "/
+        (mgr checkForExistingContainerInModule:module package:package container:fileName) ifTrue:[
+            self warn:(resources string:'container for %1 already exists in %2/%3.' with:fileName with:module with:package) withCRs.
+            ^ self
+        ] ifFalse:[
+            createContainer ifFalse:[
+                self warn:(resources string:'no container exists for %1 in %2/%3' with:fileName with:module with:package).
+                ^ self
+            ]
+        ].
+
+        (mgr
+                createContainerFor:aClass
+                inModule:module
+                package:package
+                container:fileName) ifFalse:[
+            self warn:(resources string:'failed to create container.').
+            ^ self.
+        ].
     ].
     box destroy
 
-    "Modified: 13.12.1995 / 16:37:10 / cg"
+    "Modified: 26.1.1996 / 16:25:24 / cg"
 !
 
 classLoadRevision
@@ -2188,20 +2198,20 @@
     "check a class into the source repository"
 
     currentClass isLoaded ifFalse:[
-	self warn:'cannot checkin unloaded classes.'.
-	^ self.
+        self warn:'dont know anything about unloaded classes.'.
+        ^ self.
     ].
 
     self doClassMenu:[:currentClass |
-	self 
-	    classDefineSourceContainerFor:currentClass 
-	    title:(resources string:'Repository information for %1' with:currentClass name)
-	    text:'defining/changing the source code container'
-	    createDirectories:false createContainer:false. 
+        self 
+            classDefineSourceContainerFor:currentClass 
+            title:(resources string:'Repository information for %1' with:currentClass name)
+            text:'defining/changing the source code container'
+            createDirectories:false createContainer:false. 
     ]
 
     "Created: 23.11.1995 / 11:41:38 / cg"
-    "Modified: 12.12.1995 / 18:58:02 / cg"
+    "Modified: 26.1.1996 / 15:23:22 / cg"
 !
 
 classRevisionInfo
@@ -6616,6 +6626,6 @@
 !BrowserView class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libtool/BrowserView.st,v 1.88 1996-01-25 16:47:25 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libtool/BrowserView.st,v 1.89 1996-01-26 15:28:54 ah Exp $'
 ! !
 BrowserView initialize!