Tools__ProjectBuilderAssistantApplication.st
changeset 2656 491471c26771
parent 2649 e851fc141ff1
child 2659 bec4c94bc628
equal deleted inserted replaced
2655:b1fb14b65b57 2656:491471c26771
     5 AssistantApplication subclass:#ProjectBuilderAssistantApplication
     5 AssistantApplication subclass:#ProjectBuilderAssistantApplication
     6 	instanceVariableNames:'packageToBuildHolder projectType selectedProjectIndexHolder
     6 	instanceVariableNames:'packageToBuildHolder projectType selectedProjectIndexHolder
     7 		selectedProjectDefinition listOfMatchingProjects
     7 		selectedProjectDefinition listOfMatchingProjects
     8 		selectedProjectsComment newProjectsName hideSTXProjects
     8 		selectedProjectsComment newProjectsName hideSTXProjects
     9 		startMakeButtonEnabled stopMakeButtonVisible makeOutputHolder
     9 		startMakeButtonEnabled stopMakeButtonVisible makeOutputHolder
    10 		newApplicationsName selectedApplicationIndexHolder
    10 		newApplicationsName listOfApplicationsInProject
    11 		selectedApplication listOfApplicationsInProject
    11 		selectedApplicationIndexHolder selectedApplication
    12 		selectedApplicationsComment buildDirectoryHolder makeProcess
    12 		listOfStartupClassesInProject selectedStartupClassIndexHolder
    13 		listOfClassesInProject makeOutputWindow projectBuilder'
    13 		selectedStartupClass selectedApplicationsComment
       
    14 		buildDirectoryHolder makeProcess listOfClassesInProject
       
    15 		makeOutputWindow projectBuilder'
    14 	classVariableNames:''
    16 	classVariableNames:''
    15 	poolDictionaries:''
    17 	poolDictionaries:''
    16 	category:'System-Support-Projects'
    18 	category:'System-Support-Projects'
    17 !
    19 !
    18 
    20 
   413          
   415          
   414         )
   416         )
   415       )
   417       )
   416 !
   418 !
   417 
   419 
   418 page4_specifyIncludedClasses
   420 page4_startupClassSelectionSpec
   419     "This resource specification was automatically generated
   421     "This resource specification was automatically generated
   420      by the UIPainter of ST/X."
   422      by the UIPainter of ST/X."
   421 
   423 
   422     "Do not manually edit this!! If it is corrupted,
   424     "Do not manually edit this!! If it is corrupted,
   423      the UIPainter may not be able to read the specification."
   425      the UIPainter may not be able to read the specification."
   424 
   426 
   425     "
   427     "
   426      UIPainter new openOnClass:Tools::ProjectBuilderAssistantApplication andSelector:#page4_specifyIncludedClasses
   428      UIPainter new openOnClass:Tools::ProjectBuilderAssistantApplication andSelector:#page4_startupClassSelectionSpec
   427      Tools::ProjectBuilderAssistantApplication new openInterface:#page4_specifyIncludedClasses
   429      Tools::ProjectBuilderAssistantApplication new openInterface:#page4_startupClassSelectionSpec
   428     "
   430     "
   429 
   431 
   430     <resource: #canvas>
   432     <resource: #canvas>
   431 
   433 
   432     ^ 
   434     ^ 
   433      #(FullSpec
   435      #(FullSpec
   434         name: #'page4_specifyIncludedClasses'
   436         name: #'page4_startupClassSelectionSpec'
       
   437         window: 
       
   438        (WindowSpec
       
   439           label: 'Startup Class Selection'
       
   440           name: 'Startup Class Selection'
       
   441           min: (Point 0 0)
       
   442           bounds: (Rectangle 0 0 521 408)
       
   443         )
       
   444         component: 
       
   445        (SpecCollection
       
   446           collection: (
       
   447            (FramedBoxSpec
       
   448               label: 'New Application'
       
   449               name: 'FramedBox3'
       
   450               layout: (LayoutFrame 0 0.0 5 0 4 1.0 105 0)
       
   451               labelPosition: topLeft
       
   452               translateLabel: true
       
   453               component: 
       
   454              (SpecCollection
       
   455                 collection: (
       
   456                  (InputFieldSpec
       
   457                     name: 'EntryField1'
       
   458                     layout: (LayoutFrame 1 0 6 0 210 0 28 0)
       
   459                     model: newStartupClassName
       
   460                     acceptOnReturn: true
       
   461                     acceptOnTab: true
       
   462                     acceptOnPointerLeave: true
       
   463                     emptyFieldReplacementText: 'MyStandAloneStartup'
       
   464                   )
       
   465                  (ActionButtonSpec
       
   466                     label: 'Create'
       
   467                     name: 'Button1'
       
   468                     layout: (LayoutFrame 216 0 6 0 341 0 28 0)
       
   469                     translateLabel: true
       
   470                     model: createNewStartupClass
       
   471                   )
       
   472                  )
       
   473                
       
   474               )
       
   475             )
       
   476            (FramedBoxSpec
       
   477               label: 'Existing StartupClasses'
       
   478               name: 'FramedBox4'
       
   479               layout: (LayoutFrame 0 0.0 105 0 4 1.0 -30 1)
       
   480               labelPosition: topLeft
       
   481               translateLabel: true
       
   482               component: 
       
   483              (SpecCollection
       
   484                 collection: (
       
   485                  (VariableHorizontalPanelSpec
       
   486                     name: 'VariableHorizontalPanel2'
       
   487                     layout: (LayoutFrame 0 0 4 0 0 1 0 1)
       
   488                     component: 
       
   489                    (SpecCollection
       
   490                       collection: (
       
   491                        (SequenceViewSpec
       
   492                           name: 'List2'
       
   493                           model: selectedStartupClassIndexHolder
       
   494                           hasHorizontalScrollBar: true
       
   495                           hasVerticalScrollBar: true
       
   496                           useIndex: true
       
   497                           sequenceList: listOfStartupClassesInProject
       
   498                         )
       
   499                        (TextEditorSpec
       
   500                           name: 'TextEditor2'
       
   501                           model: selectedStartupClassesComment
       
   502                           hasHorizontalScrollBar: true
       
   503                           hasVerticalScrollBar: true
       
   504                           isReadOnly: true
       
   505                           hasKeyboardFocusInitially: false
       
   506                           viewClassName: 'TextView'
       
   507                         )
       
   508                        )
       
   509                      
       
   510                     )
       
   511                     handles: (Any 0.34560327198364 1.0)
       
   512                   )
       
   513                  )
       
   514                
       
   515               )
       
   516             )
       
   517            (HorizontalPanelViewSpec
       
   518               name: 'HorizontalPanel1'
       
   519               layout: (LayoutFrame 0 0 -30 1 0 1 0 1)
       
   520               horizontalLayout: leftSpace
       
   521               verticalLayout: center
       
   522               horizontalSpace: 3
       
   523               verticalSpace: 3
       
   524               component: 
       
   525              (SpecCollection
       
   526                 collection: (
       
   527                  (ActionButtonSpec
       
   528                     label: 'Browse Selected StartupClass'
       
   529                     name: 'Button3'
       
   530                     translateLabel: true
       
   531                     model: doBrowseStartupClass
       
   532                     extent: (Point 180 22)
       
   533                   )
       
   534                  )
       
   535                
       
   536               )
       
   537             )
       
   538            )
       
   539          
       
   540         )
       
   541       )
       
   542 !
       
   543 
       
   544 page5_specifyIncludedClasses
       
   545     "This resource specification was automatically generated
       
   546      by the UIPainter of ST/X."
       
   547 
       
   548     "Do not manually edit this!! If it is corrupted,
       
   549      the UIPainter may not be able to read the specification."
       
   550 
       
   551     "
       
   552      UIPainter new openOnClass:Tools::ProjectBuilderAssistantApplication andSelector:#page5_specifyIncludedClasses
       
   553      Tools::ProjectBuilderAssistantApplication new openInterface:#page5_specifyIncludedClasses
       
   554     "
       
   555 
       
   556     <resource: #canvas>
       
   557 
       
   558     ^ 
       
   559      #(FullSpec
       
   560         name: #'page5_specifyIncludedClasses'
   435         window: 
   561         window: 
   436        (WindowSpec
   562        (WindowSpec
   437           label: 'Project Selection'
   563           label: 'Project Selection'
   438           name: 'Project Selection'
   564           name: 'Project Selection'
   439           min: (Point 0 0)
   565           min: (Point 0 0)
   496          
   622          
   497         )
   623         )
   498       )
   624       )
   499 !
   625 !
   500 
   626 
   501 page5_specifyBuildDirectorySpec
   627 page6_specifyBuildDirectorySpec
   502     "This resource specification was automatically generated
   628     "This resource specification was automatically generated
   503      by the UIPainter of ST/X."
   629      by the UIPainter of ST/X."
   504 
   630 
   505     "Do not manually edit this!! If it is corrupted,
   631     "Do not manually edit this!! If it is corrupted,
   506      the UIPainter may not be able to read the specification."
   632      the UIPainter may not be able to read the specification."
   507 
   633 
   508     "
   634     "
   509      UIPainter new openOnClass:ProjectBuilderAssistantApplication andSelector:#page5_specifyBuildDirectorySpec
   635      UIPainter new openOnClass:ProjectBuilderAssistantApplication andSelector:#page6_specifyBuildDirectorySpec
   510      ProjectBuilderAssistantApplication new openInterface:#page5_specifyBuildDirectorySpec
   636      ProjectBuilderAssistantApplication new openInterface:#page6_specifyBuildDirectorySpec
   511     "
   637     "
   512 
   638 
   513     <resource: #canvas>
   639     <resource: #canvas>
   514 
   640 
   515     ^ 
   641     ^ 
   516      #(FullSpec
   642      #(FullSpec
   517         name: #'page5_specifyBuildDirectorySpec'
   643         name: #'page6_specifyBuildDirectorySpec'
   518         window: 
   644         window: 
   519        (WindowSpec
   645        (WindowSpec
   520           label: 'Project Selection'
   646           label: 'Project Selection'
   521           name: 'Project Selection'
   647           name: 'Project Selection'
   522           min: (Point 0 0)
   648           min: (Point 0 0)
   549          
   675          
   550         )
   676         )
   551       )
   677       )
   552 !
   678 !
   553 
   679 
   554 page6_buildSpec
   680 page7_buildSpec
   555     "This resource specification was automatically generated
   681     "This resource specification was automatically generated
   556      by the UIPainter of ST/X."
   682      by the UIPainter of ST/X."
   557 
   683 
   558     "Do not manually edit this!! If it is corrupted,
   684     "Do not manually edit this!! If it is corrupted,
   559      the UIPainter may not be able to read the specification."
   685      the UIPainter may not be able to read the specification."
   560 
   686 
   561     "
   687     "
   562      UIPainter new openOnClass:Tools::ProjectBuilderAssistantApplication andSelector:#page6_buildSpec
   688      UIPainter new openOnClass:Tools::ProjectBuilderAssistantApplication andSelector:#page7_buildSpec
   563      Tools::ProjectBuilderAssistantApplication new openInterface:#page6_buildSpec
   689      Tools::ProjectBuilderAssistantApplication new openInterface:#page7_buildSpec
   564     "
   690     "
   565 
   691 
   566     <resource: #canvas>
   692     <resource: #canvas>
   567 
   693 
   568     ^ 
   694     ^ 
   569      #(FullSpec
   695      #(FullSpec
   570         name: #'page6_buildSpec'
   696         name: #'page7_buildSpec'
   571         window: 
   697         window: 
   572        (WindowSpec
   698        (WindowSpec
   573           label: 'Project Selection'
   699           label: 'Project Selection'
   574           name: 'Project Selection'
   700           name: 'Project Selection'
   575           min: (Point 0 0)
   701           min: (Point 0 0)
   635          
   761          
   636         )
   762         )
   637       )
   763       )
   638 !
   764 !
   639 
   765 
   640 page7_deploySpec
   766 page8_deploySpec
   641     "This resource specification was automatically generated
   767     "This resource specification was automatically generated
   642      by the UIPainter of ST/X."
   768      by the UIPainter of ST/X."
   643 
   769 
   644     "Do not manually edit this!! If it is corrupted,
   770     "Do not manually edit this!! If it is corrupted,
   645      the UIPainter may not be able to read the specification."
   771      the UIPainter may not be able to read the specification."
   646 
   772 
   647     "
   773     "
   648      UIPainter new openOnClass:Tools::ProjectBuilderAssistantApplication andSelector:#page7_deploySpec
   774      UIPainter new openOnClass:Tools::ProjectBuilderAssistantApplication andSelector:#page8_deploySpec
   649      Tools::ProjectBuilderAssistantApplication new openInterface:#page7_deploySpec
   775      Tools::ProjectBuilderAssistantApplication new openInterface:#page8_deploySpec
   650     "
   776     "
   651 
   777 
   652     <resource: #canvas>
   778     <resource: #canvas>
   653 
   779 
   654     ^ 
   780     ^ 
   655      #(FullSpec
   781      #(FullSpec
   656         name: #'page7_deploySpec'
   782         name: #'page8_deploySpec'
   657         window: 
   783         window: 
   658        (WindowSpec
   784        (WindowSpec
   659           label: 'Project Selection'
   785           label: 'Project Selection'
   660           name: 'Project Selection'
   786           name: 'Project Selection'
   661           min: (Point 0 0)
   787           min: (Point 0 0)
   908     self selectedApplicationIndexHolder value isNil ifTrue:[
  1034     self selectedApplicationIndexHolder value isNil ifTrue:[
   909         selectedApplication := nil.
  1035         selectedApplication := nil.
   910     ] ifFalse:[
  1036     ] ifFalse:[
   911         selectedApplication := self listOfApplicationsInProject value at:(self selectedApplicationIndexHolder value).
  1037         selectedApplication := self listOfApplicationsInProject value at:(self selectedApplicationIndexHolder value).
   912     ].
  1038     ].
   913     selectedApplication notNil ifTrue:[
  1039 "/    selectedApplication notNil ifTrue:[
   914         "/ generate startupClass code
  1040 "/        "/ generate startupClass code
   915         CodeGeneratorTool
  1041 "/        CodeGeneratorTool
   916             compile:(selectedProjectDefinition startupClassName_codeFor:(selectedApplication name))
  1042 "/            compile:(selectedProjectDefinition startupClassName_codeFor:(selectedApplication name))
   917             forClass:selectedProjectDefinition theMetaclass
  1043 "/            forClass:selectedProjectDefinition theMetaclass
   918             inCategory:'description - startup'.
  1044 "/            inCategory:'description - startup'.
   919     ].
  1045 "/    ].
   920     self updateApplicationComment.
  1046     self updateApplicationComment.
   921     self updateButtonEnableState.
  1047     self updateButtonEnableState.
   922 !
  1048 !
   923 
  1049 
   924 selectedProjectChanged
  1050 selectedProjectChanged
   927     ] ifFalse:[
  1053     ] ifFalse:[
   928         selectedProjectDefinition := self listOfMatchingProjects value at:(self selectedProjectIndexHolder value).
  1054         selectedProjectDefinition := self listOfMatchingProjects value at:(self selectedProjectIndexHolder value).
   929     ].
  1055     ].
   930     self updateComment.
  1056     self updateComment.
   931     self updateListOfApplicationsInProject.
  1057     self updateListOfApplicationsInProject.
       
  1058     self updateButtonEnableState.
       
  1059 !
       
  1060 
       
  1061 selectedStartupClassChanged
       
  1062     self selectedStartupClassIndexHolder value isNil ifTrue:[
       
  1063         selectedStartupClass := nil.
       
  1064     ] ifFalse:[
       
  1065         selectedStartupClass := self listOfStartupClassesInProject value at:(self selectedStartupClassIndexHolder value).
       
  1066     ].
       
  1067     selectedStartupClass notNil ifTrue:[
       
  1068         "/ generate startupClass code
       
  1069         CodeGeneratorTool
       
  1070             compile:(selectedProjectDefinition startupClassName_codeFor:(selectedStartupClass name))
       
  1071             forClass:selectedProjectDefinition theMetaclass
       
  1072             inCategory:'description - startup'.
       
  1073     ].
   932     self updateButtonEnableState.
  1074     self updateButtonEnableState.
   933 ! !
  1075 ! !
   934 
  1076 
   935 !ProjectBuilderAssistantApplication methodsFor:'aspects'!
  1077 !ProjectBuilderAssistantApplication methodsFor:'aspects'!
   936 
  1078 
  1014         listOfMatchingProjects := ValueHolder new.
  1156         listOfMatchingProjects := ValueHolder new.
  1015     ].
  1157     ].
  1016     ^ listOfMatchingProjects.
  1158     ^ listOfMatchingProjects.
  1017 !
  1159 !
  1018 
  1160 
       
  1161 listOfStartupClassesInProject
       
  1162     <resource: #uiAspect>
       
  1163 
       
  1164     listOfStartupClassesInProject isNil ifTrue:[
       
  1165         listOfStartupClassesInProject := ValueHolder new.
       
  1166     ].
       
  1167     ^ listOfStartupClassesInProject.
       
  1168 !
       
  1169 
  1019 makeOutputHolder
  1170 makeOutputHolder
  1020     <resource: #uiAspect>
  1171     <resource: #uiAspect>
  1021 
  1172 
  1022     makeOutputHolder isNil ifTrue:[
  1173     makeOutputHolder isNil ifTrue:[
  1023         makeOutputHolder := ValueHolder new.
  1174         makeOutputHolder := ValueHolder new.
  1065 
  1216 
  1066 projectTypeIsNotLibrary
  1217 projectTypeIsNotLibrary
  1067     ^ self projectType value ~~ #libraryType
  1218     ^ self projectType value ~~ #libraryType
  1068 !
  1219 !
  1069 
  1220 
  1070 selectedApplication
       
  1071     <resource: #uiAspect>
       
  1072 
       
  1073     selectedApplication isNil ifTrue:[
       
  1074         selectedApplication := ValueHolder new.
       
  1075         selectedApplication onChangeSend:#selectedApplicationChanged to:self.
       
  1076     ].
       
  1077     ^ selectedApplication.
       
  1078 !
       
  1079 
       
  1080 selectedApplicationIndexHolder
  1221 selectedApplicationIndexHolder
  1081     <resource: #uiAspect>
  1222     <resource: #uiAspect>
  1082 
  1223 
  1083     selectedApplicationIndexHolder isNil ifTrue:[
  1224     selectedApplicationIndexHolder isNil ifTrue:[
  1084         selectedApplicationIndexHolder := ValueHolder new.
  1225         selectedApplicationIndexHolder := ValueHolder new.
  1127 
  1268 
  1128     selectedProjectsComment isNil ifTrue:[
  1269     selectedProjectsComment isNil ifTrue:[
  1129         selectedProjectsComment := '' asValue.
  1270         selectedProjectsComment := '' asValue.
  1130     ].
  1271     ].
  1131     ^ selectedProjectsComment.
  1272     ^ selectedProjectsComment.
       
  1273 !
       
  1274 
       
  1275 selectedStartupClassIndexHolder
       
  1276     <resource: #uiAspect>
       
  1277 
       
  1278     selectedStartupClassIndexHolder isNil ifTrue:[
       
  1279         selectedStartupClassIndexHolder := ValueHolder new.
       
  1280         selectedStartupClassIndexHolder onChangeSend:#selectedStartupClassChanged to:self.
       
  1281     ].
       
  1282     ^ selectedStartupClassIndexHolder.
  1132 !
  1283 !
  1133 
  1284 
  1134 startMakeButtonEnabled
  1285 startMakeButtonEnabled
  1135     <resource: #uiAspect>
  1286     <resource: #uiAspect>
  1136 
  1287 
  1189         comment := comment asString.
  1340         comment := comment asString.
  1190     ].
  1341     ].
  1191     ^ comment
  1342     ^ comment
  1192 ! !
  1343 ! !
  1193 
  1344 
       
  1345 !ProjectBuilderAssistantApplication methodsFor:'queries'!
       
  1346 
       
  1347 canEnterApplicationSelection
       
  1348     ^ self hasProjectSelected
       
  1349 !
       
  1350 
       
  1351 canEnterBuild
       
  1352     ^ self hasBuildDirectorySpecified
       
  1353 !
       
  1354 
       
  1355 canEnterDeploy
       
  1356     ^ self hasProjectBuilder
       
  1357 !
       
  1358 
       
  1359 canEnterStartupClassSelection
       
  1360     ^ self hasProjectSelected
       
  1361 ! !
       
  1362 
  1194 !ProjectBuilderAssistantApplication methodsFor:'specs'!
  1363 !ProjectBuilderAssistantApplication methodsFor:'specs'!
  1195 
  1364 
  1196 assistantSpec
  1365 assistantSpec
  1197     ^ #(Array
  1366     ^ #(Array
  1198         ( AssistantPageSpec
  1367         ( AssistantPageSpec
  1209 
  1378 
  1210         (AssistantPageSpec
  1379         (AssistantPageSpec
  1211             pageTitle: 'Application Selection'
  1380             pageTitle: 'Application Selection'
  1212             windowSpecSelector: page3_applicationSelectionSpec
  1381             windowSpecSelector: page3_applicationSelectionSpec
  1213             isEnabledQuerySelector: #projectTypeIsNotLibrary
  1382             isEnabledQuerySelector: #projectTypeIsNotLibrary
  1214             canEnterQuerySelector: #hasProjectSelected
  1383             canEnterQuerySelector: #canEnterApplicationSelection
  1215             enterCallbackSelector: updateListOfApplicationsInProject
  1384             enterCallbackSelector: updateListOfApplicationsInProject
       
  1385         )
       
  1386 
       
  1387         (AssistantPageSpec
       
  1388             pageTitle: 'Startup Class Selection'
       
  1389             windowSpecSelector: page4_startupClassSelectionSpec
       
  1390             isEnabledQuerySelector: #projectTypeIsNotLibrary
       
  1391             canEnterQuerySelector: #canEnterStartupClassSelection
       
  1392             enterCallbackSelector: updateListOfStartupClassesInProject
  1216         )
  1393         )
  1217 
  1394 
  1218         (AssistantPageSpec
  1395         (AssistantPageSpec
  1219             pageTitle: 'Specify Contents'
  1396             pageTitle: 'Specify Contents'
  1220             windowSpecSelector: page4_specifyIncludedClasses
  1397             windowSpecSelector: page5_specifyIncludedClasses
  1221             enterCallbackSelector: updateListOfClassesInProject
  1398             enterCallbackSelector: updateListOfClassesInProject
  1222         )
  1399         )
  1223 
  1400 
  1224         (AssistantPageSpec
  1401         (AssistantPageSpec
  1225             pageTitle: 'Specify Build Directory'
  1402             pageTitle: 'Specify Build Directory'
  1226             windowSpecSelector: page5_specifyBuildDirectorySpec
  1403             windowSpecSelector: page6_specifyBuildDirectorySpec
  1227         )
  1404         )
  1228 
  1405 
  1229         (AssistantPageSpec
  1406         (AssistantPageSpec
  1230             pageTitle: 'Build'
  1407             pageTitle: 'Build'
  1231             windowSpecSelector: page6_buildSpec
  1408             windowSpecSelector: page7_buildSpec
  1232             canEnterQuerySelector: #hasBuildDirectorySpecified
  1409             canEnterQuerySelector: #canEnterBuild
  1233             enterCallbackSelector: #restoreMakeOutputsContents
  1410             enterCallbackSelector: #restoreMakeOutputsContents
  1234             leaveCallbackSelector: #rememberMakeOutputsContents
  1411             leaveCallbackSelector: #rememberMakeOutputsContents
  1235         )
  1412         )
  1236 
  1413 
  1237         (AssistantPageSpec
  1414         (AssistantPageSpec
  1238             pageTitle: 'Deploy'
  1415             pageTitle: 'Deploy'
  1239             windowSpecSelector: page7_deploySpec
  1416             windowSpecSelector: page8_deploySpec
  1240             canEnterQuerySelector: #hasProjectBuilder
  1417             canEnterQuerySelector: #canEnterDeploy
  1241         )
  1418         )
  1242     ) decodeAsLiteralArray.
  1419     ) decodeAsLiteralArray.
  1243 ! !
  1420 ! !
  1244 
  1421 
  1245 !ProjectBuilderAssistantApplication methodsFor:'update'!
  1422 !ProjectBuilderAssistantApplication methodsFor:'update'!