BrowserView.st
changeset 2821 3fbf5210c17a
parent 2820 fa69b7d4bd0e
child 2823 cfb7f5478ca7
--- a/BrowserView.st	Tue Oct 24 16:52:53 2000 +0200
+++ b/BrowserView.st	Tue Oct 24 20:22:41 2000 +0200
@@ -1034,11 +1034,20 @@
 classCategoryClone
     "open a new SystemBrowser showing the same method as I do"
 
-    SystemBrowser openInClass:actualClass selector:currentSelector
+    |brwsr|
+
+    brwsr := SystemBrowser openInClass:actualClass selector:currentSelector.
+    environment notNil ifTrue:[
+        brwsr environment:environment.
+        brwsr switchToClassNamed:actualClass name. 
+        brwsr classSelectionChanged.
+        currentSelector notNil ifTrue:[
+            brwsr switchToMethodNamed:currentSelector.
+        ]
+    ].
 
     "Created: 14.9.1995 / 10:55:20 / claus"
-    "Modified: 14.9.1995 / 10:59:31 / claus"
-!
+    "Modified: 14.9.1995 / 10:59:31 / claus"!
 
 classCategoryFileOut
     "create a file 'categoryName.st' consisting of all classes in current category
@@ -1168,7 +1177,8 @@
     self normalLabel.
 
     "Created: / 11.10.1997 / 16:38:29 / cg"
-    "Modified: / 12.8.1998 / 11:04:11 / cg"!
+    "Modified: / 12.8.1998 / 11:04:11 / cg"
+!
 
 classCategoryFileOutBinaryEach
     "fileOut each class in the current category as binary bytecode."
@@ -1472,6 +1482,12 @@
                                 ).
     ].
 
+    self environment ~~ Smalltalk ifTrue:[
+        specialMenu disableAll:#(classCategoryValidateClassRevisions classCategoryCheckinEach
+                                 classCategoryLoadFromRepository
+                      )
+    ].
+
     device ctrlDown ifTrue:[
         ^ specialMenu
     ].
@@ -1547,12 +1563,16 @@
     (currentClassCategory = '* obsolete *') ifTrue:[
         m disableAll:#(classCategorySpawn classCategorySpawnFullClass)
     ].
+
+    self environment ~~ Smalltalk ifTrue:[
+        m disableAll:#(classCategoryRename classCategoryRemove classCategoryNewCategory changeHistoryMenu
+                      )
+    ].
     ^ m
 
     "Created: / 14.9.1995 / 10:50:17 / claus"
     "Modified: / 16.1.1998 / 17:16:28 / stefan"
-    "Modified: / 7.8.1998 / 18:39:46 / cg"
-!
+    "Modified: / 7.8.1998 / 18:39:46 / cg"!
 
 classCategoryNewCategory
     |box|
@@ -1762,13 +1782,17 @@
     "create a new SystemBrowser browsing current classCategory"
 
     currentClassCategory notNil ifTrue:[
-	self withBusyCursorDo:[
-	    SystemBrowser browseClassCategory:currentClassCategory
-	]
-    ]
-
-    "Modified: 18.8.1997 / 15:42:58 / cg"
-!
+        self withBusyCursorDo:[
+            |brwsr|
+
+            brwsr := SystemBrowser browseClassCategory:currentClassCategory.
+            environment notNil ifTrue:[
+                brwsr environment:environment
+            ].
+        ]
+    ]
+
+    "Modified: 18.8.1997 / 15:42:58 / cg"!
 
 classCategorySpawnFullClass
     "create a new SystemBrowser browsing full class"
@@ -1776,17 +1800,18 @@
     |newBrowser|
 
     self withBusyCursorDo:[
-	newBrowser := SystemBrowser browseFullClasses
+        newBrowser := SystemBrowser browseFullClasses.
+        environment notNil ifTrue:[
+            newBrowser environment:environment
+        ].
 " "
-	.
-	currentClass notNil ifTrue:[
-	    newBrowser switchToClassNamed:(currentClass name)
-	]
+        currentClass notNil ifTrue:[
+            newBrowser switchToClassNamed:(currentClass name)
+        ]
 " "
     ]
 
