Tools__ProjectBuilderAssistantApplication.st
author Claus Gittinger <cg@exept.de>
Thu, 22 Oct 2009 23:17:23 +0200
changeset 2675 7bd7413e3cb3
parent 2674 3f61bdc7e0dc
child 2676 17095b9cdf97
permissions -rw-r--r--
added: #doStartMakeExe

"{ Package: 'stx:libtool2' }"

"{ NameSpace: Tools }"

AssistantApplication subclass:#ProjectBuilderAssistantApplication
	instanceVariableNames:'packageToBuildHolder projectType projectTypeHolder
		selectedProjectIndexHolder selectedProjectDefinition
		listOfMatchingProjects selectedProjectsComment
		hasProjectSelectedHolder newProjectsName hideSTXProjects
		hideOtherApplicationClasses hideOtherStartupClasses
		startMakeButtonEnabled stopMakeButtonVisible makeOutputHolder
		newApplicationsName listOfApplicationsInProject
		selectedApplicationIndexHolder selectedApplication
		hasApplicationSelectedHolder listOfStartupClassesInProject
		selectedStartupClassIndexHolder selectedStartupClass
		hasStartupClassSelectedHolder selectedApplicationsComment
		buildDirectoryHolder makeProcess listOfClassesInProject
		makeOutputWindow projectBuilder newStartupClassName'
	classVariableNames:''
	poolDictionaries:''
	category:'System-Support-Projects'
!

!ProjectBuilderAssistantApplication class methodsFor:'documentation'!

documentation
"
    a user friendly interface to the build process.
    Simply wraps up existing tools like the CodeGeneratorTool, the browsers
    and the ProjetBuilder

    [see also:]
        CodeGeneratorTool
        ProjectBuilder
        ProjectDefinition

    [author:]
        Claus Gittinger
"
! !

!ProjectBuilderAssistantApplication class methodsFor:'defaults'!

defaultIcon
    ^ ToolbarIconLibrary projectBuilderIcon
!

windowLabelTemplate
    ^ 'ST/X Packager: %1'
! !

!ProjectBuilderAssistantApplication class methodsFor:'interface specs'!

page1_projectTypeSelectionSpec
    "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:#page1_projectTypeSelectionSpec
     Tools::ProjectBuilderAssistantApplication new openInterface:#page1_projectTypeSelectionSpec
    "

    <resource: #canvas>

    ^ 
     #(FullSpec
        name: #'page1_projectTypeSelectionSpec'
        window: 
       (WindowSpec
          label: 'Project Selection'
          name: 'Project Selection'
          min: (Point 0 0)
          bounds: (Rectangle 0 0 626 394)
        )
        component: 
       (SpecCollection
          collection: (
           (FramedBoxSpec
              label: 'Project Type Filter'
              name: 'FramedBox1'
              layout: (LayoutFrame 0 0.0 0 0 4 1.0 105 0)
              labelPosition: topLeft
              translateLabel: true
              component: 
             (SpecCollection
                collection: (
                 (VerticalPanelViewSpec
                    name: 'VerticalPanel1'
                    layout: (LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0)
                    horizontalLayout: leftSpace
                    verticalLayout: topSpace
                    horizontalSpace: 3
                    verticalSpace: 3
                    component: 
                   (SpecCollection
                      collection: (
                       (ViewSpec
                          name: 'Box1'
                          extent: (Point 10 10)
                        )
                       (RadioButtonSpec
                          label: 'GUI Application'
                          name: 'RadioButton1'
                          translateLabel: true
                          model: projectTypeHolder
                          isTriggerOnDown: true
                          onCallBackSelector: projectTypeChanged
                          select: guiApplicationType
                          extent: (Point 136 22)
                        )
                       (RadioButtonSpec
                          label: 'Non-GUI Application'
                          name: 'RadioButton2'
                          translateLabel: true
                          model: projectTypeHolder
                          isTriggerOnDown: true
                          onCallBackSelector: projectTypeChanged
                          select: nonGuiApplicationType
                          extent: (Point 136 22)
                        )
                       (RadioButtonSpec
                          label: 'Class Library'
                          name: 'RadioButton3'
                          translateLabel: true
                          model: projectTypeHolder
                          isTriggerOnDown: true
                          onCallBackSelector: projectTypeChanged
                          select: libraryType
                          extent: (Point 136 22)
                        )
                       )
                     
                    )
                  )
                 )
               
              )
            )
           (FramedBoxSpec
              label: 'Existing Projects'
              name: 'FramedBox2'
              layout: (LayoutFrame 0 0.0 105 0 4 1.0 0 1)
              labelPosition: topLeft
              translateLabel: true
              component: 
             (SpecCollection
                collection: (
                 (VariableHorizontalPanelSpec
                    name: 'VariableHorizontalPanel1'
                    layout: (LayoutFrame 0 0 4 0 0 1 -26 1)
                    component: 
                   (SpecCollection
                      collection: (
                       (SequenceViewSpec
                          name: 'List1'
                          model: selectedProjectIndexHolder
                          hasHorizontalScrollBar: true
                          hasVerticalScrollBar: true
                          useIndex: true
                          sequenceList: listOfMatchingProjects
                        )
                       (TextEditorSpec
                          name: 'TextEditor1'
                          model: selectedProjectsComment
                          hasHorizontalScrollBar: true
                          hasVerticalScrollBar: true
                          isReadOnly: true
                          hasKeyboardFocusInitially: false
                        )
                       )
                     
                    )
                    handles: (Any 0.34560327198364 1.0)
                  )
                 (CheckBoxSpec
                    label: 'Hide ST/X Base Packages'
                    name: 'CheckBox1'
                    layout: (LayoutFrame -1 0 -18 1 0 1 4 1)
                    model: hideSTXProjects
                    translateLabel: true
                  )
                 )
               
              )
            )
           )
         
        )
      )
