Tools__ProjectBuilderAssistantApplication.st
changeset 2897 b6cd7ee2a43b
parent 2874 cd62528801d5
child 2899 da83d0544556
equal deleted inserted replaced
2896:6ed90332dbda 2897:b6cd7ee2a43b
   392                           name: 'RadioButton1'
   392                           name: 'RadioButton1'
   393                           translateLabel: true
   393                           translateLabel: true
   394                           model: projectTypeHolder
   394                           model: projectTypeHolder
   395                           isTriggerOnDown: true
   395                           isTriggerOnDown: true
   396                           onCallBackSelector: projectTypeChanged
   396                           onCallBackSelector: projectTypeChanged
   397                           select: guiApplicationType
   397                           select: #'GUI-Application'
   398                           extent: (Point 136 22)
   398                           extent: (Point 136 22)
   399                         )
   399                         )
   400                        (RadioButtonSpec
   400                        (RadioButtonSpec
   401                           label: 'Non-GUI Application'
   401                           label: 'Non-GUI Application'
   402                           name: 'RadioButton2'
   402                           name: 'RadioButton2'
   403                           translateLabel: true
   403                           translateLabel: true
   404                           model: projectTypeHolder
   404                           model: projectTypeHolder
   405                           isTriggerOnDown: true
   405                           isTriggerOnDown: true
   406                           onCallBackSelector: projectTypeChanged
   406                           onCallBackSelector: projectTypeChanged
   407                           select: nonGuiApplicationType
   407                           select: #'NonGUI-Application'
   408                           extent: (Point 136 22)
   408                           extent: (Point 136 22)
   409                         )
   409                         )
   410                        (RadioButtonSpec
   410                        (RadioButtonSpec
   411                           label: 'Class Library'
   411                           label: 'Class Library'
   412                           name: 'RadioButton3'
   412                           name: 'RadioButton3'
   413                           translateLabel: true
   413                           translateLabel: true
   414                           model: projectTypeHolder
   414                           model: projectTypeHolder
   415                           isTriggerOnDown: true
   415                           isTriggerOnDown: true
   416                           onCallBackSelector: projectTypeChanged
   416                           onCallBackSelector: projectTypeChanged
   417                           select: libraryType
   417                           select: #Library
   418                           extent: (Point 136 22)
   418                           extent: (Point 136 22)
   419                         )
   419                         )
   420                        )
   420                        )
   421                      
   421                      
   422                     )
   422                     )
   476             )
   476             )
   477            )
   477            )
   478          
   478          
   479         )
   479         )
   480       )
   480       )
       
   481 
       
   482     "Modified: / 20-07-2012 / 13:27:45 / cg"
   481 !
   483 !
   482 
   484 
   483 page2_projectSelectionSpec
   485 page2_projectSelectionSpec
   484     "This resource specification was automatically generated
   486     "This resource specification was automatically generated
   485      by the UIPainter of ST/X."
   487      by the UIPainter of ST/X."
  1451          
  1453          
  1452         )
  1454         )
  1453       )
  1455       )
  1454 ! !
  1456 ! !
  1455 
  1457 
       
  1458 !ProjectBuilderAssistantApplication class methodsFor:'startup'!
       
  1459 
       
  1460 openOn:aProjectDefinitionClass
       
  1461     ^ self new openOn:aProjectDefinitionClass
       
  1462 
       
  1463     "Created: / 20-07-2012 / 12:33:25 / cg"
       
  1464 !
       
  1465 
       
  1466 openOnPackage:aPackageId
       
  1467     ^ self new openOnPackage:aPackageId
       
  1468 
       
  1469     "Created: / 20-07-2012 / 13:22:50 / cg"
       
  1470 ! !
       
  1471 
  1456 !ProjectBuilderAssistantApplication methodsFor:'actions'!
  1472 !ProjectBuilderAssistantApplication methodsFor:'actions'!
  1457 
  1473 
  1458 buildDirectoryChanged
  1474 buildDirectoryChanged
  1459     self updateButtonEnableState.
  1475     self updateButtonEnableState.
  1460 !
  1476 !
  2098     ].
  2114     ].
  2099     ^ productNameHolder.
  2115     ^ productNameHolder.
  2100 !
  2116 !
  2101 
  2117 
  2102 projectType
  2118 projectType
  2103     self projectTypeHolder value == #libraryType ifTrue:[
  2119     ^ self projectTypeHolder value
  2104         ^ ProjectDefinition libraryType
  2120 
  2105     ].
  2121     "Modified: / 20-07-2012 / 13:28:46 / cg"
  2106     self projectTypeHolder value == #guiApplicationType ifTrue:[
       
  2107         ^ ProjectDefinition guiApplicationType
       
  2108     ].
       
  2109     self projectTypeHolder value == #nonGuiApplicationType ifTrue:[
       
  2110         ^ ProjectDefinition nonGuiApplicationType
       
  2111     ].
       
  2112     self error.
       
  2113 !
  2122 !
  2114 
  2123 
  2115 projectType:aProjectTypeSymbol
  2124 projectType:aProjectTypeSymbol
  2116     |pType|
       
  2117 
       
  2118     self assert:(ProjectDefinition projectTypes includes:aProjectTypeSymbol).
  2125     self assert:(ProjectDefinition projectTypes includes:aProjectTypeSymbol).
  2119     aProjectTypeSymbol == ProjectDefinition libraryType ifTrue:[
       
  2120         pType := #libraryType
       
  2121     ] ifFalse:[
       
  2122         aProjectTypeSymbol == ProjectDefinition guiApplicationType ifTrue:[
       
  2123             pType := #guiApplicationType
       
  2124         ] ifFalse:[
       
  2125             aProjectTypeSymbol == ProjectDefinition nonGuiApplicationType ifTrue:[
       
  2126                 pType := #nonGuiApplicationType
       
  2127             ] ifFalse:[
       
  2128                 self error.
       
  2129             ].
       
  2130         ]
       
  2131     ].
       
  2132     self projectTypeHolder value:aProjectTypeSymbol
  2126     self projectTypeHolder value:aProjectTypeSymbol
       
  2127 
       
  2128     "Modified: / 20-07-2012 / 13:28:25 / cg"
  2133 !
  2129 !
  2134 
  2130 
  2135 projectTypeHolder
  2131 projectTypeHolder
  2136     <resource: #uiAspect>
  2132     <resource: #uiAspect>
  2137 
  2133 
  2138     projectTypeHolder isNil ifTrue:[
  2134     projectTypeHolder isNil ifTrue:[
  2139         projectTypeHolder := RadioButtonGroup new.
  2135         projectTypeHolder := RadioButtonGroup new.
  2140         projectTypeHolder value:#guiApplicationType.
  2136         projectTypeHolder value:ProjectDefinition guiApplicationType.
  2141     ].
  2137     ].
  2142     ^ projectTypeHolder.
  2138     ^ projectTypeHolder.
       
  2139 
       
  2140     "Modified: / 20-07-2012 / 13:30:16 / cg"
  2143 !
  2141 !
  2144 
  2142 
  2145 selectedApplicationIndexHolder
  2143 selectedApplicationIndexHolder
  2146     <resource: #uiAspect>
  2144     <resource: #uiAspect>
  2147 
  2145 
  2252         browser filter:'*.exe;*.com'.
  2250         browser filter:'*.exe;*.com'.
  2253     ] ifFalse:[
  2251     ] ifFalse:[
  2254         browser filter:'*'.
  2252         browser filter:'*'.
  2255     ].
  2253     ].
  2256     ^ browser.
  2254     ^ browser.
       
  2255 !
       
  2256 
       
  2257 openOn:aProjectDefinitionClass
       
  2258     |type apps startupClass|
       
  2259 
       
  2260     self allButOpen.
       
  2261     aProjectDefinitionClass isLibraryDefinition ifTrue:[
       
  2262         type := ProjectDefinition libraryType
       
  2263     ] ifFalse:[
       
  2264         aProjectDefinitionClass isGUIApplication ifTrue:[
       
  2265             type := ProjectDefinition guiApplicationType
       
  2266         ] ifFalse:[
       
  2267             type := ProjectDefinition nonGuiApplicationType
       
  2268         ]
       
  2269     ].
       
  2270     self projectTypeHolder value:type.
       
  2271     self hideSTXProjects value:false.
       
  2272     selectedProjectDefinition := aProjectDefinitionClass.
       
  2273     self selectedProjectIndexHolder value:(self listOfMatchingPackageIds value indexOf:aProjectDefinitionClass package).
       
  2274     self hasProjectSelectedHolder value:true.
       
  2275 
       
  2276     self gotoPage:3.
       
  2277     type == ProjectDefinition guiApplicationType ifTrue:[
       
  2278         (startupClass := aProjectDefinitionClass startupClass) notNil ifTrue:[
       
  2279             selectedStartupClass := startupClass.
       
  2280             self gotoPage:4.
       
  2281         ]. 
       
  2282 "/    apps := (aProjectDefinitionClass classes select:[:cls | cls isKindOf:ApplicationModel])
       
  2283     ].
       
  2284     self openWindow.
       
  2285 
       
  2286     "Created: / 20-07-2012 / 12:34:02 / cg"
       
  2287 !
       
  2288 
       
  2289 openOnPackage:aPackageId
       
  2290     self allButOpen.
       
  2291     self projectTypeHolder value:(ProjectDefinition guiApplicationType).
       
  2292     self hideSTXProjects value:false.
       
  2293     self selectedProjectIndexHolder value:(self listOfMatchingPackageIds indexOf:aPackageId).
       
  2294     self hasProjectSelectedHolder value:true.
       
  2295     self gotoPage:2.
       
  2296     self openWindow.
       
  2297 
       
  2298     "Created: / 20-07-2012 / 13:24:38 / cg"
  2257 !
  2299 !
  2258 
  2300 
  2259 postBuildMakeOutputWindow:aView
  2301 postBuildMakeOutputWindow:aView
  2260     makeOutputWindow := aView
  2302     makeOutputWindow := aView
  2261 !
  2303 !
  2383 
  2425 
  2384     "Modified: / 23-08-2011 / 12:13:29 / cg"
  2426     "Modified: / 23-08-2011 / 12:13:29 / cg"
  2385 !
  2427 !
  2386 
  2428 
  2387 canEnterContentsSelection
  2429 canEnterContentsSelection
  2388     |prj cls impl|
  2430     |prj cls impl mthd|
  2389 
  2431 
  2390     self hasProjectSelected ifFalse:[
  2432     self hasProjectSelected ifFalse:[
  2391         self infoHolder value:'no project selected'. 
  2433         self infoHolder value:'no project selected'. 
  2392         ^ false
  2434         ^ false
  2393     ].
  2435     ].
  2413                                     bindWith:prj startupSelector
  2455                                     bindWith:prj startupSelector
  2414                                     with:prj class name). 
  2456                                     with:prj class name). 
  2415             ^ false
  2457             ^ false
  2416         ].
  2458         ].
  2417     ].
  2459     ].
  2418     (prj class compiledMethodAt:#startupClassName) package == prj package ifFalse:[
  2460     (mthd := prj class compiledMethodAt:#startupClassName) package == prj package ifFalse:[
  2419         (prj class compiledMethodAt:#startupClassName) package == PackageId noProjectID ifFalse:[
  2461         mthd package == PackageId noProjectID ifFalse:[
  2420             self infoHolder value:('startup class method (#startupClassName) of %3 must be in package "%1" (is in "%2")' 
  2462             self infoHolder value:('startup class method (#startupClassName) of %3 must be in package "%1" (is in "%2")' 
  2421                 bindWith:prj package
  2463                 bindWith:prj package
  2422                 with:(prj class compiledMethodAt:#startupClassName) package
  2464                 with:(prj class compiledMethodAt:#startupClassName) package
  2423                 with:prj class name). 
  2465                 with:prj class name). 
  2424             ^ false
  2466             ^ false
  2425         ].
  2467         ].
  2426     ].
  2468     ].
  2427     (prj class compiledMethodAt:#startupSelector) notNil ifTrue:[
  2469     (mthd := prj class compiledMethodAt:#startupSelector) notNil ifTrue:[
  2428         (prj class compiledMethodAt:#startupSelector) package == prj package ifFalse:[
  2470         mthd package == prj package ifFalse:[
  2429             (prj class compiledMethodAt:#startupSelector) package == PackageId noProjectID ifFalse:[
  2471             mthd package == PackageId noProjectID ifFalse:[
  2430                 self infoHolder value:('startup class method (#startupSelector) of %3 must be in package "%1" (is in "%2")' 
  2472                 self infoHolder value:('startup class method (#startupSelector) of %3 must be in package "%1" (is in "%2")' 
  2431                     bindWith:prj package
  2473                     bindWith:prj package
  2432                     with:(prj class compiledMethodAt:#startupSelector) package 
  2474                     with:mthd package 
  2433                     with:prj class name). 
  2475                     with:prj class name). 
  2434                 ^ false
  2476                 ^ false
  2435             ]
  2477             ]
  2436         ].
  2478         ].
  2437     ].
  2479     ].
  2448             ^ false
  2490             ^ false
  2449         ].
  2491         ].
  2450     ].
  2492     ].
  2451     ^ true.
  2493     ^ true.
  2452 
  2494 
  2453     "Modified: / 19-01-2012 / 15:30:54 / cg"
  2495     "Modified: / 20-07-2012 / 19:21:34 / cg"
  2454 !
  2496 !
  2455 
  2497 
  2456 canEnterDeploy
  2498 canEnterDeploy
  2457     self hasProjectBuilder ifFalse:[
  2499     self hasProjectBuilder ifFalse:[
  2458         self infoHolder value:'no project builder specified'. 
  2500         self infoHolder value:'no project builder specified'. 
  2492 isWindowsOS
  2534 isWindowsOS
  2493     ^ OperatingSystem isMSWINDOWSlike
  2535     ^ OperatingSystem isMSWINDOWSlike
  2494 !
  2536 !
  2495 
  2537 
  2496 projectTypeIsGuiApplication
  2538 projectTypeIsGuiApplication
  2497     ^ self projectTypeHolder value == #guiApplicationType
  2539     ^ self projectTypeHolder value == ProjectDefinition guiApplicationType
       
  2540 
       
  2541     "Modified: / 20-07-2012 / 13:29:59 / cg"
  2498 !
  2542 !
  2499 
  2543 
  2500 projectTypeIsLibrary
  2544 projectTypeIsLibrary
  2501     ^ self projectTypeHolder value == #libraryType
  2545     ^ self projectTypeHolder value == ProjectDefinition libraryType
       
  2546 
       
  2547     "Modified: / 20-07-2012 / 13:29:24 / cg"
  2502 !
  2548 !
  2503 
  2549 
  2504 projectTypeIsNotLibrary
  2550 projectTypeIsNotLibrary
  2505     ^ self projectTypeIsLibrary not
  2551     ^ self projectTypeIsLibrary not
  2506 ! !
  2552 ! !
  2731             query := #isGUIApplication
  2777             query := #isGUIApplication
  2732         ] ifFalse:[
  2778         ] ifFalse:[
  2733             projectType = ProjectDefinition nonGuiApplicationType ifTrue:[
  2779             projectType = ProjectDefinition nonGuiApplicationType ifTrue:[
  2734                 query := #isConsoleApplication
  2780                 query := #isConsoleApplication
  2735             ] ifFalse:[
  2781             ] ifFalse:[
  2736                 self error.
  2782                 self halt:'oops'.
       
  2783                 projectType := ProjectDefinition guiApplicationType.
  2737             ].
  2784             ].
  2738         ].
  2785         ].
  2739     ].
  2786     ].
  2740 
  2787 
  2741     Class flushSubclassInfo.
  2788     Class flushSubclassInfo.
  2765         self selectedProjectIndexHolder value:nil.
  2812         self selectedProjectIndexHolder value:nil.
  2766     ] ifFalse:[
  2813     ] ifFalse:[
  2767         self selectedProjectIndexHolder value:idx.
  2814         self selectedProjectIndexHolder value:idx.
  2768     ].
  2815     ].
  2769 
  2816 
  2770     "Modified: / 04-12-2011 / 19:55:37 / cg"
  2817     "Modified: / 20-07-2012 / 15:04:15 / cg"
  2771 !
  2818 !
  2772 
  2819 
  2773 updateListOfNewProjectsName
  2820 updateListOfNewProjectsName
  2774 
  2821 
  2775     |loadedProjectIDsWithoutProjectDefinition|
  2822     |loadedProjectIDsWithoutProjectDefinition|