Tools__ProjectBuilderAssistantApplication.st
changeset 2857 6fcc59a87afb
parent 2851 860e0292c5ce
child 2863 eb998d836550
equal deleted inserted replaced
2856:8f5778095338 2857:6fcc59a87afb
  2250 ! !
  2250 ! !
  2251 
  2251 
  2252 !ProjectBuilderAssistantApplication methodsFor:'queries'!
  2252 !ProjectBuilderAssistantApplication methodsFor:'queries'!
  2253 
  2253 
  2254 canEnterApplicationSelection
  2254 canEnterApplicationSelection
  2255     ^ self hasProjectSelected
  2255     self hasProjectSelected ifFalse:[
       
  2256         self infoHolder value:'no project selected'. 
       
  2257         ^ false
       
  2258     ].
       
  2259     ^ true
       
  2260 
       
  2261     "Modified: / 23-08-2011 / 12:12:35 / cg"
  2256 !
  2262 !
  2257 
  2263 
  2258 canEnterBuild
  2264 canEnterBuild
  2259     ^ self hasBuildDirectorySpecified
  2265     self hasBuildDirectorySpecified ifFalse:[
       
  2266         self infoHolder value:'no build directory specified'. 
       
  2267         ^ false
       
  2268     ].
       
  2269     ^ true
       
  2270 
       
  2271     "Modified: / 23-08-2011 / 12:13:29 / cg"
  2260 !
  2272 !
  2261 
  2273 
  2262 canEnterContentsSelection
  2274 canEnterContentsSelection
  2263     ^ self hasProjectSelected 
  2275     |prj cls|
  2264     and:[ true "self hasApplicationSelected" 
  2276 
  2265     and:[ (self projectTypeIsLibrary or:[self hasStartupClassSelected]) ]]
  2277     self hasProjectSelected ifFalse:[
       
  2278         self infoHolder value:'no project selected'. 
       
  2279         ^ false
       
  2280     ].
       
  2281     "self hasApplicationSelected ifFalse:[^ false]." 
       
  2282     (self projectTypeIsLibrary or:[self hasStartupClassSelected]) ifFalse:[
       
  2283         self infoHolder value:'must be either library or have a startup class'. 
       
  2284         ^ false
       
  2285     ].
       
  2286     prj := self selectedProjectDefinition.
       
  2287     ([prj startupClassName] on:Error do:nil) notNil ifFalse:[
       
  2288         self infoHolder value:'must have a startup class'. 
       
  2289         ^ false
       
  2290     ].
       
  2291     ([prj startupSelector] on:Error do:nil) notNil ifFalse:[
       
  2292         self infoHolder value:'must have a startup selector'. 
       
  2293         ^ false
       
  2294     ].
       
  2295     (prj class compiledMethodAt:#startupSelector) isNil ifTrue:[
       
  2296         self infoHolder value:('inherited startup selector is "%1"' bindWith:prj startupSelector). 
       
  2297 "/        ^ false
       
  2298     ].
       
  2299     (prj class compiledMethodAt:#startupClassName) package == prj package ifFalse:[
       
  2300         self infoHolder value:('startup class method must be in package "%1" (is in "%2")' 
       
  2301             bindWith:prj package
       
  2302             with:(prj class compiledMethodAt:#startupClassName) package). 
       
  2303         ^ false
       
  2304     ].
       
  2305     (prj class compiledMethodAt:#startupSelector) notNil ifTrue:[
       
  2306         (prj class compiledMethodAt:#startupSelector) package == prj package ifFalse:[
       
  2307             self infoHolder value:('startup class method must be in package "%1" (is in "%2")' 
       
  2308                 bindWith:prj package
       
  2309                 with:(prj class compiledMethodAt:#startupSelector) package). 
       
  2310             ^ false
       
  2311         ].
       
  2312     ].
       
  2313 "/    cls := Smalltalk classNamed:prj startupClassName.
       
  2314 "/    (cls implements:(prj startupSelector)) ifFalse:[
       
  2315 "/        self infoHolder value:('startup class "%1" does not implement startup selector "%2"' 
       
  2316 "/                bindWith:cls name
       
  2317 "/                with:prj startupSelector). 
       
  2318 "/        ^ false
       
  2319 "/    ].
       
  2320     ^ true.
       
  2321 
       
  2322     "Modified: / 23-08-2011 / 12:50:07 / cg"
  2266 !
  2323 !
  2267 
  2324 
  2268 canEnterDeploy
  2325 canEnterDeploy
  2269     ^ self hasProjectBuilder
  2326     self hasProjectBuilder ifFalse:[
       
  2327         self infoHolder value:'no project builder specified'. 
       
  2328         ^ false
       
  2329     ].
       
  2330     ^ true
       
  2331 
       
  2332     "Modified: / 23-08-2011 / 12:13:23 / cg"
  2270 !
  2333 !
  2271 
  2334 
  2272 canEnterStartupClassSelection
  2335 canEnterStartupClassSelection
       
  2336     self hasProjectSelected ifFalse:[
       
  2337         self infoHolder value:'no project selected'. 
       
  2338         ^ false
       
  2339     ].
  2273     ^ self hasProjectSelected "and:[ self hasApplicationSelected ]"
  2340     ^ self hasProjectSelected "and:[ self hasApplicationSelected ]"
       
  2341 
       
  2342     "Modified: / 23-08-2011 / 12:16:35 / cg"
  2274 !
  2343 !
  2275 
  2344 
  2276 isUnixOS
  2345 isUnixOS
  2277     ^ OperatingSystem isUNIXlike
  2346     ^ OperatingSystem isUNIXlike
  2278 !
  2347 !