!

page2_projectSelectionSpec
    "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:#page2_projectSelectionSpec
     Tools::ProjectBuilderAssistantApplication new openInterface:#page2_projectSelectionSpec
    "

    <resource: #canvas>

    ^ 
     #(FullSpec
        name: #'page2_projectSelectionSpec'
        window: 
       (WindowSpec
          label: 'Project Selection'
          name: 'Project Selection'
          min: (Point 0 0)
          bounds: (Rectangle 0 0 521 453)
        )
        component: 
       (SpecCollection
          collection: (
           (FramedBoxSpec
              label: 'New Project'
              name: 'FramedBox3'
              layout: (LayoutFrame 0 0.0 5 0 4 1.0 72 0)
              labelPosition: topLeft
              translateLabel: true
              component: 
             (SpecCollection
                collection: (
                 (InputFieldSpec
                    name: 'EntryField1'
                    layout: (LayoutFrame 1 0 6 0 -113 1 28 0)
                    model: newProjectsName
                    acceptOnReturn: true
                    acceptOnTab: true
                    acceptOnPointerLeave: true
                    emptyFieldReplacementText: 'module:directory'
                  )
                 (ActionButtonSpec
                    label: 'Create'
                    name: 'Button1'
                    layout: (LayoutFrame -100 1 6 0 2 1 28 0)
                    translateLabel: true
                    model: createNewProject
                  )
                 )
               
              )
            )
           (FramedBoxSpec
              label: 'Existing Projects'
              name: 'FramedBox4'
              layout: (LayoutFrame 0 0.0 70 0 4 1.0 -30 1)
              labelPosition: topLeft
              translateLabel: true
              component: 
             (SpecCollection
                collection: (
                 (VariableHorizontalPanelSpec
                    name: 'VariableHorizontalPanel2'
                    layout: (LayoutFrame 0 0 4 0 0 1 -26 1)
                    component: 
                   (SpecCollection
                      collection: (
                       (SequenceViewSpec
                          name: 'List2'
                          model: selectedProjectIndexHolder
                          hasHorizontalScrollBar: true
                          hasVerticalScrollBar: true
                          useIndex: true
                          sequenceList: listOfMatchingProjects
                        )
                       (TextEditorSpec
                          name: 'TextEditor2'
                          model: selectedProjectsComment
                          hasHorizontalScrollBar: true
                          hasVerticalScrollBar: true
                          isReadOnly: true
                          hasKeyboardFocusInitially: false
                          viewClassName: 'TextView'
                        )
                       )
                     
                    )
                    handles: (Any 0.34560327198364 1.0)
                  )
                 (CheckBoxSpec
                    label: 'Hide ST/X Base Packages'
                    name: 'CheckBox1'
                    layout: (LayoutFrame -1 0 -17 1 0 1 5 1)
                    model: hideSTXProjects
                    translateLabel: true
                  )
                 )
               
              )
            )
           (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 Project'
                    name: 'Button3'
                    translateLabel: true
                    model: doBrowseProject
                    enableChannel: hasProjectSelectedHolder
                    extent: (Point 180 22)
                  )
                 )
               
              )
            )
           )
         
        )
      )
!

page3_applicationSelectionSpec
    "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:#page3_applicationSelectionSpec
     Tools::ProjectBuilderAssistantApplication new openInterface:#page3_applicationSelectionSpec
    "

    <resource: #canvas>

    ^ 
     #(FullSpec
        name: #'page3_applicationSelectionSpec'
        window: 
       (WindowSpec
          label: 'Application Selection'
          name: 'Application Selection'
          min: (Point 0 0)
          bounds: (Rectangle 0 0 519 406)
        )
        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 -113 1 28 0)
                    model: newApplicationsName
                    acceptOnReturn: true
                    acceptOnTab: true
                    acceptOnPointerLeave: true
                    emptyFieldReplacementText: 'MyApplication'
                  )
                 (ActionButtonSpec
                    label: 'Create'
                    name: 'Button1'
                    layout: (LayoutFrame -100 1 6 0 1 1 28 0)
                    translateLabel: true
                    model: createNewApplication
                  )
                 )
               
              )
            )
           (FramedBoxSpec
              label: 'Existing Applications'
              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 -26 1)
                    component: 
                   (SpecCollection
                      collection: (
                       (SequenceViewSpec
                          name: 'List2'
                          model: selectedApplicationIndexHolder
                          hasHorizontalScrollBar: true
                          hasVerticalScrollBar: true
                          useIndex: true
                          sequenceList: listOfApplicationsInProject
                          ignoreReselect: false
                        )
                       (TextEditorSpec
                          name: 'TextEditor2'
                          model: selectedApplicationsComment
                          hasHorizontalScrollBar: true
                          hasVerticalScrollBar: true
                          isReadOnly: true
                          hasKeyboardFocusInitially: false
                          viewClassName: 'TextView'
                        )
                       )
                     
                    )
                    handles: (Any 0.34560327198364 1.0)
                  )
                 (CheckBoxSpec
                    label: 'Hide other Application Classes'
                    name: 'CheckBox1'
                    layout: (LayoutFrame -1 0 -18 1 0 1 4 1)
                    model: hideOtherApplicationClasses
                    translateLabel: true
                  )
                 )
               
              )
            )
           (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 Application'
                    name: 'Button3'
                    translateLabel: true
                    model: doBrowseApplication
                    enableChannel: hasApplicationSelectedHolder
                    extent: (Point 180 22)
                  )
                 (ActionButtonSpec
                    label: 'Launch Selected Application'
                    name: 'Button4'
                    translateLabel: true
                    model: doLaunchApplication
                    enableChannel: hasApplicationSelectedHolder
                    extent: (Point 180 22)
                  )
                 )
               
              )
            )
           )
         
        )
      )
