diff -r b1fb14b65b57 -r 491471c26771 Tools__ProjectBuilderAssistantApplication.st --- a/Tools__ProjectBuilderAssistantApplication.st Wed Oct 21 15:17:29 2009 +0200 +++ b/Tools__ProjectBuilderAssistantApplication.st Wed Oct 21 15:33:24 2009 +0200 @@ -7,10 +7,12 @@ selectedProjectDefinition listOfMatchingProjects selectedProjectsComment newProjectsName hideSTXProjects startMakeButtonEnabled stopMakeButtonVisible makeOutputHolder - newApplicationsName selectedApplicationIndexHolder - selectedApplication listOfApplicationsInProject - selectedApplicationsComment buildDirectoryHolder makeProcess - listOfClassesInProject makeOutputWindow projectBuilder' + newApplicationsName listOfApplicationsInProject + selectedApplicationIndexHolder selectedApplication + listOfStartupClassesInProject selectedStartupClassIndexHolder + selectedStartupClass selectedApplicationsComment + buildDirectoryHolder makeProcess listOfClassesInProject + makeOutputWindow projectBuilder' classVariableNames:'' poolDictionaries:'' category:'System-Support-Projects' @@ -415,7 +417,7 @@ ) ! -page4_specifyIncludedClasses +page4_startupClassSelectionSpec "This resource specification was automatically generated by the UIPainter of ST/X." @@ -423,15 +425,139 @@ the UIPainter may not be able to read the specification." " - UIPainter new openOnClass:Tools::ProjectBuilderAssistantApplication andSelector:#page4_specifyIncludedClasses - Tools::ProjectBuilderAssistantApplication new openInterface:#page4_specifyIncludedClasses + UIPainter new openOnClass:Tools::ProjectBuilderAssistantApplication andSelector:#page4_startupClassSelectionSpec + Tools::ProjectBuilderAssistantApplication new openInterface:#page4_startupClassSelectionSpec " ^ #(FullSpec - name: #'page4_specifyIncludedClasses' + name: #'page4_startupClassSelectionSpec' + window: + (WindowSpec + label: 'Startup Class Selection' + name: 'Startup Class Selection' + min: (Point 0 0) + bounds: (Rectangle 0 0 521 408) + ) + component: + (SpecCollection + collection: ( + (FramedBoxSpec + label: 'New Application' + name: 'FramedBox3' + layout: (LayoutFrame 0 0.0 5 0 4 1.0 105 0) + labelPosition: topLeft + translateLabel: true + component: + (SpecCollection + collection: ( + (InputFieldSpec + name: 'EntryField1' + layout: (LayoutFrame 1 0 6 0 210 0 28 0) + model: newStartupClassName + acceptOnReturn: true + acceptOnTab: true + acceptOnPointerLeave: true + emptyFieldReplacementText: 'MyStandAloneStartup' + ) + (ActionButtonSpec + label: 'Create' + name: 'Button1' + layout: (LayoutFrame 216 0 6 0 341 0 28 0) + translateLabel: true + model: createNewStartupClass + ) + ) + + ) + ) + (FramedBoxSpec + label: 'Existing StartupClasses' + name: 'FramedBox4' + layout: (LayoutFrame 0 0.0 105 0 4 1.0 -30 1) + labelPosition: topLeft + translateLabel: true + component: + (SpecCollection + collection: ( + (VariableHorizontalPanelSpec + name: 'VariableHorizontalPanel2' + layout: (LayoutFrame 0 0 4 0 0 1 0 1) + component: + (SpecCollection + collection: ( + (SequenceViewSpec + name: 'List2' + model: selectedStartupClassIndexHolder + hasHorizontalScrollBar: true + hasVerticalScrollBar: true + useIndex: true + sequenceList: listOfStartupClassesInProject + ) + (TextEditorSpec + name: 'TextEditor2' + model: selectedStartupClassesComment + hasHorizontalScrollBar: true + hasVerticalScrollBar: true + isReadOnly: true + hasKeyboardFocusInitially: false + viewClassName: 'TextView' + ) + ) + + ) + handles: (Any 0.34560327198364 1.0) + ) + ) + + ) + ) + (HorizontalPanelViewSpec + name: 'HorizontalPanel1' + layout: (LayoutFrame 0 0 -30 1 0 1 0 1) + horizontalLayout: leftSpace + verticalLayout: center + horizontalSpace: 3 + verticalSpace: 3 + component: + (SpecCollection + collection: ( + (ActionButtonSpec + label: 'Browse Selected StartupClass' + name: 'Button3' + translateLabel: true + model: doBrowseStartupClass + extent: (Point 180 22) + ) + ) + + ) + ) + ) + + ) + ) +! + +page5_specifyIncludedClasses + "This resource specification was automatically generated + by the UIPainter of ST/X." + + "Do not manually edit this!! If it is corrupted, + the UIPainter may not be able to read the specification." + + " + UIPainter new openOnClass:Tools::ProjectBuilderAssistantApplication andSelector:#page5_specifyIncludedClasses + Tools::ProjectBuilderAssistantApplication new openInterface:#page5_specifyIncludedClasses + " + + + + ^ + #(FullSpec + name: #'page5_specifyIncludedClasses' window: (WindowSpec label: 'Project Selection' @@ -498,7 +624,7 @@ ) ! -page5_specifyBuildDirectorySpec +page6_specifyBuildDirectorySpec "This resource specification was automatically generated by the UIPainter of ST/X." @@ -506,15 +632,15 @@ the UIPainter may not be able to read the specification." " - UIPainter new openOnClass:ProjectBuilderAssistantApplication andSelector:#page5_specifyBuildDirectorySpec - ProjectBuilderAssistantApplication new openInterface:#page5_specifyBuildDirectorySpec + UIPainter new openOnClass:ProjectBuilderAssistantApplication andSelector:#page6_specifyBuildDirectorySpec + ProjectBuilderAssistantApplication new openInterface:#page6_specifyBuildDirectorySpec " ^ #(FullSpec - name: #'page5_specifyBuildDirectorySpec' + name: #'page6_specifyBuildDirectorySpec' window: (WindowSpec label: 'Project Selection' @@ -551,7 +677,7 @@ ) ! -page6_buildSpec +page7_buildSpec "This resource specification was automatically generated by the UIPainter of ST/X." @@ -559,15 +685,15 @@ the UIPainter may not be able to read the specification." " - UIPainter new openOnClass:Tools::ProjectBuilderAssistantApplication andSelector:#page6_buildSpec - Tools::ProjectBuilderAssistantApplication new openInterface:#page6_buildSpec + UIPainter new openOnClass:Tools::ProjectBuilderAssistantApplication andSelector:#page7_buildSpec + Tools::ProjectBuilderAssistantApplication new openInterface:#page7_buildSpec " ^ #(FullSpec - name: #'page6_buildSpec' + name: #'page7_buildSpec' window: (WindowSpec label: 'Project Selection' @@ -637,7 +763,7 @@ ) ! -page7_deploySpec +page8_deploySpec "This resource specification was automatically generated by the UIPainter of ST/X." @@ -645,15 +771,15 @@ the UIPainter may not be able to read the specification." " - UIPainter new openOnClass:Tools::ProjectBuilderAssistantApplication andSelector:#page7_deploySpec - Tools::ProjectBuilderAssistantApplication new openInterface:#page7_deploySpec + UIPainter new openOnClass:Tools::ProjectBuilderAssistantApplication andSelector:#page8_deploySpec + Tools::ProjectBuilderAssistantApplication new openInterface:#page8_deploySpec " ^ #(FullSpec - name: #'page7_deploySpec' + name: #'page8_deploySpec' window: (WindowSpec label: 'Project Selection' @@ -910,13 +1036,13 @@ ] ifFalse:[ selectedApplication := self listOfApplicationsInProject value at:(self selectedApplicationIndexHolder value). ]. - selectedApplication notNil ifTrue:[ - "/ generate startupClass code - CodeGeneratorTool - compile:(selectedProjectDefinition startupClassName_codeFor:(selectedApplication name)) - forClass:selectedProjectDefinition theMetaclass - inCategory:'description - startup'. - ]. +"/ selectedApplication notNil ifTrue:[ +"/ "/ generate startupClass code +"/ CodeGeneratorTool +"/ compile:(selectedProjectDefinition startupClassName_codeFor:(selectedApplication name)) +"/ forClass:selectedProjectDefinition theMetaclass +"/ inCategory:'description - startup'. +"/ ]. self updateApplicationComment. self updateButtonEnableState. ! @@ -930,6 +1056,22 @@ self updateComment. self updateListOfApplicationsInProject. self updateButtonEnableState. +! + +selectedStartupClassChanged + self selectedStartupClassIndexHolder value isNil ifTrue:[ + selectedStartupClass := nil. + ] ifFalse:[ + selectedStartupClass := self listOfStartupClassesInProject value at:(self selectedStartupClassIndexHolder value). + ]. + selectedStartupClass notNil ifTrue:[ + "/ generate startupClass code + CodeGeneratorTool + compile:(selectedProjectDefinition startupClassName_codeFor:(selectedStartupClass name)) + forClass:selectedProjectDefinition theMetaclass + inCategory:'description - startup'. + ]. + self updateButtonEnableState. ! ! !ProjectBuilderAssistantApplication methodsFor:'aspects'! @@ -1016,6 +1158,15 @@ ^ listOfMatchingProjects. ! +listOfStartupClassesInProject + + + listOfStartupClassesInProject isNil ifTrue:[ + listOfStartupClassesInProject := ValueHolder new. + ]. + ^ listOfStartupClassesInProject. +! + makeOutputHolder @@ -1067,16 +1218,6 @@ ^ self projectType value ~~ #libraryType ! -selectedApplication - - - selectedApplication isNil ifTrue:[ - selectedApplication := ValueHolder new. - selectedApplication onChangeSend:#selectedApplicationChanged to:self. - ]. - ^ selectedApplication. -! - selectedApplicationIndexHolder @@ -1131,6 +1272,16 @@ ^ selectedProjectsComment. ! +selectedStartupClassIndexHolder + + + selectedStartupClassIndexHolder isNil ifTrue:[ + selectedStartupClassIndexHolder := ValueHolder new. + selectedStartupClassIndexHolder onChangeSend:#selectedStartupClassChanged to:self. + ]. + ^ selectedStartupClassIndexHolder. +! + startMakeButtonEnabled @@ -1191,6 +1342,24 @@ ^ comment ! ! +!ProjectBuilderAssistantApplication methodsFor:'queries'! + +canEnterApplicationSelection + ^ self hasProjectSelected +! + +canEnterBuild + ^ self hasBuildDirectorySpecified +! + +canEnterDeploy + ^ self hasProjectBuilder +! + +canEnterStartupClassSelection + ^ self hasProjectSelected +! ! + !ProjectBuilderAssistantApplication methodsFor:'specs'! assistantSpec @@ -1211,33 +1380,41 @@ pageTitle: 'Application Selection' windowSpecSelector: page3_applicationSelectionSpec isEnabledQuerySelector: #projectTypeIsNotLibrary - canEnterQuerySelector: #hasProjectSelected + canEnterQuerySelector: #canEnterApplicationSelection enterCallbackSelector: updateListOfApplicationsInProject ) (AssistantPageSpec + pageTitle: 'Startup Class Selection' + windowSpecSelector: page4_startupClassSelectionSpec + isEnabledQuerySelector: #projectTypeIsNotLibrary + canEnterQuerySelector: #canEnterStartupClassSelection + enterCallbackSelector: updateListOfStartupClassesInProject + ) + + (AssistantPageSpec pageTitle: 'Specify Contents' - windowSpecSelector: page4_specifyIncludedClasses + windowSpecSelector: page5_specifyIncludedClasses enterCallbackSelector: updateListOfClassesInProject ) (AssistantPageSpec pageTitle: 'Specify Build Directory' - windowSpecSelector: page5_specifyBuildDirectorySpec + windowSpecSelector: page6_specifyBuildDirectorySpec ) (AssistantPageSpec pageTitle: 'Build' - windowSpecSelector: page6_buildSpec - canEnterQuerySelector: #hasBuildDirectorySpecified + windowSpecSelector: page7_buildSpec + canEnterQuerySelector: #canEnterBuild enterCallbackSelector: #restoreMakeOutputsContents leaveCallbackSelector: #rememberMakeOutputsContents ) (AssistantPageSpec pageTitle: 'Deploy' - windowSpecSelector: page7_deploySpec - canEnterQuerySelector: #hasProjectBuilder + windowSpecSelector: page8_deploySpec + canEnterQuerySelector: #canEnterDeploy ) ) decodeAsLiteralArray. ! !