BrowserView.st
changeset 1815 2f7ee0e7d408
parent 1812 d5ba1973447f
child 1816 aa257f48aa9e
--- a/BrowserView.st	Fri Aug 07 12:36:05 1998 +0200
+++ b/BrowserView.st	Fri Aug 07 17:30:24 1998 +0200
@@ -1014,11 +1014,15 @@
                     (self listOfNamespaces includesIdentical:aClass nameSpace)
                     ifTrue:[
                         self busyLabel:'writing: %1' with:fileName.
-                        aClass fileOutOn:aStream withTimeStamp:true withInitialize:false.
-                        (aClass class implements:#initialize) ifTrue:[
-                            classesToInitialize add:aClass
-                        ].
-                        aStream cr.
+                        aClass isLoaded ifFalse:[
+                            self warn:'cannot fileOut unloaded class: %1\\skipped.' with:currentClass name.
+                        ] ifTrue:[
+                            aClass fileOutOn:aStream withTimeStamp:true withInitialize:false.
+                            (aClass class implements:#initialize) ifTrue:[
+                                classesToInitialize add:aClass
+                            ].
+                            aStream cr.
+                        ]
                     ]
                 ]
             ].
@@ -1039,7 +1043,7 @@
     self normalLabel.
 
     "Created: / 11.10.1997 / 16:38:29 / cg"
-    "Modified: / 13.3.1998 / 15:24:12 / cg"
+    "Modified: / 7.8.1998 / 17:23:06 / cg"
 !
 
 classCategoryFileOutBinaryEach
@@ -1082,13 +1086,62 @@
 !
 
 classCategoryFileOutEach
+    self classCategoryFileOutEachAsk:false.
+
+    "Modified: / 7.8.1998 / 17:11:25 / cg"
+!
+
+classCategoryFileOutEachAsk:doAsk
+    |fileBox dir dirName|
+
     (currentClassCategory startsWith:$*) ifTrue:[
         self warn:(resources string:'try a real category').
         ^ self
     ].
 
+    doAsk ifTrue:[
+        fileBox := FileSelectionBox
+                        title:(resources string:'fileOut %1 in:' with:currentClassCategory)
+                        okText:(resources string:'fileOut')
+                        abortText:(resources string:'cancel')
+                        action:[:fileName |dirName := fileName.].
+
+        dir := FileSelectionBox lastFileSelectionDirectory.
+        dir isNil ifTrue:[
+            "
+             this test allows a smalltalk to be built without Projects/ChangeSets
+            "
+            Project notNil ifTrue:[
+                dir := Project currentProjectDirectory
+            ]
+        ].
+        dir notNil ifTrue:[
+            fileBox directory:dir.
+        ].
+        fileBox selectingDirectory:true.
+        fileBox showAtPointer.
+
+        fileBox destroy.
+        fileBox := nil.
+
+        dirName isNil ifTrue:[
+            ^ self
+        ].
+        FileSelectionBox lastFileSelectionDirectory:dirName.
+    ] ifFalse:[
+        "
+         this test allows a smalltalk to be built without Projects/ChangeSets
+        "
+        Project notNil ifTrue:[
+            dirName := Project currentProjectDirectory asFilename.
+        ] ifFalse:[
+            dirName := Filename currentDirectory
+        ]
+    ].
     self withBusyCursorDo:[
         self allClassesInCategory:currentClassCategory do:[:aClass |
+            |fn|
+
             aClass isPrivate ifFalse:[
                 (self listOfNamespaces includesIdentical:aClass nameSpace)
                 ifTrue:[
@@ -1097,7 +1150,8 @@
                         self warn:'cannot fileOut: %1\(%2)' with:aClass name with:ex errorString.
                         ex return.
                     ] do:[
-                        aClass fileOut
+                        fn := (Smalltalk fileNameForClass:aClass) , '.st'.
+                        aClass fileOutAs:(dirName asFilename constructString:fn).
                     ]
                 ]
             ]
@@ -1105,7 +1159,14 @@
         self normalLabel.
     ]
 