!

page4_startupClassSelectionSpec
    "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:#page4_startupClassSelectionSpec
     Tools::ProjectBuilderAssistantApplication new openInterface:#page4_startupClassSelectionSpec
    "

    <resource: #canvas>

    ^ 
     #(FullSpec
        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 -113 1 28 0)
                    model: newStartupClassName
                    acceptOnReturn: true
                    acceptOnTab: true
                    acceptOnPointerLeave: true
                    emptyFieldReplacementText: 'MyStandAloneStartup'
                  )
                 (ActionButtonSpec
                    label: 'Create'
                    name: 'Button1'
                    layout: (LayoutFrame -100 1 6 0 1 1 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 -26 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)
                  )
                 (CheckBoxSpec
                    label: 'Hide other Startup Classes'
                    name: 'CheckBox1'
                    layout: (LayoutFrame -1 0 -20 1 0 1 2 1)
                    model: hideOtherStartupClasses
                    translateLabel: true
                  )
                 )
               
              )
            )
           (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
                    enableChannel: hasStartupClassSelectedHolder
                    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
    "

    <resource: #canvas>

    ^ 
     #(FullSpec
        name: #'page5_specifyIncludedClasses'
        window: 
       (WindowSpec
          label: 'Project Selection'
          name: 'Project Selection'
          min: (Point 0 0)
          bounds: (Rectangle 0 0 521 400)
        )
        component: 
       (SpecCollection
          collection: (
           (FramedBoxSpec
              label: 'Project Contents'
              name: 'FramedBox3'
              layout: (LayoutFrame 0 0.0 5 0 4 1.0 -30 1)
              labelPosition: topLeft
              translateLabel: true
              component: 
             (SpecCollection
                collection: (
                 (SequenceViewSpec
                    name: 'List1'
                    layout: (LayoutFrame 0 0 0 0 0 1 0 1)
                    initiallyDisabled: true
                    hasHorizontalScrollBar: true
                    hasVerticalScrollBar: true
                    useIndex: false
                    sequenceList: listOfClassesInProject
                  )
                 )
               
              )
            )
           (HorizontalPanelViewSpec
              name: 'HorizontalPanel1'
              layout: (LayoutFrame 0 0 -30 1 0 1 0 1)
              horizontalLayout: center
              verticalLayout: center
              horizontalSpace: 3
              verticalSpace: 3
              component: 
             (SpecCollection
                collection: (
                 (ActionButtonSpec
                    label: 'Browse Project Definition'
                    name: 'Button3'
                    translateLabel: true
                    model: doBrowseProjectDefinitionClass
                    extent: (Point 180 22)
                  )
                 (ActionButtonSpec
                    label: 'Update Contents (Scan)'
                    name: 'Button4'
                    translateLabel: true
                    model: doGenerateProjectContentsDefinition
                    extent: (Point 180 22)
                  )
                 )
               
              )
            )
           )
         
        )
      )
!

page6_specifyBuildDirectorySpec
    "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:ProjectBuilderAssistantApplication andSelector:#page6_specifyBuildDirectorySpec
     ProjectBuilderAssistantApplication new openInterface:#page6_specifyBuildDirectorySpec
    "

    <resource: #canvas>

    ^ 
     #(FullSpec
        name: #'page6_specifyBuildDirectorySpec'
        window: 
       (WindowSpec
          label: 'Project Selection'
          name: 'Project Selection'
          min: (Point 0 0)
          bounds: (Rectangle 0 0 521 104)
        )
        component: 
       (SpecCollection
          collection: (
           (FramedBoxSpec
              label: 'Build Directory'
              name: 'FramedBox3'
              layout: (LayoutFrame 0 0.0 5 0 4 1.0 79 0)
              labelPosition: topLeft
              translateLabel: true
              component: 
             (SpecCollection
                collection: (
                 (FilenameInputFieldSpec
                    name: 'FilenameEntryField1'
                    layout: (LayoutFrame 0 0.0 10 0 0 1.0 32 0)
                    model: buildDirectoryHolder
                    acceptOnPointerLeave: true
                    viewClassName: FilenameWidgetWithHistory
                  )
                 )
               
              )
            )
           )
         
        )
      )
!

page7_buildSpec
    "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:#page7_buildSpec
     Tools::ProjectBuilderAssistantApplication new openInterface:#page7_buildSpec
    "

    <resource: #canvas>

    ^ 
     #(FullSpec
        name: #'page7_buildSpec'
        window: 
       (WindowSpec
          label: 'Project Selection'
          name: 'Project Selection'
          min: (Point 0 0)
          bounds: (Rectangle 0 0 521 472)
        )
        component: 
       (SpecCollection
          collection: (
           (FramedBoxSpec
              label: 'Make Output'
              name: 'FramedBox3'
              layout: (LayoutFrame 0 0.0 5 0 4 1.0 -30 1)
              labelPosition: topLeft
              translateLabel: true
              component: 
             (SpecCollection
                collection: (
                 (TextEditorSpec
                    name: 'MakeOutputWindow'
                    layout: (LayoutFrame 0 0 0 0 0 1 0 1)
                    model: makeOutputHolder
                    hasHorizontalScrollBar: true
                    hasVerticalScrollBar: true
                    hasKeyboardFocusInitially: false
                    viewClassName: 'TextCollector'
                    postBuildCallback: postBuildMakeOutputWindow:
                  )
                 )
               
              )
            )
           (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: 'Make All'
                    name: 'Button3'
                    translateLabel: true
                    model: doStartMakeAll
                    enableChannel: startMakeButtonEnabled
                    extent: (Point 107 22)
                  )
                 (ActionButtonSpec
                    label: 'Make EXE only'
                    name: 'Button5'
                    translateLabel: true
                    model: doStartMakeExe
                    enableChannel: startMakeButtonEnabled
                    extent: (Point 107 22)
                  )
                 (ViewSpec
                    name: 'Box1'
                    extent: (Point 20 10)
                  )
                 (ActionButtonSpec
                    label: 'Stop Make'
                    name: 'Button4'
                    visibilityChannel: stopMakeButtonVisible
                    translateLabel: true
                    model: doStopMake
                    extent: (Point 107 22)
                  )
                 )
               
              )
            )
           )
         
        )
      )
