checkin from browser
authorClaus Gittinger <cg@exept.de>
Fri, 20 Aug 1999 16:20:59 +0200
changeset 2349 7a106d001d6c
parent 2348 b4fd9d8bb6dc
child 2350 805ad1edff78
checkin from browser
BrowserView.st
BrwsrView.st
--- a/BrowserView.st	Fri Aug 20 15:43:39 1999 +0200
+++ b/BrowserView.st	Fri Aug 20 16:20:59 1999 +0200
@@ -1924,36 +1924,45 @@
 classCategoryUpdate
     "update class category list and dependants"
 
-    |oldClassName oldMethodCategory|
+    |oldClass oldClassName oldMethodCategory newClass|
 
     classCategoryListView notNil ifTrue:[
-	self setListOfNamespaces.
-
-	currentClass notNil ifTrue:[
-	    oldClassName := currentClass name.
-	    (oldClassName endsWith:'-old') ifTrue:[
-		oldClassName := oldClassName copyWithoutLast:4 "copyTo:(oldClassName size - 4)"
-	    ]
-	].
-	oldMethodCategory := currentMethodCategory.
-
-	classCategoryListView setContents:(self listOfAllClassCategories).
-	currentClassCategory notNil ifTrue:[
-	    classCategoryListView setSelectElement:currentClassCategory.
-	    self classCategorySelectionChanged.
-	    oldClassName notNil ifTrue:[
-		classListView setSelectElement:oldClassName.
-		self changeCurrentClass:(Smalltalk at:oldClassName asSymbol).
-		self classSelectionChanged.
-		oldMethodCategory notNil ifTrue:[
-		    methodCategoryListView setSelectElement:oldMethodCategory.
-		    currentMethodCategory := oldMethodCategory.
-		    self methodCategorySelectionChanged
-		]
-	    ]
-	].
-
-	self updateNamespaceList
+        self setListOfNamespaces.
+
+        (oldClass := currentClass) notNil ifTrue:[
+            oldClassName := currentClass name.
+            (oldClassName endsWith:'-old') ifTrue:[
+                oldClassName := oldClassName copyWithoutLast:4 "copyTo:(oldClassName size - 4)"
+            ]
+        ].
+        oldMethodCategory := currentMethodCategory.
+
+        classCategoryListView setContents:(self listOfAllClassCategories).
+        currentClassCategory notNil ifTrue:[
+            classCategoryListView setSelectElement:currentClassCategory.
+            self classCategorySelectionChanged.
+            oldClassName notNil ifTrue:[
+                classListView setSelectElement:oldClassName.
+                oldClass isJavaClass ifTrue:[
+                    newClass := (Java at:oldClassName).
+                ] ifFalse:[
+                    newClass := (Smalltalk at:oldClassName asSymbol).
+                ].
+                newClass isNil ifTrue:[
+                    self warn:'oops - ' , oldClassName , ' is gone.'.
+                ] ifFalse:[
+                    self changeCurrentClass:newClass.
+                    self classSelectionChanged.
+                    oldMethodCategory notNil ifTrue:[
+                        methodCategoryListView setSelectElement:oldMethodCategory.
+                        currentMethodCategory := oldMethodCategory.
+                        self methodCategorySelectionChanged
+                    ]
+                ]
+            ]
+        ].
+
+        self updateNamespaceList
     ]
 
     "Modified: / 10.4.1998 / 12:25:38 / cg"
@@ -2873,25 +2882,27 @@
                     ]
                 ].
             ].
-            aStream cr; cr; cr; cr; cr.
-            aStream emphasis:(self commentEmphasisAndColor).
-            s isNil ifTrue:[
-                aStream nextPut:$" ; cr; nextPutLine:' no comment or documentation method found'.
-            ] ifFalse:[
-                aStream nextPut:$" ; cr; nextPutLine:' Documentation:'.
-                aStream cr; nextPutLine:s; cr.
-                aStream nextPutLine:' Notice: '.
-                aStream nextPutAll:'   the above text has been extracted from the classes '.
-                aStream nextPutLine:(isComment ifTrue:['comment.'] ifFalse:['documentation method.']).
-                aStream nextPutLine:'   Any change in it will be lost if you ''accept'' here.'.
-                aStream nextPutAll:'   To change the '.
-                aStream nextPutAll:(isComment ifTrue:['comment'] ifFalse:['documentation']).
-                aStream nextPutAll:', switch to the '.
-                aStream nextPutAll:(isComment ifTrue:['comment'] ifFalse:['documentation method']).
-                aStream nextPutLine:' and ''accept'' any changes there.'.
-            ].
-            aStream nextPut:$".
-            aStream emphasis:nil.
+            cls isJavaClass ifFalse:[
+                aStream cr; cr; cr; cr; cr.
+                aStream emphasis:(self commentEmphasisAndColor).
+                s isNil ifTrue:[
+                    aStream nextPut:$" ; cr; nextPutLine:' no comment or documentation method found'.
+                ] ifFalse:[
+                    aStream nextPut:$" ; cr; nextPutLine:' Documentation:'.
+                    aStream cr; nextPutLine:s; cr.
+                    aStream nextPutLine:' Notice: '.
+                    aStream nextPutAll:'   the above text has been extracted from the classes '.
+                    aStream nextPutLine:(isComment ifTrue:['comment.'] ifFalse:['documentation method.']).
+                    aStream nextPutLine:'   Any change in it will be lost if you ''accept'' here.'.
+                    aStream nextPutAll:'   To change the '.
+                    aStream nextPutAll:(isComment ifTrue:['comment'] ifFalse:['documentation']).
+                    aStream nextPutAll:', switch to the '.
+                    aStream nextPutAll:(isComment ifTrue:['comment'] ifFalse:['documentation method']).
+                    aStream nextPutLine:' and ''accept'' any changes there.'.
+                ].
+                aStream nextPut:$".
+                aStream emphasis:nil.
+            ]
         ].
 
         src := aStream contents.
