Tools__ProjectBuilderAssistantApplication.st
author Claus Gittinger <cg@exept.de>
Sat, 21 Jul 2012 18:58:03 +0200
changeset 2898 c7f6c498df6a
parent 2897 b6cd7ee2a43b
child 2899 da83d0544556
permissions -rw-r--r--
category of:15 methods
     1 "
     2  COPYRIGHT (c) 2009 by eXept Software AG
     3               All Rights Reserved
     4 
     5  This software is furnished under a license and may be used
     6  only in accordance with the terms of that license and with the
     7  inclusion of the above copyright notice.   This software may not
     8  be provided or otherwise made available to, or used by, any
     9  other person.  No title to or ownership of the software is
    10  hereby transferred.
    11 "
    12 "{ Package: 'stx:libtool2' }"
    13 
    14 "{ NameSpace: Tools }"
    15 
    16 AssistantApplication subclass:#ProjectBuilderAssistantApplication
    17 	instanceVariableNames:'packageToBuildHolder projectType projectTypeHolder
    18 		selectedProjectIndexHolder selectedProjectDefinition
    19 		listOfMatchingProjects listOfMatchingPackageIds
    20 		selectedProjectsComment hasProjectSelectedHolder newProjectsName
    21 		hideSTXProjects hideOtherApplicationClasses
    22 		hideOtherStartupClasses startMakeButtonEnabled
    23 		stopMakeButtonVisible makeOutputHolder newApplicationsName
    24 		listOfApplicationsInProject selectedApplicationIndexHolder
    25 		selectedApplication hasApplicationSelectedHolder
    26 		listOfStartupClassesInProject selectedStartupClassIndexHolder
    27 		selectedStartupClass hasStartupClassSelectedHolder
    28 		selectedApplicationsComment buildDirectoryHolder makeProcess
    29 		listOfClassesInProject makeOutputWindow projectBuilder
    30 		newStartupClassName usedCompilerHolder listOfNewProjectsName
    31 		newProjectsNameListExtendedComboBox productNameHolder
    32 		companyNameHolder compilerWarnMessageHolder
    33 		compilerWarnMessageVisibleHolder listOfPrerequisitesInProject'
    34 	classVariableNames:''
    35 	poolDictionaries:''
    36 	category:'System-Support-Projects'
    37 !
    38 
    39 !ProjectBuilderAssistantApplication class methodsFor:'documentation'!
    40 
    41 copyright
    42 "
    43  COPYRIGHT (c) 2009 by eXept Software AG
    44               All Rights Reserved
    45 
    46  This software is furnished under a license and may be used
    47  only in accordance with the terms of that license and with the
    48  inclusion of the above copyright notice.   This software may not
    49  be provided or otherwise made available to, or used by, any
    50  other person.  No title to or ownership of the software is
    51  hereby transferred.
    52 "
    53 !
    54 
    55 documentation
    56 "
    57     a user friendly interface to the build process.
    58     Simply wraps up existing tools like the CodeGeneratorTool, the browsers
    59     and the ProjetBuilder
    60 
    61     [see also:]
    62         CodeGeneratorTool
    63         ProjectBuilder
    64         ProjectDefinition
    65 
    66     [author:]
    67         Claus Gittinger
    68 "
    69 !
    70 
    71 help
    72 "
    73   Packager - A Standalone-Executable Builder and Packager
    74 
    75     This assistant-application allows for standalone applications to be built very easily. 
    76     It will generate all required classes, files, start the compilation process, 
    77     generate a self-installable executable with a few mouse clicks. 
    78 
    79     A simple demo application like the famous 'Hello World' can be generated in a few minutes.
    80 
    81   Prerequisites
    82 
    83     * Windows Users:
    84     Please install either the 'Borland Free Commandline Compiler Tools (bcc32)' 
    85     or the 'Microsoft Visual-C++' package (also free). 
    86      In addition, the 'NullSoft NSIS-Installer Package' is required.
    87 
    88     Due to limitations and bugs in the Visual-C++ compiler (limit on the size of 
    89     string-constants), some Smalltalk code is still not compilable 
    90     (currently, this affects classes which contain image-resource methods for big images). 
    91     Although microsoft is doing their best (a relative measure) to make things better 
    92     (they increase the string-limit with every new release), they still seem to be unable 
    93     to figure out how ti use malloc for string-data). 
    94     We are patiently waiting for a real fix and still using bcc in the meanwhile. 
    95     Therefore, we recommend using the borland compiler suite. 
    96     Please install it at its standard location ('C:\Borland') as our makefiles might 
    97     still contain hard-coded pathes (yes, we are ashamed about this).
    98 
    99     * Unix Users:
   100     You should already have the gcc compile suite (including all required header files) 
   101     installed and ready to use. For a lack of time on our side, there is currently no 
   102     self-installer support for Unix. The packager will generate a zipped tar file, 
   103     which must be deployed and unpacked for use. This may change in the near future.
   104 
   105   Packages, Projects, PackageIDs and ProjectDefinitions
   106 
   107     Smalltalk basically uses two objects for packaging:
   108 
   109         * PackageIDs (also called ProjectID's occasionally)
   110         * ProjectDefinitions 
   111 
   112     Older ST/X versions used instances of a Project class - this is now obsolete and 
   113     removed from the system (although there are still some minor uses of it, 
   114     which might remain there for backward compatibility for some time, as some customers 
   115     have built their own packaging scheme around it).
   116 
   117   PackageIDs
   118 
   119     These are simple symbols and are attached to classes and methods. If a method has 
   120     a packageID different from its class, it is called an extension method.
   121     PackageIDs must have a certain fixed format: they always contain exactly two parts, 
   122     which are separated by a colon character: the module and the directory part. 
   123     The module is used as main-selector on where and how the source code repository is 
   124     accessed. The directory is a path below that repository. If checked out into the local 
   125     filesystem, the module defines the top-level directory. Thus, if a packageID is 
   126     'stx:libbasic', the corresponding sources will be found in the repository associated 
   127     to the 'stx' module, under the directory 'libbasic'. 
   128     In the local file system, it will be found under 'stx/libbasic'. 
   129     As another example, if the packageID is 'exept:expecco/plugins/foo', 
   130     the repository is whichever is associated with the 'exept' module, and the subdirectory 
   131     is 'expecco/plugins/foo'. The local path to the sourcefiles would be 
   132     'exept/expecco/plugins/foo'.
   133 
   134     Please notice that it does make sense to associate different repositories to different 
   135     modules: for example, you could setup the sourceCodeManager to use CVS access to the 
   136     exept repository for everything under the 'stx' module, 
   137     and at the same time, use a local SVN repository for everything under the 'myCompany' 
   138     module.
   139 
   140   ProjectDefinitions
   141 
   142     These describe the contents of a project, such as the classes to include, 
   143     the set of extension methods, any additional compilation information. 
   144     ProjectDefinitions come in 3 flavours:
   145 
   146         * GUI Application Definition
   147         * non-GUI Application Definition
   148         * ClassLibrary Definition 
   149 
   150     ProjectDefinitions are stored and managed as class-instances, located as subclasses 
   151     of one of ApplicationDefinition or LibraryDefinition. 
   152     As classes, they are themself managed, compiled and packaged as part of the project 
   153     (and also have the same PackageID as their components). 
   154     They are also treated like any other class w.r.t. source code management.
   155 
   156   Packaging
   157 
   158     All classes and extension methods belonging to a single package are supposed to be 
   159     loaded (and possibly unloaded) together. They are also usually deployed inside a single 
   160     dynamic link library ('dll', for short). In the Unix world, these are called 
   161     'shared object' or 'so'. 
   162     Finally, they are stored in a common directory both on the local file system and in a 
   163     source code repository (CVS, SVN, etc.).
   164 
   165   Structure of a Project
   166 
   167     The artefacts as manipulated by the packager are:
   168 
   169         * the ProjectDefinition class
   170           This defines the type of application (GUI / non-GUI), 
   171           its contents (i.e. the set of classes to be included in the binary itself and 
   172           the set of library-dll's to be included in the deployed package), 
   173           and some other metadata, such as icon, title etc.
   174 
   175         * the ApplicationModel class
   176           This defines the GUI, and is typically created using the UI-Painter.
   177 
   178         * the Startup class
   179           This is the first class which gets control when the executable is started; 
   180           it can analyze the command line arguments, read patches or updates, 
   181           start background ptocesses, and will eventually open the applications GUI. 
   182 
   183   Build Procedure
   184 
   185     All of the three components above can be generated by the packager to provide an 
   186     initial framework for further work.
   187 
   188     After the definition of those classes, all required files are stored in a temporary 
   189     build directory. This means that the above classes are filed out, 
   190     and make- and other support files are generated.
   191 
   192     Finally, the actual build process is started. This requires an external C-compiler. 
   193     Under windows, both Borland-C (free download available via the internet) and Microsoft's 
   194     Visual-C++ (also available for free) can be used (the later with some limitations as explained above).
   195 
   196     A self-installing executable is built using the NullSoft NSIS package. 
   197     This is also required to be installed before the packager is started.
   198 
   199     After the build, all required files are packaged in a single install-file. 
   200     This is called 'MyApplicationSetup.exe' and found in the project-specific subdirectory 
   201     of the build directory. For deployment, this single file has to be delivered to a customer 
   202     and executed there.
   203 
   204     Summary: It has NEVER been easier to create a GUI application with Smalltalk. 
   205 "
   206 ! !
   207 
   208 !ProjectBuilderAssistantApplication class methodsFor:'assistant pages spec'!
   209 
   210 assistantSpec
   211     ^ #(Array
   212         ( AssistantPageSpec
   213             pageTitle: 'Project Type Selection'
   214             windowSpecSelector: page1_projectTypeSelectionSpec
   215             enterCallbackSelector: updateListOfMatchingProjects
   216             infoText: 'Choose the <B>type</B> of project you are about to build.'
   217         )
   218 
   219         (AssistantPageSpec
   220             pageTitle: 'ProjectDefinition Selection'
   221             windowSpecSelector: page2_projectSelectionSpec
   222             enterCallbackSelector: updateListOfMatchingProjects
   223             infoText: 'Choose an existing project definition or create a new one. These are subclasses of <I>ProjectDefinition</I> and define the type and contents of a project.'
   224         )
   225 
   226         (AssistantPageSpec
   227             pageTitle: 'Startup Application Selection'
   228             windowSpecSelector: page3_applicationSelectionSpec
   229             isEnabledQuerySelector: #projectTypeIsGuiApplication
   230             canEnterQuerySelector: #canEnterApplicationSelection
   231             enterCallbackSelector: updateListOfApplicationsInProject
   232             infoText: 'Choose an existing application or create a new one. These are subclasses of <I>ApplicationModel</I> and define the GUI and control flow inside the application. Can also be left blank if the startup class does it all (stx build).'
   233         )
   234 
   235         (AssistantPageSpec
   236             pageTitle: 'Startup Class Selection'
   237             windowSpecSelector: page4_startupClassSelectionSpec
   238             isEnabledQuerySelector: #projectTypeIsNotLibrary
   239             canEnterQuerySelector: #canEnterStartupClassSelection
   240             enterCallbackSelector: updateListOfStartupClassesInProject
   241             infoText: 'Choose an existing startup-class or create a new one. These are subclasses of <I>StandaloneStartup</I> and start the application. Command line arguments can be interpreted there.'
   242         )
   243 
   244         (AssistantPageSpec
   245             pageTitle: 'Specify Contents'
   246             windowSpecSelector: page5_specifyIncludedClasses
   247             enterCallbackSelector: enterContentsSpecification
   248             canEnterQuerySelector: #canEnterContentsSelection
   249             infoText: 'Define which (other) classes are to be included. Press "<I>Scan</I>" to include all classes of the package; browse to edit the contents manually.'
   250         )
   251 
   252         (AssistantPageSpec
   253             pageTitle: 'Specify Prerequisites'
   254             windowSpecSelector: page5b_specifyPrerequisitePackages
   255             enterCallbackSelector: enterPrerequisitesSpecification
   256             canEnterQuerySelector: #canEnterPrerequisitesSelection
   257             infoText: 'Define which (other) packages are needed as prerequisites. Press "<I>Scan</I>" to search for prerequisites; browse to edit the list manually.'
   258         )
   259 
   260         (AssistantPageSpec
   261             pageTitle: 'Specify Project Attributes'
   262             windowSpecSelector: page6a_specifyProjectAttributes
   263             infoText: 'Define additional attributes.'
   264             enterCallbackSelector: updateProjectAttributes
   265             leaveCallbackSelector: #rememberProjectAttributes
   266         )
   267 
   268         (AssistantPageSpec
   269             pageTitle: 'Specify Build Directory'
   270             windowSpecSelector: page6b_specifyBuildDirectorySpec
   271             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).'
   272             enterCallbackSelector: #checkCompilerAvailability
   273         )
   274 
   275         (AssistantPageSpec
   276             pageTitle: 'Build'
   277             windowSpecSelector: page7_buildSpec
   278             canEnterQuerySelector: #canEnterBuild
   279             enterCallbackSelector: #restoreMakeOutputsContents
   280             leaveCallbackSelector: #rememberMakeOutputsContents
   281             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.'
   282         )
   283 
   284         (AssistantPageSpec
   285             pageTitle: 'Deploy'
   286             windowSpecSelector: page8_deploySpec
   287             canEnterQuerySelector: #canEnterDeploy
   288             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).'
   289         )
   290     ) decodeAsLiteralArray.
   291 
   292     "Modified: / 19-01-2012 / 15:36:05 / cg"
   293 ! !
   294 
   295 !ProjectBuilderAssistantApplication class methodsFor:'defaults'!
   296 
   297 defaultIcon
   298     <resource: #programImage>
   299 
   300     ^ ToolbarIconLibrary projectBuilderIcon
   301 !
   302 
   303 windowLabelTemplate
   304     ^ 'ST/X Packager: %1'
   305 ! !
   306 
   307 !ProjectBuilderAssistantApplication class methodsFor:'help'!
   308 
   309 flyByHelpSpec
   310     <resource: #help>
   311 
   312     ^ super flyByHelpSpec addPairsFrom:#(
   313 
   314 #'projectType'
   315 'Choose the type of Project you are about to deploy.'
   316 
   317 #existingProjects
   318 'Projects with an existing ProjectDefinition of the chosen type (above).'
   319 
   320 #browseSelectedProject
   321 'Open a SystemBrowser on the selected Project.'
   322 
   323 #hideSTXBasePackages
   324 'Only show packages which are not already included in the basic ST/X delivery.'
   325 
   326 #'listOfNewProjectsName'
   327 'PackageID (module:directory).
   328 The pull-down list contains packageIDs for which no ProjectDefinition exists (yet).'
   329 
   330 #'createNewProject'
   331 'PackageID (module:directory).
   332 Click to create a new (empty) ProjectDefinition for the given PackageID.'
   333 
   334 )
   335 ! !
   336 
   337 !ProjectBuilderAssistantApplication class methodsFor:'interface specs'!
   338 
   339 page1_projectTypeSelectionSpec
   340     "This resource specification was automatically generated
   341      by the UIPainter of ST/X."
   342 
   343     "Do not manually edit this!! If it is corrupted,
   344      the UIPainter may not be able to read the specification."
   345 
   346     "
   347      UIPainter new openOnClass:Tools::ProjectBuilderAssistantApplication andSelector:#page1_projectTypeSelectionSpec
   348      Tools::ProjectBuilderAssistantApplication new openInterface:#page1_projectTypeSelectionSpec
   349     "
   350 
   351     <resource: #canvas>
   352 
   353     ^ 
   354      #(FullSpec
   355         name: #'page1_projectTypeSelectionSpec'
   356         window: 
   357        (WindowSpec
   358           label: 'Project Selection'
   359           name: 'Project Selection'
   360           min: (Point 0 0)
   361           bounds: (Rectangle 0 0 626 394)
   362         )
   363         component: 
   364        (SpecCollection
   365           collection: (
   366            (FramedBoxSpec
   367               label: 'Project Type'
   368               name: 'FramedBox1'
   369               layout: (LayoutFrame 0 0.0 0 0 4 1.0 120 0)
   370               activeHelpKey: projectType
   371               labelPosition: topLeft
   372               translateLabel: true
   373               component: 
   374              (SpecCollection
   375                 collection: (
   376                  (VerticalPanelViewSpec
   377                     name: 'VerticalPanel1'
   378                     layout: (LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0)
   379                     horizontalLayout: leftSpace
   380                     verticalLayout: topSpace
   381                     horizontalSpace: 3
   382                     verticalSpace: 3
   383                     component: 
   384                    (SpecCollection
   385                       collection: (
   386                        (ViewSpec
   387                           name: 'Box1'
   388                           extent: (Point 10 10)
   389                         )
   390                        (RadioButtonSpec
   391                           label: 'GUI Application'
   392                           name: 'RadioButton1'
   393                           translateLabel: true
   394                           model: projectTypeHolder
   395                           isTriggerOnDown: true
   396                           onCallBackSelector: projectTypeChanged
   397                           select: #'GUI-Application'
   398                           extent: (Point 136 22)
   399                         )
   400                        (RadioButtonSpec
   401                           label: 'Non-GUI Application'
   402                           name: 'RadioButton2'
   403                           translateLabel: true
   404                           model: projectTypeHolder
   405                           isTriggerOnDown: true
   406                           onCallBackSelector: projectTypeChanged
   407                           select: #'NonGUI-Application'
   408                           extent: (Point 136 22)
   409                         )
   410                        (RadioButtonSpec
   411                           label: 'Class Library'
   412                           name: 'RadioButton3'
   413                           translateLabel: true
   414                           model: projectTypeHolder
   415                           isTriggerOnDown: true
   416                           onCallBackSelector: projectTypeChanged
   417                           select: #Library
   418                           extent: (Point 136 22)
   419                         )
   420                        )
   421                      
   422                     )
   423                   )
   424                  )
   425                
   426               )
   427             )
   428            (FramedBoxSpec
   429               label: 'Existing Projects of this Type (PackageIDs)'
   430               name: 'FramedBox2'
   431               layout: (LayoutFrame 0 0.0 123 0 4 1.0 0 1)
   432               activeHelpKey: existingProjects
   433               labelPosition: topLeft
   434               translateLabel: true
   435               component: 
   436              (SpecCollection
   437                 collection: (
   438                  (VariableHorizontalPanelSpec
   439                     name: 'VariableHorizontalPanel1'
   440                     layout: (LayoutFrame 0 0 4 0 0 1 -26 1)
   441                     component: 
   442                    (SpecCollection
   443                       collection: (
   444                        (SequenceViewSpec
   445                           name: 'List1'
   446                           model: selectedProjectIndexHolder
   447                           hasHorizontalScrollBar: true
   448                           hasVerticalScrollBar: true
   449                           useIndex: true
   450                           sequenceList: listOfMatchingPackageIds
   451                         )
   452                        (TextEditorSpec
   453                           name: 'TextEditor1'
   454                           model: selectedProjectsComment
   455                           hasHorizontalScrollBar: true
   456                           hasVerticalScrollBar: true
   457                           isReadOnly: true
   458                           hasKeyboardFocusInitially: false
   459                         )
   460                        )
   461                      
   462                     )
   463                     handles: (Any 0.34560327198364 1.0)
   464                   )
   465                  (CheckBoxSpec
   466                     label: 'Hide ST/X Base Packages'
   467                     name: 'CheckBox1'
   468                     layout: (LayoutFrame -1 0 -18 1 0 1 4 1)
   469                     activeHelpKey: hideSTXBasePackages
   470                     model: hideSTXProjects
   471                     translateLabel: true
   472                   )
   473                  )
   474                
   475               )
   476             )
   477            )
   478          
   479         )
   480       )
   481 
   482     "Modified: / 20-07-2012 / 13:27:45 / cg"
   483 !
   484 
   485 page2_projectSelectionSpec
   486     "This resource specification was automatically generated
   487      by the UIPainter of ST/X."
   488 
   489     "Do not manually edit this!! If it is corrupted,
   490      the UIPainter may not be able to read the specification."
   491 
   492     "
   493      UIPainter new openOnClass:Tools::ProjectBuilderAssistantApplication andSelector:#page2_projectSelectionSpec
   494      Tools::ProjectBuilderAssistantApplication new openInterface:#page2_projectSelectionSpec
   495     "
   496 
   497     <resource: #canvas>
   498 
   499     ^ 
   500      #(FullSpec
   501         name: #'page2_projectSelectionSpec'
   502         window: 
   503        (WindowSpec
   504           label: 'Project Selection'
   505           name: 'Project Selection'
   506           min: (Point 0 0)
   507           bounds: (Rectangle 0 0 521 453)
   508         )
   509         component: 
   510        (SpecCollection
   511           collection: (
   512            (FramedBoxSpec
   513               label: 'New Project''s PackageID'
   514               name: 'FramedBox3'
   515               layout: (LayoutFrame 0 0.0 5 0 4 1.0 72 0)
   516               labelPosition: topLeft
   517               translateLabel: true
   518               component: 
   519              (SpecCollection
   520                 collection: (
   521                  (ExtendedComboBoxSpec
   522                     name: 'NewProjectsNameListExtendedComboBox'
   523                     layout: (LayoutFrame 1 0 6 0 -113 1 28 0)
   524                     model: newProjectsName
   525                     readOnly: false
   526                     miniScrollerHorizontal: true
   527                     postBuildCallback: postBuildNewProjectsNameListExtendedComboBox:
   528               activeHelpKey: listOfNewProjectsName
   529                   )
   530                  (ActionButtonSpec
   531                     label: 'Create'
   532                     name: 'Button1'
   533                     layout: (LayoutFrame -100 1 6 0 2 1 28 0)
   534                     translateLabel: true
   535                     model: createNewProject
   536               activeHelpKey: createNewProject
   537 
   538                   )
   539 
   540                  )
   541                
   542               )
   543             )
   544            (FramedBoxSpec
   545               label: 'Existing Projects with ProjectDefinition'
   546               name: 'FramedBox4'
   547               layout: (LayoutFrame 0 0.0 70 0 4 1.0 -30 1)
   548               labelPosition: topLeft
   549               translateLabel: true
   550               component: 
   551              (SpecCollection
   552                 collection: (
   553                  (VariableHorizontalPanelSpec
   554                     name: 'VariableHorizontalPanel2'
   555                     layout: (LayoutFrame 0 0 4 0 0 1 -26 1)
   556                     component: 
   557                    (SpecCollection
   558                       collection: (
   559                        (SequenceViewSpec
   560                           name: 'List2'
   561                           model: selectedProjectIndexHolder
   562                           hasHorizontalScrollBar: true
   563                           hasVerticalScrollBar: true
   564                           useIndex: true
   565                           sequenceList: listOfMatchingPackageIds
   566                         )
   567                        (TextEditorSpec
   568                           name: 'TextEditor2'
   569                           model: selectedProjectsComment
   570                           hasHorizontalScrollBar: true
   571                           hasVerticalScrollBar: true
   572                           isReadOnly: true
   573                           hasKeyboardFocusInitially: false
   574                           viewClassName: 'TextView'
   575                         )
   576                        )
   577                      
   578                     )
   579                     handles: (Any 0.34560327198364 1.0)
   580                   )
   581                  (CheckBoxSpec
   582                     label: 'Hide ST/X Base Packages'
   583                     name: 'CheckBox1'
   584                     layout: (LayoutFrame -1 0 -17 1 0 1 5 1)
   585                     model: hideSTXProjects
   586                     translateLabel: true
   587                     activeHelpKey: hideSTXBasePackages
   588                   )
   589                  )
   590                
   591               )
   592             )
   593            (HorizontalPanelViewSpec
   594               name: 'HorizontalPanel1'
   595               layout: (LayoutFrame 0 0 -30 1 0 1 0 1)
   596               horizontalLayout: leftSpace
   597               verticalLayout: center
   598               horizontalSpace: 3
   599               verticalSpace: 3
   600               component: 
   601              (SpecCollection
   602                 collection: (
   603                  (ActionButtonSpec
   604                     label: 'Browse Selected Project'
   605                     name: 'Button3'
   606                     translateLabel: true
   607                     model: doBrowseProject
   608                     enableChannel: hasProjectSelectedHolder
   609                     extent: (Point 180 22)
   610                     activeHelpKey: browseSelectedProject
   611                   )
   612                  )
   613                
   614               )
   615             )
   616            )
   617          
   618         )
   619       )
   620 !
   621 
   622 page3_applicationSelectionSpec
   623     "This resource specification was automatically generated
   624      by the UIPainter of ST/X."
   625 
   626     "Do not manually edit this!! If it is corrupted,
   627      the UIPainter may not be able to read the specification."
   628 
   629     "
   630      UIPainter new openOnClass:Tools::ProjectBuilderAssistantApplication andSelector:#page3_applicationSelectionSpec
   631      Tools::ProjectBuilderAssistantApplication new openInterface:#page3_applicationSelectionSpec
   632     "
   633 
   634     <resource: #canvas>
   635 
   636     ^ 
   637      #(FullSpec
   638         name: #'page3_applicationSelectionSpec'
   639         window: 
   640        (WindowSpec
   641           label: 'Application Selection'
   642           name: 'Application Selection'
   643           min: (Point 0 0)
   644           bounds: (Rectangle 0 0 519 406)
   645         )
   646         component: 
   647        (SpecCollection
   648           collection: (
   649            (FramedBoxSpec
   650               label: 'New Application Class'
   651               name: 'FramedBox3'
   652               layout: (LayoutFrame 0 0.0 5 0 4 1.0 70 0)
   653               labelPosition: topLeft
   654               translateLabel: true
   655               component: 
   656              (SpecCollection
   657                 collection: (
   658                  (InputFieldSpec
   659                     name: 'EntryField1'
   660                     layout: (LayoutFrame 1 0 6 0 -113 1 28 0)
   661                     model: newApplicationsName
   662                     acceptOnReturn: true
   663                     acceptOnTab: true
   664                     acceptOnLostFocus: true
   665                     acceptOnPointerLeave: true
   666                     emptyFieldReplacementText: 'MyApplication'
   667                   )
   668                  (ActionButtonSpec
   669                     label: 'Create'
   670                     name: 'Button1'
   671                     layout: (LayoutFrame -100 1 6 0 1 1 28 0)
   672                     translateLabel: true
   673                     model: createNewApplication
   674                   )
   675                  )
   676                
   677               )
   678             )
   679            (FramedBoxSpec
   680               label: 'Existing Applications'
   681               name: 'FramedBox4'
   682               layout: (LayoutFrame 0 0.0 72 0 4 1.0 -30 1)
   683               labelPosition: topLeft
   684               translateLabel: true
   685               component: 
   686              (SpecCollection
   687                 collection: (
   688                  (VariableHorizontalPanelSpec
   689                     name: 'VariableHorizontalPanel2'
   690                     layout: (LayoutFrame 0 0 4 0 0 1 -26 1)
   691                     component: 
   692                    (SpecCollection
   693                       collection: (
   694                        (SequenceViewSpec
   695                           name: 'List2'
   696                           model: selectedApplicationIndexHolder
   697                           hasHorizontalScrollBar: true
   698                           hasVerticalScrollBar: true
   699                           useIndex: true
   700                           sequenceList: listOfApplicationsInProject
   701                           ignoreReselect: false
   702                         )
   703                        (TextEditorSpec
   704                           name: 'TextEditor2'
   705                           model: selectedApplicationsComment
   706                           hasHorizontalScrollBar: true
   707                           hasVerticalScrollBar: true
   708                           isReadOnly: true
   709                           hasKeyboardFocusInitially: false
   710                           viewClassName: 'TextView'
   711                         )
   712                        )
   713                      
   714                     )
   715                     handles: (Any 0.34560327198364 1.0)
   716                   )
   717                  (CheckBoxSpec
   718                     label: 'Hide other Application Classes'
   719                     name: 'CheckBox1'
   720                     layout: (LayoutFrame -1 0 -18 1 0 1 4 1)
   721                     model: hideOtherApplicationClasses
   722                     translateLabel: true
   723                   )
   724                  )
   725                
   726               )
   727             )
   728            (HorizontalPanelViewSpec
   729               name: 'HorizontalPanel1'
   730               layout: (LayoutFrame 0 0 -30 1 0 1 0 1)
   731               horizontalLayout: leftSpace
   732               verticalLayout: center
   733               horizontalSpace: 3
   734               verticalSpace: 3
   735               component: 
   736              (SpecCollection
   737                 collection: (
   738                  (ActionButtonSpec
   739                     label: 'Browse Selected Application'
   740                     name: 'Button3'
   741                     translateLabel: true
   742                     model: doBrowseApplication
   743                     enableChannel: hasApplicationSelectedHolder
   744                     extent: (Point 180 22)
   745                   )
   746                  (ActionButtonSpec
   747                     label: 'Launch Selected Application'
   748                     name: 'Button4'
   749                     translateLabel: true
   750                     model: doLaunchApplication
   751                     enableChannel: hasApplicationSelectedHolder
   752                     extent: (Point 180 22)
   753                   )
   754                  )
   755                
   756               )
   757             )
   758            )
   759          
   760         )
   761       )
   762 !
   763 
   764 page4_startupClassSelectionSpec
   765     "This resource specification was automatically generated
   766      by the UIPainter of ST/X."
   767 
   768     "Do not manually edit this!! If it is corrupted,
   769      the UIPainter may not be able to read the specification."
   770 
   771     "
   772      UIPainter new openOnClass:Tools::ProjectBuilderAssistantApplication andSelector:#page4_startupClassSelectionSpec
   773      Tools::ProjectBuilderAssistantApplication new openInterface:#page4_startupClassSelectionSpec
   774     "
   775 
   776     <resource: #canvas>
   777 
   778     ^ 
   779      #(FullSpec
   780         name: #'page4_startupClassSelectionSpec'
   781         window: 
   782        (WindowSpec
   783           label: 'Startup Class Selection'
   784           name: 'Startup Class Selection'
   785           min: (Point 0 0)
   786           bounds: (Rectangle 0 0 521 408)
   787         )
   788         component: 
   789        (SpecCollection
   790           collection: (
   791            (FramedBoxSpec
   792               label: 'New Startup Class'
   793               name: 'FramedBox3'
   794               layout: (LayoutFrame 0 0.0 5 0 4 1.0 70 0)
   795               labelPosition: topLeft
   796               translateLabel: true
   797               component: 
   798              (SpecCollection
   799                 collection: (
   800                  (InputFieldSpec
   801                     name: 'EntryField1'
   802                     layout: (LayoutFrame 1 0 6 0 -113 1 28 0)
   803                     model: newStartupClassName
   804                     acceptOnReturn: true
   805                     acceptOnTab: true
   806                     acceptOnLostFocus: true
   807                     acceptOnPointerLeave: true
   808                     emptyFieldReplacementText: 'MyStandAloneStartup'
   809                   )
   810                  (ActionButtonSpec
   811                     label: 'Create'
   812                     name: 'Button1'
   813                     layout: (LayoutFrame -100 1 6 0 1 1 28 0)
   814                     translateLabel: true
   815                     model: createNewStartupClass
   816                   )
   817                  )
   818                
   819               )
   820             )
   821            (FramedBoxSpec
   822               label: 'Existing Startup Classes'
   823               name: 'FramedBox4'
   824               layout: (LayoutFrame 0 0.0 72 0 4 1.0 -30 1)
   825               labelPosition: topLeft
   826               translateLabel: true
   827               component: 
   828              (SpecCollection
   829                 collection: (
   830                  (VariableHorizontalPanelSpec
   831                     name: 'VariableHorizontalPanel2'
   832                     layout: (LayoutFrame 0 0 4 0 0 1 -26 1)
   833                     component: 
   834                    (SpecCollection
   835                       collection: (
   836                        (SequenceViewSpec
   837                           name: 'List2'
   838                           model: selectedStartupClassIndexHolder
   839                           hasHorizontalScrollBar: true
   840                           hasVerticalScrollBar: true
   841                           useIndex: true
   842                           sequenceList: listOfStartupClassesInProject
   843                         )
   844                        (TextEditorSpec
   845                           name: 'TextEditor2'
   846                           model: selectedStartupClassesComment
   847                           hasHorizontalScrollBar: true
   848                           hasVerticalScrollBar: true
   849                           isReadOnly: true
   850                           hasKeyboardFocusInitially: false
   851                           viewClassName: 'TextView'
   852                         )
   853                        )
   854                      
   855                     )
   856                     handles: (Any 0.34560327198364 1.0)
   857                   )
   858                  (CheckBoxSpec
   859                     label: 'Hide other Startup Classes'
   860                     name: 'CheckBox1'
   861                     layout: (LayoutFrame -1 0 -20 1 0 1 2 1)
   862                     model: hideOtherStartupClasses
   863                     translateLabel: true
   864                   )
   865                  )
   866                
   867               )
   868             )
   869            (HorizontalPanelViewSpec
   870               name: 'HorizontalPanel1'
   871               layout: (LayoutFrame 0 0 -30 1 0 1 0 1)
   872               horizontalLayout: leftSpace
   873               verticalLayout: center
   874               horizontalSpace: 3
   875               verticalSpace: 3
   876               component: 
   877              (SpecCollection
   878                 collection: (
   879                  (ActionButtonSpec
   880                     label: 'Browse Selected StartupClass'
   881                     name: 'Button3'
   882                     translateLabel: true
   883                     model: doBrowseStartupClass
   884                     enableChannel: hasStartupClassSelectedHolder
   885                     extent: (Point 180 22)
   886                   )
   887                  )
   888                
   889               )
   890             )
   891            )
   892          
   893         )
   894       )
   895 !
   896 
   897 page5_specifyIncludedClasses
   898     "This resource specification was automatically generated
   899      by the UIPainter of ST/X."
   900 
   901     "Do not manually edit this!! If it is corrupted,
   902      the UIPainter may not be able to read the specification."
   903 
   904     "
   905      UIPainter new openOnClass:Tools::ProjectBuilderAssistantApplication andSelector:#page5_specifyIncludedClasses
   906      Tools::ProjectBuilderAssistantApplication new openInterface:#page5_specifyIncludedClasses
   907     "
   908 
   909     <resource: #canvas>
   910 
   911     ^ 
   912      #(FullSpec
   913         name: #'page5_specifyIncludedClasses'
   914         window: 
   915        (WindowSpec
   916           label: 'Project Selection'
   917           name: 'Project Selection'
   918           min: (Point 0 0)
   919           bounds: (Rectangle 0 0 521 400)
   920         )
   921         component: 
   922        (SpecCollection
   923           collection: (
   924            (FramedBoxSpec
   925               label: 'Project Contents'
   926               name: 'FramedBox3'
   927               layout: (LayoutFrame 0 0.0 5 0 4 1.0 -30 1)
   928               labelPosition: topLeft
   929               translateLabel: true
   930               component: 
   931              (SpecCollection
   932                 collection: (
   933                  (SequenceViewSpec
   934                     name: 'List1'
   935                     layout: (LayoutFrame 0 0 0 0 0 1 0 1)
   936                     initiallyDisabled: true
   937                     hasHorizontalScrollBar: true
   938                     hasVerticalScrollBar: true
   939                     useIndex: false
   940                     sequenceList: listOfClassesInProject
   941                   )
   942                  )
   943                
   944               )
   945             )
   946            (HorizontalPanelViewSpec
   947               name: 'HorizontalPanel1'
   948               layout: (LayoutFrame 0 0 -30 1 0 1 0 1)
   949               horizontalLayout: center
   950               verticalLayout: center
   951               horizontalSpace: 3
   952               verticalSpace: 3
   953               component: 
   954              (SpecCollection
   955                 collection: (
   956                  (ActionButtonSpec
   957                     label: 'Browse Project Definition'
   958                     name: 'Button3'
   959                     translateLabel: true
   960                     model: doBrowseProjectDefinitionClass
   961                     extent: (Point 180 22)
   962                   )
   963                  (ActionButtonSpec
   964                     label: 'Update Contents (Scan)'
   965                     name: 'Button4'
   966                     translateLabel: true
   967                     model: doGenerateProjectContentsDefinition
   968                     extent: (Point 180 22)
   969                   )
   970                  )
   971                
   972               )
   973             )
   974            )
   975          
   976         )
   977       )
   978 !
   979 
   980 page5b_specifyPrerequisitePackages
   981     "This resource specification was automatically generated
   982      by the UIPainter of ST/X."
   983 
   984     "Do not manually edit this!! If it is corrupted,
   985      the UIPainter may not be able to read the specification."
   986 
   987     "
   988      UIPainter new openOnClass:Tools::ProjectBuilderAssistantApplication andSelector:#page5b_specifyPrerequisitePackages
   989      Tools::ProjectBuilderAssistantApplication new openInterface:#page5b_specifyPrerequisitePackages
   990     "
   991 
   992     <resource: #canvas>
   993 
   994     ^ 
   995      #(FullSpec
   996         name: #'page5b_specifyPrerequisitePackages'
   997         window: 
   998        (WindowSpec
   999           label: 'Project Selection'
  1000           name: 'Project Selection'
  1001           min: (Point 0 0)
  1002           bounds: (Rectangle 0 0 521 400)
  1003         )
  1004         component: 
  1005        (SpecCollection
  1006           collection: (
  1007            (FramedBoxSpec
  1008               label: 'Prerequisite Packages'
  1009               name: 'FramedBox3'
  1010               layout: (LayoutFrame 0 0.0 5 0 4 1.0 -30 1)
  1011               labelPosition: topLeft
  1012               translateLabel: true
  1013               component: 
  1014              (SpecCollection
  1015                 collection: (
  1016                  (SequenceViewSpec
  1017                     name: 'List1'
  1018                     layout: (LayoutFrame 0 0 0 0 0 1 0 1)
  1019                     initiallyDisabled: true
  1020                     hasHorizontalScrollBar: true
  1021                     hasVerticalScrollBar: true
  1022                     useIndex: false
  1023                     sequenceList: listOfPrerequisitesInProject
  1024                   )               
  1025                  )
  1026                
  1027               )
  1028             )
  1029            (HorizontalPanelViewSpec
  1030               name: 'HorizontalPanel1'
  1031               layout: (LayoutFrame 0 0 -30 1 0 1 0 1)
  1032               horizontalLayout: center
  1033               verticalLayout: center
  1034               horizontalSpace: 3
  1035               verticalSpace: 3
  1036               component: 
  1037              (SpecCollection
  1038                 collection: (
  1039                  (ActionButtonSpec
  1040                     label: 'Browse Project Definition'
  1041                     name: 'Button3'
  1042                     translateLabel: true
  1043                     model: doBrowseProjectDefinitionClass
  1044                     extent: (Point 180 22)
  1045                   )
  1046                  (ActionButtonSpec
  1047                     label: 'Update Prerequisites (Scan)'
  1048                     name: 'Button4'
  1049                     translateLabel: true
  1050                     model: doGenerateProjectPrerequisitesDefinition
  1051                     extent: (Point 180 22)
  1052                   )
  1053                  )
  1054                
  1055               )
  1056             )
  1057            )
  1058          
  1059         )
  1060       )
  1061 
  1062     "Modified: / 19-01-2012 / 15:45:14 / cg"
  1063 !
  1064 
  1065 page6a_specifyProjectAttributes
  1066     "This resource specification was automatically generated
  1067      by the UIPainter of ST/X."
  1068 
  1069     "Do not manually edit this!! If it is corrupted,
  1070      the UIPainter may not be able to read the specification."
  1071 
  1072     "
  1073      UIPainter new openOnClass:Tools::ProjectBuilderAssistantApplication andSelector:#page6a_specifyProjectAttributes
  1074      Tools::ProjectBuilderAssistantApplication new openInterface:#page6a_specifyProjectAttributes
  1075     "
  1076 
  1077     <resource: #canvas>
  1078 
  1079     ^ 
  1080      #(FullSpec
  1081         name: #'page6a_specifyProjectAttributes'
  1082         window: 
  1083        (WindowSpec
  1084           label: 'Project Selection'
  1085           name: 'Project Selection'
  1086           min: (Point 0 0)
  1087           bounds: (Rectangle 0 0 521 239)
  1088         )
  1089         component: 
  1090        (SpecCollection
  1091           collection: (
  1092            (FramedBoxSpec
  1093               label: 'Product Information'
  1094               name: 'FramedBox3'
  1095               layout: (LayoutFrame 0 0.0 5 0 4 1.0 101 0)
  1096               labelPosition: topLeft
  1097               translateLabel: true
  1098               component: 
  1099              (SpecCollection
  1100                 collection: (
  1101                  (LabelSpec
  1102                     label: 'Product Name:'
  1103                     name: 'Label1'
  1104                     layout: (LayoutFrame 0 0 10 0 148 0 32 0)
  1105                     translateLabel: true
  1106                     adjust: right
  1107                   )
  1108                  (InputFieldSpec
  1109                     name: 'EntryField4'
  1110                     layout: (LayoutFrame 150 0.0 10 0 0 1.0 32 0)
  1111                     model: productNameHolder
  1112                     acceptOnLostFocus: true
  1113                     acceptOnPointerLeave: true
  1114                     viewClassName: ''
  1115                   )
  1116                  (LabelSpec
  1117                     label: 'Company Name:'
  1118                     name: 'Label2'
  1119                     layout: (LayoutFrame 0 0 39 0 148 0 61 0)
  1120                     translateLabel: true
  1121                     adjust: right
  1122                   )
  1123                  (InputFieldSpec
  1124                     name: 'EntryField3'
  1125                     layout: (LayoutFrame 150 0.0 39 0 0 1.0 61 0)
  1126                     model: companyNameHolder
  1127                     acceptOnLostFocus: true
  1128                     acceptOnPointerLeave: true
  1129                     viewClassName: ''
  1130                   )
  1131                  )
  1132                
  1133               )
  1134             )
  1135            )
  1136          
  1137         )
  1138       )
  1139 !
  1140 
  1141 page6b_specifyBuildDirectorySpec
  1142     "This resource specification was automatically generated
  1143      by the UIPainter of ST/X."
  1144 
  1145     "Do not manually edit this!! If it is corrupted,
  1146      the UIPainter may not be able to read the specification."
  1147 
  1148     "
  1149      UIPainter new openOnClass:Tools::ProjectBuilderAssistantApplication andSelector:#page6b_specifyBuildDirectorySpec
  1150      Tools::ProjectBuilderAssistantApplication new openInterface:#page6b_specifyBuildDirectorySpec
  1151     "
  1152 
  1153     <resource: #canvas>
  1154 
  1155     ^ 
  1156      #(FullSpec
  1157         name: #'page6b_specifyBuildDirectorySpec'
  1158         window: 
  1159        (WindowSpec
  1160           label: 'Project Selection'
  1161           name: 'Project Selection'
  1162           min: (Point 0 0)
  1163           bounds: (Rectangle 0 0 521 361)
  1164         )
  1165         component: 
  1166        (SpecCollection
  1167           collection: (
  1168            (FramedBoxSpec
  1169               label: 'Build Directory'
  1170               name: 'FramedBox3'
  1171               layout: (LayoutFrame 0 0.0 5 0 4 1.0 79 0)
  1172               labelPosition: topLeft
  1173               translateLabel: true
  1174               component: 
  1175              (SpecCollection
  1176                 collection: (
  1177                  (FilenameInputFieldSpec
  1178                     name: 'FilenameEntryField1'
  1179                     layout: (LayoutFrame 0 0.0 10 0 0 1.0 32 0)
  1180                     model: buildDirectoryHolder
  1181                     acceptOnPointerLeave: true
  1182                     viewClassName: FilenameWidgetWithHistory
  1183                   )
  1184                  )
  1185                
  1186               )
  1187             )
  1188            (FramedBoxSpec
  1189               label: 'Compiler / Toolchain'
  1190               name: 'FramedBox4'
  1191               layout: (LayoutFrame 0 0.0 81 0 4 1.0 155 0)
  1192               labelPosition: topLeft
  1193               translateLabel: true
  1194               component: 
  1195              (SpecCollection
  1196                 collection: (
  1197                  (ComboListSpec
  1198                     name: 'ComboList1'
  1199                     layout: (LayoutFrame 0 0 10 0 137 0 32 0)
  1200                     model: usedCompilerHolder
  1201                     comboList: listOfPossibleCompilers
  1202                     useIndex: false
  1203                   )
  1204                  )
  1205                
  1206               )
  1207             )
  1208            (LabelSpec
  1209               label: 'Compiler Warn-Label'
  1210               name: 'Label1'
  1211               layout: (LayoutFrame 2 0.0 158 0 -2 1.0 303 0)
  1212               level: -1
  1213               visibilityChannel: compilerWarnMessageVisibleHolder
  1214               backgroundColor: (Color 100.0 49.999237048905 49.999237048905)
  1215               translateLabel: true
  1216               labelChannel: compilerWarnMessageHolder
  1217               adjust: left
  1218             )
  1219            )
  1220          
  1221         )
  1222       )
  1223 !
  1224 
  1225 page7_buildSpec
  1226     "This resource specification was automatically generated
  1227      by the UIPainter of ST/X."
  1228 
  1229     "Do not manually edit this!! If it is corrupted,
  1230      the UIPainter may not be able to read the specification."
  1231 
  1232     "
  1233      UIPainter new openOnClass:Tools::ProjectBuilderAssistantApplication andSelector:#page7_buildSpec
  1234      Tools::ProjectBuilderAssistantApplication new openInterface:#page7_buildSpec
  1235     "
  1236 
  1237     <resource: #canvas>
  1238 
  1239     ^ 
  1240      #(FullSpec
  1241         name: #'page7_buildSpec'
  1242         window: 
  1243        (WindowSpec
  1244           label: 'Project Selection'
  1245           name: 'Project Selection'
  1246           min: (Point 0 0)
  1247           bounds: (Rectangle 0 0 521 472)
  1248         )
  1249         component: 
  1250        (SpecCollection
  1251           collection: (
  1252            (FramedBoxSpec
  1253               label: 'Make Output'
  1254               name: 'FramedBox3'
  1255               layout: (LayoutFrame 0 0.0 5 0 4 1.0 -30 1)
  1256               labelPosition: topLeft
  1257               translateLabel: true
  1258               component: 
  1259              (SpecCollection
  1260                 collection: (
  1261                  (TextEditorSpec
  1262                     name: 'MakeOutputWindow'
  1263                     layout: (LayoutFrame 0 0 0 0 0 1 0 1)
  1264                     model: makeOutputHolder
  1265                     hasHorizontalScrollBar: true
  1266                     hasVerticalScrollBar: true
  1267                     hasKeyboardFocusInitially: false
  1268                     viewClassName: 'TextCollector'
  1269                     postBuildCallback: postBuildMakeOutputWindow:
  1270                   )
  1271                  )
  1272                
  1273               )
  1274             )
  1275            (HorizontalPanelViewSpec
  1276               name: 'HorizontalPanel1'
  1277               layout: (LayoutFrame 0 0 -30 1 0 1 0 1)
  1278               horizontalLayout: leftSpace
  1279               verticalLayout: center
  1280               horizontalSpace: 3
  1281               verticalSpace: 3
  1282               component: 
  1283              (SpecCollection
  1284                 collection: (
  1285                  (ActionButtonSpec
  1286                     label: 'Make All'
  1287                     name: 'Button3'
  1288                     translateLabel: true
  1289                     model: doStartMakeAll
  1290                     enableChannel: startMakeButtonEnabled
  1291                     extent: (Point 107 22)
  1292                   )
  1293                  (ActionButtonSpec
  1294                     label: 'Make EXE only'
  1295                     name: 'Button5'
  1296                     translateLabel: true
  1297                     model: doStartMakeExe
  1298                     enableChannel: startMakeButtonEnabled
  1299                     extent: (Point 107 22)
  1300                   )
  1301                  (ViewSpec
  1302                     name: 'Box1'
  1303                     extent: (Point 20 10)
  1304                   )
  1305                  (ActionButtonSpec
  1306                     label: 'Stop Make'
  1307                     name: 'Button4'
  1308                     visibilityChannel: stopMakeButtonVisible
  1309                     translateLabel: true
  1310                     model: doStopMake
  1311                     extent: (Point 107 22)
  1312                   )
  1313                  )
  1314                
  1315               )
  1316             )
  1317            )
  1318          
  1319         )
  1320       )
  1321 !
  1322 
  1323 page8_deploySpec
  1324     "This resource specification was automatically generated
  1325      by the UIPainter of ST/X."
  1326 
  1327     "Do not manually edit this!! If it is corrupted,
  1328      the UIPainter may not be able to read the specification."
  1329 
  1330     "
  1331      UIPainter new openOnClass:Tools::ProjectBuilderAssistantApplication andSelector:#page8_deploySpec
  1332      Tools::ProjectBuilderAssistantApplication new openInterface:#page8_deploySpec
  1333     "
  1334 
  1335     <resource: #canvas>
  1336 
  1337     ^ 
  1338      #(FullSpec
  1339         name: #'page8_deploySpec'
  1340         window: 
  1341        (WindowSpec
  1342           label: 'Project Selection'
  1343           name: 'Project Selection'
  1344           min: (Point 0 0)
  1345           bounds: (Rectangle 0 0 521 472)
  1346         )
  1347         component: 
  1348        (SpecCollection
  1349           collection: (
  1350            (FramedBoxSpec
  1351               label: 'Files for Deployment'
  1352               name: 'FramedBox3'
  1353               layout: (LayoutFrame 0 0.0 5 0 4 1.0 0 1)
  1354               labelPosition: topLeft
  1355               translateLabel: true
  1356               component: 
  1357              (SpecCollection
  1358                 collection: (
  1359                  (SubCanvasSpec
  1360                     name: 'SubCanvas1'
  1361                     layout: (LayoutFrame 0 0 0 0 0 1 -30 1)
  1362                     hasHorizontalScrollBar: false
  1363                     hasVerticalScrollBar: false
  1364                     clientHolder: fileBrowserInstance
  1365                     createNewApplication: true
  1366                     createNewBuilder: true
  1367                   )
  1368                  (HorizontalPanelViewSpec
  1369                     name: 'HorizontalPanel1'
  1370                     layout: (LayoutFrame 0 0 -30 1 0 1 0 1)
  1371                     horizontalLayout: centerMax
  1372                     verticalLayout: center
  1373                     horizontalSpace: 3
  1374                     verticalSpace: 3
  1375                     component: 
  1376                    (SpecCollection
  1377                       collection: (
  1378                        (ActionButtonSpec
  1379                           label: 'Open Windows Explorer'
  1380                           name: 'Button1'
  1381                           visibilityChannel: isWindowsOS
  1382                           translateLabel: true
  1383                           resizeForLabel: true
  1384                           model: doOpenExplorer
  1385                           extent: (Point 172 22)
  1386                         )
  1387                        (ActionButtonSpec
  1388                           label: 'Open Console'
  1389                           name: 'Button2'
  1390                           visibilityChannel: isUnixOS
  1391                           translateLabel: true
  1392                           resizeForLabel: true
  1393                           model: doOpenConsoleTerminal
  1394                           extent: (Point 172 22)
  1395                         )
  1396                        )
  1397                      
  1398                     )
  1399                   )
  1400                  )
  1401                
  1402               )
  1403             )
  1404            )
  1405          
  1406         )
  1407       )
  1408 ! !
  1409 
  1410 !ProjectBuilderAssistantApplication class methodsFor:'misc specs'!
  1411 
  1412 newProjectsNameListSpec
  1413     "This resource specification was automatically generated
  1414      by the UIPainter of ST/X."
  1415 
  1416     "Do not manually edit this!! If it is corrupted,
  1417      the UIPainter may not be able to read the specification."
  1418 
  1419     "
  1420      UIPainter new openOnClass:Tools::ProjectBuilderAssistantApplication andSelector:#newProjectsNameListSpec
  1421      Tools::ProjectBuilderAssistantApplication new openInterface:#newProjectsNameListSpec
  1422     "
  1423 
  1424     <resource: #canvas>
  1425 
  1426     ^ 
  1427      #(FullSpec
  1428         name: newProjectsNameListSpec
  1429         window: 
  1430        (WindowSpec
  1431           label: 'NewApplication'
  1432           name: 'NewApplication'
  1433           min: (Point 0 0)
  1434           bounds: (Rectangle 0 0 131 207)
  1435         )
  1436         component: 
  1437        (SpecCollection
  1438           collection: (
  1439            (SequenceViewSpec
  1440               name: 'ReferencePoint2'
  1441               layout: (LayoutFrame 0 0 0 0 0 1 0 1)
  1442               activeHelpKey: listOfNewProjectsName
  1443               model: newProjectsName
  1444               hasHorizontalScrollBar: true
  1445               hasVerticalScrollBar: true
  1446               miniScrollerHorizontal: true
  1447               miniScrollerVertical: false
  1448               useIndex: false
  1449               sequenceList: listOfNewProjectsName
  1450               doubleClickChannel: newProjectsNameListDoubleClickChannel
  1451             )
  1452            )
  1453          
  1454         )
  1455       )
  1456 ! !
  1457 
  1458 !ProjectBuilderAssistantApplication class methodsFor:'startup'!
  1459 
  1460 openOn:aProjectDefinitionClass
  1461     ^ self new openOn:aProjectDefinitionClass
  1462 
  1463     "Created: / 20-07-2012 / 12:33:25 / cg"
  1464 !
  1465 
  1466 openOnPackage:aPackageId
  1467     ^ self new openOnPackage:aPackageId
  1468 
  1469     "Created: / 20-07-2012 / 13:22:50 / cg"
  1470 ! !
  1471 
  1472 !ProjectBuilderAssistantApplication methodsFor:'actions'!
  1473 
  1474 buildDirectoryChanged
  1475     self updateButtonEnableState.
  1476 !
  1477 
  1478 createNewApplication
  1479     <resource: #uiCallback>
  1480 
  1481     |newAppName newAppClass|
  1482 
  1483     newAppName := self newApplicationsName value.
  1484     newAppName isEmptyOrNil ifTrue:[
  1485         Dialog warn:'Please enter the name of the Application-Class first.'.
  1486         ^ self
  1487     ].
  1488 
  1489     self withWaitCursorDo:[
  1490         Class packageQuerySignal answer:(selectedProjectDefinition package)
  1491         do:[
  1492             newAppClass := ApplicationModel
  1493                             subclass:newAppName asSymbol
  1494                             instanceVariableNames:''
  1495                             classVariableNames:''
  1496                             poolDictionaries:''
  1497                             category:'Applications'.
  1498             SmalltalkCodeGeneratorTool createApplicationCodeFor:newAppClass.
  1499         ].
  1500         self updateListOfApplicationsInProject.
  1501         self selectedApplicationIndexHolder value:(listOfApplicationsInProject value indexOf:newAppClass).
  1502     ].
  1503 
  1504     "Modified: / 31-01-2011 / 18:29:50 / cg"
  1505 !
  1506 
  1507 createNewProject
  1508     <resource: #uiCallback>
  1509 
  1510     |newProjectID projectDefinitionType projectDefinitionClass projectClasses|
  1511 
  1512     newProjectID := self newProjectsName value.
  1513     newProjectID isEmptyOrNil ifTrue:[
  1514         Dialog warn:(resources string:'Please enter a packageID first.').
  1515         ^ self
  1516     ].
  1517     newProjectID asPackageId isModuleId ifTrue:[
  1518         Dialog warn:(resources stringWithCRs:
  1519 'Please enter a corrent packageID.
  1520 
  1521 All packages must be named like "%1:%2"
  1522 (%2 can be a path like "dir/dir/...").' with:(resources string:'module')allItalic
  1523                                         with:(resources string:'directory')allItalic).
  1524         ^ self
  1525     ].
  1526 
  1527     self withWaitCursorDo:[
  1528         projectDefinitionType := ProjectDefinition perform:(self projectTypeHolder value).
  1529 
  1530         projectDefinitionClass := ProjectDefinition
  1531                                     definitionClassForPackage:newProjectID
  1532                                     projectType: projectDefinitionType
  1533                                     createIfAbsent:true.
  1534 
  1535         projectDefinitionClass compileDescriptionMethods.
  1536         self updateListOfMatchingProjects.
  1537         self updateListOfNewProjectsName.
  1538 
  1539         self selectedProjectIndexHolder value:( self listOfMatchingProjects value indexOf:projectDefinitionClass).
  1540 
  1541         projectClasses := projectDefinitionClass allClasses.
  1542 
  1543 "/    projectDefinitionClass isGUIApplication ifTrue:[
  1544 "/        "/ see if it has an AppModel class
  1545 "/        (projectClasses contains:[:cls | cls isVisualStartable]) ifFalse:[
  1546 "/            (Dialog confirm:'Create an Application Class ?') ifTrue:[
  1547 "/                self halt.
  1548 "/            ].
  1549 "/        ].
  1550 "/    ].
  1551 
  1552 "/    projectDefinitionClass isLibrary ifFalse:[
  1553 "/        "/ see if it has a Startup class
  1554 "/        (projectClasses contains:[:cls | cls isStartable]) ifFalse:[
  1555 "/        ].
  1556 "/    ].
  1557 
  1558     ].
  1559 
  1560     "Modified: / 06-08-2011 / 15:48:01 / cg"
  1561 !
  1562 
  1563 createNewStartupClass
  1564     <resource: #uiCallback>
  1565 
  1566     |newClassName newStartupClass startupApplication|
  1567 
  1568     newClassName := self newStartupClassName value.
  1569     newClassName isEmptyOrNil ifTrue:[
  1570         Dialog warn:'Please enter the name of the Startup-Class first.'.
  1571         ^ self
  1572     ].
  1573 
  1574     self withWaitCursorDo:[ 
  1575         |pkg|
  1576 
  1577         pkg := selectedProjectDefinition notNil 
  1578                     ifTrue:[selectedProjectDefinition package]
  1579                     ifFalse:[newProjectsName value].
  1580         Class packageQuerySignal answer:pkg
  1581         do:[
  1582             newStartupClass := StandaloneStartup
  1583                             subclass:newClassName asSymbol
  1584                             instanceVariableNames:''
  1585                             classVariableNames:''
  1586                             poolDictionaries:''
  1587                             category:'Applications'.   
  1588 
  1589             self projectTypeIsGuiApplication ifTrue: [startupApplication := selectedApplication].
  1590             SmalltalkCodeGeneratorTool createStartupCodeFor:newStartupClass forStartOf:startupApplication.
  1591         ].
  1592         self updateListOfStartupClassesInProject.
  1593         self selectedStartupClassIndexHolder value:(listOfStartupClassesInProject value indexOf:newStartupClass).
  1594     ].
  1595 
  1596     "Modified: / 31-01-2011 / 18:29:47 / cg"
  1597 !
  1598 
  1599 doAddClassToProject
  1600     <resource: #uiCallback>
  1601 
  1602     Transcript showCR:self class name, ': action for doAddClassToProject ...'.
  1603     self halt.
  1604 !
  1605 
  1606 doBrowseApplication
  1607     <resource: #uiCallback>
  1608 
  1609     |appClass|
  1610 
  1611     self hasApplicationSelected ifTrue:[
  1612         appClass := self listOfApplicationsInProject value at:(self selectedApplicationIndexHolder value).
  1613         UserPreferences systemBrowserClass 
  1614             openInClass:appClass class selector:#windowSpec.
  1615     ].
  1616 !
  1617 
  1618 doBrowseProject
  1619     <resource: #uiCallback>
  1620 
  1621     UserPreferences systemBrowserClass openOnPackage:selectedProjectDefinition package.
  1622 !
  1623 
  1624 doBrowseProjectDefinitionClass
  1625     <resource: #uiCallback>
  1626 
  1627     |defClass|
  1628 
  1629     self hasProjectSelected ifTrue:[
  1630         defClass := self selectedProjectDefinition.
  1631         UserPreferences systemBrowserClass 
  1632             openInClass:defClass class selector:#classNamesAndAttributes.
  1633     ].
  1634 !
  1635 
  1636 doBrowseStartupClass
  1637     <resource: #uiCallback>
  1638 
  1639     |startupClass|
  1640 
  1641     self hasStartupClassSelected ifTrue:[
  1642         startupClass := self listOfStartupClassesInProject value at:(self selectedStartupClassIndexHolder value).
  1643         UserPreferences systemBrowserClass 
  1644             openInClass:startupClass class selector:#main:.
  1645     ].
  1646 !
  1647 
  1648 doGenerateProjectContentsDefinition
  1649     self generatePackageContentsMethods
  1650 !
  1651 
  1652 doGenerateProjectPrerequisitesDefinition
  1653     self generatePackageContentsMethods
  1654 
  1655     "Created: / 19-01-2012 / 15:44:23 / cg"
  1656 !
  1657 
  1658 doLaunchApplication
  1659     <resource: #uiCallback>
  1660 
  1661     |appClass|
  1662 
  1663     self hasApplicationSelected ifTrue:[
  1664         appClass := self listOfApplicationsInProject value at:(self selectedApplicationIndexHolder value).
  1665         appClass open.
  1666     ].
  1667 !
  1668 
  1669 doOpenConsoleTerminal
  1670 "/    OperatingSystem
  1671 "/        executeCommand:'cmd.exe'        
  1672 "/        inDirectory:(projectBuilder packageBuildDirectory)
  1673     OperatingSystem isUNIXlike ifTrue:[
  1674         VT100TerminalView openShellIn:(projectBuilder packageBuildDirectory)
  1675     ] ifFalse:[
  1676         OperatingSystem
  1677             executeCommand:'c:\windows\System32\cmd.exe'        
  1678             inDirectory:(projectBuilder packageBuildDirectory)
  1679     ]
  1680 !
  1681 
  1682 doOpenExplorer
  1683     OperatingSystem
  1684         openApplicationForDocument:(projectBuilder packageBuildDirectory) 
  1685         operation:#explore.
  1686 !
  1687 
  1688 doStartMakeAll
  1689     <resource: #uiCallback>
  1690 
  1691     self stopMakeButtonVisible value:true.
  1692     self startMakeButtonEnabled value:false.
  1693 
  1694     self infoHolder value:'Building (make) - please wait...'.
  1695     makeOutputWindow clear.
  1696 
  1697     makeProcess := 
  1698             [
  1699                 [
  1700                     self runBuildProcess:'all'
  1701                 ] ensure:[
  1702                     self stopMakeButtonVisible value:false.
  1703                     self startMakeButtonEnabled value:true.
  1704                     makeProcess := nil.
  1705                     self updateButtonEnableState.
  1706                     self infoHolder value:''.
  1707                 ].
  1708             ] newProcess.
  1709 
  1710     makeProcess priority:4.
  1711     makeProcess priorityRange:(4 to:8).
  1712     makeProcess resume.
  1713 !
  1714 
  1715 doStartMakeExe
  1716     <resource: #uiCallback>
  1717 
  1718     self stopMakeButtonVisible value:true.
  1719     self startMakeButtonEnabled value:false.
  1720 
  1721     self infoHolder value:'Building (make) - please wait...'.
  1722     makeOutputWindow clear.
  1723 
  1724     makeProcess := 
  1725             [
  1726                 [
  1727                     self runBuildProcess:'exe'
  1728                 ] ensure:[
  1729                     self stopMakeButtonVisible value:false.
  1730                     self startMakeButtonEnabled value:true.
  1731                     makeProcess := nil.
  1732                     self updateButtonEnableState.
  1733                     self infoHolder value:''.
  1734                 ].
  1735             ] newProcess.
  1736 
  1737     makeProcess priority:4.
  1738     makeProcess priorityRange:(4 to:8).
  1739     makeProcess resume.
  1740 !
  1741 
  1742 doStopMake
  1743     <resource: #uiCallback>
  1744 
  1745     |p|
  1746 
  1747     (p := makeProcess) notNil ifTrue:[
  1748         makeProcess := nil.
  1749         p terminate.
  1750         p waitUntilTerminated.
  1751 
  1752         makeOutputWindow endEntry.
  1753         makeOutputWindow cr.
  1754         makeOutputWindow nextPutLine:('Make Cancelled' colorizeAllWith:Color white on:Color red).
  1755         makeOutputWindow endEntry.
  1756     ].
  1757 !
  1758 
  1759 projectTypeChanged
  1760     <resource: #uiCallback>
  1761 
  1762     self updateListOfMatchingProjects
  1763 !
  1764 
  1765 runBuildProcess:what
  1766     <resource: #uiCallback>
  1767 
  1768     self assert:makeOutputWindow notNil.
  1769     self assert:makeOutputWindow model == self makeOutputHolder.
  1770 
  1771     ActivityNotification handle:[:ex |
  1772         ex messageText notNil ifTrue:[
  1773             makeOutputWindow endEntry.
  1774             makeOutputWindow cr.
  1775             makeOutputWindow nextPutLine:(ex messageText colorizeAllWith:Color white on:Color blue).
  1776             makeOutputWindow endEntry.
  1777         ].
  1778         ex proceed.
  1779     ] do:[
  1780         projectBuilder := ProjectBuilder new.
  1781         projectBuilder package:(selectedProjectDefinition package).
  1782         projectBuilder usedCompilerForBuild:(usedCompilerHolder value).
  1783         what = 'exe' ifTrue:[
  1784             projectBuilder makeExeOnly:true
  1785         ] ifFalse:[
  1786             projectBuilder makeExeOnly:false
  1787         ].
  1788 
  1789         Error handle:[:ex |
  1790             makeOutputWindow endEntry.
  1791             makeOutputWindow cr.
  1792             makeOutputWindow nextPutLine:(ex description colorizeAllWith:Color white on:Color red).
  1793             makeOutputWindow endEntry.
  1794             ex proceed.
  1795         ] do:[
  1796             projectBuilder buildWithColorizedOutputTo:makeOutputWindow.
  1797         ].
  1798     ].
  1799 
  1800     "Modified: / 22-01-2012 / 10:51:01 / cg"
  1801 !
  1802 
  1803 selectedApplicationChanged
  1804     |idx|
  1805 
  1806     ((idx := self selectedApplicationIndexHolder value) isNil
  1807     or:[idx == 0]) ifTrue:[
  1808         selectedApplication := nil.
  1809     ] ifFalse:[
  1810         selectedApplication := self listOfApplicationsInProject value at:idx.
  1811     ].
  1812     self hasApplicationSelectedHolder value:(selectedApplication notNil).
  1813 
  1814 "/    selectedApplication notNil ifTrue:[
  1815 "/        "/ generate startupClass code
  1816 "/        CodeGeneratorTool
  1817 "/            compile:(selectedProjectDefinition startupClassName_codeFor:(selectedApplication name))
  1818 "/            forClass:selectedProjectDefinition theMetaclass
  1819 "/            inCategory:'description - startup'.
  1820 "/    ].
  1821     self updateApplicationComment.
  1822     self updateButtonEnableState.
  1823 !
  1824 
  1825 selectedProjectChanged
  1826 
  1827     |selectedProjectIndex|
  1828 
  1829     selectedProjectIndex := self selectedProjectIndexHolder value.
  1830     (selectedProjectIndex ? 0) == 0 ifTrue:[
  1831         selectedProjectDefinition := nil.
  1832     ] ifFalse:[
  1833         selectedProjectDefinition := self listOfMatchingProjects value at:(selectedProjectIndex).
  1834     ].
  1835     self hasProjectSelectedHolder value:(selectedProjectDefinition notNil).
  1836 
  1837     self updateComment.
  1838     self updateListOfApplicationsInProject.
  1839     self updateButtonEnableState.
  1840 !
  1841 
  1842 selectedStartupClassChanged
  1843     self selectedStartupClassIndexHolder value isNil ifTrue:[
  1844         selectedStartupClass := nil.
  1845     ] ifFalse:[
  1846         selectedStartupClass := self listOfStartupClassesInProject value at:(self selectedStartupClassIndexHolder value).
  1847     ].
  1848     self hasStartupClassSelectedHolder value:(selectedStartupClass notNil).
  1849 
  1850     selectedStartupClass notNil ifTrue:[
  1851         "/ generate startupClass code
  1852         SmalltalkCodeGeneratorTool
  1853             compile:(selectedProjectDefinition startupClassName_codeFor:(selectedStartupClass name))
  1854             forClass:selectedProjectDefinition theMetaclass
  1855             inCategory:'description - startup'.
  1856     ].
  1857     self updateButtonEnableState.
  1858 
  1859     "Modified: / 31-01-2011 / 18:29:42 / cg"
  1860 ! !
  1861 
  1862 !ProjectBuilderAssistantApplication methodsFor:'aspects'!
  1863 
  1864 buildDirectoryHolder
  1865     <resource: #uiAspect>
  1866 
  1867     |buildDirectory|
  1868 
  1869     buildDirectoryHolder isNil ifTrue:[
  1870         buildDirectoryHolder := nil asValue.
  1871         buildDirectoryHolder onChangeSend:#buildDirectoryChanged to:self.
  1872     ].
  1873     buildDirectoryHolder value isEmptyOrNil ifTrue:[
  1874         buildDirectory := ProjectBuilder previousBuildDirectory.
  1875         buildDirectory isNil ifTrue:[
  1876             buildDirectory := UserPreferences current buildDirectory.
  1877             buildDirectory isNil ifTrue:[
  1878                 buildDirectory := Filename tempDirectory construct:'stx_build'.
  1879             ].
  1880         ].
  1881         buildDirectoryHolder value: buildDirectory.
  1882     ].
  1883     ^ buildDirectoryHolder.
  1884 !
  1885 
  1886 companyNameHolder
  1887     <resource: #uiAspect>
  1888 
  1889     companyNameHolder isNil ifTrue:[
  1890         companyNameHolder := 'MyCompany' asValue.
  1891     ].
  1892     ^ companyNameHolder.
  1893 !
  1894 
  1895 compilerWarnMessageHolder
  1896     <resource: #uiAspect>
  1897 
  1898     compilerWarnMessageHolder isNil ifTrue:[
  1899         compilerWarnMessageHolder := '' asValue.
  1900     ].
  1901     ^ compilerWarnMessageHolder.
  1902 !
  1903 
  1904 compilerWarnMessageVisibleHolder
  1905     <resource: #uiAspect>
  1906 
  1907     compilerWarnMessageVisibleHolder isNil ifTrue:[
  1908         compilerWarnMessageVisibleHolder := false asValue.
  1909     ].
  1910     ^ compilerWarnMessageVisibleHolder.
  1911 !
  1912 
  1913 hasApplicationSelectedHolder
  1914     <resource: #uiAspect>
  1915 
  1916     hasApplicationSelectedHolder isNil ifTrue:[
  1917         hasApplicationSelectedHolder := nil asValue.
  1918     ].
  1919     ^ hasApplicationSelectedHolder.
  1920 !
  1921 
  1922 hasProjectSelectedHolder
  1923     <resource: #uiAspect>
  1924 
  1925     hasProjectSelectedHolder isNil ifTrue:[
  1926         hasProjectSelectedHolder := nil asValue.
  1927     ].
  1928     ^ hasProjectSelectedHolder.
  1929 !
  1930 
  1931 hasStartupClassSelectedHolder
  1932     <resource: #uiAspect>
  1933 
  1934     hasStartupClassSelectedHolder isNil ifTrue:[
  1935         hasStartupClassSelectedHolder := nil asValue.
  1936     ].
  1937     ^ hasStartupClassSelectedHolder.
  1938 !
  1939 
  1940 hideOtherApplicationClasses
  1941     <resource: #uiAspect>
  1942 
  1943     hideOtherApplicationClasses isNil ifTrue:[
  1944         hideOtherApplicationClasses := true asValue.
  1945         hideOtherApplicationClasses onChangeSend:#updateListOfApplicationsInProject to:self.
  1946     ].
  1947     ^ hideOtherApplicationClasses.
  1948 !
  1949 
  1950 hideOtherStartupClasses
  1951     <resource: #uiAspect>
  1952 
  1953     hideOtherStartupClasses isNil ifTrue:[
  1954         hideOtherStartupClasses := true asValue.
  1955         hideOtherStartupClasses onChangeSend:#updateListOfStartupClassesInProject to:self.
  1956     ].
  1957     ^ hideOtherStartupClasses.
  1958 !
  1959 
  1960 hideSTXProjects
  1961     <resource: #uiAspect>
  1962 
  1963     hideSTXProjects isNil ifTrue:[
  1964         hideSTXProjects := true asValue.
  1965         hideSTXProjects onChangeSend:#updateListOfMatchingProjects to:self.
  1966     ].
  1967     ^ hideSTXProjects.
  1968 !
  1969 
  1970 listOfApplicationsInProject
  1971     <resource: #uiAspect>
  1972 
  1973     listOfApplicationsInProject isNil ifTrue:[
  1974         listOfApplicationsInProject := ValueHolder new.
  1975     ].
  1976     ^ listOfApplicationsInProject.
  1977 !
  1978 
  1979 listOfClassesInProject
  1980     <resource: #uiAspect>
  1981 
  1982     listOfClassesInProject isNil ifTrue:[
  1983         listOfClassesInProject := ValueHolder new.
  1984     ].
  1985     ^ listOfClassesInProject.
  1986 !
  1987 
  1988 listOfMatchingPackageIds
  1989     <resource: #uiAspect>
  1990 
  1991     listOfMatchingPackageIds isNil ifTrue:[
  1992         listOfMatchingPackageIds := ValueHolder new.
  1993     ].
  1994     ^ listOfMatchingPackageIds.
  1995 !
  1996 
  1997 listOfMatchingProjects
  1998     <resource: #uiAspect>
  1999 
  2000     listOfMatchingProjects isNil ifTrue:[
  2001         listOfMatchingProjects := ValueHolder new.
  2002     ].
  2003     ^ listOfMatchingProjects.
  2004 !
  2005 
  2006 listOfNewProjectsName
  2007 
  2008     <resource: #uiAspect>
  2009 
  2010     listOfNewProjectsName isNil ifTrue:[
  2011         listOfNewProjectsName := ValueHolder new.
  2012     ].
  2013     ^ listOfNewProjectsName.
  2014 !
  2015 
  2016 listOfPossibleCompilers
  2017     ^ Tools::ProjectBuilder listOfPossibleCompilers
  2018 
  2019     "Modified: / 21-01-2012 / 14:05:52 / cg"
  2020 !
  2021 
  2022 listOfPrerequisitesInProject
  2023     <resource: #uiAspect>
  2024 
  2025     listOfPrerequisitesInProject isNil ifTrue:[
  2026         listOfPrerequisitesInProject := ValueHolder new.
  2027     ].
  2028     ^ listOfPrerequisitesInProject.
  2029 
  2030     "Created: / 19-01-2012 / 15:39:34 / cg"
  2031 !
  2032 
  2033 listOfStartupClassesInProject
  2034     <resource: #uiAspect>
  2035 
  2036     listOfStartupClassesInProject isNil ifTrue:[
  2037         listOfStartupClassesInProject := ValueHolder new.
  2038     ].
  2039     ^ listOfStartupClassesInProject.
  2040 !
  2041 
  2042 makeOutputHolder
  2043     <resource: #uiAspect>
  2044 
  2045     makeOutputHolder isNil ifTrue:[
  2046         makeOutputHolder := ValueHolder new.
  2047     ].
  2048     ^ makeOutputHolder.
  2049 !
  2050 
  2051 newApplicationsName
  2052     <resource: #uiAspect>
  2053 
  2054     "automatically generated by UIPainter ..."
  2055 
  2056     "*** the code below creates a default model when invoked."
  2057     "*** (which may not be the one you wanted)"
  2058     "*** Please change as required and accept it in the browser."
  2059     "*** (and replace this comment by something more useful ;-)"
  2060 
  2061     newApplicationsName isNil ifTrue:[
  2062         newApplicationsName := ValueHolder new.
  2063 "/ if your app needs to be notified of changes, uncomment one of the lines below:
  2064 "/       newApplicationsName addDependent:self.
  2065 "/       newApplicationsName onChangeSend:#newApplicationsNameChanged to:self.
  2066     ].
  2067     ^ newApplicationsName.
  2068 !
  2069 
  2070 newProjectsName
  2071     <resource: #uiAspect>
  2072 
  2073     newProjectsName isNil ifTrue:[
  2074         newProjectsName := nil asValue.
  2075     ].
  2076     ^ newProjectsName.
  2077 !
  2078 
  2079 newProjectsNameListDoubleClickChannel
  2080     "automatically generated by UIPainter ..."
  2081 
  2082     "*** the code below creates a default model when invoked."
  2083     "*** (which may not be the one you wanted)"
  2084     "*** Please change as required and accept it in the browser."
  2085 
  2086     |holder|
  2087 
  2088     (holder := builder bindingAt:#newProjectsNameListDoubleClickChannel) isNil ifTrue:[
  2089         holder := TriggerValue new.
  2090         builder aspectAt:#newProjectsNameListDoubleClickChannel put:holder.
  2091         holder onChangeEvaluate:[       
  2092             newProjectsNameListExtendedComboBox notNil ifTrue: [
  2093                 newProjectsNameListExtendedComboBox closeMenu.
  2094             ]
  2095         ]
  2096     ].
  2097     ^ holder.
  2098 !
  2099 
  2100 newStartupClassName
  2101     <resource: #uiAspect>
  2102 
  2103     newStartupClassName isNil ifTrue:[
  2104         newStartupClassName := ValueHolder new.
  2105     ].
  2106     ^ newStartupClassName.
  2107 !
  2108 
  2109 productNameHolder
  2110     <resource: #uiAspect>
  2111 
  2112     productNameHolder isNil ifTrue:[
  2113         productNameHolder := 'MyProduct' asValue.
  2114     ].
  2115     ^ productNameHolder.
  2116 !
  2117 
  2118 projectType
  2119     ^ self projectTypeHolder value
  2120 
  2121     "Modified: / 20-07-2012 / 13:28:46 / cg"
  2122 !
  2123 
  2124 projectType:aProjectTypeSymbol
  2125     self assert:(ProjectDefinition projectTypes includes:aProjectTypeSymbol).
  2126     self projectTypeHolder value:aProjectTypeSymbol
  2127 
  2128     "Modified: / 20-07-2012 / 13:28:25 / cg"
  2129 !
  2130 
  2131 projectTypeHolder
  2132     <resource: #uiAspect>
  2133 
  2134     projectTypeHolder isNil ifTrue:[
  2135         projectTypeHolder := RadioButtonGroup new.
  2136         projectTypeHolder value:ProjectDefinition guiApplicationType.
  2137     ].
  2138     ^ projectTypeHolder.
  2139 
  2140     "Modified: / 20-07-2012 / 13:30:16 / cg"
  2141 !
  2142 
  2143 selectedApplicationIndexHolder
  2144     <resource: #uiAspect>
  2145 
  2146     selectedApplicationIndexHolder isNil ifTrue:[
  2147         selectedApplicationIndexHolder := ValueHolder new.
  2148         selectedApplicationIndexHolder onChangeSend:#selectedApplicationChanged to:self.
  2149     ].
  2150     ^ selectedApplicationIndexHolder.
  2151 !
  2152 
  2153 selectedApplicationsComment
  2154     <resource: #uiAspect>
  2155 
  2156     "automatically generated by UIPainter ..."
  2157 
  2158     "*** the code below creates a default model when invoked."
  2159     "*** (which may not be the one you wanted)"
  2160     "*** Please change as required and accept it in the browser."
  2161     "*** (and replace this comment by something more useful ;-)"
  2162 
  2163     selectedApplicationsComment isNil ifTrue:[
  2164         selectedApplicationsComment := '' asValue.
  2165 "/ if your app needs to be notified of changes, uncomment one of the lines below:
  2166 "/       selectedApplicationsComment addDependent:self.
  2167 "/       selectedApplicationsComment onChangeSend:#selectedApplicationsCommentChanged to:self.
  2168     ].
  2169     ^ selectedApplicationsComment.
  2170 !
  2171 
  2172 selectedProjectDefinition
  2173     <resource: #uiAspect>
  2174 
  2175     ^ selectedProjectDefinition.
  2176 !
  2177 
  2178 selectedProjectIndexHolder
  2179     <resource: #uiAspect>
  2180 
  2181     selectedProjectIndexHolder isNil ifTrue:[
  2182         selectedProjectIndexHolder := ValueHolder new.
  2183         selectedProjectIndexHolder onChangeSend:#selectedProjectChanged to:self.
  2184     ].
  2185     ^ selectedProjectIndexHolder.
  2186 !
  2187 
  2188 selectedProjectsComment
  2189     <resource: #uiAspect>
  2190 
  2191     selectedProjectsComment isNil ifTrue:[
  2192         selectedProjectsComment := '' asValue.
  2193     ].
  2194     ^ selectedProjectsComment.
  2195 !
  2196 
  2197 selectedStartupClassIndexHolder
  2198     <resource: #uiAspect>
  2199 
  2200     selectedStartupClassIndexHolder isNil ifTrue:[
  2201         selectedStartupClassIndexHolder := ValueHolder new.
  2202         selectedStartupClassIndexHolder onChangeSend:#selectedStartupClassChanged to:self.
  2203     ].
  2204     ^ selectedStartupClassIndexHolder.
  2205 !
  2206 
  2207 startMakeButtonEnabled
  2208     <resource: #uiAspect>
  2209 
  2210     startMakeButtonEnabled isNil ifTrue:[
  2211         startMakeButtonEnabled := true asValue.
  2212     ].
  2213     ^ startMakeButtonEnabled.
  2214 !
  2215 
  2216 stopMakeButtonVisible
  2217     <resource: #uiAspect>
  2218 
  2219     stopMakeButtonVisible isNil ifTrue:[
  2220         stopMakeButtonVisible := false asValue.
  2221     ].
  2222     ^ stopMakeButtonVisible.
  2223 !
  2224 
  2225 usedCompilerHolder
  2226     <resource: #uiAspect>
  2227 
  2228     usedCompilerHolder isNil ifTrue:[
  2229         usedCompilerHolder := ValueHolder new.
  2230         usedCompilerHolder value:(ProjectBuilder defaultUsedCompiler).
  2231         usedCompilerHolder onChangeSend:#checkCompilerAvailability to:self.
  2232     ].
  2233     ^ usedCompilerHolder.
  2234 
  2235     "Modified: / 21-01-2012 / 14:07:16 / cg"
  2236 ! !
  2237 
  2238 !ProjectBuilderAssistantApplication methodsFor:'initialization & release'!
  2239 
  2240 fileBrowserInstance
  2241     "setup the embedded fileBrowser (in the last page)"
  2242 
  2243     |targetDirectory browser|
  2244 
  2245     targetDirectory := projectBuilder packageBuildDirectory.
  2246 
  2247     browser := FileBrowserV2 new.
  2248     browser onDirectory:targetDirectory.
  2249     OperatingSystem isMSWINDOWSlike ifTrue:[
  2250         browser filter:'*.exe;*.com'.
  2251     ] ifFalse:[
  2252         browser filter:'*'.
  2253     ].
  2254     ^ browser.
  2255 !
  2256 
  2257 openOn:aProjectDefinitionClass
  2258     |type apps startupClass|
  2259 
  2260     self allButOpen.
  2261     aProjectDefinitionClass isLibraryDefinition ifTrue:[
  2262         type := ProjectDefinition libraryType
  2263     ] ifFalse:[
  2264         aProjectDefinitionClass isGUIApplication ifTrue:[
  2265             type := ProjectDefinition guiApplicationType
  2266         ] ifFalse:[
  2267             type := ProjectDefinition nonGuiApplicationType
  2268         ]
  2269     ].
  2270     self projectTypeHolder value:type.
  2271     self hideSTXProjects value:false.
  2272     selectedProjectDefinition := aProjectDefinitionClass.
  2273     self selectedProjectIndexHolder value:(self listOfMatchingPackageIds value indexOf:aProjectDefinitionClass package).
  2274     self hasProjectSelectedHolder value:true.
  2275 
  2276     self gotoPage:3.
  2277     type == ProjectDefinition guiApplicationType ifTrue:[
  2278         (startupClass := aProjectDefinitionClass startupClass) notNil ifTrue:[
  2279             selectedStartupClass := startupClass.
  2280             self gotoPage:4.
  2281         ]. 
  2282 "/    apps := (aProjectDefinitionClass classes select:[:cls | cls isKindOf:ApplicationModel])
  2283     ].
  2284     self openWindow.
  2285 
  2286     "Created: / 20-07-2012 / 12:34:02 / cg"
  2287 !
  2288 
  2289 openOnPackage:aPackageId
  2290     self allButOpen.
  2291     self projectTypeHolder value:(ProjectDefinition guiApplicationType).
  2292     self hideSTXProjects value:false.
  2293     self selectedProjectIndexHolder value:(self listOfMatchingPackageIds indexOf:aPackageId).
  2294     self hasProjectSelectedHolder value:true.
  2295     self gotoPage:2.
  2296     self openWindow.
  2297 
  2298     "Created: / 20-07-2012 / 13:24:38 / cg"
  2299 !
  2300 
  2301 postBuildMakeOutputWindow:aView
  2302     makeOutputWindow := aView
  2303 !
  2304 
  2305 postBuildNewProjectsNameListExtendedComboBox:anExtendedComboBox
  2306 
  2307     |menu|
  2308 
  2309     menu := SubCanvas new.
  2310     menu client:self spec:#newProjectsNameListSpec builder:nil.
  2311     anExtendedComboBox closeOnSelect: false.
  2312     anExtendedComboBox menuWidget:menu.
  2313 
  2314     anExtendedComboBox editor 
  2315             immediateAccept:true;
  2316             acceptOnLeave:true;
  2317             acceptOnLostFocus:true;
  2318             acceptOnPointerLeave:true;
  2319             acceptOnReturn:true;
  2320             acceptOnTab:true.
  2321 
  2322     newProjectsNameListExtendedComboBox := anExtendedComboBox.
  2323 !
  2324 
  2325 postBuildWith:aBuilder
  2326     super postBuildWith:aBuilder.
  2327     self updateListOfMatchingProjects.
  2328     self updateListOfNewProjectsName.
  2329 
  2330     Smalltalk addDependent:self.
  2331 !
  2332 
  2333 release
  2334     Smalltalk removeDependent:self.
  2335     super release
  2336 ! !
  2337 
  2338 !ProjectBuilderAssistantApplication methodsFor:'menu actions'!
  2339 
  2340 openDocumentation
  2341    self openHTMLDocument:'tools/misc/TOP.html#PACKAGER'.
  2342 ! !
  2343 
  2344 !ProjectBuilderAssistantApplication methodsFor:'private'!
  2345 
  2346 commentFromClass:aClass
  2347     |docMethod comment indents minIndent maxLineLength|
  2348 
  2349     docMethod := aClass class compiledMethodAt:#documentation.
  2350     docMethod notNil ifTrue:[
  2351         comment := docMethod comment.
  2352         comment := comment asStringCollection 
  2353                         collect:[:line | line withoutTrailingSeparators].
  2354         [comment notEmpty and:[comment first isBlank]] whileTrue:[ comment removeFirst ].
  2355         maxLineLength := (comment collect:[:line | line size]) max.
  2356         indents := comment collect:[:line | 
  2357                                         line isEmptyOrNil
  2358                                             ifTrue:[maxLineLength]
  2359                                             ifFalse:[ line findFirst:[:ch | ch isSeparator not]]].
  2360         (minIndent := indents min) > 1 ifTrue:[
  2361             comment := comment collect:[:line | line copyFrom:minIndent].
  2362         ].
  2363         comment := comment asString.
  2364     ].
  2365     ^ comment
  2366 !
  2367 
  2368 generatePackageContentsMethods
  2369     <resource: #uiCallback>
  2370 
  2371     Class packageQuerySignal answer:(selectedProjectDefinition package)
  2372     do:[
  2373         selectedProjectDefinition 
  2374             forEachContentsMethodsCodeToCompileDo:[:code :category |
  2375                     SmalltalkCodeGeneratorTool
  2376                         compile:code
  2377                         forClass:selectedProjectDefinition theMetaclass
  2378                         inCategory:category.
  2379                 ]
  2380             ignoreOldDefinition:true
  2381     ].
  2382     self updateListOfClassesInProject
  2383 
  2384     "Modified: / 31-01-2011 / 18:29:44 / cg"
  2385 !
  2386 
  2387 hasApplicationSelected
  2388     ^ self selectedApplicationIndexHolder value notNil
  2389 !
  2390 
  2391 hasBuildDirectorySpecified
  2392     ^ self buildDirectoryHolder value notEmptyOrNil
  2393 !
  2394 
  2395 hasProjectBuilder
  2396     ^ projectBuilder notNil
  2397 !
  2398 
  2399 hasProjectSelected
  2400     ^ self selectedProjectIndexHolder value notNil
  2401 !
  2402 
  2403 hasStartupClassSelected
  2404     ^ self selectedStartupClassIndexHolder value notNil
  2405 ! !
  2406 
  2407 !ProjectBuilderAssistantApplication methodsFor:'queries'!
  2408 
  2409 canEnterApplicationSelection
  2410     self hasProjectSelected ifFalse:[
  2411         self infoHolder value:'no project selected'. 
  2412         ^ false
  2413     ].
  2414     ^ true
  2415 
  2416     "Modified: / 23-08-2011 / 12:12:35 / cg"
  2417 !
  2418 
  2419 canEnterBuild
  2420     self hasBuildDirectorySpecified ifFalse:[
  2421         self infoHolder value:'no build directory specified'. 
  2422         ^ false
  2423     ].
  2424     ^ true
  2425 
  2426     "Modified: / 23-08-2011 / 12:13:29 / cg"
  2427 !
  2428 
  2429 canEnterContentsSelection
  2430     |prj cls impl mthd|
  2431 
  2432     self hasProjectSelected ifFalse:[
  2433         self infoHolder value:'no project selected'. 
  2434         ^ false
  2435     ].
  2436     "self hasApplicationSelected ifFalse:[^ false]." 
  2437     (self projectTypeIsLibrary or:[self hasStartupClassSelected]) ifFalse:[
  2438         self infoHolder value:'must be either library or have a startup class'. 
  2439         ^ false
  2440     ].
  2441     prj := self selectedProjectDefinition.
  2442     ([prj startupClassName] on:Error do:nil) notNil ifFalse:[
  2443         self infoHolder value:'must have a startup class'. 
  2444         ^ false
  2445     ].
  2446     ([prj startupSelector] on:Error do:nil) notNil ifFalse:[
  2447         self infoHolder value:'must have a startup selector'. 
  2448         ^ false
  2449     ].
  2450     (prj class compiledMethodAt:#startupSelector) isNil ifTrue:[
  2451         self infoHolder value:('inherited startup selector is "%1"' bindWith:prj startupSelector). 
  2452         impl := prj class whichClassImplements:#startupSelector.
  2453         impl isNil ifTrue:[
  2454             self infoHolder value:('inherited startup selector (%1) not implemented in %2' 
  2455                                     bindWith:prj startupSelector
  2456                                     with:prj class name). 
  2457             ^ false
  2458         ].
  2459     ].
  2460     (mthd := prj class compiledMethodAt:#startupClassName) package == prj package ifFalse:[
  2461         mthd package == PackageId noProjectID ifFalse:[
  2462             self infoHolder value:('startup class method (#startupClassName) of %3 must be in package "%1" (is in "%2")' 
  2463                 bindWith:prj package
  2464                 with:(prj class compiledMethodAt:#startupClassName) package
  2465                 with:prj class name). 
  2466             ^ false
  2467         ].
  2468     ].
  2469     (mthd := prj class compiledMethodAt:#startupSelector) notNil ifTrue:[
  2470         mthd package == prj package ifFalse:[
  2471             mthd package == PackageId noProjectID ifFalse:[
  2472                 self infoHolder value:('startup class method (#startupSelector) of %3 must be in package "%1" (is in "%2")' 
  2473                     bindWith:prj package
  2474                     with:mthd package 
  2475                     with:prj class name). 
  2476                 ^ false
  2477             ]
  2478         ].
  2479     ].
  2480     cls := Smalltalk classNamed:prj startupClassName.
  2481     cls isNil ifTrue:[
  2482         self infoHolder value:('startup class "%1" does not exist' bindWith:prj startupClassName).
  2483         ^ false.
  2484     ].
  2485     (cls implements:(prj startupSelector)) ifFalse:[
  2486         (cls respondsTo:(prj startupSelector)) ifFalse:[
  2487             self infoHolder value:('startup class "%1" does not implement startup selector "%2"' 
  2488                     bindWith:cls name
  2489                     with:prj startupSelector). 
  2490             ^ false
  2491         ].
  2492     ].
  2493     ^ true.
  2494 
  2495     "Modified: / 20-07-2012 / 19:21:34 / cg"
  2496 !
  2497 
  2498 canEnterDeploy
  2499     self hasProjectBuilder ifFalse:[
  2500         self infoHolder value:'no project builder specified'. 
  2501         ^ false
  2502     ].
  2503     ^ true
  2504 
  2505     "Modified: / 23-08-2011 / 12:13:23 / cg"
  2506 !
  2507 
  2508 canEnterPrerequisitesSelection
  2509     |prj cls impl|
  2510 
  2511     self hasProjectSelected ifFalse:[
  2512         self infoHolder value:'no project selected'. 
  2513         ^ false
  2514     ].
  2515     ^ true.
  2516 
  2517     "Created: / 19-01-2012 / 15:37:30 / cg"
  2518 !
  2519 
  2520 canEnterStartupClassSelection
  2521     self hasProjectSelected ifFalse:[
  2522         self infoHolder value:'no project selected'. 
  2523         ^ false
  2524     ].
  2525     ^ self hasProjectSelected "and:[ self hasApplicationSelected ]"
  2526 
  2527     "Modified: / 23-08-2011 / 12:16:35 / cg"
  2528 !
  2529 
  2530 isUnixOS
  2531     ^ OperatingSystem isUNIXlike
  2532 !
  2533 
  2534 isWindowsOS
  2535     ^ OperatingSystem isMSWINDOWSlike
  2536 !
  2537 
  2538 projectTypeIsGuiApplication
  2539     ^ self projectTypeHolder value == ProjectDefinition guiApplicationType
  2540 
  2541     "Modified: / 20-07-2012 / 13:29:59 / cg"
  2542 !
  2543 
  2544 projectTypeIsLibrary
  2545     ^ self projectTypeHolder value == ProjectDefinition libraryType
  2546 
  2547     "Modified: / 20-07-2012 / 13:29:24 / cg"
  2548 !
  2549 
  2550 projectTypeIsNotLibrary
  2551     ^ self projectTypeIsLibrary not
  2552 ! !
  2553 
  2554 !ProjectBuilderAssistantApplication methodsFor:'specs'!
  2555 
  2556 assistantSpec
  2557     ^ self class assistantSpec
  2558 ! !
  2559 
  2560 !ProjectBuilderAssistantApplication methodsFor:'update'!
  2561 
  2562 checkCompilerAvailability
  2563     |cmd suite warnMsg1 warnMsg2 sep|
  2564 
  2565     cmd := 'cc'.
  2566     suite := 'C-Compiler'.
  2567     warnMsg1 := warnMsg2 := ''.
  2568 
  2569     self usedCompilerHolder value = 'bcc' ifTrue:[
  2570         cmd := 'bcc32'.
  2571         suite := 'Borland C-Compiler'.
  2572     ].
  2573     self usedCompilerHolder value = 'vc' ifTrue:[
  2574         cmd := 'cl'.
  2575         suite := 'Microsoft Visual C C-Compiler'.
  2576         warnMsg2 := 'Due to bugs in this C-compiler, some classes may not be compilable.'.
  2577     ].
  2578     self usedCompilerHolder value = 'lcc' ifTrue:[
  2579         cmd := 'lcc'.
  2580         suite := 'LCC C-Compiler'.
  2581         warnMsg2 := 'The LCC C-compiler suite is not yet supported (linkage).'.
  2582     ].
  2583     self usedCompilerHolder value = 'gcc' ifTrue:[
  2584         cmd := 'gcc'.
  2585         suite := 'GNU C-Compiler'.
  2586         OperatingSystem isMSWINDOWSlike ifTrue:[
  2587             warnMsg2 := 'The GNU C-compiler suite is not yet supported on MSDOS systems.'.
  2588         ].
  2589     ].
  2590 
  2591     (OperatingSystem canExecuteCommand:cmd) ifFalse:[
  2592         warnMsg1 :=
  2593 'The "%1"-command seems to be not in your path.
  2594 Please ensure that you installed the 
  2595 "%2" compiler suite correctly.' bindWith:cmd with:suite.
  2596     ].
  2597 
  2598     (warnMsg1 notEmpty or:[warnMsg2 notEmpty]) ifTrue:[
  2599         sep := ''.
  2600         (warnMsg2 notEmpty) ifTrue:[ sep := '\\' withCRs ].
  2601 
  2602         self compilerWarnMessageHolder value:('Warning:
  2603 
  2604 ',warnMsg1,sep,warnMsg2).
  2605         self compilerWarnMessageVisibleHolder value:true.
  2606     ] ifFalse:[
  2607         self compilerWarnMessageVisibleHolder value:false
  2608     ].
  2609 !
  2610 
  2611 enterContentsSpecification
  2612     |toAdd|
  2613 
  2614     self updateListOfClassesInProject.
  2615 
  2616     toAdd := OrderedCollection new.
  2617 
  2618     "/ ensure that startup & app-class are in the list
  2619     selectedApplication notNil ifTrue:[
  2620         (selectedProjectDefinition classNames includes:selectedApplication name) ifFalse:[
  2621             toAdd add:selectedApplication.
  2622         ].
  2623     ].
  2624     selectedStartupClass notNil ifTrue:[
  2625         (selectedProjectDefinition classNames includes:selectedStartupClass name) ifFalse:[
  2626             toAdd add:selectedStartupClass.
  2627         ].
  2628     ].
  2629 
  2630     selectedProjectDefinition includeClasses:toAdd usingCompiler:nil.
  2631 
  2632     self updateListOfClassesInProject.
  2633 !
  2634 
  2635 enterPrerequisitesSpecification
  2636     |toAdd|
  2637 
  2638     self updateListOfPrerequisitesInProject.
  2639 
  2640 "/    toAdd := OrderedCollection new.
  2641 "/
  2642 "/    "/ ensure that startup & app-class are in the list
  2643 "/    selectedApplication notNil ifTrue:[
  2644 "/        (selectedProjectDefinition classNames includes:selectedApplication name) ifFalse:[
  2645 "/            toAdd add:selectedApplication.
  2646 "/        ].
  2647 "/    ].
  2648 "/    selectedStartupClass notNil ifTrue:[
  2649 "/        (selectedProjectDefinition classNames includes:selectedStartupClass name) ifFalse:[
  2650 "/            toAdd add:selectedStartupClass.
  2651 "/        ].
  2652 "/    ].
  2653 "/
  2654 "/    selectedProjectDefinition includeClasses:toAdd usingCompiler:nil.
  2655 "/
  2656 "/    self updateListOfClassesInProject.
  2657 
  2658     "Created: / 19-01-2012 / 15:36:47 / cg"
  2659 !
  2660 
  2661 rememberMakeOutputsContents
  2662     makeOutputHolder value:(makeOutputWindow contents)
  2663 !
  2664 
  2665 rememberProjectAttributes
  2666     self assert:selectedProjectDefinition notNil.
  2667     Class withoutUpdatingChangesDo:[
  2668         self productNameHolder value ~= selectedProjectDefinition productName ifTrue:[
  2669             selectedProjectDefinition class compile:(selectedProjectDefinition 
  2670                         productName_codeFor:(self productNameHolder value)).
  2671         ].
  2672         self companyNameHolder value ~= selectedProjectDefinition companyName ifTrue:[
  2673             selectedProjectDefinition class compile:(selectedProjectDefinition 
  2674                         companyName_codeFor:(self companyNameHolder value)).
  2675         ]
  2676     ].
  2677 !
  2678 
  2679 restoreMakeOutputsContents
  2680     makeOutputWindow contents:makeOutputHolder value
  2681 !
  2682 
  2683 update:something with:anArgument from:changedObject
  2684     changedObject == Smalltalk ifTrue:[
  2685         (something == #newClass
  2686         or:[something == #classRemove
  2687         or:[something == #projectOrganization]]) ifTrue:[
  2688             self updateListOfMatchingProjects.
  2689             self updateListOfNewProjectsName.
  2690             ^ self.
  2691         ].
  2692         ^ self.
  2693     ].
  2694     super update:something with:anArgument from:changedObject
  2695 !
  2696 
  2697 updateApplicationComment
  2698     |comment|
  2699 
  2700     self selectedApplicationIndexHolder value notNil ifTrue:[
  2701         comment := self commentFromClass:selectedApplication.
  2702         comment isNil ifTrue:[
  2703             comment := 'Application has no comment' allItalic colorizeAllWith:Color lightGrey.
  2704         ].
  2705     ] ifFalse:[
  2706         comment := 'Please select an Application' allItalic colorizeAllWith:Color lightGrey.
  2707     ].
  2708     self selectedApplicationsComment value:comment.
  2709 !
  2710 
  2711 updateComment
  2712     |comment|
  2713 
  2714     self selectedProjectIndexHolder value notNil ifTrue:[
  2715         comment := self commentFromClass:selectedProjectDefinition.
  2716         comment isNil ifTrue:[
  2717             comment := 'Project has no comment' allItalic colorizeAllWith:Color lightGrey.
  2718         ].
  2719     ] ifFalse:[
  2720         comment := 'Please select a Project' allItalic colorizeAllWith:Color lightGrey.
  2721     ].
  2722     self selectedProjectsComment value:comment.
  2723 !
  2724 
  2725 updateListOfApplicationsInProject
  2726     |oldList applicationClasses package appClass appClassIndex|
  2727 
  2728     appClassIndex := nil.
  2729 
  2730     selectedProjectDefinition isNil ifTrue:[
  2731         applicationClasses := #()
  2732     ] ifFalse:[
  2733         package := selectedProjectDefinition package.
  2734 
  2735         applicationClasses := Smalltalk allClasses
  2736                                     select:[:cls |
  2737                                         ((cls isSubclassOf:ApplicationModel)
  2738                                         and:[ self hideOtherApplicationClasses value not
  2739                                               or:[ cls package = package ]])
  2740                                     ].
  2741         applicationClasses := applicationClasses asOrderedCollection.
  2742         applicationClasses sort:[:a :b | a name < b name].
  2743 
  2744 "/        startUpClassName := [ selectedProjectDefinition startupClassName ] ifError:[ nil ].
  2745 "/        startUpClassName notNil ifTrue:[
  2746 "/            startUpClass := Smalltalk classNamed:startUpClassName.
  2747 "/            startUpClass notNil ifTrue:[
  2748 "/                appClassIndex := applicationClasses indexOf:startUpClass.
  2749 "/                appClassIndex == 0 ifTrue:[ appClassIndex := nil ].
  2750 "/            ].
  2751 "/        ].
  2752     ].
  2753 
  2754     oldList := self listOfApplicationsInProject value.
  2755     oldList = applicationClasses ifFalse:[
  2756         appClass := selectedApplication.
  2757         appClassIndex := applicationClasses indexOf:appClass.
  2758         appClassIndex == 0 ifTrue:[ appClassIndex := nil ].
  2759 
  2760         self listOfApplicationsInProject value:applicationClasses.
  2761         self selectedApplicationIndexHolder value:appClassIndex.
  2762     ].
  2763 !
  2764 
  2765 updateListOfClassesInProject
  2766     self listOfClassesInProject value:(selectedProjectDefinition classNames).
  2767 !
  2768 
  2769 updateListOfMatchingProjects
  2770     |query matching projectType idx|
  2771 
  2772     projectType := self projectType.
  2773     projectType = ProjectDefinition libraryType ifTrue:[
  2774         query := #isLibraryDefinition
  2775     ] ifFalse:[
  2776         projectType = ProjectDefinition guiApplicationType ifTrue:[
  2777             query := #isGUIApplication
  2778         ] ifFalse:[
  2779             projectType = ProjectDefinition nonGuiApplicationType ifTrue:[
  2780                 query := #isConsoleApplication
  2781             ] ifFalse:[
  2782                 self halt:'oops'.
  2783                 projectType := ProjectDefinition guiApplicationType.
  2784             ].
  2785         ].
  2786     ].
  2787 
  2788     Class flushSubclassInfo.
  2789 
  2790     matching := ProjectDefinition allSubclasses
  2791                     select:[:defClass |
  2792                         |match|
  2793 
  2794                         match := false.
  2795 
  2796                         defClass isAbstract ifFalse:[
  2797                             (self hideSTXProjects value not
  2798                             or:[ defClass package asPackageId module ~= 'stx' ])
  2799                             ifTrue:[
  2800                                 match := defClass perform:query
  2801                             ].
  2802                         ].
  2803                         match
  2804                    ]. 
  2805 
  2806     matching sort:[:a :b | a name < b name].
  2807     self listOfMatchingProjects value:matching.
  2808     self listOfMatchingPackageIds value:(matching collect:[:def | def package]).
  2809 
  2810     idx := matching indexOf:selectedProjectDefinition.
  2811     idx == 0 ifTrue:[
  2812         self selectedProjectIndexHolder value:nil.
  2813     ] ifFalse:[
  2814         self selectedProjectIndexHolder value:idx.
  2815     ].
  2816 
  2817     "Modified: / 20-07-2012 / 15:04:15 / cg"
  2818 !
  2819 
  2820 updateListOfNewProjectsName
  2821 
  2822     |loadedProjectIDsWithoutProjectDefinition|
  2823 
  2824     loadedProjectIDsWithoutProjectDefinition := Smalltalk allLoadedProjectIDs 
  2825                                                             select:[:eachProjectID | 
  2826                                                                 eachProjectID ~= PackageId noProjectID 
  2827                                                                 and:[ (ProjectDefinition definitionClassForPackage: eachProjectID) isNil ].
  2828                                                             ].
  2829     self listOfNewProjectsName value:loadedProjectIDsWithoutProjectDefinition.
  2830 !
  2831 
  2832 updateListOfPrerequisitesInProject
  2833     self listOfPrerequisitesInProject value:(selectedProjectDefinition preRequisites).
  2834 
  2835     "Created: / 19-01-2012 / 15:39:15 / cg"
  2836 !
  2837 
  2838 updateListOfStartupClassesInProject
  2839     |startupClasses package startUpClassName startUpClass startupClassIndex|
  2840 
  2841     startupClassIndex := nil.
  2842     self selectedStartupClassIndexHolder value:nil.
  2843 
  2844     selectedProjectDefinition isNil ifTrue:[
  2845         startupClasses := #()
  2846     ] ifFalse:[
  2847         package := selectedProjectDefinition package.
  2848 
  2849         startupClasses := Smalltalk allClasses
  2850                                     select:[:cls |
  2851                                         ((cls includesBehavior:StandaloneStartup)
  2852                                         and:[ self hideOtherStartupClasses value not
  2853                                               or:[ cls package = package ]])
  2854                                         or:[ cls == Smalltalk
  2855                                              and:[ self hideOtherStartupClasses value not ] ]
  2856                                     ].
  2857         startupClasses := startupClasses asOrderedCollection.
  2858         startupClasses sort:[:a :b | a name < b name].
  2859 
  2860         startUpClassName := [ selectedProjectDefinition startupClassName ] ifError:[ nil ].
  2861         startUpClassName notNil ifTrue:[
  2862             startUpClass := Smalltalk classNamed:startUpClassName.
  2863             startUpClass notNil ifTrue:[
  2864                 startupClassIndex := startupClasses indexOf:startUpClass.
  2865                 startupClassIndex == 0 ifTrue:[ startupClassIndex := nil ].
  2866             ].
  2867         ].
  2868     ].
  2869 
  2870     self listOfStartupClassesInProject value:startupClasses.
  2871     self selectedStartupClassIndexHolder value:startupClassIndex.
  2872 !
  2873 
  2874 updateProjectAttributes
  2875     self assert:selectedProjectDefinition notNil.
  2876     self productNameHolder value:(selectedProjectDefinition productName).
  2877     self companyNameHolder value:(selectedProjectDefinition companyName).
  2878 ! !
  2879 
  2880 !ProjectBuilderAssistantApplication class methodsFor:'documentation'!
  2881 
  2882 version
  2883     ^ '$Header$'
  2884 !
  2885 
  2886 version_CVS
  2887     ^ '$Header$'
  2888 ! !