!

)
                 (ActionButtonSpec
                    label: 'Stop Make'
                    name: 'Button4'
                    visibilityChannel: stopMakeButtonVisible
                    translateLabel: true
                    model: doStopMake
                    extent: (Point 107 22)
                  )
                 )
               
              )
            )
           )
         
        )
      )
! !

!ProjectBuilderAssistantApplication methodsFor:'actions'!

: true
                          resizeForLabel: true
                          model: doOpenExplorer
                          extent: (Point 172 22)
                        )
                       )
                     
                    )
                  )
                 )
               
              )
            )
           )
         
        )
      )
!

model: doOpenExplorer
                          extent: (Point 172 22)
                        )
                       )
                     
                    )
                  )
                 )
               
              )
            )
           )
         
        )
      )
!

:[
            newAppClass := ApplicationModel
                            subclass:newAppName asSymbol
                            instanceVariableNames:''
                            classVariableNames:''
                            poolDictionaries:''
                            category:'Applications'.
            CodeGeneratorTool createApplicationCodeFor:newAppClass.
        ].
        self updateListOfApplicationsInProject
    ].
!

"/ see if it has an AppModel class
"/        (projectClasses contains:[:cls | cls isVisualStartable]) ifFalse:[
"/            (Dialog confirm:'Create an Application Class ?') ifTrue:[
"/                self halt.
"/            ].
"/        ].
"/    ].

"/    projectDefinitionClass isLibrary ifFalse:[
"/        "/ see if it has a Startup class
"/        (projectClasses contains:[:cls | cls isStartable]) ifFalse:[
"/        ].
"/    ].
!

aloneStartup
                            subclass:newClassName asSymbol
                            instanceVariableNames:''
                            classVariableNames:''
                            poolDictionaries:''
                            category:'Applications'.
            CodeGeneratorTool createStartupCodeFor:newStartupClass forStartOf:selectedApplication.
        ].
        self updateListOfStartupClassesInProject
    ].
!

classVariableNames:''
                            poolDictionaries:''
                            category:'Applications'.
            CodeGeneratorTool createStartupCodeFor:newStartupClass forStartOf:selectedApplication.
        ].
        self updateListOfStartupClassesInProject
    ].
!

#uiCallback>

    Transcript showCR:self class name, ': action for doAddClassToProject ...'.
    self halt.
!

<resource: #uiCallback>

    |appClass|

    self hasApplicationSelected ifTrue:[
        appClass := self listOfApplicationsInProject value at:(self selectedApplicationIndexHolder value).
        UserPreferences systemBrowserClass 
            openInClass:appClass class selector:#windowSpec.
    ].
!

].
!

emBrowserClass 
            openInClass:defClass class selector:#classNamesAndAttributes.
    ].
!

ibutes.
    ].
!

UserPreferences systemBrowserClass 
            openInClass:startupClass class selector:#main:.
    ].
!

doStartMakeAll
    <resource: #uiCallback>

    self stopMakeButtonVisible value:true.
    self startMakeButtonEnabled value:false.

    makeOutputWindow clear.

    makeProcess := 
            [
                [
                    self runBuildProcess:'all'
                ] ensure:[
                    self stopMakeButtonVisible value:false.
                    self startMakeButtonEnabled value:true.
                    makeProcess := nil.
                    self updateButtonEnableState.
                ].
            ] newProcess.

    makeProcess priority:4.
    makeProcess priorityRange:(4 to:8).
    makeProcess resume.
!

doStartMakeExe
    <resource: #uiCallback>

    self stopMakeButtonVisible value:true.
    self startMakeButtonEnabled value:false.

    makeOutputWindow clear.

    makeProcess := 
            [
                [
                    self runBuildProcess:'exe'
                ] ensure:[
                    self stopMakeButtonVisible value:false.
                    self startMakeButtonEnabled value:true.
                    makeProcess := nil.
                    self updateButtonEnableState.
                ].
            ] newProcess.

    makeProcess priority:4.
    makeProcess priorityRange:(4 to:8).
    makeProcess resume.
!

[
                [
                    self runBuildProcess:'all'
                ] ensure:[
                    self stopMakeButtonVisible value:false.
                    self startMakeButtonEnabled value:true.
                    makeProcess := nil.
                    self updateButtonEnableState.
                ].
            ] newProcess.

    makeProcess priority:4.
    makeProcess priorityRange:(4 to:8).
    makeProcess resume.
!

makeProcess priorityRange:(4 to:8).
    makeProcess resume.
!

runBuildProcess:what
    <resource: #uiCallback>

    self assert:makeOutputWindow notNil.
    self assert:makeOutputWindow model == self makeOutputHolder.

    ActivityNotification handle:[:ex |
        ex messageText notNil ifTrue:[
            makeOutputWindow endEntry.
            makeOutputWindow cr.
            makeOutputWindow nextPutLine:(ex messageText colorizeAllWith:Color white on:Color blue).
            makeOutputWindow endEntry.
        ].
        ex proceed.
    ] do:[
        projectBuilder := ProjectBuilder new.
        projectBuilder package:(selectedProjectDefinition package).
        what = 'exe' ifTrue:[
            projectBuilder makeExeOnly:true
        ] ifFalse:[
            projectBuilder makeExeOnly:false
        ].

        Error handle:[:ex |
            makeOutputWindow endEntry.
            makeOutputWindow cr.
            makeOutputWindow nextPutLine:(ex messageText colorizeAllWith:Color white on:Color red).
            makeOutputWindow endEntry.
        ] do:[
            projectBuilder buildWithColorizedOutputTo:makeOutputWindow.
        ].
    ].