-    "Modified: 18.8.1997 / 15:43:01 / cg"
-!
+    "Modified: 18.8.1997 / 15:43:01 / cg"!
 
 classCategoryUpdate
     "update class category list and dependants"
@@ -3382,6 +3407,12 @@
                                      classPrimitiveFunctions).
     ].
 
+    self environment ~~ Smalltalk ifTrue:[
+        specialMenu disableAll:#(classMakePrivate classMakePublic classModifyContainer classRemoveContainer
+                                 classRevisionInfo classLoadRevision classCheckin classModifyPackage
+                      )
+    ].
+
     device ctrlDown ifTrue:[
         ^ specialMenu
     ].
@@ -3512,10 +3543,16 @@
     ].
 
     m subMenuAt:#otherMenu put:specialMenu.
+
+    self environment ~~ Smalltalk ifTrue:[
+        m disableAll:#(classUnload classRename classRemove classNewDialog classNewApplication
+                       classNewPrivateClass classNewSubclass classNewClass newClassMenu
+                       classRefs classDocumentation classDocumentationAs
+                      )
+    ].
     ^ m
 
-    "Modified: / 20.5.1999 / 18:36:25 / cg"
-!
+    "Modified: / 20.5.1999 / 18:36:25 / cg"!
 
 classNewApplication
     "create a class-definition prototype for an application in codeview"
@@ -3871,6 +3908,9 @@
             ^ self
         ].
         browser := SystemBrowser browseClass:cls. 
+        environment notNil ifTrue:[
+            browser environment:environment
+        ].
         cls hasMethods ifFalse:[
             browser instanceProtocol:false.
         ].
@@ -3889,39 +3929,45 @@
 classSpawnFullProtocol
     "create a new browser, browsing current classes full protocol"
 
-    self doClassMenuWithSelection:[:cls :sel |
-	SystemBrowser browseFullClassProtocol:cls 
-    ]
-!
+    self doClassMenuWithSelection:[:cls :sel |  |brwsr|
+        brwsr := SystemBrowser browseFullClassProtocol:cls.
+        environment notNil ifTrue:[
+            brwsr environment:environment
+        ]
+    ]!
 
 classSpawnHierarchy
     "create a new HierarchyBrowser browsing current class"
 
-    self doClassMenuWithSelection:[:cls :sel |
-	SystemBrowser browseClassHierarchy:cls 
-    ]
-!
+    self doClassMenuWithSelection:[:cls :sel | |brwsr|
+        brwsr := SystemBrowser browseClassHierarchy:cls.
+        environment notNil ifTrue:[
+            brwsr environment:environment
+        ]
+    ]!
 
 classSpawnSubclasses
     "create a new browser browsing current class's subclasses"
 
     self doClassMenuWithSelection:[:cls :sel |
-	|subs|
-
-	subs := OrderedCollection new.
-	self classHierarchyOf:cls withAutoloaded:false do:[:aClass :lvl |
-	    subs add:(String new:lvl*2) , aClass name
-	].
+        |subs brwsr|
+
+        subs := OrderedCollection new.
+        self classHierarchyOf:cls withAutoloaded:false do:[:aClass :lvl |
+            subs add:(String new:lvl*2) , aClass name
+        ].
 "/        subs := cls allSubclasses.
-	(subs notNil and:[subs size ~~ 0]) ifTrue:[
-	    SystemBrowser browseClasses:subs 
-				  title:('subclasses of ' , cls name)
-				   sort:false
-	]
-    ]
-
-    "Modified: 4.1.1997 / 13:35:55 / cg"
-!
+        (subs notNil and:[subs size ~~ 0]) ifTrue:[
+            brwsr := SystemBrowser browseClasses:subs 
+                                   title:('subclasses of ' , cls name)
+                                   sort:false.
+            environment notNil ifTrue:[
+                brwsr environment:environment
+            ]
+        ]
+    ]
+
+    "Modified: 4.1.1997 / 13:35:55 / cg"!
 
 classUnload
     "unload an autoloaded class"