-    "Modified: / 5.3.1998 / 02:45:38 / cg"
+    "Created: / 7.8.1998 / 17:10:59 / cg"
+    "Modified: / 7.8.1998 / 17:25:28 / cg"
+!
+
+classCategoryFileOutEachIn
+    self classCategoryFileOutEachAsk:true.
+
+    "Created: / 7.8.1998 / 17:20:01 / cg"
 !
 
 classCategoryFindClass
@@ -1206,20 +1267,20 @@
 
     currentClassCategory notNil ifTrue:[
         items :=  #(
-                    ('fileOut each binary ...'   classCategoryFileOutBinaryEach      )
+                    ('fileOut each binary...'   classCategoryFileOutBinaryEach      )
                     ('-'                         nil                                 )
-                    ('repository history ...'    classCategoryRepositoryHistory      )
+                    ('repository history...'    classCategoryRepositoryHistory      )
                     ('validate class revisions'  classCategoryValidateClassRevisions )
                     ('-'                         nil                                 )
-                    ('checkin each ...'          classCategoryCheckinEach            )
+                    ('checkin each...'          classCategoryCheckinEach            )
                     ('-'                         nil                                 )
-                    ('load from repository ...'  classCategoryLoadFromRepository     )
+                    ('load from repository...'  classCategoryLoadFromRepository     )
                    ).
     ] ifFalse:[
         items :=  #(
-                    ('repository history ...'    classCategoryRepositoryHistory )
+                    ('repository history...'    classCategoryRepositoryHistory )
                     ('-'                         nil                            )
-                    ('load from repository ...'  classCategoryLoadFromRepository)
+                    ('load from repository...'  classCategoryLoadFromRepository)
                    ).
     ].
 
