changed:5 methods
authorClaus Gittinger <cg@exept.de>
Tue, 23 Aug 2011 13:51:32 +0200
changeset 2857 6fcc59a87afb
parent 2856 8f5778095338
child 2858 e993adca5ecf
changed:5 methods
Tools__ProjectBuilderAssistantApplication.st
--- a/Tools__ProjectBuilderAssistantApplication.st	Mon Aug 22 10:36:39 2011 +0200
+++ b/Tools__ProjectBuilderAssistantApplication.st	Tue Aug 23 13:51:32 2011 +0200
@@ -2252,25 +2252,94 @@
 !ProjectBuilderAssistantApplication methodsFor:'queries'!
 
 canEnterApplicationSelection
-    ^ self hasProjectSelected
+    self hasProjectSelected ifFalse:[
+        self infoHolder value:'no project selected'. 
+        ^ false
+    ].
+    ^ true
+
+    "Modified: / 23-08-2011 / 12:12:35 / cg"
 !
 
 canEnterBuild
-    ^ self hasBuildDirectorySpecified
+    self hasBuildDirectorySpecified ifFalse:[
+        self infoHolder value:'no build directory specified'. 
+        ^ false
+    ].
+    ^ true
+
+    "Modified: / 23-08-2011 / 12:13:29 / cg"
 !
 
 canEnterContentsSelection
-    ^ self hasProjectSelected 
-    and:[ true "self hasApplicationSelected" 
-    and:[ (self projectTypeIsLibrary or:[self hasStartupClassSelected]) ]]
+    |prj cls|
+
+    self hasProjectSelected ifFalse:[
+        self infoHolder value:'no project selected'. 
+        ^ false
+    ].
+    "self hasApplicationSelected ifFalse:[^ false]." 
+    (self projectTypeIsLibrary or:[self hasStartupClassSelected]) ifFalse:[
+        self infoHolder value:'must be either library or have a startup class'. 
+        ^ false
+    ].
+    prj := self selectedProjectDefinition.
+    ([prj startupClassName] on:Error do:nil) notNil ifFalse:[
+        self infoHolder value:'must have a startup class'. 
+        ^ false
+    ].
+    ([prj startupSelector] on:Error do:nil) notNil ifFalse:[
+        self infoHolder value:'must have a startup selector'. 
+        ^ false
+    ].
+    (prj class compiledMethodAt:#startupSelector) isNil ifTrue:[
+        self infoHolder value:('inherited startup selector is "%1"' bindWith:prj startupSelector). 
+"/        ^ false
+    ].
+    (prj class compiledMethodAt:#startupClassName) package == prj package ifFalse:[
+        self infoHolder value:('startup class method must be in package "%1" (is in "%2")' 
+            bindWith:prj package
+            with:(prj class compiledMethodAt:#startupClassName) package). 
+        ^ false
+    ].
+    (prj class compiledMethodAt:#startupSelector) notNil ifTrue:[
+        (prj class compiledMethodAt:#startupSelector) package == prj package ifFalse:[
+            self infoHolder value:('startup class method must be in package "%1" (is in "%2")' 
+                bindWith:prj package
+                with:(prj class compiledMethodAt:#startupSelector) package). 
+            ^ false
+        ].
+    ].
+"/    cls := Smalltalk classNamed:prj startupClassName.
+"/    (cls implements:(prj startupSelector)) ifFalse:[
+"/        self infoHolder value:('startup class "%1" does not implement startup selector "%2"' 
+"/                bindWith:cls name
+"/                with:prj startupSelector). 
+"/        ^ false
+"/    ].
+    ^ true.
+
+    "Modified: / 23-08-2011 / 12:50:07 / cg"
 !
 
 canEnterDeploy
-    ^ self hasProjectBuilder
+    self hasProjectBuilder ifFalse:[
+        self infoHolder value:'no project builder specified'. 
+        ^ false
+    ].
+    ^ true
+
+    "Modified: / 23-08-2011 / 12:13:23 / cg"
 !
 
 canEnterStartupClassSelection
+    self hasProjectSelected ifFalse:[
+        self infoHolder value:'no project selected'. 
+        ^ false
+    ].
     ^ self hasProjectSelected "and:[ self hasApplicationSelected ]"
+
+    "Modified: / 23-08-2011 / 12:16:35 / cg"
 !
 
 isUnixOS