@@ -12136,6 +12147,10 @@
 setAcceptActionForClass
     "tell the codeView what to do on accept and explain"
 
+    currentClass isJavaClass ifTrue:[
+        ^ self setAcceptActionForJavaClass.
+    ].
+
     (currentClass isNamespace and:[currentClass ~~ Smalltalk]) ifTrue:[
         codeView acceptAction:nil
     ] ifFalse:[
@@ -12217,6 +12232,12 @@
     "Modified: / 17.6.1998 / 11:39:02 / cg"
 !
 
+setAcceptActionForJavaClass
+    "tell the codeView what to do on accept and explain"
+
+    self setAcceptActionForNewJavaClass 
+!
+
 setAcceptActionForNewClass
     "tell the codeView what to do on accept and explain"
 
@@ -12272,6 +12293,7 @@
                     self classCategoryUpdate.
                     self updateClassListWithScroll:false.
                     self switchToClassNamed:(cls name).
+                    self updateCodeView.
                 ]
             ]
         ].
@@ -13815,6 +13837,6 @@
 !BrowserView class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libtool/BrowserView.st,v 1.543 1999-08-20 13:43:39 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libtool/BrowserView.st,v 1.544 1999-08-20 14:20:59 cg Exp $'
 ! !
 BrowserView initialize!
--- a/BrwsrView.st	Fri Aug 20 15:43:39 1999 +0200
+++ b/BrwsrView.st	Fri Aug 20 16:20:59 1999 +0200
@@ -1924,36 +1924,45 @@
 classCategoryUpdate
     "update class category list and dependants"
 
-    |oldClassName oldMethodCategory|
+    |oldClass oldClassName oldMethodCategory newClass|
 
     classCategoryListView notNil ifTrue:[
-	self setListOfNamespaces.
-
-	currentClass notNil ifTrue:[
-	    oldClassName := currentClass name.
-	    (oldClassName endsWith:'-old') ifTrue:[
-		oldClassName := oldClassName copyWithoutLast:4 "copyTo:(oldClassName size - 4)"
-	    ]
-	].
-	oldMethodCategory := currentMethodCategory.
-
-	classCategoryListView setContents:(self listOfAllClassCategories).
-	currentClassCategory notNil ifTrue:[
-	    classCategoryListView setSelectElement:currentClassCategory.
-	    self classCategorySelectionChanged.
-	    oldClassName notNil ifTrue:[
-		classListView setSelectElement:oldClassName.
-		self changeCurrentClass:(Smalltalk at:oldClassName asSymbol).
-		self classSelectionChanged.
-		oldMethodCategory notNil ifTrue:[
-		    methodCategoryListView setSelectElement:oldMethodCategory.
-		    currentMethodCategory := oldMethodCategory.
-		    self methodCategorySelectionChanged
-		]
-	    ]
-	].
-
-	self updateNamespaceList
+        self setListOfNamespaces.
+
+        (oldClass := currentClass) notNil ifTrue:[
+            oldClassName := currentClass name.
+            (oldClassName endsWith:'-old') ifTrue:[
+                oldClassName := oldClassName copyWithoutLast:4 "copyTo:(oldClassName size - 4)"
+            ]
+        ].
+        oldMethodCategory := currentMethodCategory.
+
+        classCategoryListView setContents:(self listOfAllClassCategories).
+        currentClassCategory notNil ifTrue:[
+            classCategoryListView setSelectElement:currentClassCategory.
+            self classCategorySelectionChanged.
+            oldClassName notNil ifTrue:[
+                classListView setSelectElement:oldClassName.
+                oldClass isJavaClass ifTrue:[
+                    newClass := (Java at:oldClassName).
+                ] ifFalse:[
+                    newClass := (Smalltalk at:oldClassName asSymbol).
+                ].
+                newClass isNil ifTrue:[
+                    self warn:'oops - ' , oldClassName , ' is gone.'.
+                ] ifFalse:[
+                    self changeCurrentClass:newClass.
+                    self classSelectionChanged.
+                    oldMethodCategory notNil ifTrue:[
+                        methodCategoryListView setSelectElement:oldMethodCategory.
+                        currentMethodCategory := oldMethodCategory.
+                        self methodCategorySelectionChanged
+                    ]
+                ]
+            ]
+        ].
+
+        self updateNamespaceList
     ]
 
     "Modified: / 10.4.1998 / 12:25:38 / cg"