@@ -5744,11 +5790,15 @@
 !BrowserView methodsFor:'class-method list menu'!
 
 classMethodBrowse
-    SystemBrowser openInClass:actualClass selector:currentSelector
+    |brwsr|
+
+    brwsr := SystemBrowser openInClass:actualClass selector:currentSelector.
+    environment notNil ifTrue:[
+        brwsr environment:environment
+    ].
 
     "Created: 13.12.1995 / 15:05:12 / cg"
-    "Modified: 13.12.1995 / 15:06:26 / cg"
-!
+    "Modified: 13.12.1995 / 15:06:26 / cg"!
 
 classMethodFileOutAll
     "fileout all methods into one source file"
@@ -5889,6 +5939,12 @@
                         itemList:items
                         resources:resources.
 
+    self environment ~~ Smalltalk ifTrue:[
+        specialMenu disableAll:#(methodStartMemoryUsage methodStartCounting methodStartTiming
+                       methodTraceFull methodTraceSender methodTrace  methodBreakPointInProcess methodBreakPoint
+                      )
+    ].
+
     device ctrlDown ifTrue:[
         currentMethod isNil ifTrue:[
             classMethodListView flash.
@@ -5923,10 +5979,15 @@
 
     m := PopUpMenu itemList:items resources:resources.
     m subMenuAt:#othersMenu put:specialMenu.
+
+    self environment ~~ Smalltalk ifTrue:[
+        m disableAll:#(methodSenders classMethodFilter methodImplementors methodGlobalReferends
+                       methodChangeCategory methodMove methodRemove 
+                      )
+    ].
     ^ m
 
-    "Modified: / 7.8.1998 / 17:13:47 / cg"
-! !
+    "Modified: / 7.8.1998 / 17:13:47 / cg"! !
 
 !BrowserView methodsFor:'class-method stuff'!
 
@@ -7883,10 +7944,16 @@
     codeMenu notNil ifTrue:[
         m subMenuAt:#codeMenu put:codeMenu.
     ].
+
+    self environment ~~ Smalltalk ifTrue:[
+        m disableAll:#(methodCategoryNewCategory methodCategoryCreateAccessMethods methodCategoryRemove
+                       methodCategoryRename codeMenu
+                      )
+    ].
+
     ^ m
 
-    "Modified: / 10.2.2000 / 13:38:58 / cg"
-!
+    "Modified: / 10.2.2000 / 13:38:58 / cg"!
 
 methodCategoryNewCategory
     "show the enter box to add a new method category.
@@ -8047,22 +8114,26 @@
     "create a new SystemBrowser browsing current method category"
 
     currentMethodCategory notNil ifTrue:[
-	self withBusyCursorDo:[
-	    SystemBrowser browseClass:actualClass
-		    methodCategory:currentMethodCategory
-	]
-    ]
-
-    "Modified: 18.8.1997 / 15:44:18 / cg"
-!
+        self withBusyCursorDo:[
+            |brwsr|
+
+            brwsr := SystemBrowser browseClass:actualClass
+                                   methodCategory:currentMethodCategory.
+            environment notNil ifTrue:[
+                brwsr environment:environment
+            ].
+        ]
+    ]
+
+    "Modified: 18.8.1997 / 15:44:18 / cg"!
 
 methodCategorySpawnCategory
     "create a new SystemBrowser browsing all methods from all
      classes with same category as current method category"
 
     self askAndBrowseMethodCategory:'category to browse methods (matchPattern allowed):'
