Tools__ProjectBuilderAssistantApplication.st
changeset 2915 e0da59b7e3c9
parent 2913 94e5ae8e15b2
child 2917 086fcfdbd182
equal deleted inserted replaced
2914:745b9c77b599 2915:e0da59b7e3c9
  2486         self infoHolder value:'no project selected'. 
  2486         self infoHolder value:'no project selected'. 
  2487         ^ false
  2487         ^ false
  2488     ].
  2488     ].
  2489     "self hasApplicationSelected ifFalse:[^ false]." 
  2489     "self hasApplicationSelected ifFalse:[^ false]." 
  2490     (self projectTypeIsLibrary or:[self hasStartupClassSelected]) ifFalse:[
  2490     (self projectTypeIsLibrary or:[self hasStartupClassSelected]) ifFalse:[
  2491         self infoHolder value:'must be either library or have a startup class'. 
  2491         self infoHolder value:'Must be either library or have a startup class'. 
  2492         ^ false
  2492         ^ false
  2493     ].
  2493     ].
  2494     prj := self selectedProjectDefinition.
  2494     prj := self selectedProjectDefinition.
  2495     ([prj startupClassName] on:Error do:nil) notNil ifFalse:[
  2495     ([prj startupClassName] on:Error do:nil) notNil ifFalse:[
  2496         self infoHolder value:'must have a startup class'. 
  2496         self infoHolder value:'Must have a startup class'. 
  2497         ^ false
  2497         ^ false
  2498     ].
  2498     ].
  2499     ([prj startupSelector] on:Error do:nil) notNil ifFalse:[
  2499     ([prj startupSelector] on:Error do:nil) notNil ifFalse:[
  2500         self infoHolder value:'must have a startup selector'. 
  2500         self infoHolder value:'Must have a startup selector'. 
  2501         ^ false
  2501         ^ false
  2502     ].
  2502     ].
  2503     (prj class compiledMethodAt:#startupSelector) isNil ifTrue:[
  2503     (prj class compiledMethodAt:#startupSelector) isNil ifTrue:[
  2504         self infoHolder value:('inherited startup selector is "%1"' bindWith:prj startupSelector). 
  2504         self infoHolder value:('Inherited startup selector is "%1"' bindWith:prj startupSelector). 
  2505         impl := prj class whichClassImplements:#startupSelector.
  2505         impl := prj class whichClassImplements:#startupSelector.
  2506         impl isNil ifTrue:[
  2506         impl isNil ifTrue:[
  2507             self infoHolder value:('inherited startup selector (%1) not implemented in %2' 
  2507             self infoHolder value:('Inherited startup selector (%1) not implemented in %2' 
  2508                                     bindWith:prj startupSelector
  2508                                     bindWith:prj startupSelector
  2509                                     with:prj class name). 
  2509                                     with:prj class name). 
  2510             ^ false
  2510             ^ false
  2511         ].
  2511         ].
  2512     ].
  2512     ].
  2513     (mthd := prj class compiledMethodAt:#startupClassName) package == prj package ifFalse:[
  2513     (mthd := prj class compiledMethodAt:#startupClassName) package == prj package ifFalse:[
  2514         mthd package == PackageId noProjectID ifFalse:[
  2514         mthd package == PackageId noProjectID ifFalse:[
  2515             self infoHolder value:('startup class method (#startupClassName) of %3 must be in package "%1" (is in "%2")' 
  2515             self infoHolder value:('Startup class method (#startupClassName) of %3 must be in package "%1" (is in "%2")' 
  2516                 bindWith:prj package
  2516                 bindWith:prj package
  2517                 with:(prj class compiledMethodAt:#startupClassName) package
  2517                 with:(prj class compiledMethodAt:#startupClassName) package
  2518                 with:prj class name). 
  2518                 with:prj class name). 
  2519             ^ false
  2519             ^ false
  2520         ].
  2520         ].
  2521     ].
  2521     ].
  2522     (mthd := prj class compiledMethodAt:#startupSelector) notNil ifTrue:[
  2522     (mthd := prj class compiledMethodAt:#startupSelector) notNil ifTrue:[
  2523         mthd package == prj package ifFalse:[
  2523         mthd package == prj package ifFalse:[
  2524             mthd package == PackageId noProjectID ifFalse:[
  2524             mthd package == PackageId noProjectID ifFalse:[
  2525                 self infoHolder value:('startup class method (#startupSelector) of %3 must be in package "%1" (is in "%2")' 
  2525                 self infoHolder value:('Startup class method (#startupSelector) of %3 must be in package "%1" (is in "%2")' 
  2526                     bindWith:prj package
  2526                     bindWith:prj package
  2527                     with:mthd package 
  2527                     with:mthd package 
  2528                     with:prj class name). 
  2528                     with:prj class name). 
  2529                 ^ false
  2529                 ^ false
  2530             ]
  2530             ]
  2531         ].
  2531         ].
  2532     ].
  2532     ].
  2533     cls := Smalltalk classNamed:prj startupClassName.
  2533     cls := Smalltalk classNamed:prj startupClassName.
  2534     cls isNil ifTrue:[
  2534     cls isNil ifTrue:[
  2535         self infoHolder value:('startup class "%1" does not exist' bindWith:prj startupClassName).
  2535         self infoHolder value:('Startup class "%1" does not exist' bindWith:prj startupClassName).
  2536         ^ false.
  2536         ^ false.
  2537     ].
  2537     ].
  2538     (cls implements:(prj startupSelector)) ifFalse:[
  2538     (cls implements:(prj startupSelector)) ifFalse:[
  2539         (cls respondsTo:(prj startupSelector)) ifFalse:[
  2539         (cls respondsTo:(prj startupSelector)) ifFalse:[
  2540             self infoHolder value:('startup class "%1" does not implement startup selector "%2"' 
  2540             self infoHolder value:('Startup class "%1" does not implement startup selector "%2"' 
  2541                     bindWith:cls name
  2541                     bindWith:cls name
  2542                     with:prj startupSelector). 
  2542                     with:prj startupSelector). 
  2543             ^ false
  2543             ^ false
  2544         ].
  2544         ].
  2545     ].
  2545     ].
       
  2546     self infoHolder value:nil.
  2546     ^ true.
  2547     ^ true.
  2547 
  2548 
  2548     "Modified: / 20-07-2012 / 19:21:34 / cg"
  2549     "Modified: / 04-09-2012 / 10:29:43 / cg"
  2549 !
  2550 !
  2550 
  2551 
  2551 canEnterDeploy
  2552 canEnterDeploy
  2552     self hasProjectBuilder ifFalse:[
  2553     self hasProjectBuilder ifFalse:[
  2553         self infoHolder value:'no project builder specified'. 
  2554         self infoHolder value:'Nothing to deploy (please build first)'. 
  2554         ^ false
  2555         ^ false
  2555     ].
  2556     ].
       
  2557     self infoHolder value:nil. 
  2556     ^ true
  2558     ^ true
  2557 
  2559 
  2558     "Modified: / 23-08-2011 / 12:13:23 / cg"
  2560     "Modified: / 04-09-2012 / 10:30:18 / cg"
  2559 !
  2561 !
  2560 
  2562 
  2561 canEnterPrerequisitesSelection
  2563 canEnterPrerequisitesSelection
  2562     |prj cls impl|
  2564     |prj cls impl|
  2563 
  2565