@@ -1241,44 +1302,45 @@
 
     currentClassCategory isNil ifTrue:[
         items := #(
-"/                    ('namespace ...'           namespaceDialog               )
+"/                    ('namespace...'           namespaceDialog               )
 "/                    ('-'                       nil                           )
 
                     ('clone'                   classCategoryClone            )
-                    ('open for class ...'      classCategoryOpenInClass      )
+                    ('open for class...'      classCategoryOpenInClass      )
                     ('spawn full class'        classCategorySpawnFullClass   )
                     ('-'                       nil                           )
                     ('update'                  classCategoryUpdate           )
-                    ('find class ...'          classCategoryFindClass      #Find )
-                    ('find method ...'         classCategoryFindMethod       )
+                    ('find class...'          classCategoryFindClass      #Find )
+                    ('find method...'         classCategoryFindMethod       )
                     ('class history'           classHistoryMenu              )
                     ('-'                       nil                           )
-                    ('new class category ...'  classCategoryNewCategory    #Cmdn )
+                    ('new class category...'  classCategoryNewCategory    #Cmdn )
                     ('='                       nil                           )
                     ('others'                  otherMenu                   #Ctrl )
                    ).
     ] ifFalse:[
         items := #(
                     ('fileOut'                 classCategoryFileOut            )
-                    ('fileOut as ...'          classCategoryFileOutAs          )
+                    ('fileOut as...'           classCategoryFileOutAs          )
                     ('fileOut each'            classCategoryFileOutEach        )
+                    ('fileOut each in...'      classCategoryFileOutEachIn      )
                     ('printOut'                classCategoryPrintOut           )
                     ('printOut protocol'       classCategoryPrintOutProtocol   )
                     ('-'                       nil                             )
-"/                    ('namespace ...'           namespaceDialog                 )
+"/                    ('namespace...'           namespaceDialog                 )
 "/                    ('-'                       nil                             )
                     ('clone'                   classCategoryClone            Cmdc )
-                    ('open for class ...'      classCategoryOpenInClass      Cmdo )
+                    ('open for class...'      classCategoryOpenInClass      Cmdo )
                     ('SPAWN_CATEGORY'          classCategorySpawn              )
                     ('spawn full class'        classCategorySpawnFullClass     )
                     ('-'                       nil                             )
                     ('update'                  classCategoryUpdate             )
-                    ('find class ...'          classCategoryFindClass        Find )
-                    ('find method ...'         classCategoryFindMethod         )
+                    ('find class...'          classCategoryFindClass        Find )
+                    ('find method...'         classCategoryFindMethod         )
                     ('class history'           classHistoryMenu                )
                     ('-'                       nil                             )
-                    ('new class category ...'  classCategoryNewCategory      Cmdn )
-                    ('rename ...'              classCategoryRename             )
+                    ('new class category...'  classCategoryNewCategory      Cmdn )
+                    ('rename...'              classCategoryRename             )
                     ('remove'                  classCategoryRemove             )
                     ('='                       nil                             )
                     ('others'                  otherMenu                     Ctrl )
@@ -1295,7 +1357,7 @@
 
     "Created: / 14.9.1995 / 10:50:17 / claus"
     "Modified: / 16.1.1998 / 17:16:28 / stefan"
-    "Modified: / 21.5.1998 / 14:58:34 / cg"
+    "Modified: / 7.8.1998 / 17:20:15 / cg"
 !
 
 classCategoryNewCategory
@@ -2802,7 +2864,7 @@
 
     currentClass isNil ifTrue:[
         items :=  #(
-                       ('fileIn new from repository ...' classLoadNewRevision)
+                       ('fileIn new from repository...' classLoadNewRevision)
                     ).
     ] ifFalse:[
         items :=  #(
@@ -2811,21 +2873,21 @@
                        ('inspect class'                classInspect                 )
                        ('inspect instances'            classInstancesInspect        )
                        ('-'                            nil                          )
-                       ('make private class ...'       classMakePrivate             )
+                       ('make private class...'       classMakePrivate             )
                        ('make public class'            classMakePublic              )
                        ('-'                            nil                          )
                        ('primitive definitions'        classPrimitiveDefinitions    )
                        ('primitive variables'          classPrimitiveVariables      )
                        ('primitive functions'          classPrimitiveFunctions      )
                        ('-'                            nil                          )
-                       ('source container ...'         classModifyContainer         )
-                       ('remove source container ...'  classRemoveContainer         )
+                       ('source container...'         classModifyContainer         )
+                       ('remove source container...'  classRemoveContainer         )
                        ('-'                            nil                          )
                        ('revision log'                 classRevisionInfo            )
-                       ('compare with repository ...'  classCompareWithRepository   )
+                       ('compare with repository...'  classCompareWithRepository   )
                        ('-'                            nil                          )
                        ('check into source repository' classCheckin                 )
-                       ('fileIn from repository ...'   classLoadRevision            )
+                       ('fileIn from repository...'   classLoadRevision            )
                     ).
     ].
 
@@ -2891,7 +2953,7 @@
         currentClass isLoaded ifFalse:[
             items :=    #(
                            ('documentation'              classDocumentation     )
-                           ('save documentation as ...'  classDocumentationAs   )
+                           ('save documentation as...'  classDocumentationAs   )
                            ('-'                          nil                    )
                            ('class refs'                 classRefs              )
                            ('-'                          nil                    )
@@ -2906,18 +2968,18 @@
                                ('hierarchy'                 classHierarchy             )
                                ('definition'                classDefinition            )
                                ('documentation'             classDocumentation    Cmdd )
-                               ('save documentation as ...' classDocumentationAs       )
+                               ('save documentation as...' classDocumentationAs       )
                                ('comment'                   classComment               )
                                ('class instvars'            classClassInstVars         )
                              ).
             ] ifFalse:[
                 items :=    #(
                                ('fileOut'                   classFileOut          )
-                               ('fileOut as ...'            classFileOutAs        )
+                               ('fileOut as...'            classFileOutAs        )
                                ('printOut'                  classPrintOut         )
                                ('printOut protocol'         classPrintOutProtocol )
                                ('-'                         nil                   )
-                               ('spawn ...'                 spawnMenu             )
+                               ('spawn...'                 spawnMenu             )
                                ('-'                         nil                   )
                               ).
 
@@ -2936,7 +2998,7 @@
                                ('hierarchy'                 classHierarchy            )
                                ('definition'                classDefinition           )
                                ('documentation'             classDocumentation   Cmdd )
-                               ('save documentation as ...' classDocumentationAs      )
+                               ('save documentation as...' classDocumentationAs      )
                                ('comment'                   classComment              )
                                ('class instvars'            classClassInstVars        )
                                ('-'                         nil                       )
@@ -2946,7 +3008,7 @@
                 items := items , #(
                                ('class refs'  classRefs   )
                                ('-'           nil         )
-                               ('new ...'     newClassMenu)
+                               ('new...'     newClassMenu)
                               ).
 
                 newClassMenu := PopUpMenu 
@@ -2958,7 +3020,7 @@
                             resources:resources.
 
                 items := items , #(
-                               ('rename ...'  classRename )
+                               ('rename...'  classRename )
                                ('remove'      classRemove )
                               ).
 
