fixed search for classRefs if class is in a namespace
authorClaus Gittinger <cg@exept.de>
Thu, 23 Sep 1999 14:15:27 +0200
changeset 2408 d23105f0d146
parent 2407 5d84d78c3707
child 2409 656eeb7197fa
fixed search for classRefs if class is in a namespace (must search for both with- and without ns-prefix)
BrowserView.st
--- a/BrowserView.st	Thu Sep 23 09:00:27 1999 +0200
+++ b/BrowserView.st	Thu Sep 23 14:15:27 1999 +0200
@@ -3758,9 +3758,30 @@
 
 classRefs
     self doClassMenu:[:currentClass |
-	self withBusyCursorDo:[
-	    SystemBrowser browseReferendsOf:currentClass name asSymbol
-	]
+        self withBusyCursorDo:[
+            |any1 any2 nm msg|
+
+            any1 :=true.
+            any2 :=false.
+            nm := currentClass name asSymbol.
+            msg := SystemBrowser classResources string:'users of: %1' with:nm.
+            SystemBrowser 
+                browseReferendsOf:nm 
+                title:msg
+                ifNone:[any1 := false].
+
+            "/ for namespace-classes, also search for accesses without prefix
+            (nm := currentClass nameWithoutPrefix) ~= currentClass name ifTrue:[
+                any2 :=true.
+                SystemBrowser 
+                    browseReferendsOf:nm asSymbol
+                    title:(SystemBrowser classResources string:'users of: %1' with:nm)
+                    ifNone:[any2 := false].
+            ].
+            (any1 or:[any2]) ifFalse:[
+                SystemBrowser showNoneFound:msg.
+            ]
+        ]
     ]
 
     "Created: 23.11.1995 / 14:11:43 / cg"
@@ -13923,6 +13944,6 @@
 !BrowserView class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libtool/BrowserView.st,v 1.559 1999-09-22 16:57:13 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libtool/BrowserView.st,v 1.560 1999-09-23 12:15:27 cg Exp $'
 ! !
 BrowserView initialize!