@@ -2873,25 +2882,27 @@
                     ]
                 ].
             ].
-            aStream cr; cr; cr; cr; cr.
-            aStream emphasis:(self commentEmphasisAndColor).
-            s isNil ifTrue:[
-                aStream nextPut:$" ; cr; nextPutLine:' no comment or documentation method found'.
-            ] ifFalse:[
-                aStream nextPut:$" ; cr; nextPutLine:' Documentation:'.
-                aStream cr; nextPutLine:s; cr.
-                aStream nextPutLine:' Notice: '.
-                aStream nextPutAll:'   the above text has been extracted from the classes '.
-                aStream nextPutLine:(isComment ifTrue:['comment.'] ifFalse:['documentation method.']).
-                aStream nextPutLine:'   Any change in it will be lost if you ''accept'' here.'.
-                aStream nextPutAll:'   To change the '.
-                aStream nextPutAll:(isComment ifTrue:['comment'] ifFalse:['documentation']).
-                aStream nextPutAll:', switch to the '.
-                aStream nextPutAll:(isComment ifTrue:['comment'] ifFalse:['documentation method']).
-                aStream nextPutLine:' and ''accept'' any changes there.'.
-            ].
-            aStream nextPut:$".
-            aStream emphasis:nil.
+            cls isJavaClass ifFalse:[
+                aStream cr; cr; cr; cr; cr.
+                aStream emphasis:(self commentEmphasisAndColor).
+                s isNil ifTrue:[
+                    aStream nextPut:$" ; cr; nextPutLine:' no comment or documentation method found'.
+                ] ifFalse:[
+                    aStream nextPut:$" ; cr; nextPutLine:' Documentation:'.
+                    aStream cr; nextPutLine:s; cr.
+                    aStream nextPutLine:' Notice: '.
+                    aStream nextPutAll:'   the above text has been extracted from the classes '.
+                    aStream nextPutLine:(isComment ifTrue:['comment.'] ifFalse:['documentation method.']).
+                    aStream nextPutLine:'   Any change in it will be lost if you ''accept'' here.'.
+                    aStream nextPutAll:'   To change the '.
+                    aStream nextPutAll:(isComment ifTrue:['comment'] ifFalse:['documentation']).
+                    aStream nextPutAll:', switch to the '.
+                    aStream nextPutAll:(isComment ifTrue:['comment'] ifFalse:['documentation method']).
+                    aStream nextPutLine:' and ''accept'' any changes there.'.
+                ].
+                aStream nextPut:$".
+                aStream emphasis:nil.
+            ]
         ].
 
         src := aStream contents.
@@ -12136,6 +12147,10 @@
 setAcceptActionForClass
     "tell the codeView what to do on accept and explain"
 
+    currentClass isJavaClass ifTrue:[
+        ^ self setAcceptActionForJavaClass.
+    ].
+
     (currentClass isNamespace and:[currentClass ~~ Smalltalk]) ifTrue:[
         codeView acceptAction:nil
     ] ifFalse:[
@@ -12217,6 +12232,12 @@
     "Modified: / 17.6.1998 / 11:39:02 / cg"
 !
 
+setAcceptActionForJavaClass
+    "tell the codeView what to do on accept and explain"
+
+    self setAcceptActionForNewJavaClass 
+!
+
 setAcceptActionForNewClass
     "tell the codeView what to do on accept and explain"
 
@@ -12272,6 +12293,7 @@
                     self classCategoryUpdate.
                     self updateClassListWithScroll:false.
                     self switchToClassNamed:(cls name).
+                    self updateCodeView.
                 ]
             ]
         ].
@@ -13815,6 +13837,6 @@
 !BrowserView class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libtool/Attic/BrwsrView.st,v 1.543 1999-08-20 13:43:39 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libtool/Attic/BrwsrView.st,v 1.544 1999-08-20 14:20:59 cg Exp $'
 ! !
 BrowserView initialize!