checkin from browser
authorClaus Gittinger <cg@exept.de>
Fri, 17 Sep 1999 12:57:58 +0200
changeset 4742 59256069f8f0
parent 4741 c4bf20b435e1
child 4743 11f9e45976cb
checkin from browser
Class.st
--- a/Class.st	Fri Sep 17 11:39:16 1999 +0200
+++ b/Class.st	Fri Sep 17 12:57:58 1999 +0200
@@ -660,11 +660,37 @@
      A packageInfo loosely relates to ehat a classLoader is in Java.
      Experimental."
 
-    |packageId|
+    |packageId prj handle t|
 
     packageId := self package.
     packageId notNil ifTrue:[
-        ^ Project projectWithId:packageId
+        prj := Project projectWithId:packageId.
+        prj notNil ifTrue:[self halt. ^ prj].
+
+        "/
+        "/ intermediate kludge (will be removed)
+        "/ search for a loaded class library and extract
+        "/ information from it ...
+        "/
+        handle := ObjectFileLoader loadedObjectHandles 
+                    detect:[:h | |cls|
+                        cls := h classes firstIfEmpty:nil.
+                        cls notNil and:[cls package = packageId]
+                    ]
+                    ifNone:nil.
+
+        handle notNil ifTrue:[
+            prj := Project new.
+self halt.
+            prj name:packageId.
+            prj directory:(handle pathName asFilename directory pathName).
+            prj package:packageId.
+            t := packageId asCollectionOfSubstringsSeparatedByAny:'/\:'.
+            prj repositoryModule:(t first).
+            prj repositoryDirectory:(packageId copyFrom:t first size + 2).
+            prj isLoaded:true.
+            ^ prj
+        ]
     ].
     ^ nil
 
@@ -3956,5 +3982,5 @@
 !Class class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Class.st,v 1.352 1999-09-17 09:36:37 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/Class.st,v 1.353 1999-09-17 10:57:58 cg Exp $'
 ! !