@@ -2995,7 +3057,7 @@
     m subMenuAt:#otherMenu put:specialMenu.
     ^ m
 
-    "Modified: / 21.5.1998 / 15:12:04 / cg"
+    "Modified: / 7.8.1998 / 17:13:41 / cg"
 !
 
 classNewClass
@@ -5489,7 +5551,7 @@
                             ('inspect method'      methodInspect            )
                             ('-'                   nil                      )
                             ('breakpoint'          methodBreakPoint         )
-                            ('breakpoint in ...'   methodBreakPointInProcess)
+                            ('breakpoint in...'   methodBreakPointInProcess)
                             ('-'                   nil                      )
                             ('trace'               methodTrace              )
                             ('trace sender'        methodTraceSender        )
@@ -5524,9 +5586,9 @@
                                 ('spawn full protocol' classSpawnFullProtocol          )
                                 ('spawn hierarchy'     classSpawnHierarchy             )
                                 ('-'                   nil                             )
-                                ('senders ...'         methodSenders             Cmds  )
-                                ('implementors ...'    methodImplementors        Cmdi  )
-                                ('globals ...'         methodGlobalReferends     Cmdg  )
+                                ('senders...'         methodSenders             Cmds  )
+                                ('implementors...'    methodImplementors        Cmdi  )
+                                ('globals...'         methodGlobalReferends     Cmdg  )
                                 ('-'                   nil                             )
                                 ('remove'              methodRemove                    )
                                 ('-'                   nil                             )
@@ -5537,7 +5599,7 @@
     m subMenuAt:#othersMenu put:specialMenu.
     ^ m
 
-    "Modified: / 21.5.1998 / 14:56:53 / cg"
+    "Modified: / 7.8.1998 / 17:13:47 / cg"
 ! !
 
 !BrowserView methodsFor:'class-method stuff'!
@@ -6841,11 +6903,11 @@
     ].            
 
     labels := labels , #(
-                'find method here ...'
-                'find method ...'
+                'find method here...'
+                'find method...'
                 '-'
-                'new category ...' 
-                'copy category ...' 
+                'new category...' 
+                'copy category...' 
                ).
     selectors := selectors , #(
                 methodCategoryFindMethod
@@ -6875,7 +6937,7 @@
     currentMethodCategory notNil ifTrue:[
         labels := labels , #(
                     '-'
-                    'rename ...' 
+                    'rename...' 
                     'remove'
                    ).
 
@@ -6915,7 +6977,7 @@
 
     ^ m
 
-    "Modified: / 18.4.1998 / 15:56:20 / cg"
+    "Modified: / 7.8.1998 / 17:13:59 / cg"
 !
 
 methodCategoryNewCategory
@@ -7729,7 +7791,7 @@
                             brkItems := #(
                                                 ('-'                   nil                       )
                                                 ('breakpoint'          methodBreakPoint          )
-                                                ('breakpoint in ...'   methodBreakPointInProcess )
+                                                ('breakpoint in...'   methodBreakPointInProcess )
                                                 ('-'                   nil                       )
                                                 ('trace'               methodTrace               )
                                                 ('trace sender'        methodTraceSender         )
@@ -7816,11 +7878,11 @@
     sepMthdItems  := #().
 
     searchItems := #(
