fixes for remote/image browsing
authorClaus Gittinger <cg@exept.de>
Fri, 15 Feb 2002 13:41:04 +0100
changeset 3571 b892c1154d9d
parent 3570 da6d661593d8
child 3572 b06bfddcbead
fixes for remote/image browsing
BrowserView.st
--- a/BrowserView.st	Mon Feb 11 20:49:59 2002 +0100
+++ b/BrowserView.st	Fri Feb 15 13:41:04 2002 +0100
@@ -743,7 +743,7 @@
                   #label: 'Spawn Category'
                   #translateLabel: true
                   #value: #classCategorySpawn
-                  #enabled: #hasClassCategorySelected
+                  #enabled: #hasClassCategorySelectedAndIsNotSimulatedEnvironment
                 )
                #(#MenuItem
                   #label: '-'
@@ -2132,8 +2132,8 @@
         doAsk ifTrue:[
             fileBox := FileSelectionBox
                             title:(resources string:'fileOut %1 as:' with:currentClassCategory)
-                            okText:(resources string:'fileOut')
-                            abortText:(resources string:'cancel')
+                            okText:(resources string:'FileOut')
+                            abortText:(resources string:'Cancel')
                             action:[:fileName |saveName := fileName.].
 
             fileBox initialText:fileName.
@@ -2281,8 +2281,8 @@
     doAsk ifTrue:[
         fileBox := FileSelectionBox
                         title:(resources string:'fileOut %1 in:' with:currentClassCategory)
-                        okText:(resources string:'fileOut')
-                        abortText:(resources string:'cancel')
+                        okText:(resources string:'FileOut')
+                        abortText:(resources string:'Cancel')
                         action:[:fileName |dirName := fileName.].
 
         dir := FileSelectionBox lastFileSelectionDirectory.
@@ -2543,10 +2543,10 @@
 "/                    ('namespace...'           namespaceDialog               )
 "/                    ('-'                       nil                           )
 
-                    ('Clone'                   browserClone                  )
-                    ('Class...'                browserOpenInClass            )
-                    ('Full Class Source'       browserSpawnFullClass   )
-                    ('Class Extensions'        browserSpawnExtensions  )
+                    ('Clone'                    browserClone                  )
+                    ('Browse Class...'          browserOpenInClass            )
+                    ('Browse Full Class Source' browserSpawnFullClass   )
+                    ('Browse Class Extensions'  browserSpawnExtensions  )
                     ('-'                       nil                           )
                     ('Update'                  classCategoryUpdate           )
                     ('Find Class...'           classCategoryFindClass      #Find )
@@ -2570,10 +2570,10 @@
 "/                    ('namespace...'           namespaceDialog                 )
 "/                    ('-'                       nil                             )
                     ('Clone'                   browserClone                  Cmdc )
-                    ('Class...'                browserOpenInClass            Cmdo )
-                    ('SPAWN_CATEGORY'          classCategorySpawn              )
-                    ('Full Class Source'       browserSpawnFullClass     )
-                    ('Class Extensions'        browserSpawnExtensions  )
+                    ('Browse Class...'          browserOpenInClass            Cmdo )
+                    ('SPAWN_CATEGORY'           classCategorySpawn              )
+                    ('Browse Full Class Source' browserSpawnFullClass     )
+                    ('Browse Class Extensions'  browserSpawnExtensions  )
                     ('-'                       nil                             )
                     ('Update'                  classCategoryUpdate             )
                     ('Find Class...'           classCategoryFindClass        Find )
@@ -2615,6 +2615,7 @@
     self isSimulatedEnvironment ifTrue:[
         m disableAll:#(classCategoryRename classCategoryRemove classCategoryNewCategory changeHistoryMenu
                        classCategoryUpdate browserSpawnFullClass
+                       classCategorySpawn browserOpenInClass browserClone
                       )
     ].
     ^ m
@@ -4139,8 +4140,8 @@
             ask ifTrue:[
                 fileBox := FileSelectionBox
                                 title:(resources string:'fileOut %1 as:' with:currentClass name)
-                                okText:(resources string:'fileOut')
-                                abortText:(resources string:'cancel')
+                                okText:(resources string:'FileOut')
+                                abortText:(resources string:'Cancel')
                                 action:[:fileName | saveName := fileName].
                 fileBox initialText:((Smalltalk fileNameForClass:currentClass) , '.st').
                 dir := FileSelectionBox lastFileSelectionDirectory.
@@ -4643,10 +4644,10 @@
 
     m subMenuAt:#otherMenu put:specialMenu.
 
-    self environment ~~ Smalltalk ifTrue:[
+    self isSimulatedEnvironment ifTrue:[
         m disableAll:#(classUnload classRename classRemove classNewDialog classNewApplication
                        classNewPrivateClass classNewSubclass classNewClass newClassMenu
-                       classRefs classDocumentation classDocumentationAs
+                       classRefs classDocumentation classDocumentationAs classSpawn
                       )
     ].
     ^ m
@@ -6323,7 +6324,7 @@
         listOfClassNames := OrderedCollection new.
         listOfClasses := OrderedCollection new.
 
-        self classHierarchyOf:Object withAutoloaded:true do:[:aClass :lvl|
+        self classHierarchyOf:(environment at:#Object) withAutoloaded:true do:[:aClass :lvl|
             |indent|
 
             (aClass isNameSpace not
@@ -6793,43 +6794,42 @@
 
     gotClassList == true ifTrue:[^ self].
 
-    classListView notNil ifTrue:[
-	"
-	 refetch in case we are not up to date
-	"
-	(currentClass notNil and:[fullProtocol not]) ifTrue:[
-	    oldClassName := currentClass name.
-	    currentClass := self findClassNamed:oldClassName.
-	].
-
-	currentClassCategory notNil ifTrue:[
-	    classes := self listOfAllClassNamesInCategory:currentClassCategory
-	] ifFalse:[
-	    currentClassHierarchy notNil ifTrue:[
-		classes := self listOfClassNameHierarchyOf:currentClassHierarchy
-	    ]
-	].
-
-	classListView list = classes ifFalse:[
-	    scroll ifTrue:[
-		classListView contents:classes
-	    ] ifFalse:[
-		classListView setContents:classes
-	    ].
-	    oldClassName notNil ifTrue:[
-		classListView setContents:classes.
-		classListView setSelectElement:oldClassName
-	    ] ifFalse:[
-		variableListView notNil ifTrue:[variableListView contents:nil]
-	    ].
-
-	    scroll ifTrue:[
-		fullProtocol ifTrue:[
-		    classListView scrollToBottom
-		]
-	    ]
-	].
-    ]
+    classListView isNil ifTrue:[^ self].
+    "
+     refetch in case we are not up to date
+    "
+    (currentClass notNil and:[fullProtocol not]) ifTrue:[
+        oldClassName := currentClass name.
+        currentClass := self findClassNamed:oldClassName.
+    ].
+
+    currentClassCategory notNil ifTrue:[
+        classes := self listOfAllClassNamesInCategory:currentClassCategory
+    ] ifFalse:[
+        currentClassHierarchy notNil ifTrue:[
+            classes := self listOfClassNameHierarchyOf:currentClassHierarchy
+        ]
+    ].
+
+    classListView list = classes ifFalse:[
+        scroll ifTrue:[
+            classListView contents:classes
+        ] ifFalse:[
+            classListView setContents:classes
+        ].
+        oldClassName notNil ifTrue:[
+            classListView setContents:classes.
+            classListView setSelectElement:oldClassName
+        ] ifFalse:[
+            variableListView notNil ifTrue:[variableListView contents:nil]
+        ].
+
+        scroll ifTrue:[
+            fullProtocol ifTrue:[
+                classListView scrollToBottom
+            ]
+        ]
+    ].
 
     "Modified: 10.1.1997 / 14:01:20 / cg"
 ! !
@@ -12604,15 +12604,15 @@
 
     subclasses := subclassDictionary at:aClass ifAbsent:[nil].
     (subclasses size == 0) ifFalse:[
-	names := subclasses collect:[:class | class name].
-	names sortWith:subclasses.
-	subclasses do:[:aSubClass |
-	    self classHierarchyOf:aSubClass 
-			    level:(level + 1) 
-			       do:aBlock 
-			    using:subclassDictionary
-		       removeFrom:remainSet
-	]
+        names := subclasses collect:[:class | class name].
+        names sortWith:subclasses.
+        subclasses do:[:aSubClass |
+            self classHierarchyOf:aSubClass 
+                            level:(level + 1) 
+                               do:aBlock 
+                            using:subclassDictionary
+                       removeFrom:remainSet
+        ]
     ]
 
     "Created: 20.12.1996 / 17:05:06 / cg"
@@ -13764,7 +13764,7 @@
 !
 
 hasClassCategorySelectedAndIsNotSimulatedEnvironment
-        ^ self hasClassCategorySelected and:[self isNotSimulatedEnvironment]
+        ^ currentClassCategory notNil and:[self isNotSimulatedEnvironment]
 !
 
 hasClassCategorySelectedHolder
@@ -14923,6 +14923,6 @@
 !BrowserView class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libtool/BrowserView.st,v 1.710 2002-02-02 11:40:39 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libtool/BrowserView.st,v 1.711 2002-02-15 12:41:04 cg Exp $'
 ! !
 BrowserView initialize!