!

(p := makeProcess) notNil ifTrue:[
        makeProcess := nil.
        p terminate.
        p waitUntilTerminated.

        makeOutputWindow endEntry.
        makeOutputWindow cr.
        makeOutputWindow nextPutLine:('Make Cancelled' colorizeAllWith:Color white on:Color red).
        makeOutputWindow endEntry.
    ].
!

akeOutputWindow nextPutLine:(ex messageText colorizeAllWith:Color white on:Color blue).
            makeOutputWindow endEntry.
        ].
        ex proceed.
    ] do:[
        projectBuilder := ProjectBuilder new.
        projectBuilder package:(selectedProjectDefinition package).
        what = 'exe' ifTrue:[
            projectBuilder makeExeOnly:true
        ] ifFalse:[
            projectBuilder makeExeOnly:false
        ].

        Error handle:[:ex |
            makeOutputWindow endEntry.
            makeOutputWindow cr.
            makeOutputWindow nextPutLine:(ex messageText colorizeAllWith:Color white on:Color red).
            makeOutputWindow endEntry.
        ] do:[
            projectBuilder buildWithColorizedOutputTo:makeOutputWindow.
        ].
    ].
!

Error handle:[:ex |
            makeOutputWindow endEntry.
            makeOutputWindow cr.
            makeOutputWindow nextPutLine:(ex messageText colorizeAllWith:Color white on:Color red).
            makeOutputWindow endEntry.
        ] do:[
            projectBuilder buildWithColorizedOutputTo:makeOutputWindow.
        ].
    ].
! !

!ProjectBuilderAssistantApplication methodsFor:'aspects'!

CodeGeneratorTool
"/            compile:(selectedProjectDefinition startupClassName_codeFor:(selectedApplication name))
"/            forClass:selectedProjectDefinition theMetaclass
"/            inCategory:'description - startup'.
"/    ].
    self updateApplicationComment.
    self updateButtonEnableState.
!

onsInProject.
    self updateButtonEnableState.
!

StartupClassesInProject value at:(self selectedStartupClassIndexHolder value).
    ].
    self hasStartupClassSelectedHolder value:(selectedStartupClass notNil).

    selectedStartupClass notNil ifTrue:[
        "/ generate startupClass code
        CodeGeneratorTool
            compile:(selectedProjectDefinition startupClassName_codeFor:(selectedStartupClass name))
            forClass:selectedProjectDefinition theMetaclass
            inCategory:'description - startup'.
    ].
    self updateButtonEnableState.
!

"/ generate startupClass code
        CodeGeneratorTool
            compile:(selectedProjectDefinition startupClassName_codeFor:(selectedStartupClass name))
            forClass:selectedProjectDefinition theMetaclass
            inCategory:'description - startup'.
    ].
    self updateButtonEnableState.
!

ojectDefinition theMetaclass
            inCategory:'description - startup'.
    ].
    self updateButtonEnableState.
!

<resource: #uiAspect>

    |buildDirectory|

    buildDirectoryHolder isNil ifTrue:[
        buildDirectoryHolder := nil asValue.
        buildDirectoryHolder onChangeSend:#buildDirectoryChanged to:self.
    ].
    buildDirectoryHolder value isEmptyOrNil ifTrue:[
        buildDirectory := Tools::ProjectBuilder previousBuildDirectory.
        buildDirectory isNil ifTrue:[
            buildDirectory := UserPreferences current buildDirectory.
            buildDirectory isNil ifTrue:[
                buildDirectory := Filename tempDirectory construct:'stx_build'.
            ].
        ].
        buildDirectoryHolder value: buildDirectory.
    ].
    ^ buildDirectoryHolder.
!

s::ProjectBuilder previousBuildDirectory.
        buildDirectory isNil ifTrue:[
            buildDirectory := UserPreferences current buildDirectory.
            buildDirectory isNil ifTrue:[
                buildDirectory := Filename tempDirectory construct:'stx_build'.
            ].
        ].
        buildDirectoryHolder value: buildDirectory.
    ].
    ^ buildDirectoryHolder.
!

].
        ].
        buildDirectoryHolder value: buildDirectory.
    ].
    ^ buildDirectoryHolder.
!

rowser := FileBrowserV2 new.
    browser onDirectory:targetDirectory.
    browser filter:'*.exe'.
    ^ browser.
!

r isNil ifTrue:[
        hasApplicationSelectedHolder := nil asValue.
    ].
    ^ hasApplicationSelectedHolder.
!

electedHolder isNil ifTrue:[
        hasProjectSelectedHolder := nil asValue.
    ].
    ^ hasProjectSelectedHolder.
!

sStartupClassSelectedHolder isNil ifTrue:[
        hasStartupClassSelectedHolder := nil asValue.
    ].
    ^ hasStartupClassSelectedHolder.
!

rApplicationClasses isNil ifTrue:[
        hideOtherApplicationClasses := true asValue.
        hideOtherApplicationClasses onChangeSend:#updateListOfApplicationsInProject to:self.
    ].
    ^ hideOtherApplicationClasses.
!

oject to:self.
    ].
    ^ hideOtherApplicationClasses.
!

:[
        listOfApplicationsInProject := ValueHolder new.
    ].
    ^ listOfApplicationsInProject.
!

listOfClassesInProject isNil ifTrue:[
        listOfClassesInProject := ValueHolder new.
    ].
    ^ listOfClassesInProject.