-                                ('senders ...'        methodSenders         Cmds)
-                                ('implementors ...'   methodImplementors    Cmdi)
-                                ('globals ...'        methodGlobalReferends Cmdg)
-                                ('string search ...'  methodStringSearch    Cmdt)
-                                ('apropos ...'        methodAproposSearch   )
+                                ('senders...'        methodSenders         Cmds)
+                                ('implementors...'   methodImplementors    Cmdi)
+                                ('globals...'        methodGlobalReferends Cmdg)
+                                ('string search...'  methodStringSearch    Cmdt)
+                                ('apropos...'        methodAproposSearch   )
                     ).
 
     currentMethodCategory notNil ifTrue:[
@@ -7856,8 +7918,8 @@
         sepLocalItems := #(('-')). 
 
         mthdItems :=           #(
-                                ('change category ...'      methodChangeCategory )
-                                ('move ...'                 methodMove           )
+                                ('change category...'      methodChangeCategory )
+                                ('move...'                 methodMove           )
                                 ('remove'                   methodRemove         )
 "/                                ('-'                        nil                              )
 "/                                ('compare with previous'    methodCompareWithPreviousVersion )
@@ -7926,7 +7988,7 @@
     "Created: / 23.11.1995 / 12:02:29 / cg"
     "Modified: / 18.12.1995 / 16:20:07 / stefan"
     "Modified: / 29.4.1997 / 11:20:59 / dq"
-    "Modified: / 31.7.1998 / 00:41:17 / cg"
+    "Modified: / 7.8.1998 / 17:14:10 / cg"
 !
 
 methodMove
@@ -11685,27 +11747,27 @@
 
     showInstance ifFalse:[
         items := #(
-                    ('class instvar refs ...'      classInstVarRefs    )
-                    ('class instvar mods ...'      classInstVarMods    )
-                    ('classvar refs ...'           classVarRefs        )
-                    ('classvar mods ...'           classVarMods        )
+                    ('class instvar refs...'      classInstVarRefs    )
+                    ('class instvar mods...'      classInstVarMods    )
+                    ('classvar refs...'           classVarRefs        )
+                    ('classvar mods...'           classVarMods        )
                     ('-'                           nil                 )
-                    ('all class instvar refs ...'  allClassInstVarRefs )
-                    ('all class instvar mods ...'  allClassInstVarMods )
-                    ('all classvar refs ...'       allClassVarRefs     )
-                    ('all classvar mods ...'       allClassVarMods     )
+                    ('all class instvar refs...'  allClassInstVarRefs )
+                    ('all class instvar mods...'  allClassInstVarMods )
+                    ('all classvar refs...'       allClassVarRefs     )
+                    ('all classvar mods...'       allClassVarMods     )
                    ).
     ] ifTrue:[
         items := #(
-                    ('instvar refs ...'            instVarRefs         )
-                    ('instvar mods ...'            instVarMods         )
-                    ('classvar refs ...'           classVarRefs        )
-                    ('classvar mods ...'           classVarMods        )
+                    ('instvar refs...'            instVarRefs         )
+                    ('instvar mods...'            instVarMods         )
+                    ('classvar refs...'           classVarRefs        )
+                    ('classvar mods...'           classVarMods        )
                     ('-'                           nil                 )
-                    ('all instvar refs ...'        allInstVarRefs      )
-                    ('all classvar refs ...'       allClassVarRefs     )
-                    ('all instvar mods ...'        allInstVarMods      )
-                    ('all classvar mods ...'       allClassVarMods     )
+                    ('all instvar refs...'        allInstVarRefs      )
+                    ('all classvar refs...'       allClassVarRefs     )
+                    ('all instvar mods...'        allInstVarMods      )
+                    ('all classvar mods...'       allClassVarMods     )
                    ).
     ].
 
@@ -11744,7 +11806,7 @@
     ].
     ^ m
 
-    "Modified: / 16.6.1998 / 09:39:40 / cg"
+    "Modified: / 7.8.1998 / 17:14:48 / cg"
 !
 
 variableSelection:lineNr
@@ -12089,6 +12151,6 @@
 !BrowserView class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libtool/BrowserView.st,v 1.443 1998-08-05 16:07:18 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libtool/BrowserView.st,v 1.444 1998-08-07 15:30:24 cg Exp $'
 ! !
 BrowserView initialize!