preps to allow for monticello packages to be loaded
authorClaus Gittinger <cg@exept.de>
Mon, 26 Oct 2009 17:39:09 +0100
changeset 12360 18b9a4b30466
parent 12359 81f518f8fd9c
child 12361 58f46d1d341b
preps to allow for monticello packages to be loaded
ProjectDefinition.st
--- a/ProjectDefinition.st	Mon Oct 26 17:24:22 2009 +0100
+++ b/ProjectDefinition.st	Mon Oct 26 17:39:09 2009 +0100
@@ -213,6 +213,8 @@
 !
 
 initialClassNameForDefinitionOf:aPackageId
+    "given a package-ID, return an appropriate class name for this package"
+
     |s|
 
     s := aPackageId asString copy replaceAny:':/' with:$_.
@@ -342,6 +344,12 @@
     "Modified: / 17-08-2006 / 14:13:51 / cg"
 !
 
+monticelloPackageName
+    "hook for packages which have been loaded from monticello"
+
+    ^ nil
+!
+
 msdosPathToPackage:toPackageID from:fromPackageID
     "Returns the path to the package defined by aPackageID relative to my path"
     
@@ -4644,6 +4652,33 @@
 
 !ProjectDefinition class methodsFor:'queries'!
 
+definitionClassForMonticelloPackage:aMonicelloPackagename
+    ^ self definitionClassForMonticelloPackage:aMonicelloPackagename createIfAbsent:false
+
+    "
+     self definitionClassForMonticelloPackage:'foobar'
+    "
+!
+
+definitionClassForMonticelloPackage:aMonicelloPackagename createIfAbsent:createIfAbsent
+    ^ self allSubclasses 
+        detect:[:eachProjectDefinition |
+            eachProjectDefinition monticelloPackageName = aMonicelloPackagename ]
+        ifNone:[
+            createIfAbsent ifTrue:[
+                ApplicationDefinition 
+                    definitionClassForPackage:'mc:',aMonicelloPackagename createIfAbsent:true projectType:GUIApplicationType.                
+            ] ifFalse:[
+                nil
+            ]
+        ]
+
+    "
+     self definitionClassForMonticelloPackage:'foobar'
+     self definitionClassForMonticelloPackage:'foobar' createIfAbsent:true
+    "
+!
+
 definitionClassForPackage:aPackageID
     ^ self definitionClassForPackage:aPackageID createIfAbsent:false
 
@@ -4907,11 +4942,11 @@
 !ProjectDefinition class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/ProjectDefinition.st,v 1.270 2009-10-26 16:19:51 fm Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/ProjectDefinition.st,v 1.271 2009-10-26 16:39:09 cg Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libbasic/ProjectDefinition.st,v 1.270 2009-10-26 16:19:51 fm Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/ProjectDefinition.st,v 1.271 2009-10-26 16:39:09 cg Exp $'
 ! !
 
 ProjectDefinition initialize!