!

#uiAspect>

    listOfMatchingProjects isNil ifTrue:[
        listOfMatchingProjects := ValueHolder new.
    ].
    ^ listOfMatchingProjects.
!

<resource: #uiAspect>

    makeOutputHolder isNil ifTrue:[
        makeOutputHolder := ValueHolder new.
    ].
    ^ makeOutputHolder.
!

below:
"/       newApplicationsName addDependent:self.
"/       newApplicationsName onChangeSend:#newApplicationsNameChanged to:self.
    ].
    ^ newApplicationsName.
!

wProjectsName isNil ifTrue:[
        newProjectsName := nil asValue.
    ].
    ^ newProjectsName.
!

^ newProjectsName.
!

ype
    ].
    self projectTypeHolder value == #guiApplicationType ifTrue:[
        ^ ProjectDefinition guiApplicationType
    ].
    self projectTypeHolder value == #nonGuiApplicationType ifTrue:[
        ^ ProjectDefinition nonGuiApplicationType
    ].
    self error.
!

True:[
                pType := #nonGuiApplicationType
            ] ifFalse:[
                self error.
            ].
        ]
    ].
    self projectTypeHolder value:aProjectTypeSymbol
!

self error.
            ].
        ]
    ].
    self projectTypeHolder value:aProjectTypeSymbol
!

tionType.
    ].
    ^ projectTypeHolder.
!

selectedApplicationIndexHolder isNil ifTrue:[
        selectedApplicationIndexHolder := ValueHolder new.
        selectedApplicationIndexHolder onChangeSend:#selectedApplicationChanged to:self.
    ].
    ^ selectedApplicationIndexHolder.
!

tomatically generated by UIPainter ..."

    "*** the code below creates a default model when invoked."
    "*** (which may not be the one you wanted)"
    "*** Please change as required and accept it in the browser."
    "*** (and replace this comment by something more useful ;-)"

    selectedApplicationsComment isNil ifTrue:[
        selectedApplicationsComment := '' asValue.
"/ if your app needs to be notified of changes, uncomment one of the lines below:
"/       selectedApplicationsComment addDependent:self.
"/       selectedApplicationsComment onChangeSend:#selectedApplicationsCommentChanged to:self.
    ].
    ^ selectedApplicationsComment.
!

d and accept it in the browser."
    "*** (and replace this comment by something more useful ;-)"

    selectedApplicationsComment isNil ifTrue:[
        selectedApplicationsComment := '' asValue.
"/ if your app needs to be notified of changes, uncomment one of the lines below:
"/       selectedApplicationsComment addDependent:self.
"/       selectedApplicationsComment onChangeSend:#selectedApplicationsCommentChanged to:self.
    ].
    ^ selectedApplicationsComment.
! !

!ProjectBuilderAssistantApplication methodsFor:'initialization & release'!

the lines below:
"/       selectedApplicationsComment addDependent:self.
"/       selectedApplicationsComment onChangeSend:#selectedApplicationsCommentChanged to:self.
    ].
    ^ selectedApplicationsComment.
!

self.
"/       selectedApplicationsComment onChangeSend:#selectedApplicationsCommentChanged to:self.
    ].
    ^ selectedApplicationsComment.
!

ment.
! !

!ProjectBuilderAssistantApplication methodsFor:'menu actions'!

<resource: #uiAspect>

    selectedProjectIndexHolder isNil ifTrue:[
        selectedProjectIndexHolder := ValueHolder new.
        selectedProjectIndexHolder onChangeSend:#selectedProjectChanged to:self.
    ].
    ^ selectedProjectIndexHolder.
! !

!ProjectBuilderAssistantApplication methodsFor:'private'!

ProjectIndexHolder onChangeSend:#selectedProjectChanged to:self.
    ].
    ^ selectedProjectIndexHolder.
!

akeButtonVisible.
!

ntApplication methodsFor:'private'
!

t indents minIndent maxLineLength|

    docMethod := aClass class compiledMethodAt:#documentation.
    docMethod notNil ifTrue:[
        comment := docMethod comment.
        comment := comment asStringCollection 
                        collect:[:line | line withoutTrailingSeparators].
        [comment notEmpty and:[comment first isBlank]] whileTrue:[ comment removeFirst ].
        maxLineLength := (comment collect:[:line | line size]) max.
        indents := comment collect:[:line | 
                                        line isEmptyOrNil
                                            ifTrue:[maxLineLength]
                                            ifFalse:[ line findFirst:[:ch | ch isSeparator not]]].
        (minIndent := indents min) > 1 ifTrue:[
            comment := comment collect:[:line | line copyFrom:minIndent].
        ].
        comment := comment asString.
    ].
    ^ comment
!

documentation.
    docMethod notNil ifTrue:[
        comment := docMethod comment.
        comment := comment asStringCollection 
                        collect:[:line | line withoutTrailingSeparators].
        [comment notEmpty and:[comment first isBlank]] whileTrue:[ comment removeFirst ].
        maxLineLength := (comment collect:[:line | line size]) max.
        indents := comment collect:[:line | 
                                        line isEmptyOrNil
                                            ifTrue:[maxLineLength]
                                            ifFalse:[ line findFirst:[:ch | ch isSeparator not]]].
        (minIndent := indents min) > 1 ifTrue:[
            comment := comment collect:[:line | line copyFrom:minIndent].
        ].
        comment := comment asString.
    ].
    ^ comment
!

comment := docMethod comment.
        comment := comment asStringCollection 
                        collect:[:line | line withoutTrailingSeparators].
        [comment notEmpty and:[comment first isBlank]] whileTrue:[ comment removeFirst ].
        maxLineLength := (comment collect:[:line | line size]) max.
        indents := comment collect:[:line | 
                                        line isEmptyOrNil
                                            ifTrue:[maxLineLength]
                                            ifFalse:[ line findFirst:[:ch | ch isSeparator not]]].
        (minIndent := indents min) > 1 ifTrue:[
            comment := comment collect:[:line | line copyFrom:minIndent].
        ].
        comment := comment asString.
    ].
    ^ comment