-                             action:[:aString | 
-                                        SystemBrowser browseMethodCategory:aString
+                             action:[:aString | |brwsr|
+                                        brwsr := SystemBrowser browseMethodCategory:aString.
                                     ]
 ! !
 
@@ -9036,6 +9107,13 @@
         currentMethod numArgs ~~ 0 ifTrue:[
             specialMenu disable:#methodInvoke
         ].
+        self environment ~~ Smalltalk ifTrue:[
+            specialMenu disableAll:#(methodSTCCompile methodModifyPackage 
+                                     methodMakePublic methodMakePrivate methodMakeProtected methodMakeIgnored 
+                                     methodBreakPoint methodBreakPointInProcess methodTrace methodTraceSender   
+                                     methodTraceFull methodStartTiming methodStartCounting methodStartMemoryUsage
+                                    )
+        ].
     ].
 
     device ctrlDown ifTrue:[
@@ -9137,39 +9215,23 @@
     ].
 
     currentMethod notNil ifTrue:[
-"/        currentMethod isPrivate ifTrue:[
-"/            m disable:#methodMakePrivate
-"/        ].
-"/        currentMethod isProtected ifTrue:[
-"/            m disable:#methodMakeProtected
-"/        ].
-"/        currentMethod isPublic ifTrue:[
-"/            m disable:#methodMakePublic
-"/        ].
-"/        currentMethod isIgnored ifTrue:[
-"/            m disable:#methodMakeIgnored
-"/        ].
-"/
-"/        (currentMethod code notNil
-"/        or:[Compiler canCreateMachineCode not]) ifTrue:[
-"/            m disable:#methodSTCCompile
-"/        ].
-"/        currentMethod byteCode isNil ifTrue:[
-"/            m disable:#methodDecompile
-"/        ].
-
         currentMethod previousVersion isNil ifTrue:[
             m disable:#methodPreviousVersion.
             m disable:#methodCompareWithPreviousVersion
         ]
     ].
+    self environment ~~ Smalltalk ifTrue:[
+        m disableAll:#(methodSenders methodImplementors methodGlobalReferends methodStringSearch
+                       methodAproposSearch methodNewMethod methodChangeCategory methodMove 
+                       methodRemove 
+                      )
+    ].
     ^ m
 
     "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: / 30.4.1999 / 09:15:32 / cg"
-!
+    "Modified: / 30.4.1999 / 09:15:32 / cg"!
 
 methodModifyPackage
     "change the methods package assignment"
@@ -9557,7 +9619,7 @@
      or if the current selection is of the form 'class>>selector', spawan
      a browser on that method."
 
-    |s sel selSymbol clsName clsSymbol cls isMeta w|
+    |s sel selSymbol clsName clsSymbol cls isMeta w brwsr|
 
     classMethodListView notNil ifTrue:[
         s := classMethodListView selectionValue string.
@@ -9615,7 +9677,11 @@
 
     self withBusyCursorDo:[
         w := currentMethod who.
-        SystemBrowser browseClass:(w methodClass) selector:(w methodSelector)
+        brwsr := SystemBrowser browseClass:(w methodClass) selector:(w methodSelector).
+        environment notNil ifTrue:[
+            brwsr environment:environment
+        ].
+
     ]
 
     "Modified: 18.8.1997 / 15:46:10 / cg"!
@@ -11836,7 +11902,8 @@
     ^ nil
 
     "Created: 20.12.1996 / 15:39:38 / cg"
-    "Modified: 23.1.1997 / 14:21:00 / cg"!
+    "Modified: 23.1.1997 / 14:21:00 / cg"
+!
 
 findClassNamedInNameSpace:aClassName
     "search through current namespaces for aClassName.
@@ -13672,6 +13739,6 @@
 !BrowserView class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libtool/BrowserView.st,v 1.642 2000-10-24 14:52:53 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libtool/BrowserView.st,v 1.643 2000-10-24 18:22:41 cg Exp $'
 ! !
 BrowserView initialize!