!

n 
                        collect:[:line | line withoutTrailingSeparators].
        [comment notEmpty and:[comment first isBlank]] whileTrue:[ comment removeFirst ].
        maxLineLength := (comment collect:[:line | line size]) max.
        indents := comment collect:[:line | 
                                        line isEmptyOrNil
                                            ifTrue:[maxLineLength]
                                            ifFalse:[ line findFirst:[:ch | ch isSeparator not]]].
        (minIndent := indents min) > 1 ifTrue:[
            comment := comment collect:[:line | line copyFrom:minIndent].
        ].
        comment := comment asString.
    ].
    ^ comment
! !

!ProjectBuilderAssistantApplication methodsFor:'queries'!

ent removeFirst ].
        maxLineLength := (comment collect:[:line | line size]) max.
        indents := comment collect:[:line | 
                                        line isEmptyOrNil
                                            ifTrue:[maxLineLength]
                                            ifFalse:[ line findFirst:[:ch | ch isSeparator not]]].
        (minIndent := indents min) > 1 ifTrue:[
            comment := comment collect:[:line | line copyFrom:minIndent].
        ].
        comment := comment asString.
    ].
    ^ comment
!

ne | line size]) max.
        indents := comment collect:[:line | 
                                        line isEmptyOrNil
                                            ifTrue:[maxLineLength]
                                            ifFalse:[ line findFirst:[:ch | ch isSeparator not]]].
        (minIndent := indents min) > 1 ifTrue:[
            comment := comment collect:[:line | line copyFrom:minIndent].
        ].
        comment := comment asString.
    ].
    ^ comment
!

canEnterContentsSelection
    ^ self hasProjectSelected 
    and:[ true "self hasApplicationSelected" 
    and:[ self hasStartupClassSelected ]]
!

ifFalse:[ line findFirst:[:ch | ch isSeparator not]]].
        (minIndent := indents min) > 1 ifTrue:[
            comment := comment collect:[:line | line copyFrom:minIndent].
        ].
        comment := comment asString.
    ].
    ^ comment
!

ndFirst:[:ch | ch isSeparator not]]].
        (minIndent := indents min) > 1 ifTrue:[
            comment := comment collect:[:line | line copyFrom:minIndent].
        ].
        comment := comment asString.
    ].
    ^ comment
! !

!ProjectBuilderAssistantApplication methodsFor:'specs'!

].
        comment := comment asString.
    ].
    ^ comment
! !

!ProjectBuilderAssistantApplication methodsFor:'update'!

ecifyBuildDirectorySpec
            infoText: 'Define where the build-process is to be performed.
                       All generated files are created below that directory.
                       After deployment, the build directory is no longer needed
                       (but you can keep it for a faster compile the next time).'
        )

        (AssistantPageSpec
            pageTitle: 'Build'
            windowSpecSelector: page7_buildSpec
            canEnterQuerySelector: #canEnterBuild
            enterCallbackSelector: #restoreMakeOutputsContents
            leaveCallbackSelector: #rememberMakeOutputsContents
            infoText: 'Start the build-process. This will run make/bcc to compile
                       all required classes and nsis to generate a self-installable
                       executable. You must have the borland-cc and NullSoft NSIS
                       packages installed for this to work.'
        )

        (AssistantPageSpec
            pageTitle: 'Deploy'
            windowSpecSelector: page8_deploySpec
            canEnterQuerySelector: #canEnterDeploy
            infoText: 'Find the installer to be deployed (or test-run the binary).
                       You can open a WindowsExplorer there to copy the files for
                       deployment. After that, the build directory is no longer needed
                       (but you can keep it for a faster compile the next time).'
        )
    ) decodeAsLiteralArray.
!

rformed.
                       All generated files are created below that directory.
                       After deployment, the build directory is no longer needed
                       (but you can keep it for a faster compile the next time).'
        )

        (AssistantPageSpec
            pageTitle: 'Build'
            windowSpecSelector: page7_buildSpec
            canEnterQuerySelector: #canEnterBuild
            enterCallbackSelector: #restoreMakeOutputsContents
            leaveCallbackSelector: #rememberMakeOutputsContents
            infoText: 'Start the build-process. This will run make/bcc to compile
                       all required classes and nsis to generate a self-installable
                       executable. You must have the borland-cc and NullSoft NSIS
                       packages installed for this to work.'
        )

        (AssistantPageSpec
            pageTitle: 'Deploy'
            windowSpecSelector: page8_deploySpec
            canEnterQuerySelector: #canEnterDeploy
            infoText: 'Find the installer to be deployed (or test-run the binary).
                       You can open a WindowsExplorer there to copy the files for
                       deployment. After that, the build directory is no longer needed
                       (but you can keep it for a faster compile the next time).'
        )
    ) decodeAsLiteralArray.
!

After deployment, the build directory is no longer needed
                       (but you can keep it for a faster compile the next time).'
        )

        (AssistantPageSpec
            pageTitle: 'Build'
            windowSpecSelector: page7_buildSpec
            canEnterQuerySelector: #canEnterBuild
            enterCallbackSelector: #restoreMakeOutputsContents
            leaveCallbackSelector: #rememberMakeOutputsContents
            infoText: 'Start the build-process. This will run make/bcc to compile
                       all required classes and nsis to generate a self-installable
                       executable. You must have the borland-cc and NullSoft NSIS
                       packages installed for this to work.'
        )

        (AssistantPageSpec
            pageTitle: 'Deploy'
            windowSpecSelector: page8_deploySpec
            canEnterQuerySelector: #canEnterDeploy
            infoText: 'Find the installer to be deployed (or test-run the binary).
                       You can open a WindowsExplorer there to copy the files for
                       deployment. After that, the build directory is no longer needed
                       (but you can keep it for a faster compile the next time).'
        )
    ) decodeAsLiteralArray.
!

ts
            leaveCallbackSelector: #rememberMakeOutputsContents
            infoText: 'Start the build-process. This will run make/bcc to compile
                       all required classes and nsis to generate a self-installable
                       executable. You must have the borland-cc and NullSoft NSIS
                       packages installed for this to work.'
        )

        (AssistantPageSpec
            pageTitle: 'Deploy'
            windowSpecSelector: page8_deploySpec
            canEnterQuerySelector: #canEnterDeploy
            infoText: 'Find the installer to be deployed (or test-run the binary).
                       You can open a WindowsExplorer there to copy the files for
                       deployment. After that, the build directory is no longer needed
                       (but you can keep it for a faster compile the next time).'
        )
    ) decodeAsLiteralArray.
!

: page8_deploySpec
            canEnterQuerySelector: #canEnterDeploy
            infoText: 'Find the installer to be deployed (or test-run the binary).
                       You can open a WindowsExplorer there to copy the files for
                       deployment. After that, the build directory is no longer needed
                       (but you can keep it for a faster compile the next time).'
        )
    ) decodeAsLiteralArray.
!

tBuilderAssistantApplication methodsFor:'update'
!

lassIndex|

    appClassIndex := nil.

    selectedProjectDefinition isNil ifTrue:[
        applicationClasses := #()
    ] ifFalse:[
        package := selectedProjectDefinition package.

        applicationClasses := Smalltalk allClasses
                                    select:[:cls |
                                        ((cls isSubclassOf:ApplicationModel)
                                        and:[ self hideOtherApplicationClasses value not
                                              or:[ cls package = package ]])
                                    ].
        applicationClasses := applicationClasses asOrderedCollection.
        applicationClasses sort:[:a :b | a name < b name].

"/        startUpClassName := [ selectedProjectDefinition startupClassName ] ifError:[ nil ].
"/        startUpClassName notNil ifTrue:[
"/            startUpClass := Smalltalk classNamed:startUpClassName.
"/            startUpClass notNil ifTrue:[
"/                appClassIndex := applicationClasses indexOf:startUpClass.
"/                appClassIndex == 0 ifTrue:[ appClassIndex := nil ].
"/            ].
"/        ].
    ].

    oldList := self listOfApplicationsInProject value.
    oldList = applicationClasses ifFalse:[
        appClass := selectedApplication.
        appClassIndex := applicationClasses indexOf:appClass.
        appClassIndex == 0 ifTrue:[ appClassIndex := nil ].

        self listOfApplicationsInProject value:applicationClasses.
        self selectedApplicationIndexHolder value:appClassIndex.
    ].
!

s := #()
    ] ifFalse:[
        package := selectedProjectDefinition package.

        applicationClasses := Smalltalk allClasses
                                    select:[:cls |
                                        ((cls isSubclassOf:ApplicationModel)
                                        and:[ self hideOtherApplicationClasses value not
                                              or:[ cls package = package ]])
                                    ].
        applicationClasses := applicationClasses asOrderedCollection.
        applicationClasses sort:[:a :b | a name < b name].

"/        startUpClassName := [ selectedProjectDefinition startupClassName ] ifError:[ nil ].
"/        startUpClassName notNil ifTrue:[
"/            startUpClass := Smalltalk classNamed:startUpClassName.
"/            startUpClass notNil ifTrue:[
"/                appClassIndex := applicationClasses indexOf:startUpClass.
"/                appClassIndex == 0 ifTrue:[ appClassIndex := nil ].
"/            ].
"/        ].
    ].

    oldList := self listOfApplicationsInProject value.
    oldList = applicationClasses ifFalse:[
        appClass := selectedApplication.
        appClassIndex := applicationClasses indexOf:appClass.
        appClassIndex == 0 ifTrue:[ appClassIndex := nil ].

        self listOfApplicationsInProject value:applicationClasses.
        self selectedApplicationIndexHolder value:appClassIndex.
    ].
!

updateListOfStartupClassesInProject
    |startupClasses package startUpClassName startUpClass startupClassIndex|

    startupClassIndex := nil.
    self selectedStartupClassIndexHolder value:nil.

    selectedProjectDefinition isNil ifTrue:[
        startupClasses := #()
    ] ifFalse:[
        package := selectedProjectDefinition package.

        startupClasses := Smalltalk allClasses
                                    select:[:cls |
                                        ((cls includesBehavior:StandaloneStartup)
                                        and:[ self hideOtherStartupClasses value not
                                              or:[ cls package = package ]])
                                        or:[ cls == Smalltalk
                                             and:[ self hideOtherStartupClasses value not ] ]
                                    ].
        startupClasses := startupClasses asOrderedCollection.
        startupClasses sort:[:a :b | a name < b name].

        startUpClassName := [ selectedProjectDefinition startupClassName ] ifError:[ nil ].
        startUpClassName notNil ifTrue:[
            startUpClass := Smalltalk classNamed:startUpClassName.
            startUpClass notNil ifTrue:[
                startupClassIndex := startupClasses indexOf:startUpClass.
                startupClassIndex == 0 ifTrue:[ startupClassIndex := nil ].
            ].
        ].
    ].

    self listOfStartupClassesInProject value:startupClasses.
    self selectedStartupClassIndexHolder value:startupClassIndex.
! !

!ProjectBuilderAssistantApplication class methodsFor:'documentation'!

version_CVS
    ^ '$Header$'
! !